Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH] avcodec/hevc_ps: Constify VPS, SPS pointers when parsing PPS
Date: Fri, 30 Jun 2023 01:36:17 +0200
Message-ID: <GV1P250MB0737DABBF84C2D9C9BA4A0AA8F25A@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> (raw)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/hevc_ps.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index d7930d3ac3..4c4c1e2c17 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -725,7 +725,8 @@ static void set_default_scaling_list_data(ScalingList *sl)
     memcpy(sl->sl[3][5], default_scaling_list_inter, 64);
 }
 
-static int scaling_list_data(GetBitContext *gb, AVCodecContext *avctx, ScalingList *sl, HEVCSPS *sps)
+static int scaling_list_data(GetBitContext *gb, AVCodecContext *avctx,
+                             ScalingList *sl, const HEVCSPS *sps)
 {
     uint8_t scaling_list_pred_mode_flag;
     uint8_t scaling_list_dc_coef[2][6];
@@ -1412,7 +1413,7 @@ static int colour_mapping_table(GetBitContext *gb, AVCodecContext *avctx, HEVCPP
 }
 
 static int pps_multilayer_extension(GetBitContext *gb, AVCodecContext *avctx,
-                                    HEVCPPS *pps, HEVCSPS *sps, HEVCVPS *vps)
+                                    HEVCPPS *pps, const HEVCSPS *sps, const HEVCVPS *vps)
 {
     pps->poc_reset_info_present_flag = get_bits1(gb);
     pps->pps_infer_scaling_list_flag = get_bits1(gb);
@@ -1483,7 +1484,7 @@ static void delta_dlt(GetBitContext *gb, HEVCPPS *pps)
 }
 
 static int pps_3d_extension(GetBitContext *gb, AVCodecContext *avctx,
-                            HEVCPPS *pps, HEVCSPS *sps)
+                            HEVCPPS *pps, const HEVCSPS *sps)
 {
     unsigned int pps_depth_layers_minus1;
 
@@ -1507,7 +1508,7 @@ static int pps_3d_extension(GetBitContext *gb, AVCodecContext *avctx,
 }
 
 static int pps_range_extensions(GetBitContext *gb, AVCodecContext *avctx,
-                                HEVCPPS *pps, HEVCSPS *sps)
+                                HEVCPPS *pps, const HEVCSPS *sps)
 {
     if (pps->transform_skip_enabled_flag) {
         pps->log2_max_transform_skip_block_size = get_ue_golomb_31(gb) + 2;
@@ -1547,7 +1548,7 @@ static int pps_range_extensions(GetBitContext *gb, AVCodecContext *avctx,
 }
 
 static int pps_scc_extension(GetBitContext *gb, AVCodecContext *avctx,
-                             HEVCPPS *pps, HEVCSPS *sps)
+                             HEVCPPS *pps, const HEVCSPS *sps)
 {
     int num_comps, ret;
 
@@ -1599,7 +1600,7 @@ static int pps_scc_extension(GetBitContext *gb, AVCodecContext *avctx,
 }
 
 static inline int setup_pps(AVCodecContext *avctx, GetBitContext *gb,
-                            HEVCPPS *pps, HEVCSPS *sps)
+                            HEVCPPS *pps, const HEVCSPS *sps)
 {
     int log2_diff;
     int pic_area_in_ctbs;
@@ -1733,8 +1734,8 @@ static inline int setup_pps(AVCodecContext *avctx, GetBitContext *gb,
 int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx,
                            HEVCParamSets *ps)
 {
-    HEVCSPS      *sps = NULL;
-    HEVCVPS      *vps = NULL;
+    const HEVCSPS *sps = NULL;
+    const HEVCVPS *vps = NULL;
     int i, ret = 0;
     unsigned int pps_id = 0;
     ptrdiff_t nal_size;
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

                 reply	other threads:[~2023-06-29 23:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=GV1P250MB0737DABBF84C2D9C9BA4A0AA8F25A@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git