[FFmpeg-cvslog] avcodec/rv34: Constify pointer to static object

Andreas Rheinhardt git at videolan.org
Tue Oct 31 22:15:30 EET 2023


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sun Sep 24 15:16:03 2023 +0200| [1ae750a16ec2f27535af8d4db2acc49da1ee74f6] | committer: Andreas Rheinhardt

avcodec/rv34: Constify pointer to static object

Said object is only allowed to be modified during its
initialization and is immutable afterwards.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1ae750a16ec2f27535af8d4db2acc49da1ee74f6
---

 libavcodec/rv34.c | 5 +++--
 libavcodec/rv34.h | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index a564785f18..914bde4a2a 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -186,7 +186,7 @@ static av_cold void rv34_init_tables(void)
 /**
  * Decode coded block pattern.
  */
-static int rv34_decode_cbp(GetBitContext *gb, RV34VLC *vlc, int table)
+static int rv34_decode_cbp(GetBitContext *gb, const RV34VLC *vlc, int table)
 {
     int pattern, code, cbp=0;
     int ones;
@@ -289,7 +289,8 @@ static inline void decode_subblock3(int16_t *dst, int code, GetBitContext *gb,
  *  o--o
  */
 
-static int rv34_decode_block(int16_t *dst, GetBitContext *gb, RV34VLC *rvlc, int fc, int sc, int q_dc, int q_ac1, int q_ac2)
+static int rv34_decode_block(int16_t *dst, GetBitContext *gb, const RV34VLC *rvlc,
+                             int fc, int sc, int q_dc, int q_ac1, int q_ac2)
 {
     int code, pattern, has_ac = 1;
 
diff --git a/libavcodec/rv34.h b/libavcodec/rv34.h
index 4bb81b4965..6fe1f8087d 100644
--- a/libavcodec/rv34.h
+++ b/libavcodec/rv34.h
@@ -92,7 +92,7 @@ typedef struct RV34DecContext{
     const uint8_t *luma_dc_quant_i;///< luma subblock DC quantizer for intraframes
     const uint8_t *luma_dc_quant_p;///< luma subblock DC quantizer for interframes
 
-    RV34VLC *cur_vlcs;       ///< VLC set used for current frame decoding
+    const RV34VLC *cur_vlcs; ///< VLC set used for current frame decoding
     H264PredContext h;       ///< functions for 4x4 and 16x16 intra block prediction
     SliceInfo si;            ///< current slice information
 



More information about the ffmpeg-cvslog mailing list