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:
commit
318778de9e
2
configure
vendored
2
configure
vendored
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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"
|
||||
};
|
||||
|
||||
|
@ -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]);
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -1171,7 +1171,7 @@ 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",
|
||||
static const char * const vp7_feature_name[] = { "q-index",
|
||||
"lf-delta",
|
||||
"partial-golden-update",
|
||||
"blit-pitch" };
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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",
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user