From: He Junyan Date: Fri, 15 Apr 2022 14:19:09 +0000 (+0800) Subject: va: h264enc: Do not let L0 number surplus the HW limitation. X-Git-Tag: 1.22.0~1773 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=277aa12b86d7a1d554cc12792a67a62562ed683f;p=platform%2Fupstream%2Fgstreamer.git va: h264enc: Do not let L0 number surplus the HW limitation. The algorithm to calculate the L0/L1 number may let the L0 number surplus the HW limitation. We should ensure that limitation after that calculation. Part-of: --- diff --git a/subprojects/gst-plugins-bad/sys/va/gstvah264enc.c b/subprojects/gst-plugins-bad/sys/va/gstvah264enc.c index c0b61c8..082cdad 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvah264enc.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvah264enc.c @@ -1123,6 +1123,9 @@ _generate_gop_structure (GstVaH264Enc * self) self->gop.ref_num_list0--; self->gop.ref_num_list1++; } + + if (self->gop.ref_num_list0 > list0) + self->gop.ref_num_list0 = list0; } /* It's OK, keep slots for GST_VIDEO_CODEC_FRAME_IS_FORCE_KEYFRAME frame. */