[FFmpeg-devel] [PATCH]lavc/vaapi_h264: Do not set unused deprecated fields

Mark Thompson sw at jkqxz.net
Thu Mar 28 00:16:52 EET 2019


On 27/03/2019 14:02, Carl Eugen Hoyos wrote:
> Hi!
> 
> I don't think setting vaapi fields that are deprecated makes sense, this
> also silences a warning when compiling with clang.
> 
> Please comment, Carl Eugen
> 
> From b1f4e64e577ffecd1eab7b95d8d6f90e261cdd74 Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <ceffmpeg at gmail.com>
> Date: Wed, 27 Mar 2019 14:58:51 +0100
> Subject: [PATCH] lavc/vaapi_264: Do not set deprecated unused fields.
> 
> Fixes the following warnings:
> libavcodec/vaapi_h264.c:259:10: warning: 'num_slice_groups_minus1' is deprecated [-Wdeprecated-declarations]
>         .num_slice_groups_minus1                    = pps->slice_group_count - 1,
>          ^
> libavcodec/vaapi_h264.c:260:10: warning: 'slice_group_map_type' is deprecated [-Wdeprecated-declarations]
>         .slice_group_map_type                       = pps->mb_slice_group_map_type,
>          ^
> libavcodec/vaapi_h264.c:261:10: warning: 'slice_group_change_rate_minus1' is deprecated [-Wdeprecated-declarations]
>         .slice_group_change_rate_minus1             = 0, /* FMO is not implemented */
>          ^
> ---
>  libavcodec/vaapi_h264.c |    3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
> index 5854587..dd2a657 100644
> --- a/libavcodec/vaapi_h264.c
> +++ b/libavcodec/vaapi_h264.c
> @@ -256,9 +256,6 @@ static int vaapi_h264_start_frame(AVCodecContext          *avctx,
>              .log2_max_pic_order_cnt_lsb_minus4      = sps->log2_max_poc_lsb - 4,
>              .delta_pic_order_always_zero_flag       = sps->delta_pic_order_always_zero_flag,
>          },
> -        .num_slice_groups_minus1                    = pps->slice_group_count - 1,
> -        .slice_group_map_type                       = pps->mb_slice_group_map_type,
> -        .slice_group_change_rate_minus1             = 0, /* FMO is not implemented */
>          .pic_init_qp_minus26                        = pps->init_qp - 26,
>          .pic_init_qs_minus26                        = pps->init_qs - 26,
>          .chroma_qp_index_offset                     = pps->chroma_qp_index_offset[0],
> -- 
> 1.7.10.4

They aren't deprecated on all VAAPI versions we support (try building with libva < 2).

I think the change is ok anyway because zero is fine as a value for them?  The commit message should probably mention that if you want to go with it.

Thanks,

- Mark


More information about the ffmpeg-devel mailing list