From 79f5e8bc644d77081c376d3aa862189c700c7986 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Thu, 10 Apr 2025 17:54:03 +0200 Subject: [PATCH 07/15] avcodec/opus/tab: Deduplicate arrays Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/opus/tab.c | 6 ------ libavcodec/opus/tab.h | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/libavcodec/opus/tab.c b/libavcodec/opus/tab.c index e7d20d1688..d1f2f8c8c2 100644 --- a/libavcodec/opus/tab.c +++ b/libavcodec/opus/tab.c @@ -110,12 +110,8 @@ const uint16_t ff_silk_model_pitch_highbits[] = { 216, 224, 231, 237, 241, 243, 245, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256 }; -const uint16_t ff_silk_model_pitch_lowbits_nb[] = { 256, 64, 128, 192, 256 }; - const uint16_t ff_silk_model_pitch_lowbits_mb[] = { 256, 43, 85, 128, 171, 213, 256 }; -const uint16_t ff_silk_model_pitch_lowbits_wb[] = { 256, 32, 64, 96, 128, 160, 192, 224, 256 }; - const uint16_t ff_silk_model_pitch_delta[] = { 256, 46, 48, 50, 53, 57, 63, 73, 88, 114, 152, 182, 204, 219, 229, 236, 242, 246, 250, 252, 254, 256 @@ -763,8 +759,6 @@ const uint16_t ff_celt_model_alloc_trim[] = { 128, 2, 4, 9, 19, 41, 87, 109, 119, 124, 126, 128 }; -const uint16_t ff_celt_model_energy_small[] = { 4, 2, 3, 4 }; - const uint8_t ff_celt_freq_bands[] = { /* in steps of 200Hz */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 34, 40, 48, 60, 78, 100 }; diff --git a/libavcodec/opus/tab.h b/libavcodec/opus/tab.h index 109a422b9f..ac140d5868 100644 --- a/libavcodec/opus/tab.h +++ b/libavcodec/opus/tab.h @@ -53,9 +53,9 @@ extern const uint16_t ff_silk_model_lsf_s2_ext[]; extern const uint16_t ff_silk_model_lsf_interpolation_offset[]; extern const uint16_t ff_silk_model_pitch_highbits[]; -extern const uint16_t ff_silk_model_pitch_lowbits_nb[]; +#define ff_silk_model_pitch_lowbits_nb ff_silk_model_lcg_seed extern const uint16_t ff_silk_model_pitch_lowbits_mb[]; -extern const uint16_t ff_silk_model_pitch_lowbits_wb[]; +#define ff_silk_model_pitch_lowbits_wb ff_silk_model_gain_lowbits extern const uint16_t ff_silk_model_pitch_delta[]; extern const uint16_t ff_silk_model_pitch_contour_nb10ms[]; extern const uint16_t ff_silk_model_pitch_contour_nb20ms[]; @@ -124,7 +124,7 @@ extern const int ff_silk_stereo_interp_len[3]; extern const uint16_t ff_celt_model_tapset[]; extern const uint16_t ff_celt_model_spread[]; extern const uint16_t ff_celt_model_alloc_trim[]; -extern const uint16_t ff_celt_model_energy_small[]; +#define ff_celt_model_energy_small ff_celt_model_tapset extern const uint8_t ff_celt_freq_bands[]; extern const uint8_t ff_celt_freq_range[]; -- 2.45.2