Commit 876dada0 authored by Brian Matherly's avatar Brian Matherly Committed by Michael Niedermayer

avcodec/hevc_sei: Support HEVC paired fields.

Correctly set the interlaced_frame and top_field_first fields when pic_struct
indicates paired fields.
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 3df437c2
...@@ -137,10 +137,10 @@ static int decode_nal_sei_pic_timing(HEVCSEIContext *s, GetBitContext *gb, const ...@@ -137,10 +137,10 @@ static int decode_nal_sei_pic_timing(HEVCSEIContext *s, GetBitContext *gb, const
if (sps->vui.frame_field_info_present_flag) { if (sps->vui.frame_field_info_present_flag) {
int pic_struct = get_bits(gb, 4); int pic_struct = get_bits(gb, 4);
h->picture_struct = AV_PICTURE_STRUCTURE_UNKNOWN; h->picture_struct = AV_PICTURE_STRUCTURE_UNKNOWN;
if (pic_struct == 2) { if (pic_struct == 2 || pic_struct == 10 || pic_struct == 12) {
av_log(logctx, AV_LOG_DEBUG, "BOTTOM Field\n"); av_log(logctx, AV_LOG_DEBUG, "BOTTOM Field\n");
h->picture_struct = AV_PICTURE_STRUCTURE_BOTTOM_FIELD; h->picture_struct = AV_PICTURE_STRUCTURE_BOTTOM_FIELD;
} else if (pic_struct == 1) { } else if (pic_struct == 1 || pic_struct == 9 || pic_struct == 11) {
av_log(logctx, AV_LOG_DEBUG, "TOP Field\n"); av_log(logctx, AV_LOG_DEBUG, "TOP Field\n");
h->picture_struct = AV_PICTURE_STRUCTURE_TOP_FIELD; h->picture_struct = AV_PICTURE_STRUCTURE_TOP_FIELD;
} }
......
...@@ -225,6 +225,9 @@ $(foreach N,$(HEVC_SAMPLES_444_12BIT),$(eval $(call FATE_HEVC_TEST_444_12BIT,$(N ...@@ -225,6 +225,9 @@ $(foreach N,$(HEVC_SAMPLES_444_12BIT),$(eval $(call FATE_HEVC_TEST_444_12BIT,$(N
fate-hevc-paramchange-yuv420p-yuv420p10: CMD = framecrc -vsync 0 -i $(TARGET_SAMPLES)/hevc/paramchange_yuv420p_yuv420p10.hevc -sws_flags area+accurate_rnd+bitexact fate-hevc-paramchange-yuv420p-yuv420p10: CMD = framecrc -vsync 0 -i $(TARGET_SAMPLES)/hevc/paramchange_yuv420p_yuv420p10.hevc -sws_flags area+accurate_rnd+bitexact
FATE_HEVC += fate-hevc-paramchange-yuv420p-yuv420p10 FATE_HEVC += fate-hevc-paramchange-yuv420p-yuv420p10
fate-hevc-paired-fields: CMD = probeframes -show_entries frame=interlaced_frame,top_field_first $(TARGET_SAMPLES)/hevc/paired_fields.hevc
FATE_HEVC_FFPROBE-$(call DEMDEC, HEVC, HEVC) += fate-hevc-paired-fields
tests/data/hevc-mp4.mov: TAG = GEN tests/data/hevc-mp4.mov: TAG = GEN
tests/data/hevc-mp4.mov: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data tests/data/hevc-mp4.mov: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
$(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \ $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
...@@ -244,5 +247,6 @@ FATE_HEVC-$(call DEMDEC, MOV, HEVC) += fate-hevc-extradata-reload ...@@ -244,5 +247,6 @@ FATE_HEVC-$(call DEMDEC, MOV, HEVC) += fate-hevc-extradata-reload
fate-hevc-extradata-reload: CMD = framemd5 -i $(TARGET_SAMPLES)/hevc/extradata-reload-multi-stsd.mov -sws_flags bitexact fate-hevc-extradata-reload: CMD = framemd5 -i $(TARGET_SAMPLES)/hevc/extradata-reload-multi-stsd.mov -sws_flags bitexact
FATE_SAMPLES_AVCONV += $(FATE_HEVC-yes) FATE_SAMPLES_AVCONV += $(FATE_HEVC-yes)
FATE_SAMPLES_FFPROBE += $(FATE_HEVC_FFPROBE-yes)
fate-hevc: $(FATE_HEVC-yes) fate-hevc: $(FATE_HEVC-yes) $(FATE_HEVC_FFPROBE-yes)
[FRAME]
interlaced_frame=1
top_field_first=1
[/FRAME]
[FRAME]
interlaced_frame=1
top_field_first=0
[/FRAME]
[FRAME]
interlaced_frame=1
top_field_first=1
[/FRAME]
[FRAME]
interlaced_frame=1
top_field_first=0
[/FRAME]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment