From 52ab3cd8d165a838be92189c87c54915efc1c7e5 Mon Sep 17 00:00:00 2001 From: Lynne Date: Wed, 11 Jan 2023 05:20:32 +0100 Subject: [PATCH 10/72] h264dec: track picture_structure in H264Picture --- libavcodec/h264_picture.c | 1 + libavcodec/h264_slice.c | 1 + libavcodec/h264dec.h | 1 + 3 files changed, 3 insertions(+) diff --git a/libavcodec/h264_picture.c b/libavcodec/h264_picture.c index 2661ff4698..0348166c43 100644 --- a/libavcodec/h264_picture.c +++ b/libavcodec/h264_picture.c @@ -80,6 +80,7 @@ static void h264_copy_picture_params(H264Picture *dst, const H264Picture *src) dst->mbaff = src->mbaff; dst->field_picture = src->field_picture; dst->reference = src->reference; + dst->picture_structure = src->picture_structure; dst->recovered = src->recovered; dst->invalid_gap = src->invalid_gap; dst->sei_recovery_frame_cnt = src->sei_recovery_frame_cnt; diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 6188c74632..8ac66b343c 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -491,6 +491,7 @@ static int h264_frame_start(H264Context *h) pic->reference = h->droppable ? 0 : h->picture_structure; pic->f->coded_picture_number = h->coded_picture_number++; pic->field_picture = h->picture_structure != PICT_FRAME; + pic->picture_structure = h->picture_structure; pic->frame_num = h->poc.frame_num; /* * Zero key_frame here; IDR markings per slice in frame or fields are ORed diff --git a/libavcodec/h264dec.h b/libavcodec/h264dec.h index 9a1ec1bace..1b18aba71f 100644 --- a/libavcodec/h264dec.h +++ b/libavcodec/h264dec.h @@ -137,6 +137,7 @@ typedef struct H264Picture { int ref_count[2][2]; ///< number of entries in ref_poc (FIXME need per slice) int mbaff; ///< 1 -> MBAFF frame 0-> not MBAFF int field_picture; ///< whether or not picture was encoded in separate fields + int picture_structure; ///< picture structure /** * H264Picture.reference has this flag set, -- 2.39.2