Commit 6bb6fb05 authored by Mans Rullgard's avatar Mans Rullgard

mpegaudio: remove CONFIG_MPEGAUDIO_HP option

The low quality mode is off by default and never tested.  The high
quality mode is also plenty fast enough.
Signed-off-by: 's avatarMans Rullgard <mans@mansr.com>
parent ed87375d
...@@ -94,7 +94,6 @@ Configuration options: ...@@ -94,7 +94,6 @@ Configuration options:
--enable-w32threads use Win32 threads [no] --enable-w32threads use Win32 threads [no]
--enable-x11grab enable X11 grabbing [no] --enable-x11grab enable X11 grabbing [no]
--disable-network disable network support [no] --disable-network disable network support [no]
--disable-mpegaudio-hp faster (but less accurate) MPEG audio decoding [no]
--enable-gray enable full grayscale support (slower color) --enable-gray enable full grayscale support (slower color)
--disable-swscale-alpha disable alpha channel support in swscale --disable-swscale-alpha disable alpha channel support in swscale
--disable-fastdiv disable table-based division --disable-fastdiv disable table-based division
...@@ -953,7 +952,6 @@ CONFIG_LIST=" ...@@ -953,7 +952,6 @@ CONFIG_LIST="
mdct mdct
memalign_hack memalign_hack
mlib mlib
mpegaudio_hp
network network
nonfree nonfree
pic pic
...@@ -1643,7 +1641,6 @@ enable ffmpeg ...@@ -1643,7 +1641,6 @@ enable ffmpeg
enable ffplay enable ffplay
enable ffprobe enable ffprobe
enable ffserver enable ffserver
enable mpegaudio_hp
enable network enable network
enable optimizations enable optimizations
enable protocols enable protocols
......
...@@ -682,14 +682,6 @@ $(SUBDIR)cos_fixed_tables.c: $(SUBDIR)costablegen$(HOSTEXESUF) ...@@ -682,14 +682,6 @@ $(SUBDIR)cos_fixed_tables.c: $(SUBDIR)costablegen$(HOSTEXESUF)
$(SUBDIR)sin_tables.c: $(SUBDIR)costablegen$(HOSTEXESUF) $(SUBDIR)sin_tables.c: $(SUBDIR)costablegen$(HOSTEXESUF)
$(M)./$< sin > $@ $(M)./$< sin > $@
ifdef CONFIG_MPEGAUDIO_HP
$(SUBDIR)mpegaudio_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DFRAC_BITS=23
$(SUBDIR)mpegaudio_tablegen.ho: CPPFLAGS += -DFRAC_BITS=23
else
$(SUBDIR)mpegaudio_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DFRAC_BITS=15
$(SUBDIR)mpegaudio_tablegen.ho: CPPFLAGS += -DFRAC_BITS=15
endif
ifdef CONFIG_SMALL ifdef CONFIG_SMALL
$(SUBDIR)%_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DCONFIG_SMALL=1 $(SUBDIR)%_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DCONFIG_SMALL=1
else else
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "config.h" #include "config.h"
#if CONFIG_MPEGAUDIO_HP
#define MULH(X,Y) ({ int xxo; \ #define MULH(X,Y) ({ int xxo; \
__asm__ ( \ __asm__ ( \
"a1 = %2.L * %1.L (FU);\n\t" \ "a1 = %2.L * %1.L (FU);\n\t" \
...@@ -34,15 +33,6 @@ ...@@ -34,15 +33,6 @@
"a1 = a1 >>> 16;\n\t" \ "a1 = a1 >>> 16;\n\t" \
"%0 = (a0 += a1);\n\t" \ "%0 = (a0 += a1);\n\t" \
: "=d" (xxo) : "d" (X), "d" (Y) : "A0","A1"); xxo; }) : "=d" (xxo) : "d" (X), "d" (Y) : "A0","A1"); xxo; })
#else
#define MULH(X,Y) ({ int xxo; \
__asm__ ( \
"a1 = %2.H * %1.L (IS,M);\n\t" \
"a0 = %1.H * %2.H, a1+= %1.H * %2.L (IS,M);\n\t"\
"a1 = a1 >>> 16;\n\t" \
"%0 = (a0 += a1);\n\t" \
: "=d" (xxo) : "d" (X), "d" (Y) : "A0","A1"); xxo; })
#endif
/* signed 16x16 -> 32 multiply */ /* signed 16x16 -> 32 multiply */
#define MUL16(a, b) ({ int xxo; \ #define MUL16(a, b) ({ int xxo; \
......
...@@ -56,12 +56,9 @@ ...@@ -56,12 +56,9 @@
#define MP3_MASK 0xFFFE0CCF #define MP3_MASK 0xFFFE0CCF
#if CONFIG_MPEGAUDIO_HP #ifndef FRAC_BITS
#define FRAC_BITS 23 /* fractional bits for sb_samples and dct */ #define FRAC_BITS 23 /* fractional bits for sb_samples and dct */
#define WFRAC_BITS 16 /* fractional bits for window */ #define WFRAC_BITS 16 /* fractional bits for window */
#else
#define FRAC_BITS 15 /* fractional bits for sb_samples and dct */
#define WFRAC_BITS 14 /* fractional bits for window */
#endif #endif
#define FRAC_ONE (1 << FRAC_BITS) #define FRAC_ONE (1 << FRAC_BITS)
......
...@@ -38,6 +38,8 @@ static uint32_t expval_table[512][16]; ...@@ -38,6 +38,8 @@ static uint32_t expval_table[512][16];
static float exp_table_float[512]; static float exp_table_float[512];
static float expval_table_float[512][16]; static float expval_table_float[512][16];
#define FRAC_BITS 23
static void mpegaudio_tableinit(void) static void mpegaudio_tableinit(void)
{ {
int i, value, exponent; int i, value, exponent;
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
/* /*
* TODO: * TODO:
* - in low precision mode, use more 16 bit multiplies in synth filter
* - test lsf / mpeg25 extensively. * - test lsf / mpeg25 extensively.
*/ */
...@@ -540,24 +539,6 @@ static inline float round_sample(float *sum) ...@@ -540,24 +539,6 @@ static inline float round_sample(float *sum)
#define MLSS(rt, ra, rb) rt-=(ra)*(rb) #define MLSS(rt, ra, rb) rt-=(ra)*(rb)
#elif FRAC_BITS <= 15
static inline int round_sample(int *sum)
{
int sum1;
sum1 = (*sum) >> OUT_SHIFT;
*sum &= (1<<OUT_SHIFT)-1;
return av_clip(sum1, OUT_MIN, OUT_MAX);
}
/* signed 16x16 -> 32 multiply add accumulate */
#define MACS(rt, ra, rb) MAC16(rt, ra, rb)
/* signed 16x16 -> 32 multiply */
#define MULS(ra, rb) MUL16(ra, rb)
#define MLSS(rt, ra, rb) MLS16(rt, ra, rb)
#else #else
static inline int round_sample(int64_t *sum) static inline int round_sample(int64_t *sum)
...@@ -624,8 +605,6 @@ void av_cold RENAME(ff_mpa_synth_init)(MPA_INT *window) ...@@ -624,8 +605,6 @@ void av_cold RENAME(ff_mpa_synth_init)(MPA_INT *window)
v = ff_mpa_enwindow[i]; v = ff_mpa_enwindow[i];
#if CONFIG_FLOAT #if CONFIG_FLOAT
v *= 1.0 / (1LL<<(16 + FRAC_BITS)); v *= 1.0 / (1LL<<(16 + FRAC_BITS));
#elif WFRAC_BITS < 16
v = (v + (1 << (16 - WFRAC_BITS - 1))) >> (16 - WFRAC_BITS);
#endif #endif
window[i] = v; window[i] = v;
if ((i & 63) != 0) if ((i & 63) != 0)
...@@ -652,8 +631,6 @@ static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, ...@@ -652,8 +631,6 @@ static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window,
OUT_INT *samples2; OUT_INT *samples2;
#if CONFIG_FLOAT #if CONFIG_FLOAT
float sum, sum2; float sum, sum2;
#elif FRAC_BITS <= 15
int sum, sum2;
#else #else
int64_t sum, sum2; int64_t sum, sum2;
#endif #endif
...@@ -710,25 +687,11 @@ void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, ...@@ -710,25 +687,11 @@ void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
{ {
register MPA_INT *synth_buf; register MPA_INT *synth_buf;
int offset; int offset;
#if FRAC_BITS <= 15
int32_t tmp[32];
int j;
#endif
offset = *synth_buf_offset; offset = *synth_buf_offset;
synth_buf = synth_buf_ptr + offset; synth_buf = synth_buf_ptr + offset;
#if FRAC_BITS <= 15
dct32(tmp, sb_samples);
for(j=0;j<32;j++) {
/* NOTE: can cause a loss in precision if very high amplitude
sound */
synth_buf[j] = av_clip_int16(tmp[j]);
}
#else
dct32(synth_buf, sb_samples); dct32(synth_buf, sb_samples);
#endif
apply_window_mp3_c(synth_buf, window, dither_state, samples, incr); apply_window_mp3_c(synth_buf, window, dither_state, samples, incr);
offset = (offset - 32) & 511; offset = (offset - 32) & 511;
......
...@@ -27,8 +27,9 @@ ...@@ -27,8 +27,9 @@
#include "avcodec.h" #include "avcodec.h"
#include "put_bits.h" #include "put_bits.h"
#undef CONFIG_MPEGAUDIO_HP #define FRAC_BITS 15 /* fractional bits for sb_samples and dct */
#define CONFIG_MPEGAUDIO_HP 0 #define WFRAC_BITS 14 /* fractional bits for window */
#include "mpegaudio.h" #include "mpegaudio.h"
/* currently, cannot change these constants (need to modify /* currently, cannot change these constants (need to modify
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment