[FFmpeg-cvslog] mpegaudio: add _fixed suffix to some names

Mans Rullgard git at videolan.org
Wed May 18 05:59:19 CEST 2011


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Tue May 17 13:07:08 2011 +0100| [4bac1bbc3bc6e102cd1e8bfd0a36db07d769dfea] | committer: Mans Rullgard

mpegaudio: add _fixed suffix to some names

This adds a _fixed suffix to the fixed-point versions of things
with both float and fixed-point variants.  This makes it more
consistent with other dual-implementation things, e.g. fft.

Signed-off-by: Mans Rullgard <mans at mansr.com>

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

 libavcodec/mpc.c                |    6 +++---
 libavcodec/mpegaudio.h          |    6 +++---
 libavcodec/mpegaudio_tablegen.c |    4 ++--
 libavcodec/mpegaudio_tablegen.h |    8 ++++----
 libavcodec/mpegaudiodec.c       |    4 ++--
 libavcodec/qdm2.c               |    6 +++---
 6 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/libavcodec/mpc.c b/libavcodec/mpc.c
index 36e0f04..15febef 100644
--- a/libavcodec/mpc.c
+++ b/libavcodec/mpc.c
@@ -36,7 +36,7 @@
 
 void ff_mpc_init(void)
 {
-    ff_mpa_synth_init(ff_mpa_synth_window);
+    ff_mpa_synth_init_fixed(ff_mpa_synth_window_fixed);
 }
 
 /**
@@ -51,8 +51,8 @@ static void mpc_synth(MPCContext *c, int16_t *out, int channels)
     for(ch = 0;  ch < channels; ch++){
         samples_ptr = samples + ch;
         for(i = 0; i < SAMPLES_PER_BAND; i++) {
-            ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]),
-                                ff_mpa_synth_window, &dither_state,
+            ff_mpa_synth_filter_fixed(c->synth_buf[ch], &(c->synth_buf_offset[ch]),
+                                ff_mpa_synth_window_fixed, &dither_state,
                                 samples_ptr, channels,
                                 c->sb_samples[ch][i]);
             samples_ptr += 32 * channels;
diff --git a/libavcodec/mpegaudio.h b/libavcodec/mpegaudio.h
index 2c3f2ec..3422b6d 100644
--- a/libavcodec/mpegaudio.h
+++ b/libavcodec/mpegaudio.h
@@ -158,9 +158,9 @@ typedef struct HuffTable {
 
 int ff_mpa_l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
 int ff_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bitrate);
-extern MPA_INT ff_mpa_synth_window[];
-void ff_mpa_synth_init(MPA_INT *window);
-void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
+extern MPA_INT ff_mpa_synth_window_fixed[];
+void ff_mpa_synth_init_fixed(MPA_INT *window);
+void ff_mpa_synth_filter_fixed(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
                          MPA_INT *window, int *dither_state,
                          OUT_INT *samples, int incr,
                          INTFLOAT sb_samples[SBLIMIT]);
diff --git a/libavcodec/mpegaudio_tablegen.c b/libavcodec/mpegaudio_tablegen.c
index 27da219..b4c240b 100644
--- a/libavcodec/mpegaudio_tablegen.c
+++ b/libavcodec/mpegaudio_tablegen.c
@@ -33,9 +33,9 @@ int main(void)
 
     WRITE_ARRAY("static const", int8_t, table_4_3_exp);
     WRITE_ARRAY("static const", uint32_t, table_4_3_value);
-    WRITE_ARRAY("static const", uint32_t, exp_table);
+    WRITE_ARRAY("static const", uint32_t, exp_table_fixed);
     WRITE_ARRAY("static const", float, exp_table_float);
-    WRITE_2D_ARRAY("static const", uint32_t, expval_table);
+    WRITE_2D_ARRAY("static const", uint32_t, expval_table_fixed);
     WRITE_2D_ARRAY("static const", float, expval_table_float);
 
     return 0;
diff --git a/libavcodec/mpegaudio_tablegen.h b/libavcodec/mpegaudio_tablegen.h
index 6bde277..2264b73 100644
--- a/libavcodec/mpegaudio_tablegen.h
+++ b/libavcodec/mpegaudio_tablegen.h
@@ -33,8 +33,8 @@
 #else
 static int8_t   table_4_3_exp[TABLE_4_3_SIZE];
 static uint32_t table_4_3_value[TABLE_4_3_SIZE];
-static uint32_t exp_table[512];
-static uint32_t expval_table[512][16];
+static uint32_t exp_table_fixed[512];
+static uint32_t expval_table_fixed[512][16];
 static float exp_table_float[512];
 static float expval_table_float[512][16];
 
@@ -59,10 +59,10 @@ static void mpegaudio_tableinit(void)
     for (exponent = 0; exponent < 512; exponent++) {
         for (value = 0; value < 16; value++) {
             double f = (double)value * cbrtf(value) * pow(2, (exponent - 400) * 0.25 + FRAC_BITS + 5);
-            expval_table[exponent][value] = llrint(f);
+            expval_table_fixed[exponent][value] = llrint(f);
             expval_table_float[exponent][value] = f;
         }
-        exp_table[exponent] = expval_table[exponent][1];
+        exp_table_fixed[exponent] = expval_table_fixed[exponent][1];
         exp_table_float[exponent] = expval_table_float[exponent][1];
     }
 }
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index 35e217e..77ecb44 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -58,7 +58,7 @@
 #   define FIXHR(a)       ((int)((a) * (1LL<<32) + 0.5))
 #   define MULH3(x, y, s) MULH((s)*(x), y)
 #   define MULLx(x, y, s) MULL(x,y,s)
-#   define RENAME(a)      a
+#   define RENAME(a)      a ## _fixed
 #   define OUT_FMT AV_SAMPLE_FMT_S16
 #endif
 
@@ -621,7 +621,7 @@ static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window,
    32 samples. */
 /* XXX: optimize by avoiding ring buffer usage */
 #if !CONFIG_FLOAT
-void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
+void ff_mpa_synth_filter_fixed(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
                          MPA_INT *window, int *dither_state,
                          OUT_INT *samples, int incr,
                          INTFLOAT sb_samples[SBLIMIT])
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index 76ecb79..0f4dd18 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -1616,8 +1616,8 @@ static void qdm2_synthesis_filter (QDM2Context *q, int index)
         OUT_INT *samples_ptr = samples + ch;
 
         for (i = 0; i < 8; i++) {
-            ff_mpa_synth_filter(q->synth_buf[ch], &(q->synth_buf_offset[ch]),
-                ff_mpa_synth_window, &dither_state,
+            ff_mpa_synth_filter_fixed(q->synth_buf[ch], &(q->synth_buf_offset[ch]),
+                ff_mpa_synth_window_fixed, &dither_state,
                 samples_ptr, q->nb_channels,
                 q->sb_samples[ch][(8 * index) + i]);
             samples_ptr += 32 * q->nb_channels;
@@ -1646,7 +1646,7 @@ static av_cold void qdm2_init(QDM2Context *q) {
     initialized = 1;
 
     qdm2_init_vlc();
-    ff_mpa_synth_init(ff_mpa_synth_window);
+    ff_mpa_synth_init_fixed(ff_mpa_synth_window_fixed);
     softclip_table_init();
     rnd_table_init();
     init_noise_samples();



More information about the ffmpeg-cvslog mailing list