[FFmpeg-devel] [PATCH v1 17/19] avcodec/vvc: support fields

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Tue Apr 1 20:35:49 EEST 2025


toqsxw at gmail.com:
> From: Wu Jianhua <toqsxw at outlook.com>
> 
> passed files:
>     FIELD_A_Panasonic_4.bit
>     FIELD_B_Panasonic_2.bit
> 
> Signed-off-by: Wu Jianhua <toqsxw at outlook.com>
> ---
>  libavcodec/vvc/refs.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/libavcodec/vvc/refs.c b/libavcodec/vvc/refs.c
> index cfbc2977c0..79967b77d3 100644
> --- a/libavcodec/vvc/refs.c
> +++ b/libavcodec/vvc/refs.c
> @@ -160,6 +160,14 @@ static VVCFrame *alloc_frame(VVCContext *s, VVCFrameContext *fc)
>          frame->ref_width   = pps->r->pps_pic_width_in_luma_samples  - win->left_offset   - win->right_offset;
>          frame->ref_height  = pps->r->pps_pic_height_in_luma_samples - win->bottom_offset - win->top_offset;
>  
> +        if (fc->sei.frame_field_info.present) {
> +            if (fc->sei.frame_field_info.picture_struct == AV_PICTURE_STRUCTURE_TOP_FIELD)
> +                frame->frame->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST;
> +            if (fc->sei.frame_field_info.picture_struct == AV_PICTURE_STRUCTURE_TOP_FIELD ||
> +                fc->sei.frame_field_info.picture_struct == AV_PICTURE_STRUCTURE_BOTTOM_FIELD)
> +                frame->frame->flags |= AV_FRAME_FLAG_INTERLACED;
> +        }
> +
>          frame->progress = alloc_progress();
>          if (!frame->progress)
>              goto fail;

Does this output the fields separately? Normally, FFmpeg/libavcodec only
outputs actual frames and marks these with the AV_FRAME_FLAG_INTERLACED
flag if the content is interlaced. AV_FRAME_FLAG_INTERLACED does not
mean that it is a single field.

- Andreas



More information about the ffmpeg-devel mailing list