The low quality mode is off by default and never tested. The high
quality mode is also plenty fast enough.
Signed-off-by: Mans Rullgard <mans@mansr.com>
| ... | ... |
@@ -94,7 +94,6 @@ Configuration options: |
| 94 | 94 |
--enable-w32threads use Win32 threads [no] |
| 95 | 95 |
--enable-x11grab enable X11 grabbing [no] |
| 96 | 96 |
--disable-network disable network support [no] |
| 97 |
- --disable-mpegaudio-hp faster (but less accurate) MPEG audio decoding [no] |
|
| 98 | 97 |
--enable-gray enable full grayscale support (slower color) |
| 99 | 98 |
--disable-swscale-alpha disable alpha channel support in swscale |
| 100 | 99 |
--disable-fastdiv disable table-based division |
| ... | ... |
@@ -953,7 +952,6 @@ CONFIG_LIST=" |
| 953 | 953 |
mdct |
| 954 | 954 |
memalign_hack |
| 955 | 955 |
mlib |
| 956 |
- mpegaudio_hp |
|
| 957 | 956 |
network |
| 958 | 957 |
nonfree |
| 959 | 958 |
pic |
| ... | ... |
@@ -1643,7 +1641,6 @@ enable ffmpeg |
| 1643 | 1643 |
enable ffplay |
| 1644 | 1644 |
enable ffprobe |
| 1645 | 1645 |
enable ffserver |
| 1646 |
-enable mpegaudio_hp |
|
| 1647 | 1646 |
enable network |
| 1648 | 1647 |
enable optimizations |
| 1649 | 1648 |
enable protocols |
| ... | ... |
@@ -682,14 +682,6 @@ $(SUBDIR)cos_fixed_tables.c: $(SUBDIR)costablegen$(HOSTEXESUF) |
| 682 | 682 |
$(SUBDIR)sin_tables.c: $(SUBDIR)costablegen$(HOSTEXESUF) |
| 683 | 683 |
$(M)./$< sin > $@ |
| 684 | 684 |
|
| 685 |
-ifdef CONFIG_MPEGAUDIO_HP |
|
| 686 |
-$(SUBDIR)mpegaudio_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DFRAC_BITS=23 |
|
| 687 |
-$(SUBDIR)mpegaudio_tablegen.ho: CPPFLAGS += -DFRAC_BITS=23 |
|
| 688 |
-else |
|
| 689 |
-$(SUBDIR)mpegaudio_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DFRAC_BITS=15 |
|
| 690 |
-$(SUBDIR)mpegaudio_tablegen.ho: CPPFLAGS += -DFRAC_BITS=15 |
|
| 691 |
-endif |
|
| 692 |
- |
|
| 693 | 685 |
ifdef CONFIG_SMALL |
| 694 | 686 |
$(SUBDIR)%_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DCONFIG_SMALL=1 |
| 695 | 687 |
else |
| ... | ... |
@@ -24,7 +24,6 @@ |
| 24 | 24 |
|
| 25 | 25 |
#include "config.h" |
| 26 | 26 |
|
| 27 |
-#if CONFIG_MPEGAUDIO_HP |
|
| 28 | 27 |
#define MULH(X,Y) ({ int xxo; \
|
| 29 | 28 |
__asm__ ( \ |
| 30 | 29 |
"a1 = %2.L * %1.L (FU);\n\t" \ |
| ... | ... |
@@ -34,15 +33,6 @@ |
| 34 | 34 |
"a1 = a1 >>> 16;\n\t" \ |
| 35 | 35 |
"%0 = (a0 += a1);\n\t" \ |
| 36 | 36 |
: "=d" (xxo) : "d" (X), "d" (Y) : "A0","A1"); xxo; }) |
| 37 |
-#else |
|
| 38 |
-#define MULH(X,Y) ({ int xxo; \
|
|
| 39 |
- __asm__ ( \ |
|
| 40 |
- "a1 = %2.H * %1.L (IS,M);\n\t" \ |
|
| 41 |
- "a0 = %1.H * %2.H, a1+= %1.H * %2.L (IS,M);\n\t"\ |
|
| 42 |
- "a1 = a1 >>> 16;\n\t" \ |
|
| 43 |
- "%0 = (a0 += a1);\n\t" \ |
|
| 44 |
- : "=d" (xxo) : "d" (X), "d" (Y) : "A0","A1"); xxo; }) |
|
| 45 |
-#endif |
|
| 46 | 37 |
|
| 47 | 38 |
/* signed 16x16 -> 32 multiply */ |
| 48 | 39 |
#define MUL16(a, b) ({ int xxo; \
|
| ... | ... |
@@ -56,12 +56,9 @@ |
| 56 | 56 |
|
| 57 | 57 |
#define MP3_MASK 0xFFFE0CCF |
| 58 | 58 |
|
| 59 |
-#if CONFIG_MPEGAUDIO_HP |
|
| 59 |
+#ifndef FRAC_BITS |
|
| 60 | 60 |
#define FRAC_BITS 23 /* fractional bits for sb_samples and dct */ |
| 61 | 61 |
#define WFRAC_BITS 16 /* fractional bits for window */ |
| 62 |
-#else |
|
| 63 |
-#define FRAC_BITS 15 /* fractional bits for sb_samples and dct */ |
|
| 64 |
-#define WFRAC_BITS 14 /* fractional bits for window */ |
|
| 65 | 62 |
#endif |
| 66 | 63 |
|
| 67 | 64 |
#define FRAC_ONE (1 << FRAC_BITS) |
| ... | ... |
@@ -31,7 +31,6 @@ |
| 31 | 31 |
|
| 32 | 32 |
/* |
| 33 | 33 |
* TODO: |
| 34 |
- * - in low precision mode, use more 16 bit multiplies in synth filter |
|
| 35 | 34 |
* - test lsf / mpeg25 extensively. |
| 36 | 35 |
*/ |
| 37 | 36 |
|
| ... | ... |
@@ -540,24 +539,6 @@ static inline float round_sample(float *sum) |
| 540 | 540 |
|
| 541 | 541 |
#define MLSS(rt, ra, rb) rt-=(ra)*(rb) |
| 542 | 542 |
|
| 543 |
-#elif FRAC_BITS <= 15 |
|
| 544 |
- |
|
| 545 |
-static inline int round_sample(int *sum) |
|
| 546 |
-{
|
|
| 547 |
- int sum1; |
|
| 548 |
- sum1 = (*sum) >> OUT_SHIFT; |
|
| 549 |
- *sum &= (1<<OUT_SHIFT)-1; |
|
| 550 |
- return av_clip(sum1, OUT_MIN, OUT_MAX); |
|
| 551 |
-} |
|
| 552 |
- |
|
| 553 |
-/* signed 16x16 -> 32 multiply add accumulate */ |
|
| 554 |
-#define MACS(rt, ra, rb) MAC16(rt, ra, rb) |
|
| 555 |
- |
|
| 556 |
-/* signed 16x16 -> 32 multiply */ |
|
| 557 |
-#define MULS(ra, rb) MUL16(ra, rb) |
|
| 558 |
- |
|
| 559 |
-#define MLSS(rt, ra, rb) MLS16(rt, ra, rb) |
|
| 560 |
- |
|
| 561 | 543 |
#else |
| 562 | 544 |
|
| 563 | 545 |
static inline int round_sample(int64_t *sum) |
| ... | ... |
@@ -624,8 +605,6 @@ void av_cold RENAME(ff_mpa_synth_init)(MPA_INT *window) |
| 624 | 624 |
v = ff_mpa_enwindow[i]; |
| 625 | 625 |
#if CONFIG_FLOAT |
| 626 | 626 |
v *= 1.0 / (1LL<<(16 + FRAC_BITS)); |
| 627 |
-#elif WFRAC_BITS < 16 |
|
| 628 |
- v = (v + (1 << (16 - WFRAC_BITS - 1))) >> (16 - WFRAC_BITS); |
|
| 629 | 627 |
#endif |
| 630 | 628 |
window[i] = v; |
| 631 | 629 |
if ((i & 63) != 0) |
| ... | ... |
@@ -652,8 +631,6 @@ static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, |
| 652 | 652 |
OUT_INT *samples2; |
| 653 | 653 |
#if CONFIG_FLOAT |
| 654 | 654 |
float sum, sum2; |
| 655 |
-#elif FRAC_BITS <= 15 |
|
| 656 |
- int sum, sum2; |
|
| 657 | 655 |
#else |
| 658 | 656 |
int64_t sum, sum2; |
| 659 | 657 |
#endif |
| ... | ... |
@@ -710,25 +687,11 @@ void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, |
| 710 | 710 |
{
|
| 711 | 711 |
register MPA_INT *synth_buf; |
| 712 | 712 |
int offset; |
| 713 |
-#if FRAC_BITS <= 15 |
|
| 714 |
- int32_t tmp[32]; |
|
| 715 |
- int j; |
|
| 716 |
-#endif |
|
| 717 | 713 |
|
| 718 | 714 |
offset = *synth_buf_offset; |
| 719 | 715 |
synth_buf = synth_buf_ptr + offset; |
| 720 | 716 |
|
| 721 |
-#if FRAC_BITS <= 15 |
|
| 722 |
- dct32(tmp, sb_samples); |
|
| 723 |
- for(j=0;j<32;j++) {
|
|
| 724 |
- /* NOTE: can cause a loss in precision if very high amplitude |
|
| 725 |
- sound */ |
|
| 726 |
- synth_buf[j] = av_clip_int16(tmp[j]); |
|
| 727 |
- } |
|
| 728 |
-#else |
|
| 729 | 717 |
dct32(synth_buf, sb_samples); |
| 730 |
-#endif |
|
| 731 |
- |
|
| 732 | 718 |
apply_window_mp3_c(synth_buf, window, dither_state, samples, incr); |
| 733 | 719 |
|
| 734 | 720 |
offset = (offset - 32) & 511; |
| ... | ... |
@@ -27,8 +27,9 @@ |
| 27 | 27 |
#include "avcodec.h" |
| 28 | 28 |
#include "put_bits.h" |
| 29 | 29 |
|
| 30 |
-#undef CONFIG_MPEGAUDIO_HP |
|
| 31 |
-#define CONFIG_MPEGAUDIO_HP 0 |
|
| 30 |
+#define FRAC_BITS 15 /* fractional bits for sb_samples and dct */ |
|
| 31 |
+#define WFRAC_BITS 14 /* fractional bits for window */ |
|
| 32 |
+ |
|
| 32 | 33 |
#include "mpegaudio.h" |
| 33 | 34 |
|
| 34 | 35 |
/* currently, cannot change these constants (need to modify |