[FFmpeg-cvslog] Merge commit 'fd9212f2edfe9b107c3c08ba2df5fd2cba5ab9e3'

James Almer git at videolan.org
Tue Sep 26 22:23:49 EEST 2017


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Sep 26 15:58:40 2017 -0300| [318778de9ebec276cb9dfc65509231ca56590d13] | committer: James Almer

Merge commit 'fd9212f2edfe9b107c3c08ba2df5fd2cba5ab9e3'

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

Merged-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=318778de9ebec276cb9dfc65509231ca56590d13
---

 configure                       |  2 +-
 libavcodec/aaccoder.c           |  2 +-
 libavcodec/aacenc.h             |  4 ++--
 libavcodec/amrwbdata.h          |  2 +-
 libavcodec/atrac3plus.c         |  4 ++--
 libavcodec/dfa.c                |  2 +-
 libavcodec/g722dec.c            |  4 ++--
 libavcodec/on2avcdata.c         | 16 ++++++++--------
 libavcodec/on2avcdata.h         | 20 ++++++++++----------
 libavcodec/opus_silk.c          |  6 +++---
 libavcodec/qsvdec_h2645.c       |  4 ++--
 libavcodec/qsvenc_hevc.c        |  4 ++--
 libavcodec/tscc2data.h          |  6 +++---
 libavcodec/vaapi_encode.c       |  2 +-
 libavcodec/vaapi_encode_mjpeg.c |  2 +-
 libavcodec/vp8.c                |  8 ++++----
 libavcodec/vp9block.c           |  2 +-
 libavcodec/x86/mlpdsp_init.c    | 12 ++++++------
 libavformat/hls.c               |  4 ++--
 libavformat/id3v2.c             |  2 +-
 libavformat/id3v2.h             |  2 +-
 libavformat/mxfdec.c            |  2 +-
 libavutil/hwcontext.c           |  2 +-
 libavutil/hwcontext_vaapi.c     |  2 +-
 libavutil/pixdesc.c             | 10 +++++-----
 libavutil/stereo3d.c            |  2 +-
 26 files changed, 64 insertions(+), 64 deletions(-)

diff --git a/configure b/configure
index f0c114e9e3..70b7677983 100755
--- a/configure
+++ b/configure
@@ -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
diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c
index abd0b9c636..baa82489b1 100644
--- a/libavcodec/aaccoder.c
+++ b/libavcodec/aaccoder.c
@@ -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,
diff --git a/libavcodec/aacenc.h b/libavcodec/aacenc.h
index 9d244fd1f5..ea2d3b9628 100644
--- a/libavcodec/aacenc.h
+++ b/libavcodec/aacenc.h
@@ -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;
diff --git a/libavcodec/amrwbdata.h b/libavcodec/amrwbdata.h
index e0152a651e..8a8cbfdddf 100644
--- a/libavcodec/amrwbdata.h
+++ b/libavcodec/amrwbdata.h
@@ -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,
diff --git a/libavcodec/atrac3plus.c b/libavcodec/atrac3plus.c
index 46e0beafc2..3e3bba801b 100644
--- a/libavcodec/atrac3plus.c
+++ b/libavcodec/atrac3plus.c
@@ -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,
diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c
index 8067ac94e5..43dba2c8e9 100644
--- a/libavcodec/dfa.c
+++ b/libavcodec/dfa.c
@@ -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"
 };
 
diff --git a/libavcodec/g722dec.c b/libavcodec/g722dec.c
index 0bfa82a394..000b591fe6 100644
--- a/libavcodec/g722dec.c
+++ b/libavcodec/g722dec.c
@@ -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)
diff --git a/libavcodec/on2avcdata.c b/libavcodec/on2avcdata.c
index abe598350b..ec983572e6 100644
--- a/libavcodec/on2avcdata.c
+++ b/libavcodec/on2avcdata.c
@@ -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],
diff --git a/libavcodec/on2avcdata.h b/libavcodec/on2avcdata.h
index 95d88e0252..dc7833feff 100644
--- a/libavcodec/on2avcdata.h
+++ b/libavcodec/on2avcdata.h
@@ -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];
diff --git a/libavcodec/opus_silk.c b/libavcodec/opus_silk.c
index dbf6756864..3c9c849c21 100644
--- a/libavcodec/opus_silk.c
+++ b/libavcodec/opus_silk.c
@@ -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]);
diff --git a/libavcodec/qsvdec_h2645.c b/libavcodec/qsvdec_h2645.c
index 276cdf884d..a6b53cce8d 100644
--- a/libavcodec/qsvdec_h2645.c
+++ b/libavcodec/qsvdec_h2645.c
@@ -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,
diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c
index 7d4d55bb61..b0e5ace7c7 100644
--- a/libavcodec/qsvenc_hevc.c
+++ b/libavcodec/qsvenc_hevc.c
@@ -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,
diff --git a/libavcodec/tscc2data.h b/libavcodec/tscc2data.h
index 7cd6f5216e..5e8d18b3f5 100644
--- a/libavcodec/tscc2data.h
+++ b/libavcodec/tscc2data.h
@@ -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,
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 4d7683f146..e13e99587d 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -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,
diff --git a/libavcodec/vaapi_encode_mjpeg.c b/libavcodec/vaapi_encode_mjpeg.c
index 3afce28a10..2cbf7925f2 100644
--- a/libavcodec/vaapi_encode_mjpeg.c
+++ b/libavcodec/vaapi_encode_mjpeg.c
@@ -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,
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 5bf601a8ef..7841a9d964 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -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;
diff --git a/libavcodec/vp9block.c b/libavcodec/vp9block.c
index d4ace149a5..1c3f7a7225 100644
--- a/libavcodec/vp9block.c
+++ b/libavcodec/vp9block.c
@@ -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];
diff --git a/libavcodec/x86/mlpdsp_init.c b/libavcodec/x86/mlpdsp_init.c
index 7f5e6b11d5..cb90ca24f0 100644
--- a/libavcodec/x86/mlpdsp_init.c
+++ b/libavcodec/x86/mlpdsp_init.c
@@ -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
 
diff --git a/libavformat/hls.c b/libavformat/hls.c
index 0995345bbf..786934af03 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -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;
 
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index 05346350ad..f15cefee47 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -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",
diff --git a/libavformat/id3v2.h b/libavformat/id3v2.h
index 9d7bf1c03c..6e7a8c9abf 100644
--- a/libavformat/id3v2.h
+++ b/libavformat/id3v2.h
@@ -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 */
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 476d284c96..1855f95d79 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -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",
 };
 
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index aa6b3ad176..2f4ee9661e 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -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
diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index c4473a229f..9214dc6e50 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -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;
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index b39afe3758..2cfab89c03 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -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",
diff --git a/libavutil/stereo3d.c b/libavutil/stereo3d.c
index a53836424d..6edcdb1796 100644
--- a/libavutil/stereo3d.c
+++ b/libavutil/stereo3d.c
@@ -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",


======================================================================

diff --cc libavcodec/aaccoder.c
index abd0b9c636,a654844cd0..baa82489b1
--- a/libavcodec/aaccoder.c
+++ b/libavcodec/aaccoder.c
@@@ -894,8 -1112,14 +894,8 @@@ static void search_for_ms(AACEncContex
      }
  }
  
- AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = {
 -const AACCoefficientsEncoder ff_aac_coders[] = {
 -    {
 -        search_for_quantizers_faac,
 -        encode_window_bands_info,
 -        quantize_and_encode_band,
 -        search_for_ms,
 -    },
 -    {
++const AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = {
 +    [AAC_CODER_ANMR] = {
          search_for_quantizers_anmr,
          encode_window_bands_info,
          quantize_and_encode_band,
diff --cc libavcodec/aacenc.h
index 9d244fd1f5,f77b2002e4..ea2d3b9628
--- a/libavcodec/aacenc.h
+++ b/libavcodec/aacenc.h
@@@ -57,38 -41,13 +57,38 @@@ typedef struct AACCoefficientsEncoder 
                                    SingleChannelElement *sce, const float lambda);
      void (*encode_window_bands_info)(struct AACEncContext *s, SingleChannelElement *sce,
                                       int win, int group_len, const float lambda);
 -    void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, int size,
 -                                     int scale_idx, int cb, const float lambda);
 -    void (*search_for_ms)(struct AACEncContext *s, ChannelElement *cpe, const float lambda);
 +    void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, float *out, int size,
 +                                     int scale_idx, int cb, const float lambda, int rtz);
 +    void (*encode_tns_info)(struct AACEncContext *s, SingleChannelElement *sce);
 +    void (*encode_ltp_info)(struct AACEncContext *s, SingleChannelElement *sce, int common_window);
 +    void (*encode_main_pred)(struct AACEncContext *s, SingleChannelElement *sce);
 +    void (*adjust_common_pred)(struct AACEncContext *s, ChannelElement *cpe);
 +    void (*adjust_common_ltp)(struct AACEncContext *s, ChannelElement *cpe);
 +    void (*apply_main_pred)(struct AACEncContext *s, SingleChannelElement *sce);
 +    void (*apply_tns_filt)(struct AACEncContext *s, SingleChannelElement *sce);
 +    void (*update_ltp)(struct AACEncContext *s, SingleChannelElement *sce);
 +    void (*ltp_insert_new_frame)(struct AACEncContext *s);
 +    void (*set_special_band_scalefactors)(struct AACEncContext *s, SingleChannelElement *sce);
 +    void (*search_for_pns)(struct AACEncContext *s, AVCodecContext *avctx, SingleChannelElement *sce);
 +    void (*mark_pns)(struct AACEncContext *s, AVCodecContext *avctx, SingleChannelElement *sce);
 +    void (*search_for_tns)(struct AACEncContext *s, SingleChannelElement *sce);
 +    void (*search_for_ltp)(struct AACEncContext *s, SingleChannelElement *sce, int common_window);
 +    void (*search_for_ms)(struct AACEncContext *s, ChannelElement *cpe);
 +    void (*search_for_is)(struct AACEncContext *s, AVCodecContext *avctx, ChannelElement *cpe);
 +    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;
 +    float energy;
 +    int bits;
 +    char cb;
 +    char rtz;
 +    uint16_t generation;
 +} AACQuantizeBandCostCacheEntry;
 +
  /**
   * AAC encoder context
   */
@@@ -110,15 -67,10 +110,15 @@@ typedef struct AACEncContext 
      ChannelElement *cpe;                         ///< channel elements
      FFPsyContext psy;
      struct FFPsyPreprocessContext* psypp;
-     AACCoefficientsEncoder *coder;
+     const AACCoefficientsEncoder *coder;
 -    int cur_channel;
 -    int last_frame;
 +    int cur_channel;                             ///< current channel for coder context
 +    int random_state;
      float lambda;
 +    int last_frame_pb_count;                     ///< number of bits for the previous frame
 +    float lambda_sum;                            ///< sum(lambda), for Qvg reporting
 +    int lambda_count;                            ///< count(lambda), for Qvg reporting
 +    enum RawDataBlockType cur_type;              ///< channel group type cur_channel belongs to
 +
      AudioFrameQueue afq;
      DECLARE_ALIGNED(16, int,   qcoefs)[96];      ///< quantized coefficients
      DECLARE_ALIGNED(32, float, scoefs)[1024];    ///< scaled coefficients
diff --cc libavcodec/opus_silk.c
index dbf6756864,e5d1a9923d..3c9c849c21
--- a/libavcodec/opus_silk.c
+++ b/libavcodec/opus_silk.c
@@@ -599,15 -1323,15 +599,15 @@@ static void silk_decode_frame(SilkConte
          if (lag_absolute) {
              /* primary lag is coded absolute */
              int highbits, lowbits;
-             static const uint16_t *model[] = {
+             static const uint16_t * const model[] = {
 -                silk_model_pitch_lowbits_nb, silk_model_pitch_lowbits_mb,
 -                silk_model_pitch_lowbits_wb
 +                ff_silk_model_pitch_lowbits_nb, ff_silk_model_pitch_lowbits_mb,
 +                ff_silk_model_pitch_lowbits_wb
              };
 -            highbits = opus_rc_getsymbol(rc, silk_model_pitch_highbits);
 -            lowbits  = opus_rc_getsymbol(rc, model[s->bandwidth]);
 +            highbits = ff_opus_rc_dec_cdf(rc, ff_silk_model_pitch_highbits);
 +            lowbits  = ff_opus_rc_dec_cdf(rc, model[s->bandwidth]);
  
 -            primarylag = silk_pitch_min_lag[s->bandwidth] +
 -                         highbits*silk_pitch_scale[s->bandwidth] + lowbits;
 +            primarylag = ff_silk_pitch_min_lag[s->bandwidth] +
 +                         highbits*ff_silk_pitch_scale[s->bandwidth] + lowbits;
          }
          frame->primarylag = primarylag;
  
@@@ -626,21 -1350,21 +626,21 @@@
  
          for (i = 0; i < s->subframes; i++)
              sf[i].pitchlag = av_clip(primarylag + offsets[i],
 -                                     silk_pitch_min_lag[s->bandwidth],
 -                                     silk_pitch_max_lag[s->bandwidth]);
 +                                     ff_silk_pitch_min_lag[s->bandwidth],
 +                                     ff_silk_pitch_max_lag[s->bandwidth]);
  
          /* obtain LTP filter coefficients */
 -        ltpfilter = opus_rc_getsymbol(rc, silk_model_ltp_filter);
 +        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[] = {
 -                silk_model_ltp_filter0_sel, silk_model_ltp_filter1_sel,
 -                silk_model_ltp_filter2_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] = {
 -                silk_ltp_filter0_taps, silk_ltp_filter1_taps, silk_ltp_filter2_taps
 +                ff_silk_ltp_filter0_taps, ff_silk_ltp_filter1_taps, ff_silk_ltp_filter2_taps
              };
 -            index = opus_rc_getsymbol(rc, filter_sel[ltpfilter]);
 +            index = ff_opus_rc_dec_cdf(rc, filter_sel[ltpfilter]);
              for (j = 0; j < 5; j++)
                  sf[i].ltptaps[j] = filter_taps[ltpfilter][index][j] / 128.0f;
          }
diff --cc libavcodec/vp9block.c
index d4ace149a5,35c9c27c53..1c3f7a7225
--- a/libavcodec/vp9block.c
+++ b/libavcodec/vp9block.c
@@@ -921,62 -827,23 +921,62 @@@ skip_eob
      return i;
  }
  
 -static int decode_coeffs(AVCodecContext *avctx)
 +static int decode_coeffs_b_8bpp(VP9TileData *td, int16_t *coef, int n_coeffs,
 +                                unsigned (*cnt)[6][3], unsigned (*eob)[6][2],
 +                                uint8_t (*p)[6][11], int nnz, const int16_t *scan,
 +                                const int16_t (*nb)[2], const int16_t *band_counts,
 +                                int16_t *qmul)
 +{
 +    return decode_coeffs_b_generic(td->c, coef, n_coeffs, 0, 1, 8, cnt, eob, p,
 +                                   nnz, scan, nb, band_counts, qmul);
 +}
 +
 +static int decode_coeffs_b32_8bpp(VP9TileData *td, int16_t *coef, int n_coeffs,
 +                                  unsigned (*cnt)[6][3], unsigned (*eob)[6][2],
 +                                  uint8_t (*p)[6][11], int nnz, const int16_t *scan,
 +                                  const int16_t (*nb)[2], const int16_t *band_counts,
 +                                  int16_t *qmul)
 +{
 +    return decode_coeffs_b_generic(td->c, coef, n_coeffs, 1, 1, 8, cnt, eob, p,
 +                                   nnz, scan, nb, band_counts, qmul);
 +}
 +
 +static int decode_coeffs_b_16bpp(VP9TileData *td, int16_t *coef, int n_coeffs,
 +                                 unsigned (*cnt)[6][3], unsigned (*eob)[6][2],
 +                                 uint8_t (*p)[6][11], int nnz, const int16_t *scan,
 +                                 const int16_t (*nb)[2], const int16_t *band_counts,
 +                                 int16_t *qmul)
 +{
 +    return decode_coeffs_b_generic(td->c, coef, n_coeffs, 0, 0, td->s->s.h.bpp, cnt, eob, p,
 +                                   nnz, scan, nb, band_counts, qmul);
 +}
 +
 +static int decode_coeffs_b32_16bpp(VP9TileData *td, int16_t *coef, int n_coeffs,
 +                                   unsigned (*cnt)[6][3], unsigned (*eob)[6][2],
 +                                   uint8_t (*p)[6][11], int nnz, const int16_t *scan,
 +                                   const int16_t (*nb)[2], const int16_t *band_counts,
 +                                   int16_t *qmul)
  {
 -    VP9Context *s = avctx->priv_data;
 -    VP9Block *b = s->b;
 -    int row = b->row, col = b->col;
 +    return decode_coeffs_b_generic(td->c, coef, n_coeffs, 1, 0, td->s->s.h.bpp, cnt, eob, p,
 +                                   nnz, scan, nb, band_counts, qmul);
 +}
 +
 +static av_always_inline int decode_coeffs(VP9TileData *td, int is8bitsperpixel)
 +{
 +    VP9Context *s = td->s;
 +    VP9Block *b = td->b;
 +    int row = td->row, col = td->col;
      uint8_t (*p)[6][11] = s->prob.coef[b->tx][0 /* y */][!b->intra];
 -    unsigned (*c)[6][3] = s->counts.coef[b->tx][0 /* y */][!b->intra];
 -    unsigned (*e)[6][2] = s->counts.eob[b->tx][0 /* y */][!b->intra];
 -    int w4 = bwh_tab[1][b->bs][0] << 1, h4 = bwh_tab[1][b->bs][1] << 1;
 +    unsigned (*c)[6][3] = td->counts.coef[b->tx][0 /* y */][!b->intra];
 +    unsigned (*e)[6][2] = td->counts.eob[b->tx][0 /* y */][!b->intra];
 +    int w4 = ff_vp9_bwh_tab[1][b->bs][0] << 1, h4 = ff_vp9_bwh_tab[1][b->bs][1] << 1;
      int end_x = FFMIN(2 * (s->cols - col), w4);
      int end_y = FFMIN(2 * (s->rows - row), h4);
 -    int n, pl, x, y, step1d = 1 << b->tx, step = 1 << (b->tx * 2);
 -    int uvstep1d = 1 << b->uvtx, uvstep = 1 << (b->uvtx * 2), ret;
 -    int16_t (*qmul)[2] = s->segmentation.feat[b->seg_id].qmul;
 -    int tx = 4 * s->lossless + b->tx;
 +    int n, pl, x, y, ret;
 +    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];
diff --cc libavcodec/x86/mlpdsp_init.c
index 7f5e6b11d5,0000000000..cb90ca24f0
mode 100644,000000..100644
--- a/libavcodec/x86/mlpdsp_init.c
+++ b/libavcodec/x86/mlpdsp_init.c
@@@ -1,204 -1,0 +1,204 @@@
 +/*
 + * MLP DSP functions x86-optimized
 + * Copyright (c) 2009 Ramiro Polla
 + *
 + * This file is part of FFmpeg.
 + *
 + * FFmpeg is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public
 + * License as published by the Free Software Foundation; either
 + * version 2.1 of the License, or (at your option) any later version.
 + *
 + * FFmpeg is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with FFmpeg; if not, write to the Free Software
 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 + */
 +
 +#include "libavutil/attributes.h"
 +#include "libavutil/cpu.h"
 +#include "libavutil/x86/asm.h"
 +#include "libavutil/x86/cpu.h"
 +#include "libavcodec/mlpdsp.h"
 +#include "libavcodec/mlp.h"
 +
 +#define REMATRIX_CHANNEL_FUNC(opt) \
 +void ff_mlp_rematrix_channel_##opt(int32_t *samples, \
 +                                   const int32_t *coeffs, \
 +                                   const uint8_t *bypassed_lsbs, \
 +                                   const int8_t *noise_buffer, \
 +                                   int index, \
 +                                   unsigned int dest_ch, \
 +                                   uint16_t blockpos, \
 +                                   unsigned int maxchan, \
 +                                   int matrix_noise_shift, \
 +                                   int access_unit_size_pow2, \
 +                                   int32_t mask);
 +
 +REMATRIX_CHANNEL_FUNC(sse4)
 +REMATRIX_CHANNEL_FUNC(avx2_bmi2)
 +
 +#if HAVE_7REGS && HAVE_INLINE_ASM && HAVE_INLINE_ASM_NONLOCAL_LABELS
 +
 +extern char ff_mlp_firorder_8;
 +extern char ff_mlp_firorder_7;
 +extern char ff_mlp_firorder_6;
 +extern char ff_mlp_firorder_5;
 +extern char ff_mlp_firorder_4;
 +extern char ff_mlp_firorder_3;
 +extern char ff_mlp_firorder_2;
 +extern char ff_mlp_firorder_1;
 +extern char ff_mlp_firorder_0;
 +
 +extern char ff_mlp_iirorder_4;
 +extern char ff_mlp_iirorder_3;
 +extern char ff_mlp_iirorder_2;
 +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
 +
 +#define MLPMUL(label, offset, offs, offc)   \
 +    LABEL_MANGLE(label)":             \n\t" \
 +    "movslq "offset"+"offs"(%0), %%rax\n\t" \
 +    "movslq "offset"+"offc"(%1), %%rdx\n\t" \
 +    "imul                 %%rdx, %%rax\n\t" \
 +    "add                  %%rax, %%rsi\n\t"
 +
 +#define FIRMULREG(label, offset, firc)\
 +    LABEL_MANGLE(label)":       \n\t" \
 +    "movslq "#offset"(%0), %%rax\n\t" \
 +    "imul        %"#firc", %%rax\n\t" \
 +    "add            %%rax, %%rsi\n\t"
 +
 +#define CLEAR_ACCUM                   \
 +    "xor            %%rsi, %%rsi\n\t"
 +
 +#define SHIFT_ACCUM                   \
 +    "shr     %%cl,         %%rsi\n\t"
 +
 +#define ACCUM    "%%rdx"
 +#define RESULT   "%%rsi"
 +#define RESULT32 "%%esi"
 +
 +#else /* if ARCH_X86_32 */
 +
 +#define MLPMUL(label, offset, offs, offc)  \
 +    LABEL_MANGLE(label)":            \n\t" \
 +    "mov   "offset"+"offs"(%0), %%eax\n\t" \
 +    "imull "offset"+"offc"(%1)       \n\t" \
 +    "add                %%eax , %%esi\n\t" \
 +    "adc                %%edx , %%ecx\n\t"
 +
 +#define FIRMULREG(label, offset, firc)  \
 +    MLPMUL(label, #offset, "0", "0")
 +
 +#define CLEAR_ACCUM                  \
 +    "xor           %%esi, %%esi\n\t" \
 +    "xor           %%ecx, %%ecx\n\t"
 +
 +#define SHIFT_ACCUM                  \
 +    "mov           %%ecx, %%edx\n\t" \
 +    "mov           %%esi, %%eax\n\t" \
 +    "movzbl        %7   , %%ecx\n\t" \
 +    "shrd    %%cl, %%edx, %%eax\n\t" \
 +
 +#define ACCUM    "%%edx"
 +#define RESULT   "%%eax"
 +#define RESULT32 "%%eax"
 +
 +#endif /* !ARCH_X86_64 */
 +
 +#define BINC  AV_STRINGIFY(4* MAX_CHANNELS)
 +#define IOFFS AV_STRINGIFY(4*(MAX_FIR_ORDER + MAX_BLOCKSIZE))
 +#define IOFFC AV_STRINGIFY(4* MAX_FIR_ORDER)
 +
 +#define FIRMUL(label, offset) MLPMUL(label, #offset,   "0",   "0")
 +#define IIRMUL(label, offset) MLPMUL(label, #offset, IOFFS, IOFFC)
 +
 +static void mlp_filter_channel_x86(int32_t *state, const int32_t *coeff,
 +                                   int firorder, int iirorder,
 +                                   unsigned int filter_shift, int32_t mask,
 +                                   int blocksize, int32_t *sample_buffer)
 +{
 +    const void *firjump = firtable[firorder];
 +    const void *iirjump = iirtable[iirorder];
 +
 +    blocksize = -blocksize;
 +
 +    __asm__ volatile(
 +        "1:                           \n\t"
 +        CLEAR_ACCUM
 +        "jmp  *%5                     \n\t"
 +        FIRMUL   (ff_mlp_firorder_8, 0x1c   )
 +        FIRMUL   (ff_mlp_firorder_7, 0x18   )
 +        FIRMUL   (ff_mlp_firorder_6, 0x14   )
 +        FIRMUL   (ff_mlp_firorder_5, 0x10   )
 +        FIRMUL   (ff_mlp_firorder_4, 0x0c   )
 +        FIRMUL   (ff_mlp_firorder_3, 0x08   )
 +        FIRMUL   (ff_mlp_firorder_2, 0x04   )
 +        FIRMULREG(ff_mlp_firorder_1, 0x00, 8)
 +        LABEL_MANGLE(ff_mlp_firorder_0)":\n\t"
 +        "jmp  *%6                     \n\t"
 +        IIRMUL   (ff_mlp_iirorder_4, 0x0c   )
 +        IIRMUL   (ff_mlp_iirorder_3, 0x08   )
 +        IIRMUL   (ff_mlp_iirorder_2, 0x04   )
 +        IIRMUL   (ff_mlp_iirorder_1, 0x00   )
 +        LABEL_MANGLE(ff_mlp_iirorder_0)":\n\t"
 +        SHIFT_ACCUM
 +        "mov  "RESULT"  ,"ACCUM"      \n\t"
 +        "add  (%2)      ,"RESULT"     \n\t"
 +        "and   %4       ,"RESULT"     \n\t"
 +        "sub   $4       ,  %0         \n\t"
 +        "mov  "RESULT32", (%0)        \n\t"
 +        "mov  "RESULT32", (%2)        \n\t"
 +        "add $"BINC"    ,  %2         \n\t"
 +        "sub  "ACCUM"   ,"RESULT"     \n\t"
 +        "mov  "RESULT32","IOFFS"(%0)  \n\t"
 +        "incl              %3         \n\t"
 +        "js 1b                        \n\t"
 +        : /* 0*/"+r"(state),
 +          /* 1*/"+r"(coeff),
 +          /* 2*/"+r"(sample_buffer),
 +#if ARCH_X86_64
 +          /* 3*/"+r"(blocksize)
 +        : /* 4*/"r"((x86_reg)mask), /* 5*/"r"(firjump),
 +          /* 6*/"r"(iirjump)      , /* 7*/"c"(filter_shift)
 +        , /* 8*/"r"((int64_t)coeff[0])
 +        : "rax", "rdx", "rsi"
 +#else /* ARCH_X86_32 */
 +          /* 3*/"+m"(blocksize)
 +        : /* 4*/"m"(         mask), /* 5*/"m"(firjump),
 +          /* 6*/"m"(iirjump)      , /* 7*/"m"(filter_shift)
 +        : "eax", "edx", "esi", "ecx"
 +#endif /* !ARCH_X86_64 */
 +    );
 +}
 +
 +#endif /* HAVE_7REGS && HAVE_INLINE_ASM */
 +
 +av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
 +{
 +    int cpu_flags = av_get_cpu_flags();
 +#if HAVE_7REGS && HAVE_INLINE_ASM && HAVE_INLINE_ASM_NONLOCAL_LABELS
 +    if (INLINE_MMX(cpu_flags))
 +        c->mlp_filter_channel = mlp_filter_channel_x86;
 +#endif
 +    if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags))
 +        c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4;
 +    if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
 +        c->mlp_rematrix_channel = ff_mlp_rematrix_channel_avx2_bmi2;
 +}
diff --cc libavformat/hls.c
index 0995345bbf,c9da4e30ec..786934af03
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@@ -1498,9 -477,8 +1498,9 @@@ static int select_cur_seq_no(HLSContex
  static int save_avio_options(AVFormatContext *s)
  {
      HLSContext *c = s->priv_data;
-     static const char *opts[] = {
 -    static const char * const opts[] = { "headers", "user_agent", NULL };
 -    const char * const *opt = 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;
  
diff --cc libavformat/mxfdec.c
index 476d284c96,cf4931e731..1855f95d79
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@@ -1201,10 -978,10 +1201,10 @@@ static const MXFCodecUL mxf_sound_essen
  
  static const MXFCodecUL mxf_data_essence_container_uls[] = {
      { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 }, 16, 0 },
 -    { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 }, 16, AV_CODEC_ID_NONE },
 +    { { 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",
  };
  
diff --cc libavutil/pixdesc.c
index b39afe3758,d69eeea9de..2cfab89c03
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@@ -2252,7 -1770,7 +2252,7 @@@ static const char * const color_range_n
      [AVCOL_RANGE_JPEG] = "pc",
  };
  
- static const char *color_primaries_names[AVCOL_PRI_NB] = {
 -static const char * const color_primaries_names[] = {
++static const char * const color_primaries_names[AVCOL_PRI_NB] = {
      [AVCOL_PRI_RESERVED0] = "reserved",
      [AVCOL_PRI_BT709] = "bt709",
      [AVCOL_PRI_UNSPECIFIED] = "unknown",
@@@ -2304,12 -1822,9 +2304,12 @@@ static const char * const color_space_n
      [AVCOL_SPC_BT2020_NCL] = "bt2020nc",
      [AVCOL_SPC_BT2020_CL] = "bt2020c",
      [AVCOL_SPC_SMPTE2085] = "smpte2085",
 +    [AVCOL_SPC_CHROMA_DERIVED_NCL] = "chroma-derived-nc",
 +    [AVCOL_SPC_CHROMA_DERIVED_CL] = "chroma-derived-c",
 +    [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",




More information about the ffmpeg-cvslog mailing list