Merge commit 'fd9212f2edfe9b107c3c08ba2df5fd2cba5ab9e3'

* commit 'fd9212f2edfe9b107c3c08ba2df5fd2cba5ab9e3':
  Mark some arrays that never change as const.

Merged-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2017-09-26 15:58:40 -03:00
commit 318778de9e
26 changed files with 64 additions and 64 deletions

2
configure vendored
View File

@ -7034,7 +7034,7 @@ print_enabled_components(){
struct_name=$2
name=$3
shift 3
echo "static const $struct_name *$name[] = {" > $TMPH
echo "static const $struct_name * const $name[] = {" > $TMPH
for c in $*; do
enabled $c && printf " &ff_%s,\n" $c >> $TMPH
done

View File

@ -894,7 +894,7 @@ static void search_for_ms(AACEncContext *s, ChannelElement *cpe)
}
}
AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = {
const AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = {
[AAC_CODER_ANMR] = {
search_for_quantizers_anmr,
encode_window_bands_info,

View File

@ -78,7 +78,7 @@ typedef struct AACCoefficientsEncoder {
void (*search_for_pred)(struct AACEncContext *s, SingleChannelElement *sce);
} AACCoefficientsEncoder;
extern AACCoefficientsEncoder ff_aac_coders[];
extern const AACCoefficientsEncoder ff_aac_coders[];
typedef struct AACQuantizeBandCostCacheEntry {
float rd;
@ -110,7 +110,7 @@ typedef struct AACEncContext {
ChannelElement *cpe; ///< channel elements
FFPsyContext psy;
struct FFPsyPreprocessContext* psypp;
AACCoefficientsEncoder *coder;
const AACCoefficientsEncoder *coder;
int cur_channel; ///< current channel for coder context
int random_state;
float lambda;

View File

@ -673,7 +673,7 @@ static const uint16_t order_MODE_23k85[] = {
};
/** Reordering array addresses for each mode */
static const uint16_t* amr_bit_orderings_by_mode[] = {
static const uint16_t * const amr_bit_orderings_by_mode[] = {
order_MODE_6k60,
order_MODE_8k85,
order_MODE_12k65,

View File

@ -109,8 +109,8 @@ av_cold void ff_atrac3p_init_vlcs(void)
NULL, NULL, atrac3p_ct_huff_xlat1, NULL
};
static const int sf_nb_bits[8] = { 9, 9, 9, 9, 6, 6, 7, 7 };
static const int sf_nb_codes[8] = { 64, 64, 64, 64, 16, 16, 16, 16 };
static const int sf_nb_bits[8] = { 9, 9, 9, 9, 6, 6, 7, 7 };
static const int sf_nb_codes[8] = { 64, 64, 64, 64, 16, 16, 16, 16 };
static const uint8_t * const sf_bits[8] = {
atrac3p_sf_huff_bits1, atrac3p_sf_huff_bits1, atrac3p_sf_huff_bits2,
atrac3p_sf_huff_bits3, atrac3p_sf_huff_bits4, atrac3p_sf_huff_bits4,

View File

@ -330,7 +330,7 @@ static const chunk_decoder decoder[8] = {
decode_tdlt, decode_dsw1, decode_blck, decode_dds1,
};
static const char* chunk_name[8] = {
static const char * const chunk_name[8] = {
"COPY", "TSW1", "BDLT", "WDLT", "TDLT", "DSW1", "BLCK", "DDS1"
};

View File

@ -80,8 +80,8 @@ static const int16_t low_inv_quant5[32] = {
};
static const int16_t * const low_inv_quants[3] = { ff_g722_low_inv_quant6,
low_inv_quant5,
ff_g722_low_inv_quant4 };
low_inv_quant5,
ff_g722_low_inv_quant4 };
static int g722_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)

View File

@ -7724,12 +7724,12 @@ static const double tabs_9_20[9 * 2][20] = {
0.22783, 0.058894795, -0.61350902, 0.69559873, -0.27013783, }
};
const double* const ff_on2avc_tabs_9_20_1[9] = {
const double * const ff_on2avc_tabs_9_20_1[9] = {
tabs_9_20[0], tabs_9_20[1], tabs_9_20[2], tabs_9_20[3], tabs_9_20[4],
tabs_9_20[5], tabs_9_20[6], tabs_9_20[7], tabs_9_20[8]
};
const double* const ff_on2avc_tabs_9_20_2[9] = {
const double * const ff_on2avc_tabs_9_20_2[9] = {
tabs_9_20[ 9], tabs_9_20[10], tabs_9_20[11], tabs_9_20[12], tabs_9_20[13],
tabs_9_20[14], tabs_9_20[15], tabs_9_20[16], tabs_9_20[17]
};
@ -7927,7 +7927,7 @@ static const double tabs_19_40[19 * 2][40] = {
0.019871848, -0.11989559, 0.036659135, 0.26632201, -0.3057397, -0.23220335, 0.68741352, -0.54024027, }
};
const double* const ff_on2avc_tabs_19_40_1[19] = {
const double * const ff_on2avc_tabs_19_40_1[19] = {
tabs_19_40[ 0], tabs_19_40[ 1], tabs_19_40[ 2], tabs_19_40[ 3],
tabs_19_40[ 4], tabs_19_40[ 5], tabs_19_40[ 6], tabs_19_40[ 7],
tabs_19_40[ 8], tabs_19_40[ 9], tabs_19_40[10], tabs_19_40[11],
@ -7935,7 +7935,7 @@ const double* const ff_on2avc_tabs_19_40_1[19] = {
tabs_19_40[16], tabs_19_40[17], tabs_19_40[18],
};
const double* const ff_on2avc_tabs_19_40_2[19] = {
const double * const ff_on2avc_tabs_19_40_2[19] = {
tabs_19_40[19], tabs_19_40[20], tabs_19_40[21], tabs_19_40[22],
tabs_19_40[23], tabs_19_40[24], tabs_19_40[25], tabs_19_40[26],
tabs_19_40[27], tabs_19_40[28], tabs_19_40[29], tabs_19_40[30],
@ -8826,7 +8826,7 @@ static const double tabs_20_84[20 * 4][84] = {
0.51434408, -0.41486443, 0.27672635, -0.10432054, },
};
const double* const ff_on2avc_tabs_20_84_1[20] = {
const double * const ff_on2avc_tabs_20_84_1[20] = {
tabs_20_84[ 0], tabs_20_84[ 1], tabs_20_84[ 2], tabs_20_84[ 3],
tabs_20_84[ 4], tabs_20_84[ 5], tabs_20_84[ 6], tabs_20_84[ 7],
tabs_20_84[ 8], tabs_20_84[ 9], tabs_20_84[10], tabs_20_84[11],
@ -8834,7 +8834,7 @@ const double* const ff_on2avc_tabs_20_84_1[20] = {
tabs_20_84[16], tabs_20_84[17], tabs_20_84[18], tabs_20_84[19]
};
const double* const ff_on2avc_tabs_20_84_2[20] = {
const double * const ff_on2avc_tabs_20_84_2[20] = {
tabs_20_84[20], tabs_20_84[21], tabs_20_84[22], tabs_20_84[23],
tabs_20_84[24], tabs_20_84[25], tabs_20_84[26], tabs_20_84[27],
tabs_20_84[28], tabs_20_84[29], tabs_20_84[30], tabs_20_84[31],
@ -8842,7 +8842,7 @@ const double* const ff_on2avc_tabs_20_84_2[20] = {
tabs_20_84[36], tabs_20_84[37], tabs_20_84[38], tabs_20_84[39]
};
const double* const ff_on2avc_tabs_20_84_3[20] = {
const double * const ff_on2avc_tabs_20_84_3[20] = {
tabs_20_84[40], tabs_20_84[41], tabs_20_84[42], tabs_20_84[43],
tabs_20_84[44], tabs_20_84[45], tabs_20_84[46], tabs_20_84[47],
tabs_20_84[48], tabs_20_84[49], tabs_20_84[50], tabs_20_84[51],
@ -8850,7 +8850,7 @@ const double* const ff_on2avc_tabs_20_84_3[20] = {
tabs_20_84[56], tabs_20_84[57], tabs_20_84[58], tabs_20_84[59]
};
const double* const ff_on2avc_tabs_20_84_4[20] = {
const double * const ff_on2avc_tabs_20_84_4[20] = {
tabs_20_84[60], tabs_20_84[61], tabs_20_84[62], tabs_20_84[63],
tabs_20_84[64], tabs_20_84[65], tabs_20_84[66], tabs_20_84[67],
tabs_20_84[68], tabs_20_84[69], tabs_20_84[70], tabs_20_84[71],

View File

@ -64,16 +64,16 @@ extern const double ff_on2avc_tab_84_1[];
extern const double ff_on2avc_tab_84_2[];
extern const double ff_on2avc_tab_84_3[];
extern const double ff_on2avc_tab_84_4[];
extern const double* const ff_on2avc_tabs_4_10_1[4];
extern const double* const ff_on2avc_tabs_4_10_2[4];
extern const double* const ff_on2avc_tabs_9_20_1[9];
extern const double* const ff_on2avc_tabs_9_20_2[9];
extern const double* const ff_on2avc_tabs_19_40_1[19];
extern const double* const ff_on2avc_tabs_19_40_2[19];
extern const double* const ff_on2avc_tabs_20_84_1[20];
extern const double* const ff_on2avc_tabs_20_84_2[20];
extern const double* const ff_on2avc_tabs_20_84_3[20];
extern const double* const ff_on2avc_tabs_20_84_4[20];
extern const double * const ff_on2avc_tabs_4_10_1[4];
extern const double * const ff_on2avc_tabs_4_10_2[4];
extern const double * const ff_on2avc_tabs_9_20_1[9];
extern const double * const ff_on2avc_tabs_9_20_2[9];
extern const double * const ff_on2avc_tabs_19_40_1[19];
extern const double * const ff_on2avc_tabs_19_40_2[19];
extern const double * const ff_on2avc_tabs_20_84_1[20];
extern const double * const ff_on2avc_tabs_20_84_2[20];
extern const double * const ff_on2avc_tabs_20_84_3[20];
extern const double * const ff_on2avc_tabs_20_84_4[20];
extern const float ff_on2avc_ctab_1[2048];
extern const float ff_on2avc_ctab_2[2048];
extern const float ff_on2avc_ctab_3[2048];

View File

@ -599,7 +599,7 @@ static void silk_decode_frame(SilkContext *s, OpusRangeCoder *rc,
if (lag_absolute) {
/* primary lag is coded absolute */
int highbits, lowbits;
static const uint16_t *model[] = {
static const uint16_t * const model[] = {
ff_silk_model_pitch_lowbits_nb, ff_silk_model_pitch_lowbits_mb,
ff_silk_model_pitch_lowbits_wb
};
@ -633,11 +633,11 @@ static void silk_decode_frame(SilkContext *s, OpusRangeCoder *rc,
ltpfilter = ff_opus_rc_dec_cdf(rc, ff_silk_model_ltp_filter);
for (i = 0; i < s->subframes; i++) {
int index, j;
static const uint16_t *filter_sel[] = {
static const uint16_t * const filter_sel[] = {
ff_silk_model_ltp_filter0_sel, ff_silk_model_ltp_filter1_sel,
ff_silk_model_ltp_filter2_sel
};
static const int8_t (*filter_taps[])[5] = {
static const int8_t (* const filter_taps[])[5] = {
ff_silk_ltp_filter0_taps, ff_silk_ltp_filter1_taps, ff_silk_ltp_filter2_taps
};
index = ff_opus_rc_dec_cdf(rc, filter_sel[ltpfilter]);

View File

@ -84,8 +84,8 @@ static av_cold int qsv_decode_init(AVCodecContext *avctx)
int ret;
if (avctx->codec_id == AV_CODEC_ID_HEVC && s->load_plugin != LOAD_PLUGIN_NONE) {
static const char *uid_hevcdec_sw = "15dd936825ad475ea34e35f3f54217a6";
static const char *uid_hevcdec_hw = "33a61c0b4c27454ca8d85dde757c6f8e";
static const char * const uid_hevcdec_sw = "15dd936825ad475ea34e35f3f54217a6";
static const char * const uid_hevcdec_hw = "33a61c0b4c27454ca8d85dde757c6f8e";
if (s->qsv.load_plugins[0]) {
av_log(avctx, AV_LOG_WARNING,

View File

@ -161,8 +161,8 @@ static av_cold int qsv_enc_init(AVCodecContext *avctx)
int ret;
if (q->load_plugin != LOAD_PLUGIN_NONE) {
static const char *uid_hevcenc_sw = "2fca99749fdb49aeb121a5b63ef568f7";
static const char *uid_hevcenc_hw = "6fadc791a0c2eb479ab6dcd5ea9da347";
static const char * const uid_hevcenc_sw = "2fca99749fdb49aeb121a5b63ef568f7";
static const char * const uid_hevcenc_hw = "6fadc791a0c2eb479ab6dcd5ea9da347";
if (q->qsv.load_plugins[0]) {
av_log(avctx, AV_LOG_WARNING,

View File

@ -903,14 +903,14 @@ static const int tscc2_ac_vlc_sizes[NUM_VLC_SETS] = {
172, 169, 165, 162, 131, 132, 130, 125, 121, 114, 110, 101, 96
};
static const uint16_t *tscc2_ac_vlc_syms[NUM_VLC_SETS] = {
static const uint16_t * const tscc2_ac_vlc_syms[NUM_VLC_SETS] = {
ac_vlc_desc0_syms, ac_vlc_desc1_syms, ac_vlc_desc2_syms, ac_vlc_desc3_syms,
ac_vlc_desc4_syms, ac_vlc_desc5_syms, ac_vlc_desc6_syms, ac_vlc_desc7_syms,
ac_vlc_desc8_syms, ac_vlc_desc9_syms, ac_vlc_descA_syms, ac_vlc_descB_syms,
ac_vlc_descC_syms,
};
static const uint16_t *tscc2_ac_vlc_codes[NUM_VLC_SETS] = {
static const uint16_t * const tscc2_ac_vlc_codes[NUM_VLC_SETS] = {
ac_vlc_desc0_codes, ac_vlc_desc1_codes, ac_vlc_desc2_codes,
ac_vlc_desc3_codes, ac_vlc_desc4_codes, ac_vlc_desc5_codes,
ac_vlc_desc6_codes, ac_vlc_desc7_codes, ac_vlc_desc8_codes,
@ -918,7 +918,7 @@ static const uint16_t *tscc2_ac_vlc_codes[NUM_VLC_SETS] = {
ac_vlc_descC_codes,
};
static const uint8_t *tscc2_ac_vlc_bits[NUM_VLC_SETS] = {
static const uint8_t * const tscc2_ac_vlc_bits[NUM_VLC_SETS] = {
ac_vlc_desc0_bits, ac_vlc_desc1_bits, ac_vlc_desc2_bits, ac_vlc_desc3_bits,
ac_vlc_desc4_bits, ac_vlc_desc5_bits, ac_vlc_desc6_bits, ac_vlc_desc7_bits,
ac_vlc_desc8_bits, ac_vlc_desc9_bits, ac_vlc_descA_bits, ac_vlc_descB_bits,

View File

@ -27,7 +27,7 @@
#include "vaapi_encode.h"
#include "avcodec.h"
static const char *picture_type_name[] = { "IDR", "I", "P", "B" };
static const char * const picture_type_name[] = { "IDR", "I", "P", "B" };
static int vaapi_encode_make_packed_header(AVCodecContext *avctx,
VAAPIEncodePicture *pic,

View File

@ -361,7 +361,7 @@ static av_cold int vaapi_encode_mjpeg_configure(AVCodecContext *avctx)
return 0;
}
static VAAPIEncodeType vaapi_encode_type_mjpeg = {
static const VAAPIEncodeType vaapi_encode_type_mjpeg = {
.priv_data_size = sizeof(VAAPIEncodeMJPEGContext),
.configure = &vaapi_encode_mjpeg_configure,

View File

@ -1171,10 +1171,10 @@ void decode_mb_mode(VP8Context *s, VP8mvbounds *mv_bounds,
uint8_t *segment, uint8_t *ref, int layout, int is_vp7)
{
VP56RangeCoder *c = &s->c;
static const char *vp7_feature_name[] = { "q-index",
"lf-delta",
"partial-golden-update",
"blit-pitch" };
static const char * const vp7_feature_name[] = { "q-index",
"lf-delta",
"partial-golden-update",
"blit-pitch" };
if (is_vp7) {
int i;
*segment = 0;

View File

@ -976,7 +976,7 @@ static av_always_inline int decode_coeffs(VP9TileData *td, int is8bitsperpixel)
int16_t (*qmul)[2] = s->s.h.segmentation.feat[b->seg_id].qmul;
int tx = 4 * s->s.h.lossless + b->tx;
const int16_t * const *yscans = ff_vp9_scans[tx];
const int16_t (* const *ynbs)[2] = ff_vp9_scans_nb[tx];
const int16_t (* const * ynbs)[2] = ff_vp9_scans_nb[tx];
const int16_t *uvscan = ff_vp9_scans[b->uvtx][DCT_DCT];
const int16_t (*uvnb)[2] = ff_vp9_scans_nb[b->uvtx][DCT_DCT];
uint8_t *a = &s->above_y_nnz_ctx[col * 2];

View File

@ -61,13 +61,13 @@ extern char ff_mlp_iirorder_1;
extern char ff_mlp_iirorder_0;
static const void * const firtable[9] = { &ff_mlp_firorder_0, &ff_mlp_firorder_1,
&ff_mlp_firorder_2, &ff_mlp_firorder_3,
&ff_mlp_firorder_4, &ff_mlp_firorder_5,
&ff_mlp_firorder_6, &ff_mlp_firorder_7,
&ff_mlp_firorder_8 };
&ff_mlp_firorder_2, &ff_mlp_firorder_3,
&ff_mlp_firorder_4, &ff_mlp_firorder_5,
&ff_mlp_firorder_6, &ff_mlp_firorder_7,
&ff_mlp_firorder_8 };
static const void * const iirtable[5] = { &ff_mlp_iirorder_0, &ff_mlp_iirorder_1,
&ff_mlp_iirorder_2, &ff_mlp_iirorder_3,
&ff_mlp_iirorder_4 };
&ff_mlp_iirorder_2, &ff_mlp_iirorder_3,
&ff_mlp_iirorder_4 };
#if ARCH_X86_64

View File

@ -1498,9 +1498,9 @@ static int select_cur_seq_no(HLSContext *c, struct playlist *pls)
static int save_avio_options(AVFormatContext *s)
{
HLSContext *c = s->priv_data;
static const char *opts[] = {
static const char * const opts[] = {
"headers", "http_proxy", "user_agent", "user-agent", "cookies", NULL };
const char **opt = opts;
const char * const * opt = opts;
uint8_t *buf;
int ret = 0;

View File

@ -102,7 +102,7 @@ const char ff_id3v2_3_tags[][4] = {
{ 0 },
};
const char *ff_id3v2_picture_types[21] = {
const char * const ff_id3v2_picture_types[21] = {
"Other",
"32x32 pixels 'file icon'",
"Other file icon",

View File

@ -180,6 +180,6 @@ extern const char ff_id3v2_3_tags[][4];
extern const CodecMime ff_id3v2_mime_tags[];
extern const char *ff_id3v2_picture_types[21];
extern const char * const ff_id3v2_picture_types[21];
#endif /* AVFORMAT_ID3V2_H */

View File

@ -1204,7 +1204,7 @@ static const MXFCodecUL mxf_data_essence_container_uls[] = {
{ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AV_CODEC_ID_NONE },
};
static const char* const mxf_data_essence_descriptor[] = {
static const char * const mxf_data_essence_descriptor[] = {
"vbi_vanc_smpte_436M",
};

View File

@ -28,7 +28,7 @@
#include "pixdesc.h"
#include "pixfmt.h"
static const HWContextType *const hw_table[] = {
static const HWContextType * const hw_table[] = {
#if CONFIG_CUDA
&ff_hwcontext_type_cuda,
#endif

View File

@ -93,7 +93,7 @@ typedef struct VAAPIMapping {
}
// The map fourcc <-> pix_fmt isn't bijective because of the annoying U/V
// plane swap cases. The frame handling below tries to hide these.
static struct {
static const struct {
unsigned int fourcc;
unsigned int rt_format;
enum AVPixelFormat pix_fmt;

View File

@ -2246,13 +2246,13 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
FF_ENABLE_DEPRECATION_WARNINGS
#endif
static const char *color_range_names[] = {
static const char * const color_range_names[] = {
[AVCOL_RANGE_UNSPECIFIED] = "unknown",
[AVCOL_RANGE_MPEG] = "tv",
[AVCOL_RANGE_JPEG] = "pc",
};
static const char *color_primaries_names[AVCOL_PRI_NB] = {
static const char * const color_primaries_names[AVCOL_PRI_NB] = {
[AVCOL_PRI_RESERVED0] = "reserved",
[AVCOL_PRI_BT709] = "bt709",
[AVCOL_PRI_UNSPECIFIED] = "unknown",
@ -2269,7 +2269,7 @@ static const char *color_primaries_names[AVCOL_PRI_NB] = {
[AVCOL_PRI_JEDEC_P22] = "jedec-p22",
};
static const char *color_transfer_names[] = {
static const char * const color_transfer_names[] = {
[AVCOL_TRC_RESERVED0] = "reserved",
[AVCOL_TRC_BT709] = "bt709",
[AVCOL_TRC_UNSPECIFIED] = "unknown",
@ -2291,7 +2291,7 @@ static const char *color_transfer_names[] = {
[AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67",
};
static const char *color_space_names[] = {
static const char * const color_space_names[] = {
[AVCOL_SPC_RGB] = "gbr",
[AVCOL_SPC_BT709] = "bt709",
[AVCOL_SPC_UNSPECIFIED] = "unknown",
@ -2309,7 +2309,7 @@ static const char *color_space_names[] = {
[AVCOL_SPC_ICTCP] = "ictcp",
};
static const char *chroma_location_names[] = {
static const char * const chroma_location_names[] = {
[AVCHROMA_LOC_UNSPECIFIED] = "unspecified",
[AVCHROMA_LOC_LEFT] = "left",
[AVCHROMA_LOC_CENTER] = "center",

View File

@ -43,7 +43,7 @@ AVStereo3D *av_stereo3d_create_side_data(AVFrame *frame)
return (AVStereo3D *)side_data->data;
}
static const char *stereo3d_type_names[] = {
static const char * const stereo3d_type_names[] = {
[AV_STEREO3D_2D] = "2D",
[AV_STEREO3D_SIDEBYSIDE] = "side by side",
[AV_STEREO3D_TOPBOTTOM] = "top and bottom",