mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
nvh264sldec: Fix wrong scaling list matrix scan order
Quatization matrix of NVDEC should be raster scan order but h264parser stores it in zig-zag scan order. We need to convert the matrix. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1290>
This commit is contained in:
parent
d806dd2543
commit
e75049eb84
1 changed files with 25 additions and 11 deletions
|
@ -715,6 +715,29 @@ gst_nv_h264_dec_get_decoder_frame_from_picture (GstNvH264Dec * self,
|
||||||
return frame;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_nv_h264_dec_fill_scaling_list_4x4 (const GstH264PPS * pps,
|
||||||
|
CUVIDH264PICPARAMS * params)
|
||||||
|
{
|
||||||
|
guint i;
|
||||||
|
|
||||||
|
for (i = 0; i < G_N_ELEMENTS (params->WeightScale4x4); i++)
|
||||||
|
gst_h264_quant_matrix_4x4_get_raster_from_zigzag (params->WeightScale4x4[i],
|
||||||
|
pps->scaling_lists_4x4[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_nv_h264_dec_fill_scaling_list_8x8 (const GstH264PPS * pps,
|
||||||
|
CUVIDH264PICPARAMS * params)
|
||||||
|
{
|
||||||
|
guint i;
|
||||||
|
|
||||||
|
for (i = 0; i < G_N_ELEMENTS (params->WeightScale8x8); i++) {
|
||||||
|
gst_h264_quant_matrix_8x8_get_raster_from_zigzag (params->WeightScale8x8[i],
|
||||||
|
pps->scaling_lists_8x8[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_nv_h264_dec_picture_params_from_sps (GstNvH264Dec * self,
|
gst_nv_h264_dec_picture_params_from_sps (GstNvH264Dec * self,
|
||||||
const GstH264SPS * sps, gboolean field_pic, CUVIDH264PICPARAMS * params)
|
const GstH264SPS * sps, gboolean field_pic, CUVIDH264PICPARAMS * params)
|
||||||
|
@ -764,17 +787,8 @@ gst_nv_h264_dec_picture_params_from_pps (GstNvH264Dec * self,
|
||||||
COPY_FIELD (chroma_qp_index_offset);
|
COPY_FIELD (chroma_qp_index_offset);
|
||||||
#undef COPY_FIELD
|
#undef COPY_FIELD
|
||||||
|
|
||||||
/* h264parser will copy scaling list from sps to pps regardless of
|
gst_nv_h264_dec_fill_scaling_list_4x4 (pps, params);
|
||||||
* pic_scaling_matrix_present_flag */
|
gst_nv_h264_dec_fill_scaling_list_8x8 (pps, params);
|
||||||
g_assert (sizeof (params->WeightScale4x4) == sizeof (pps->scaling_lists_4x4));
|
|
||||||
g_assert (sizeof (params->WeightScale8x8[0]) ==
|
|
||||||
sizeof (pps->scaling_lists_8x8[0]));
|
|
||||||
memcpy (params->WeightScale4x4, pps->scaling_lists_4x4,
|
|
||||||
sizeof (params->WeightScale4x4));
|
|
||||||
memcpy (params->WeightScale8x8[0], pps->scaling_lists_8x8[0],
|
|
||||||
sizeof (params->WeightScale8x8[0]));
|
|
||||||
memcpy (params->WeightScale8x8[1], pps->scaling_lists_8x8[3],
|
|
||||||
sizeof (params->WeightScale8x8[0]));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue