diff mbox series

[FFmpeg-devel,08/30] avcodec/truespeech: Avoid indirection for truespeech codebooks

Message ID 20201230233157.1055287-8-andreas.rheinhardt@gmail.com
State New
Headers show
Series [FFmpeg-devel,01/30] avcodec/opustab: Make array static
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Dec. 30, 2020, 11:31 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/truespeech.c      | 16 ++++++++--------
 libavcodec/truespeech_data.h |  4 ----
 2 files changed, 8 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c
index 3cdae8c556..d28779a610 100644
--- a/libavcodec/truespeech.c
+++ b/libavcodec/truespeech.c
@@ -82,14 +82,14 @@  static void truespeech_read_frame(TSContext *dec, const uint8_t *input)
     dec->bdsp.bswap_buf((uint32_t *) dec->buffer, (const uint32_t *) input, 8);
     init_get_bits(&gb, dec->buffer, 32 * 8);
 
-    dec->vector[7] = ts_codebook[7][get_bits(&gb, 3)];
-    dec->vector[6] = ts_codebook[6][get_bits(&gb, 3)];
-    dec->vector[5] = ts_codebook[5][get_bits(&gb, 3)];
-    dec->vector[4] = ts_codebook[4][get_bits(&gb, 4)];
-    dec->vector[3] = ts_codebook[3][get_bits(&gb, 4)];
-    dec->vector[2] = ts_codebook[2][get_bits(&gb, 4)];
-    dec->vector[1] = ts_codebook[1][get_bits(&gb, 5)];
-    dec->vector[0] = ts_codebook[0][get_bits(&gb, 5)];
+    dec->vector[7] = ts_cb_7[get_bits(&gb, 3)];
+    dec->vector[6] = ts_cb_6[get_bits(&gb, 3)];
+    dec->vector[5] = ts_cb_5[get_bits(&gb, 3)];
+    dec->vector[4] = ts_cb_4[get_bits(&gb, 4)];
+    dec->vector[3] = ts_cb_3[get_bits(&gb, 4)];
+    dec->vector[2] = ts_cb_2[get_bits(&gb, 4)];
+    dec->vector[1] = ts_cb_1[get_bits(&gb, 5)];
+    dec->vector[0] = ts_cb_0[get_bits(&gb, 5)];
     dec->flag      = get_bits1(&gb);
 
     dec->offset1[0] = get_bits(&gb, 4) << 4;
diff --git a/libavcodec/truespeech_data.h b/libavcodec/truespeech_data.h
index 73ebda5e85..85a9bafce3 100644
--- a/libavcodec/truespeech_data.h
+++ b/libavcodec/truespeech_data.h
@@ -66,10 +66,6 @@  static const int16_t ts_cb_7[8] = {
     0xCEF0, 0xE4F9, 0xF6BB, 0x0646, 0x14F5, 0x23FF, 0x356F, 0x4A8D,
 };
 
-static const int16_t * const ts_codebook[8] = {
-    ts_cb_0, ts_cb_1, ts_cb_2, ts_cb_3, ts_cb_4, ts_cb_5, ts_cb_6, ts_cb_7
-};
-
 /* table used for decoding pulse positions */
 static const int16_t ts_pulse_values[120] = {
     0x0E46, 0x0CCC, 0x0B6D, 0x0A28, 0x08FC, 0x07E8, 0x06EB, 0x0604,