History

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.

Andreas Rheinhardt committed 1 year ago

Commit ec6c8e51 parent 8b159792 files · +9 −9Browse files

Showing the changes to libavcodec (2 of 2 files). Show all

Unified · Split

2 files
  1. libavcodec/me_cmp.c +2 −2
  2. libavcodec/mpegvideoenc.h +7 −7
libavcodec/me_cmp.c+2−2
@@ -758,7 +758,7 @@ static int rd8x8_c(MPVEncContext *const s, const uint8_t *src1, const uint8_t *s · 757 unmodified lines
758 LOCAL_ALIGNED_16(uint8_t, lsrc2, [64]);758 LOCAL_ALIGNED_16(uint8_t, lsrc2, [64]);
759 int i, last, run, bits, level, distortion, start_i;759 int i, last, run, bits, level, distortion, start_i;
760 const int esc_length = s->ac_esc_length;760 const int esc_length = s->ac_esc_length;
761 uint8_t *length, *last_length;761 const uint8_t *length, *last_length;
762 762
763 copy_block8(lsrc1, src1, 8, stride, 8);763 copy_block8(lsrc1, src1, 8, stride, 8);
764 copy_block8(lsrc2, src2, 8, stride, 8);764 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 * · 66 unmodified lines
831 LOCAL_ALIGNED_16(int16_t, temp, [64]);831 LOCAL_ALIGNED_16(int16_t, temp, [64]);
832 int i, last, run, bits, level, start_i;832 int i, last, run, bits, level, start_i;
833 const int esc_length = s->ac_esc_length;833 const int esc_length = s->ac_esc_length;
834 uint8_t *length, *last_length;834 const uint8_t *length, *last_length;
835 835
836 s->pdsp.diff_pixels_unaligned(temp, src1, src2, stride);836 s->pdsp.diff_pixels_unaligned(temp, src1, src2, stride);
837 837
libavcodec/mpegvideoenc.h+7−7
@@ -93,13 +93,13 @@ typedef struct MPVEncContext { · 92 unmodified lines
93 int min_qcoeff; ///< minimum encodable coefficient93 int min_qcoeff; ///< minimum encodable coefficient
94 int max_qcoeff; ///< maximum encodable coefficient94 int max_qcoeff; ///< maximum encodable coefficient
95 int ac_esc_length; ///< num of bits needed to encode the longest esc95 int ac_esc_length; ///< num of bits needed to encode the longest esc
96 uint8_t *intra_ac_vlc_length;96 const uint8_t *intra_ac_vlc_length;
97 uint8_t *intra_ac_vlc_last_length;97 const uint8_t *intra_ac_vlc_last_length;
98 uint8_t *intra_chroma_ac_vlc_length;98 const uint8_t *intra_chroma_ac_vlc_length;
99 uint8_t *intra_chroma_ac_vlc_last_length;99 const uint8_t *intra_chroma_ac_vlc_last_length;
100 uint8_t *inter_ac_vlc_length;100 const uint8_t *inter_ac_vlc_length;
101 uint8_t *inter_ac_vlc_last_length;101 const uint8_t *inter_ac_vlc_last_length;
102 uint8_t *luma_dc_vlc_length;102 const uint8_t *luma_dc_vlc_length;
103 103
104 int coded_score[12];104 int coded_score[12];
105 105

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t