[FFmpeg-devel] [PATCH 00/72] Implement support for Vulkan multiplane images and video decoding

Anton Khirnov anton at khirnov.net
Mon Feb 20 19:21:11 EET 2023


Quoting Lynne (2023-02-17 04:43:50)
> From 52ab3cd8d165a838be92189c87c54915efc1c7e5 Mon Sep 17 00:00:00 2001
> From: Lynne <dev at lynne.ee>
> 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;

How does this make sense? picture_structure in slice header tells you
whether you're currently decoding a frame or a field, but a decoded
H264Picture is always a full frame (i.e. two fields).

This code marks field-coded pictures as whatever the second coded field
was.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list