Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
69d94d9c
Commit
69d94d9c
authored
Apr 25, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced ReduceHeight by GCD (vout).
parent
0da14023
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
36 deletions
+1
-36
src/video_output/video_output.c
src/video_output/video_output.c
+1
-36
No files found.
src/video_output/video_output.c
View file @
69d94d9c
...
@@ -1577,44 +1577,9 @@ static void ChromaDestroy( vout_thread_t *p_vout )
...
@@ -1577,44 +1577,9 @@ static void ChromaDestroy( vout_thread_t *p_vout )
}
}
/* following functions are local */
/* following functions are local */
static
int
ReduceHeight
(
int
i_ratio
)
{
int
i_dummy
=
VOUT_ASPECT_FACTOR
;
int
i_pgcd
=
1
;
if
(
!
i_ratio
)
{
return
i_pgcd
;
}
/* VOUT_ASPECT_FACTOR is (2^7 * 3^3 * 5^3), we just check for 2, 3 and 5 */
while
(
!
(
i_ratio
&
1
)
&&
!
(
i_dummy
&
1
)
)
{
i_ratio
>>=
1
;
i_dummy
>>=
1
;
i_pgcd
<<=
1
;
}
while
(
!
(
i_ratio
%
3
)
&&
!
(
i_dummy
%
3
)
)
{
i_ratio
/=
3
;
i_dummy
/=
3
;
i_pgcd
*=
3
;
}
while
(
!
(
i_ratio
%
5
)
&&
!
(
i_dummy
%
5
)
)
{
i_ratio
/=
5
;
i_dummy
/=
5
;
i_pgcd
*=
5
;
}
return
i_pgcd
;
}
static
void
AspectRatio
(
int
i_aspect
,
int
*
i_aspect_x
,
int
*
i_aspect_y
)
static
void
AspectRatio
(
int
i_aspect
,
int
*
i_aspect_x
,
int
*
i_aspect_y
)
{
{
unsigned
int
i_pgcd
=
ReduceHeight
(
i_aspect
)
;
const
int
i_pgcd
=
i_aspect
?
GCD
(
i_aspect
,
VOUT_ASPECT_FACTOR
)
:
1
;
*
i_aspect_x
=
i_aspect
/
i_pgcd
;
*
i_aspect_x
=
i_aspect
/
i_pgcd
;
*
i_aspect_y
=
VOUT_ASPECT_FACTOR
/
i_pgcd
;
*
i_aspect_y
=
VOUT_ASPECT_FACTOR
/
i_pgcd
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment