From fb09c028e396bf99ac95fa5e99b726f306ce2308 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Cerveau?= Date: Fri, 23 Sep 2022 17:18:35 +0200 Subject: [PATCH] h265parse: fix typo in member of GstH265SPS Rename sps_extnsion_params to sps_extension_params Fix comment about vui_parameters_present_flag Part-of: --- .../gst-libs/gst/codecparsers/gsth265bitwriter.c | 18 +++---- .../gst-libs/gst/codecparsers/gsth265parser.c | 62 ++++++++++++---------- .../gst-libs/gst/codecparsers/gsth265parser.h | 9 +++- .../gst-plugins-bad/sys/nvcodec/gstnvh265dec.c | 2 +- subprojects/gst-plugins-bad/sys/va/gstvah265dec.c | 2 +- .../tests/check/libs/h265bitwriter.c | 20 +++---- .../gst-libs/gst/vaapi/gstvaapidecoder_h265.c | 18 +++---- 7 files changed, 72 insertions(+), 59 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265bitwriter.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265bitwriter.c index 770cd3b..7bd5925 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265bitwriter.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265bitwriter.c @@ -975,20 +975,20 @@ _h265_bit_writer_sps (const GstH265SPS * sps, if (sps->sps_range_extension_flag) { WRITE_BITS (bw, - sps->sps_extnsion_params.transform_skip_rotation_enabled_flag, 1); + sps->sps_extension_params.transform_skip_rotation_enabled_flag, 1); WRITE_BITS (bw, - sps->sps_extnsion_params.transform_skip_context_enabled_flag, 1); - WRITE_BITS (bw, sps->sps_extnsion_params.implicit_rdpcm_enabled_flag, 1); - WRITE_BITS (bw, sps->sps_extnsion_params.explicit_rdpcm_enabled_flag, 1); + sps->sps_extension_params.transform_skip_context_enabled_flag, 1); + WRITE_BITS (bw, sps->sps_extension_params.implicit_rdpcm_enabled_flag, 1); + WRITE_BITS (bw, sps->sps_extension_params.explicit_rdpcm_enabled_flag, 1); WRITE_BITS (bw, - sps->sps_extnsion_params.extended_precision_processing_flag, 1); - WRITE_BITS (bw, sps->sps_extnsion_params.intra_smoothing_disabled_flag, 1); + sps->sps_extension_params.extended_precision_processing_flag, 1); + WRITE_BITS (bw, sps->sps_extension_params.intra_smoothing_disabled_flag, 1); WRITE_BITS (bw, - sps->sps_extnsion_params.high_precision_offsets_enabled_flag, 1); + sps->sps_extension_params.high_precision_offsets_enabled_flag, 1); WRITE_BITS (bw, - sps->sps_extnsion_params.persistent_rice_adaptation_enabled_flag, 1); + sps->sps_extension_params.persistent_rice_adaptation_enabled_flag, 1); WRITE_BITS (bw, - sps->sps_extnsion_params.cabac_bypass_alignment_enabled_flag, 1); + sps->sps_extension_params.cabac_bypass_alignment_enabled_flag, 1); } if (sps->sps_multilayer_extension_flag) { diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.c index cd005fb..d232ba9 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.c @@ -2128,20 +2128,21 @@ gst_h265_parse_sps (GstH265Parser * parser, GstH265NalUnit * nalu, if (sps->sps_range_extension_flag) { READ_UINT8 (&nr, - sps->sps_extnsion_params.transform_skip_rotation_enabled_flag, 1); + sps->sps_extension_params.transform_skip_rotation_enabled_flag, 1); READ_UINT8 (&nr, - sps->sps_extnsion_params.transform_skip_context_enabled_flag, 1); - READ_UINT8 (&nr, sps->sps_extnsion_params.implicit_rdpcm_enabled_flag, 1); - READ_UINT8 (&nr, sps->sps_extnsion_params.explicit_rdpcm_enabled_flag, 1); + sps->sps_extension_params.transform_skip_context_enabled_flag, 1); + READ_UINT8 (&nr, sps->sps_extension_params.implicit_rdpcm_enabled_flag, 1); + READ_UINT8 (&nr, sps->sps_extension_params.explicit_rdpcm_enabled_flag, 1); READ_UINT8 (&nr, - sps->sps_extnsion_params.extended_precision_processing_flag, 1); - READ_UINT8 (&nr, sps->sps_extnsion_params.intra_smoothing_disabled_flag, 1); + sps->sps_extension_params.extended_precision_processing_flag, 1); + READ_UINT8 (&nr, sps->sps_extension_params.intra_smoothing_disabled_flag, + 1); READ_UINT8 (&nr, - sps->sps_extnsion_params.high_precision_offsets_enabled_flag, 1); + sps->sps_extension_params.high_precision_offsets_enabled_flag, 1); READ_UINT8 (&nr, - sps->sps_extnsion_params.persistent_rice_adaptation_enabled_flag, 1); + sps->sps_extension_params.persistent_rice_adaptation_enabled_flag, 1); READ_UINT8 (&nr, - sps->sps_extnsion_params.cabac_bypass_alignment_enabled_flag, 1); + sps->sps_extension_params.cabac_bypass_alignment_enabled_flag, 1); } if (sps->sps_multilayer_extension_flag) { @@ -2166,22 +2167,25 @@ gst_h265_parse_sps (GstH265Parser * parser, GstH265NalUnit * nalu, 128 - sps->sps_scc_extension_params.palette_max_size); READ_UINT8 (&nr, - sps->sps_scc_extension_params. - sps_palette_predictor_initializers_present_flag, 1); - if (sps->sps_scc_extension_params. - sps_palette_predictor_initializers_present_flag) { + sps-> + sps_scc_extension_params.sps_palette_predictor_initializers_present_flag, + 1); + if (sps-> + sps_scc_extension_params.sps_palette_predictor_initializers_present_flag) + { guint comp; READ_UE_MAX (&nr, - sps->sps_scc_extension_params. - sps_num_palette_predictor_initializer_minus1, + sps-> + sps_scc_extension_params.sps_num_palette_predictor_initializer_minus1, sps->sps_scc_extension_params.palette_max_size + sps->sps_scc_extension_params.delta_palette_max_predictor_size - 1); for (comp = 0; comp < (sps->chroma_format_idc == 0 ? 1 : 3); comp++) { guint num_bits; guint num = - sps->sps_scc_extension_params. - sps_num_palette_predictor_initializer_minus1 + 1; + sps-> + sps_scc_extension_params.sps_num_palette_predictor_initializer_minus1 + + 1; num_bits = (comp == 0 ? sps->bit_depth_luma_minus8 + 8 : sps->bit_depth_chroma_minus8 + 8); @@ -2482,10 +2486,12 @@ gst_h265_parse_pps (GstH265Parser * parser, GstH265NalUnit * nalu, READ_UINT8 (&nr, pps->pps_scc_extension_params.pps_curr_pic_ref_enabled_flag, 1); READ_UINT8 (&nr, - pps->pps_scc_extension_params. - residual_adaptive_colour_transform_enabled_flag, 1); - if (pps->pps_scc_extension_params. - residual_adaptive_colour_transform_enabled_flag) { + pps-> + pps_scc_extension_params.residual_adaptive_colour_transform_enabled_flag, + 1); + if (pps-> + pps_scc_extension_params.residual_adaptive_colour_transform_enabled_flag) + { READ_UINT8 (&nr, pps->pps_scc_extension_params.pps_slice_act_qp_offsets_present_flag, 1); @@ -2498,10 +2504,12 @@ gst_h265_parse_pps (GstH265Parser * parser, GstH265NalUnit * nalu, } READ_UINT8 (&nr, - pps->pps_scc_extension_params. - pps_palette_predictor_initializers_present_flag, 1); - if (pps->pps_scc_extension_params. - pps_palette_predictor_initializers_present_flag) { + pps-> + pps_scc_extension_params.pps_palette_predictor_initializers_present_flag, + 1); + if (pps-> + pps_scc_extension_params.pps_palette_predictor_initializers_present_flag) + { READ_UE_MAX (&nr, pps->pps_scc_extension_params.pps_num_palette_predictor_initializer, sps->sps_scc_extension_params.palette_max_size + @@ -2532,8 +2540,8 @@ gst_h265_parse_pps (GstH265Parser * parser, GstH265NalUnit * nalu, comp++) { guint num_bits; guint num = - pps->pps_scc_extension_params. - pps_num_palette_predictor_initializer; + pps-> + pps_scc_extension_params.pps_num_palette_predictor_initializer; num_bits = (comp == 0 ? pps->pps_scc_extension_params.luma_bit_depth_entry_minus8 + 8 : diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.h b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.h index 1631ccb..679d70c 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.h @@ -1183,7 +1183,7 @@ struct _GstH265SPS guint8 strong_intra_smoothing_enabled_flag; guint8 vui_parameters_present_flag; - /* if vui_parameters_present_flat */ + /* if vui_parameters_present_flag */ GstH265VUIParams vui_params; guint8 sps_extension_flag; @@ -1196,7 +1196,12 @@ struct _GstH265SPS guint8 sps_extension_4bits; /* if sps_range_extension_flag */ - GstH265SPSExtensionParams sps_extnsion_params; + /** + * _GstH265SPS.sps_extension_params: + * + * Since: 1.22 + */ + GstH265SPSExtensionParams sps_extension_params; /* if sps_scc_extension_flag */ GstH265SPSSccExtensionParams sps_scc_extension_params; diff --git a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh265dec.c b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh265dec.c index 6f594ba..0bba5b3 100644 --- a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh265dec.c +++ b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh265dec.c @@ -552,7 +552,7 @@ gst_nv_h265_dec_picture_params_from_sps (GstNvH265Dec * self, #define COPY_FIELD_WITH_PREFIX(f) \ (params)->G_PASTE(sps_,f) = (sps)->f #define COPY_FIELD_EXTENSION(f) \ - (params)->f = (sps)->sps_extnsion_params.f + (params)->f = (sps)->sps_extension_params.f params->pic_width_in_luma_samples = sps->width; params->pic_height_in_luma_samples = sps->height; diff --git a/subprojects/gst-plugins-bad/sys/va/gstvah265dec.c b/subprojects/gst-plugins-bad/sys/va/gstvah265dec.c index 58d16d3..f90b23d 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvah265dec.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvah265dec.c @@ -574,7 +574,7 @@ _fill_picture_range_ext_parameter (GstVaH265Dec * decoder, { VAPictureParameterBufferHEVCRext *pic_param = &decoder->pic_param.rext; - GstH265SPSExtensionParams *sps_ext = &sps->sps_extnsion_params; + GstH265SPSExtensionParams *sps_ext = &sps->sps_extension_params; GstH265PPSExtensionParams *pps_ext = &pps->pps_extension_params; /* *INDENT-OFF* */ diff --git a/subprojects/gst-plugins-bad/tests/check/libs/h265bitwriter.c b/subprojects/gst-plugins-bad/tests/check/libs/h265bitwriter.c index 2110155..70a6ed1 100644 --- a/subprojects/gst-plugins-bad/tests/check/libs/h265bitwriter.c +++ b/subprojects/gst-plugins-bad/tests/check/libs/h265bitwriter.c @@ -365,7 +365,7 @@ static const GstH265SPS sps = { .sps_3d_extension_flag = 0, .sps_scc_extension_flag = 0, - .sps_extnsion_params = { + .sps_extension_params = { .transform_skip_rotation_enabled_flag = 0, .transform_skip_context_enabled_flag = 0, .implicit_rdpcm_enabled_flag = 0, @@ -785,15 +785,15 @@ GST_START_TEST (test_h265_bitwriter_vps_sps_pps_slice_hdr) CHECK_FIELD (sps_multilayer_extension_flag); CHECK_FIELD (sps_3d_extension_flag); CHECK_FIELD (sps_scc_extension_flag); - CHECK_FIELD (sps_extnsion_params.transform_skip_rotation_enabled_flag); - CHECK_FIELD (sps_extnsion_params.transform_skip_context_enabled_flag); - CHECK_FIELD (sps_extnsion_params.implicit_rdpcm_enabled_flag); - CHECK_FIELD (sps_extnsion_params.explicit_rdpcm_enabled_flag); - CHECK_FIELD (sps_extnsion_params.extended_precision_processing_flag); - CHECK_FIELD (sps_extnsion_params.intra_smoothing_disabled_flag); - CHECK_FIELD (sps_extnsion_params.high_precision_offsets_enabled_flag); - CHECK_FIELD (sps_extnsion_params.persistent_rice_adaptation_enabled_flag); - CHECK_FIELD (sps_extnsion_params.cabac_bypass_alignment_enabled_flag); + CHECK_FIELD (sps_extension_params.transform_skip_rotation_enabled_flag); + CHECK_FIELD (sps_extension_params.transform_skip_context_enabled_flag); + CHECK_FIELD (sps_extension_params.implicit_rdpcm_enabled_flag); + CHECK_FIELD (sps_extension_params.explicit_rdpcm_enabled_flag); + CHECK_FIELD (sps_extension_params.extended_precision_processing_flag); + CHECK_FIELD (sps_extension_params.intra_smoothing_disabled_flag); + CHECK_FIELD (sps_extension_params.high_precision_offsets_enabled_flag); + CHECK_FIELD (sps_extension_params.persistent_rice_adaptation_enabled_flag); + CHECK_FIELD (sps_extension_params.cabac_bypass_alignment_enabled_flag); #undef CHECK_FIELD memset (header_data, 0, sizeof (header_data)); diff --git a/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapidecoder_h265.c b/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapidecoder_h265.c index 167058f..025939c 100644 --- a/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapidecoder_h265.c +++ b/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapidecoder_h265.c @@ -2057,23 +2057,23 @@ fill_picture (GstVaapiDecoderH265 * decoder, GstVaapiPictureH265 * picture, #define COPY_REXT_BFM(a, s, f) \ pic_rext_param->a.bits.f = s.f - COPY_REXT_BFM (range_extension_pic_fields, sps->sps_extnsion_params, + COPY_REXT_BFM (range_extension_pic_fields, sps->sps_extension_params, transform_skip_rotation_enabled_flag); - COPY_REXT_BFM (range_extension_pic_fields, sps->sps_extnsion_params, + COPY_REXT_BFM (range_extension_pic_fields, sps->sps_extension_params, transform_skip_context_enabled_flag); - COPY_REXT_BFM (range_extension_pic_fields, sps->sps_extnsion_params, + COPY_REXT_BFM (range_extension_pic_fields, sps->sps_extension_params, implicit_rdpcm_enabled_flag); - COPY_REXT_BFM (range_extension_pic_fields, sps->sps_extnsion_params, + COPY_REXT_BFM (range_extension_pic_fields, sps->sps_extension_params, explicit_rdpcm_enabled_flag); - COPY_REXT_BFM (range_extension_pic_fields, sps->sps_extnsion_params, + COPY_REXT_BFM (range_extension_pic_fields, sps->sps_extension_params, extended_precision_processing_flag); - COPY_REXT_BFM (range_extension_pic_fields, sps->sps_extnsion_params, + COPY_REXT_BFM (range_extension_pic_fields, sps->sps_extension_params, intra_smoothing_disabled_flag); - COPY_REXT_BFM (range_extension_pic_fields, sps->sps_extnsion_params, + COPY_REXT_BFM (range_extension_pic_fields, sps->sps_extension_params, high_precision_offsets_enabled_flag); - COPY_REXT_BFM (range_extension_pic_fields, sps->sps_extnsion_params, + COPY_REXT_BFM (range_extension_pic_fields, sps->sps_extension_params, persistent_rice_adaptation_enabled_flag); - COPY_REXT_BFM (range_extension_pic_fields, sps->sps_extnsion_params, + COPY_REXT_BFM (range_extension_pic_fields, sps->sps_extension_params, cabac_bypass_alignment_enabled_flag); COPY_REXT_BFM (range_extension_pic_fields, pps->pps_extension_params, -- 2.7.4