diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2025-03-19 13:03:22 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2025-03-26 04:10:31 +0100 |
commit | ec6c8e52734c72c6a3e09fd32dc02b68d58ff8ae (patch) | |
tree | 20600e9b5599bcf604b880c8d8641d5a7983aeb5 | |
parent | 8b15979a4b49f2981c27a85f202bf29b6a1c0de7 (diff) | |
download | ffmpeg-ec6c8e52734c72c6a3e09fd32dc02b68d58ff8ae.tar.gz |
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@outlook.com>
-rw-r--r-- | libavcodec/me_cmp.c | 4 | ||||
-rw-r--r-- | 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]; |