From 21b2d9cea2e56b9b31f8de11440a9c8a29326780 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Fri, 18 Feb 2022 16:23:09 -0500 Subject: [PATCH] v4l2codecs: vp9: Fix reset_frame_context parameter It was assumed that the kernel parameters would match with the bitstream value but instead the author when with another set of value. Surprisingly, this makes no difference with the resulting fluster score. Part-of: --- .../sys/v4l2codecs/gstv4l2codecvp9dec.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecvp9dec.c b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecvp9dec.c index 585946e905..ec4fe51b63 100644 --- a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecvp9dec.c +++ b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecvp9dec.c @@ -308,7 +308,6 @@ gst_v4l2_codec_vp9_dec_fill_dec_params (GstV4l2CodecVp9Dec * self, .compressed_header_size = h->header_size_in_bytes, .uncompressed_header_size = h->frame_header_length_in_bytes, .profile = h->profile, - .reset_frame_context = h->reset_frame_context, .frame_context_idx = h->frame_context_idx, .bit_depth = self->bit_depth, .interpolation_filter = h->interpolation_filter, @@ -350,12 +349,26 @@ gst_v4l2_codec_vp9_dec_fill_dec_params (GstV4l2CodecVp9Dec * self, }; /* *INDENT-ON* */ + switch (h->reset_frame_context) { + case 0: + case 1: + self->v4l2_vp9_frame.reset_frame_context = V4L2_VP9_RESET_FRAME_CTX_NONE; + break; + case 2: + self->v4l2_vp9_frame.reset_frame_context = V4L2_VP9_RESET_FRAME_CTX_SPEC; + break; + case 3: + self->v4l2_vp9_frame.reset_frame_context = V4L2_VP9_RESET_FRAME_CTX_ALL; + break; + default: + break; + } + gst_v4l2_codecs_vp9_dec_fill_refs (self, h, reference_frames); gst_v4l2_codec_vp9_dec_fill_lf_params (self, &h->loop_filter_params); gst_v4l2_codec_vp9_dec_fill_seg_params (self, &h->segmentation_params); } - static gboolean gst_v4l2_codec_vp9_dec_open (GstVideoDecoder * decoder) {