[FFmpeg-cvslog] avcodec/mpegvideoenc: Constify vlc length pointees
Andreas Rheinhardt
git at videolan.org
Wed Mar 26 06:10:50 EET 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Wed Mar 19 13:03:22 2025 +0100| [ec6c8e52734c72c6a3e09fd32dc02b68d58ff8ae] | committer: Andreas Rheinhardt
avcodec/mpegvideoenc: Constify vlc length pointees
These pointers point to static tables which must not be modified
by anyone after they have been initialized. So constify the pointees.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ec6c8e52734c72c6a3e09fd32dc02b68d58ff8ae
---
libavcodec/me_cmp.c | 4 ++--
libavcodec/mpegvideoenc.h | 14 +++++++-------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/libavcodec/me_cmp.c b/libavcodec/me_cmp.c
index 09a830d15e..2a8ede5955 100644
--- a/libavcodec/me_cmp.c
+++ b/libavcodec/me_cmp.c
@@ -758,7 +758,7 @@ static int rd8x8_c(MPVEncContext *const s, const uint8_t *src1, const uint8_t *s
LOCAL_ALIGNED_16(uint8_t, lsrc2, [64]);
int i, last, run, bits, level, distortion, start_i;
const int esc_length = s->ac_esc_length;
- uint8_t *length, *last_length;
+ const uint8_t *length, *last_length;
copy_block8(lsrc1, src1, 8, stride, 8);
copy_block8(lsrc2, src2, 8, stride, 8);
@@ -831,7 +831,7 @@ static int bit8x8_c(MPVEncContext *const s, const uint8_t *src1, const uint8_t *
LOCAL_ALIGNED_16(int16_t, temp, [64]);
int i, last, run, bits, level, start_i;
const int esc_length = s->ac_esc_length;
- uint8_t *length, *last_length;
+ const uint8_t *length, *last_length;
s->pdsp.diff_pixels_unaligned(temp, src1, src2, stride);
diff --git a/libavcodec/mpegvideoenc.h b/libavcodec/mpegvideoenc.h
index 689297e55c..6e76185c0c 100644
--- a/libavcodec/mpegvideoenc.h
+++ b/libavcodec/mpegvideoenc.h
@@ -93,13 +93,13 @@ typedef struct MPVEncContext {
int min_qcoeff; ///< minimum encodable coefficient
int max_qcoeff; ///< maximum encodable coefficient
int ac_esc_length; ///< num of bits needed to encode the longest esc
- uint8_t *intra_ac_vlc_length;
- uint8_t *intra_ac_vlc_last_length;
- uint8_t *intra_chroma_ac_vlc_length;
- uint8_t *intra_chroma_ac_vlc_last_length;
- uint8_t *inter_ac_vlc_length;
- uint8_t *inter_ac_vlc_last_length;
- uint8_t *luma_dc_vlc_length;
+ const uint8_t *intra_ac_vlc_length;
+ const uint8_t *intra_ac_vlc_last_length;
+ const uint8_t *intra_chroma_ac_vlc_length;
+ const uint8_t *intra_chroma_ac_vlc_last_length;
+ const uint8_t *inter_ac_vlc_length;
+ const uint8_t *inter_ac_vlc_last_length;
+ const uint8_t *luma_dc_vlc_length;
int coded_score[12];
More information about the ffmpeg-cvslog
mailing list