From 353013fcaad88bf32322d8faf39b7708f9e697d9 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Wed, 26 Feb 2020 17:33:59 +0900 Subject: [PATCH] h265parser: Store NumDeltaPocs of reference for hardware accelerators That's the value of NumDeltaPocs[RefRpsIdx] and we might be able to derive the value from given sps and slice header. Because well known hardware implementations refer to the value, however, storing the value makes things easier. Following is the list of hardware implementations * DXVA2: ucNumDeltaPocsOfRefRpsIdx * NVDEC/VDPAU: NumDeltaPocsOfRefRpsIdx --- gst-libs/gst/codecparsers/gsth265parser.c | 1 + gst-libs/gst/codecparsers/gsth265parser.h | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/gst-libs/gst/codecparsers/gsth265parser.c b/gst-libs/gst/codecparsers/gsth265parser.c index 46e304b..8297035 100644 --- a/gst-libs/gst/codecparsers/gsth265parser.c +++ b/gst-libs/gst/codecparsers/gsth265parser.c @@ -805,6 +805,7 @@ gst_h265_parser_parse_short_term_ref_pic_sets (GstH265ShortTermRefPicSet * deltaRps = (1 - 2 * stRPS->delta_rps_sign) * (stRPS->abs_delta_rps_minus1 + 1); /* 7-46 */ RefRPS = &sps->short_term_ref_pic_set[RefRpsIdx]; + stRPS->NumDeltaPocsOfRefRpsIdx = RefRPS->NumDeltaPocs; for (j = 0; j <= RefRPS->NumDeltaPocs; j++) { READ_UINT8 (nr, used_by_curr_pic_flag[j], 1); diff --git a/gst-libs/gst/codecparsers/gsth265parser.h b/gst-libs/gst/codecparsers/gsth265parser.h index be62b13..43c319f 100644 --- a/gst-libs/gst/codecparsers/gsth265parser.h +++ b/gst-libs/gst/codecparsers/gsth265parser.h @@ -735,6 +735,32 @@ struct _GstH265VPS { * the value of the variable deltaRps. * @abs_delta_rps_minus1: delta_rps_sign and abs_delta_rps_minus1 together specify * the value of the variable deltaRps + * @NumDeltaPocs: sum of @NumNegativePics and @NumPositivePics. + * @NumNegativePics: Derived value depending on inter_ref_pic_set_prediction_flag. + * If inter_ref_pic_set_prediction_flag is equal to 0, this specifies + * the number of entries in the stRpsIdx-th candidate + * short-term RPS that have poc values less than the poc of the current picture. + * @NumPositivePics: Derived value depending on inter_ref_pic_set_prediction_flag. + * If inter_ref_pic_set_prediction_flag is equal to 0, this specifies + * the number of entires in the stRpsIdx-th candidate + * short-term RPS that have poc values greater than the poc value of the current picture. + * @UsedByCurrPicS0: Derived value depending on inter_ref_pic_set_prediction_flag. + * If inter_ref_pic_set_prediction_flag is equal to 0, + * equal to zero specifies that the i-th entry in the stRpsIdx-th + * candidate short-term RPS that has poc value less than of the current picture + * is not used for reference by the current picture + * @UsedByCurrPicS1: Derived value depending on inter_ref_pic_set_prediction_flag. + * If inter_ref_pic_set_prediction_flag is equal to 0, + * equal to zero specifies that the i-th entry in the current + * candidate short-term RPS that has poc value greater than that of the current picture + * is not used for reference by the current picture. + * @DeltaPocS0: Derived value depending on inter_ref_pic_set_prediction_flag. + * See 7.4.8 Short-term reference picture set semantics + * @DeltaPocS1: Derived value depending on inter_ref_pic_set_prediction_flag. + * See 7.4.8 Short-term reference picture set semantics + * @NumDeltaPocsOfRefRpsIdx: The value of NumDeltaPocs[RefRpsIdx]. + * If inter_ref_pic_set_prediction_flag is equal to 0, + * this value should be ignored (Since: 1.18) * * Defines the #GstH265ShortTermRefPicSet params */ @@ -753,6 +779,7 @@ struct _GstH265ShortTermRefPicSet guint8 UsedByCurrPicS1[16]; gint32 DeltaPocS0[16]; gint32 DeltaPocS1[16]; + guint8 NumDeltaPocsOfRefRpsIdx; }; /** -- 2.7.4