aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTong Wu <tong1.wu@intel.com>2024-03-05 16:02:38 +0800
committerHaihao Xiang <haihao.xiang@intel.com>2024-04-18 14:43:07 +0800
commitb2e2fb0344a4b05106453d1bde09740d19a6e062 (patch)
treea658d6d87a3e7a750c2ed87db12bc044c25de81f
parent02fb1782efdcb30d4a1eb1ef80d19ebe1c435d1e (diff)
downloadffmpeg-b2e2fb0344a4b05106453d1bde09740d19a6e062.tar.gz
avcodec/vaapi_encode_h265: use is_reference to fill reference_pic_flag
This codec supports FLAG_B_PICTURE_REFERENCES. We need to fill reference_pic_flag with pic->is_reference. Signed-off-by: Tong Wu <tong1.wu@intel.com>
-rw-r--r--libavcodec/vaapi_encode_h265.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c
index 2777632fb6..2f59161346 100644
--- a/libavcodec/vaapi_encode_h265.c
+++ b/libavcodec/vaapi_encode_h265.c
@@ -944,26 +944,23 @@ static int vaapi_encode_h265_init_picture_params(AVCodecContext *avctx,
vpic->nal_unit_type = hpic->slice_nal_unit;
+ vpic->pic_fields.bits.reference_pic_flag = pic->is_reference;
switch (pic->type) {
case PICTURE_TYPE_IDR:
vpic->pic_fields.bits.idr_pic_flag = 1;
vpic->pic_fields.bits.coding_type = 1;
- vpic->pic_fields.bits.reference_pic_flag = 1;
break;
case PICTURE_TYPE_I:
vpic->pic_fields.bits.idr_pic_flag = 0;
vpic->pic_fields.bits.coding_type = 1;
- vpic->pic_fields.bits.reference_pic_flag = 1;
break;
case PICTURE_TYPE_P:
vpic->pic_fields.bits.idr_pic_flag = 0;
vpic->pic_fields.bits.coding_type = 2;
- vpic->pic_fields.bits.reference_pic_flag = 1;
break;
case PICTURE_TYPE_B:
vpic->pic_fields.bits.idr_pic_flag = 0;
vpic->pic_fields.bits.coding_type = 3;
- vpic->pic_fields.bits.reference_pic_flag = 0;
break;
default:
av_assert0(0 && "invalid picture type");