Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
bb1a6786
Commit
bb1a6786
authored
Mar 25, 2003
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/codec/libmpeg2.c: fixed aspect ratio when reading DVDs.
parent
9bfeef47
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
6 deletions
+49
-6
modules/codec/libmpeg2.c
modules/codec/libmpeg2.c
+49
-6
No files found.
modules/codec/libmpeg2.c
View file @
bb1a6786
...
...
@@ -2,7 +2,7 @@
* libmpeg2.c: mpeg2 video decoder module making use of libmpeg2.
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: libmpeg2.c,v 1.
3 2003/03/20 21:45:01
gbazin Exp $
* $Id: libmpeg2.c,v 1.
4 2003/03/25 23:06:49
gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
...
...
@@ -34,6 +34,12 @@
#include <mpeg2dec/mpeg2.h>
/* Aspect ratio (ISO/IEC 13818-2 section 6.3.3, table 6-3) */
#define AR_SQUARE_PICTURE 1
/* square pixels */
#define AR_3_4_PICTURE 2
/* 3:4 picture (TV) */
#define AR_16_9_PICTURE 3
/* 16:9 picture (wide screen) */
#define AR_221_1_PICTURE 4
/* 2.21:1 picture (movie) */
/*****************************************************************************
* dec_thread_t : libmpeg2 decoder thread descriptor
*****************************************************************************/
...
...
@@ -53,6 +59,7 @@ typedef struct dec_thread_t
mtime_t
i_pts
;
mtime_t
i_previous_pts
;
mtime_t
i_current_pts
;
mtime_t
i_period_remainder
;
/*
* Output properties
...
...
@@ -122,6 +129,7 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
p_dec
->
i_pts
=
mdate
()
+
DEFAULT_PTS_DELAY
;
p_dec
->
i_current_pts
=
0
;
p_dec
->
i_previous_pts
=
0
;
p_dec
->
i_period_remainder
=
0
;
/* Initialize decoder */
p_dec
->
p_mpeg2dec
=
mpeg2_init
();
...
...
@@ -175,10 +183,39 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
case
STATE_SEQUENCE
:
/* Initialize video output */
i_aspect
=
((
uint64_t
)
p_dec
->
p_info
->
sequence
->
width
)
*
p_dec
->
p_info
->
sequence
->
pixel_width
*
VOUT_ASPECT_FACTOR
/
p_dec
->
p_info
->
sequence
->
height
/
p_dec
->
p_info
->
sequence
->
pixel_height
;
/* Check whether the input gives a particular aspect ratio */
if
(
p_dec
->
p_fifo
->
p_demux_data
&&
(
*
(
int
*
)(
p_dec
->
p_fifo
->
p_demux_data
)
&
0x7
)
)
{
i_aspect
=
*
(
int
*
)(
p_dec
->
p_fifo
->
p_demux_data
);
switch
(
i_aspect
)
{
case
AR_3_4_PICTURE
:
i_aspect
=
VOUT_ASPECT_FACTOR
*
4
/
3
;
break
;
case
AR_16_9_PICTURE
:
i_aspect
=
VOUT_ASPECT_FACTOR
*
16
/
9
;
break
;
case
AR_221_1_PICTURE
:
i_aspect
=
VOUT_ASPECT_FACTOR
*
221
/
100
;
break
;
case
AR_SQUARE_PICTURE
:
default:
i_aspect
=
VOUT_ASPECT_FACTOR
*
p_dec
->
p_info
->
sequence
->
width
/
p_dec
->
p_info
->
sequence
->
height
;
break
;
}
}
else
{
/* Use the value provided in the MPEG sequence header */
i_aspect
=
((
uint64_t
)
p_dec
->
p_info
->
sequence
->
width
)
*
p_dec
->
p_info
->
sequence
->
pixel_width
*
VOUT_ASPECT_FACTOR
/
p_dec
->
p_info
->
sequence
->
height
/
p_dec
->
p_info
->
sequence
->
pixel_height
;
}
i_chroma
=
VLC_FOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
);
...
...
@@ -232,7 +269,13 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
}
else
{
p_dec
->
i_pts
+=
(
p_dec
->
p_info
->
sequence
->
frame_period
/
27
);
p_dec
->
i_pts
+=
(
(
p_dec
->
p_info
->
sequence
->
frame_period
+
p_dec
->
i_period_remainder
)
/
27
);
p_dec
->
i_period_remainder
=
p_dec
->
p_info
->
sequence
->
frame_period
+
p_dec
->
i_period_remainder
-
(
p_dec
->
p_info
->
sequence
->
frame_period
+
p_dec
->
i_period_remainder
)
/
27
*
27
;
}
vout_DatePicture
(
p_dec
->
p_vout
,
p_pic
,
p_dec
->
i_pts
);
...
...
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