[FFmpeg-devel] [PATCH] lavc/vaap_encode_h265: Init the refs with predefined value.

Mark Thompson sw at jkqxz.net
Wed Dec 6 23:32:06 EET 2017


On 06/12/17 08:20, Jun Zhao wrote:
> 
> From 7519718216a2b98eb289ba20ba27685dff1cf686 Mon Sep 17 00:00:00 2001

> From: Jun Zhao <jun.zhao at intel.com>

> Date: Wed, 6 Dec 2017 15:50:05 +0800

> Subject: [PATCH] lavc/vaap_encode_h265: Init the refs with predefined value.

> 

> Give a explicit init value to ref0/ref1 list to avoid use default value

> assgined by compiler, in iHD driver, it's will lead to HEVC ENC crash.

> h264_vaapi encoder use this way too.

> 

> Signed-off-by: Jun Zhao <jun.zhao at intel.com>

> ---

>  libavcodec/vaapi_encode_h265.c | 6 ++++++

>  1 file changed, 6 insertions(+)

> 

> diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c

> index 2fc94be632..db9a7163cc 100644

> --- a/libavcodec/vaapi_encode_h265.c

> +++ b/libavcodec/vaapi_encode_h265.c

> @@ -757,6 +757,12 @@ static int vaapi_encode_h265_init_slice_params(AVCodecContext *avctx,

>      else

>          sh->slice_qp_delta = priv->fixed_qp_idr - (pps->init_qp_minus26 + 26);

>  

> +    for (i = 0; i < FF_ARRAY_ELEMS(vslice->ref_pic_list0); i++) {

> +        vslice->ref_pic_list0[i].picture_id = VA_INVALID_ID;

> +        vslice->ref_pic_list0[i].flags      = VA_PICTURE_HEVC_INVALID;

> +        vslice->ref_pic_list1[i].picture_id = VA_INVALID_ID;

> +        vslice->ref_pic_list1[i].flags      = VA_PICTURE_HEVC_INVALID;

> +    }

>  

>      *vslice = (VAEncSliceParameterBufferHEVC) {

>          .slice_segment_address = sh->slice_segment_address,

> -- 

> 2.14.1

> 


Um, this doesn't appear to do anything?

I haven't tried the new driver release yet, but I intend to soon.

- Mark


More information about the ffmpeg-devel mailing list