Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
d09321b6
Commit
d09321b6
authored
May 22, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mpeg12dec: Fix chroma location
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
ebb08f3f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
mpeg12dec.c
libavcodec/mpeg12dec.c
+8
-4
No files found.
libavcodec/mpeg12dec.c
View file @
d09321b6
...
...
@@ -1141,10 +1141,6 @@ static av_cold int mpeg_decode_init(AVCodecContext *avctx)
s
->
repeat_field
=
0
;
s
->
mpeg_enc_ctx
.
codec_id
=
avctx
->
codec
->
id
;
avctx
->
color_range
=
AVCOL_RANGE_MPEG
;
if
(
avctx
->
codec
->
id
==
AV_CODEC_ID_MPEG1VIDEO
)
avctx
->
chroma_sample_location
=
AVCHROMA_LOC_CENTER
;
else
avctx
->
chroma_sample_location
=
AVCHROMA_LOC_LEFT
;
return
0
;
}
...
...
@@ -1366,6 +1362,8 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
// MPEG-1 fps
avctx
->
framerate
=
ff_mpeg12_frame_rate_tab
[
s
->
frame_rate_index
];
avctx
->
ticks_per_frame
=
1
;
avctx
->
chroma_sample_location
=
AVCHROMA_LOC_CENTER
;
}
else
{
// MPEG-2
// MPEG-2 fps
av_reduce
(
&
s
->
avctx
->
framerate
.
num
,
...
...
@@ -1374,6 +1372,12 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
ff_mpeg12_frame_rate_tab
[
s
->
frame_rate_index
].
den
*
s1
->
frame_rate_ext
.
den
,
1
<<
30
);
avctx
->
ticks_per_frame
=
2
;
switch
(
s
->
chroma_format
)
{
case
1
:
avctx
->
chroma_sample_location
=
AVCHROMA_LOC_LEFT
;
break
;
case
2
:
case
3
:
avctx
->
chroma_sample_location
=
AVCHROMA_LOC_TOPLEFT
;
break
;
}
}
// MPEG-2
avctx
->
pix_fmt
=
mpeg_get_pixelformat
(
avctx
);
...
...
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