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
9b0fed98
Commit
9b0fed98
authored
19 years ago
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/codec/libmpeg2.c: backport of 13117 from trunk.
parent
c62e5905
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
modules/codec/libmpeg2.c
modules/codec/libmpeg2.c
+18
-17
No files found.
modules/codec/libmpeg2.c
View file @
9b0fed98
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
/* Aspect ratio (ISO/IEC 13818-2 section 6.3.3, table 6-3) */
/* Aspect ratio (ISO/IEC 13818-2 section 6.3.3, table 6-3) */
#define AR_SQUARE_PICTURE 1
/* square pixels */
#define AR_SQUARE_PICTURE 1
/* square pixels */
#define AR_
3_4_PICTURE 2
/* 3:4
picture (TV) */
#define AR_
4_3_PICTURE 2
/* 4:3
picture (TV) */
#define AR_16_9_PICTURE 3
/* 16:9 picture (wide screen) */
#define AR_16_9_PICTURE 3
/* 16:9 picture (wide screen) */
#define AR_221_1_PICTURE 4
/* 2.21:1 picture (movie) */
#define AR_221_1_PICTURE 4
/* 2.21:1 picture (movie) */
...
@@ -625,35 +625,34 @@ static picture_t *GetNewPicture( decoder_t *p_dec, uint8_t **pp_buf )
...
@@ -625,35 +625,34 @@ static picture_t *GetNewPicture( decoder_t *p_dec, uint8_t **pp_buf )
*****************************************************************************/
*****************************************************************************/
static
void
GetAR
(
decoder_t
*
p_dec
)
static
void
GetAR
(
decoder_t
*
p_dec
)
{
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
/* Check whether the input gave a particular aspect ratio */
/* Check whether the input gave a particular aspect ratio */
if
(
p_dec
->
fmt_in
.
video
.
i_aspect
)
if
(
p_dec
->
fmt_in
.
video
.
i_aspect
)
{
{
/* AR is relative to width/height, not display_width/height */
p_sys
->
i_aspect
=
p_dec
->
fmt_in
.
video
.
i_aspect
;
p_sys
->
i_aspect
=
p_dec
->
fmt_in
.
video
.
i_aspect
;
if
(
p_sys
->
i_aspect
<=
AR_221_1_PICTURE
)
if
(
p_sys
->
i_aspect
<=
AR_221_1_PICTURE
)
switch
(
p_sys
->
i_aspect
)
switch
(
p_sys
->
i_aspect
)
{
{
case
AR_
3_4
_PICTURE
:
case
AR_
4_3
_PICTURE
:
p_sys
->
i_aspect
=
VOUT_ASPECT_FACTOR
*
4
/
3
;
p_sys
->
i_aspect
=
VOUT_ASPECT_FACTOR
*
4
/
3
;
p_sys
->
i_sar_num
=
p_sys
->
p_info
->
sequence
->
height
*
4
;
p_sys
->
i_sar_num
=
p_sys
->
p_info
->
sequence
->
picture_
height
*
4
;
p_sys
->
i_sar_den
=
p_sys
->
p_info
->
sequence
->
width
*
3
;
p_sys
->
i_sar_den
=
p_sys
->
p_info
->
sequence
->
picture_
width
*
3
;
break
;
break
;
case
AR_16_9_PICTURE
:
case
AR_16_9_PICTURE
:
p_sys
->
i_aspect
=
VOUT_ASPECT_FACTOR
*
16
/
9
;
p_sys
->
i_aspect
=
VOUT_ASPECT_FACTOR
*
16
/
9
;
p_sys
->
i_sar_num
=
p_sys
->
p_info
->
sequence
->
height
*
16
;
p_sys
->
i_sar_num
=
p_sys
->
p_info
->
sequence
->
picture_
height
*
16
;
p_sys
->
i_sar_den
=
p_sys
->
p_info
->
sequence
->
width
*
9
;
p_sys
->
i_sar_den
=
p_sys
->
p_info
->
sequence
->
picture_
width
*
9
;
break
;
break
;
case
AR_221_1_PICTURE
:
case
AR_221_1_PICTURE
:
p_sys
->
i_aspect
=
VOUT_ASPECT_FACTOR
*
221
/
100
;
p_sys
->
i_aspect
=
VOUT_ASPECT_FACTOR
*
221
/
100
;
p_sys
->
i_sar_num
=
p_sys
->
p_info
->
sequence
->
height
*
221
;
p_sys
->
i_sar_num
=
p_sys
->
p_info
->
sequence
->
picture_
height
*
221
;
p_sys
->
i_sar_den
=
p_sys
->
p_info
->
sequence
->
width
*
100
;
p_sys
->
i_sar_den
=
p_sys
->
p_info
->
sequence
->
picture_
width
*
100
;
break
;
break
;
case
AR_SQUARE_PICTURE
:
case
AR_SQUARE_PICTURE
:
p_sys
->
i_aspect
=
VOUT_ASPECT_FACTOR
*
p_sys
->
i_aspect
=
VOUT_ASPECT_FACTOR
*
p_sys
->
p_info
->
sequence
->
width
/
p_sys
->
p_info
->
sequence
->
picture_
width
/
p_sys
->
p_info
->
sequence
->
height
;
p_sys
->
p_info
->
sequence
->
picture_
height
;
p_sys
->
i_sar_num
=
p_sys
->
i_sar_den
=
1
;
p_sys
->
i_sar_num
=
p_sys
->
i_sar_den
=
1
;
break
;
break
;
}
}
...
@@ -664,10 +663,10 @@ static void GetAR( decoder_t *p_dec )
...
@@ -664,10 +663,10 @@ static void GetAR( decoder_t *p_dec )
if
(
p_sys
->
p_info
->
sequence
->
pixel_height
>
0
)
if
(
p_sys
->
p_info
->
sequence
->
pixel_height
>
0
)
{
{
p_sys
->
i_aspect
=
p_sys
->
i_aspect
=
((
uint64_t
)
p_sys
->
p_info
->
sequence
->
display
_width
)
*
((
uint64_t
)
p_sys
->
p_info
->
sequence
->
picture
_width
)
*
p_sys
->
p_info
->
sequence
->
pixel_width
*
p_sys
->
p_info
->
sequence
->
pixel_width
*
VOUT_ASPECT_FACTOR
/
VOUT_ASPECT_FACTOR
/
p_sys
->
p_info
->
sequence
->
display
_height
/
p_sys
->
p_info
->
sequence
->
picture
_height
/
p_sys
->
p_info
->
sequence
->
pixel_height
;
p_sys
->
p_info
->
sequence
->
pixel_height
;
p_sys
->
i_sar_num
=
p_sys
->
p_info
->
sequence
->
pixel_width
;
p_sys
->
i_sar_num
=
p_sys
->
p_info
->
sequence
->
pixel_width
;
p_sys
->
i_sar_den
=
p_sys
->
p_info
->
sequence
->
pixel_height
;
p_sys
->
i_sar_den
=
p_sys
->
p_info
->
sequence
->
pixel_height
;
...
@@ -678,12 +677,14 @@ static void GetAR( decoder_t *p_dec )
...
@@ -678,12 +677,14 @@ static void GetAR( decoder_t *p_dec )
* This shouldn't happen and if it does it is a bug
* This shouldn't happen and if it does it is a bug
* in libmpeg2 (likely triggered by an invalid stream) */
* in libmpeg2 (likely triggered by an invalid stream) */
p_sys
->
i_aspect
=
VOUT_ASPECT_FACTOR
*
4
/
3
;
p_sys
->
i_aspect
=
VOUT_ASPECT_FACTOR
*
4
/
3
;
p_sys
->
i_sar_num
=
p_sys
->
p_info
->
sequence
->
display
_height
*
4
;
p_sys
->
i_sar_num
=
p_sys
->
p_info
->
sequence
->
picture
_height
*
4
;
p_sys
->
i_sar_den
=
p_sys
->
p_info
->
sequence
->
display
_width
*
3
;
p_sys
->
i_sar_den
=
p_sys
->
p_info
->
sequence
->
picture
_width
*
3
;
}
}
}
}
msg_Dbg
(
p_dec
,
"%dx%d, aspect %d, sar %i:%i, %u.%03u fps"
,
msg_Dbg
(
p_dec
,
"%dx%d (display %d,%d), aspect %d, sar %i:%i, %u.%03u fps"
,
p_sys
->
p_info
->
sequence
->
picture_width
,
p_sys
->
p_info
->
sequence
->
picture_height
,
p_sys
->
p_info
->
sequence
->
display_width
,
p_sys
->
p_info
->
sequence
->
display_width
,
p_sys
->
p_info
->
sequence
->
display_height
,
p_sys
->
p_info
->
sequence
->
display_height
,
p_sys
->
i_aspect
,
p_sys
->
i_sar_num
,
p_sys
->
i_sar_den
,
p_sys
->
i_aspect
,
p_sys
->
i_sar_num
,
p_sys
->
i_sar_den
,
...
...
This diff is collapsed.
Click to expand it.
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