[Libva] [PATCH 2/3] HEVC: Fix the nal unit type generation in packed slice header.

Zhao, Yakui yakui.zhao at intel.com
Mon May 25 18:39:49 PDT 2015


On Thu, 2015-05-21 at 19:46 -0600, sreerenj.balachandran at intel.com
wrote:
> From: Sreerenj Balachandran <sreerenj.balachandran at intel.com>
> 
> Generate the Nal unit type for packed slice headers based
> on idr_pic_flag and reference_pic_flag.

this looks good to me.

Thanks.
> ---
>  src/i965_encoder_utils.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/src/i965_encoder_utils.c b/src/i965_encoder_utils.c
> index 9c9619c..0b7df4c 100644
> --- a/src/i965_encoder_utils.c
> +++ b/src/i965_encoder_utils.c
> @@ -1118,6 +1118,16 @@ static void slice_rbsp(avc_bitstream *bs,
>      avc_rbsp_trailing_bits(bs);
>  }
>  
> +int get_hevc_slice_nalu_type (VAEncPictureParameterBufferHEVC *pic_param)
> +{
> +    if (pic_param->pic_fields.bits.idr_pic_flag)
> +      return IDR_WRADL_NUT;
> +    else if (pic_param->pic_fields.bits.reference_pic_flag)
> +      return SLICE_TRAIL_R_NUT;
> +    else
> +      return SLICE_TRAIL_N_NUT;
> +}
> +
>  int build_hevc_slice_header(VAEncSequenceParameterBufferHEVC *seq_param,
>                         VAEncPictureParameterBufferHEVC *pic_param,
>                         VAEncSliceParameterBufferHEVC *slice_param,
> @@ -1128,7 +1138,7 @@ int build_hevc_slice_header(VAEncSequenceParameterBufferHEVC *seq_param,
>  
>      avc_bitstream_start(&bs);
>      nal_start_code_prefix(&bs);
> -    nal_header_hevc(&bs, SLICE_TRAIL_N_NUT, 0);
> +    nal_header_hevc(&bs, get_hevc_slice_nalu_type(pic_param), 0);
>      slice_rbsp(&bs, slice_index, seq_param,pic_param,slice_param);
>      avc_bitstream_end(&bs);
>  




More information about the Libva mailing list