1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

libavcodec/mpegaudio: change CONFIG_FLOAT to USE_FLOAT

The CONFIG_ name-space is set by configure, so its better to use a
different prefix here.
This also unifies the encoder & decoder define that is used

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-12-03 19:55:12 +01:00
parent 04e06cdf7d
commit babb611d35
9 changed files with 20 additions and 20 deletions

View File

@ -26,8 +26,8 @@
#ifndef AVCODEC_MPEGAUDIO_H
#define AVCODEC_MPEGAUDIO_H
#ifndef CONFIG_FLOAT
# define CONFIG_FLOAT 0
#ifndef USE_FLOATS
# define USE_FLOATS 0
#endif
#include <stdint.h>
@ -58,7 +58,7 @@
#define FIX(a) ((int)((a) * FRAC_ONE))
#if CONFIG_FLOAT
#if USE_FLOATS
# define INTFLOAT float
typedef float MPA_INT;
typedef float OUT_INT;

View File

@ -21,7 +21,7 @@
#include "config.h"
#include "libavutil/samplefmt.h"
#define CONFIG_FLOAT 0
#define USE_FLOATS 0
#include "mpegaudio.h"

View File

@ -22,7 +22,7 @@
#include "config.h"
#include "libavutil/samplefmt.h"
#define CONFIG_FLOAT 1
#define USE_FLOATS 1
#include "mpegaudio.h"

View File

@ -392,7 +392,7 @@ static av_cold void decode_init_static(void)
ci = ci_table[i];
cs = 1.0 / sqrt(1.0 + ci * ci);
ca = cs * ci;
#if !CONFIG_FLOAT
#if !USE_FLOATS
csa_table[i][0] = FIXHR(cs/4);
csa_table[i][1] = FIXHR(ca/4);
csa_table[i][2] = FIXHR(ca/4) + FIXHR(cs/4);
@ -828,7 +828,7 @@ static void switch_buffer(MPADecodeContext *s, int *pos, int *end_pos,
v = -v;
*dst = v;
*/
#if CONFIG_FLOAT
#if USE_FLOATS
#define READ_FLIP_SIGN(dst,src) \
v = AV_RN32A(src) ^ (get_bits1(&s->gb) << 31); \
AV_WN32A(dst, v);
@ -1137,7 +1137,7 @@ found2:
/* ms stereo ONLY */
/* NOTE: the 1/sqrt(2) normalization factor is included in the
global gain */
#if CONFIG_FLOAT
#if USE_FLOATS
s->fdsp.butterflies_float(g0->sb_hybrid, g1->sb_hybrid, 576);
#else
tab0 = g0->sb_hybrid;
@ -1152,7 +1152,7 @@ found2:
}
}
#if CONFIG_FLOAT
#if USE_FLOATS
#if HAVE_MIPSFPU
# include "mips/compute_antialias_float.h"
#endif /* HAVE_MIPSFPU */
@ -1160,10 +1160,10 @@ found2:
#if HAVE_MIPSDSPR1
# include "mips/compute_antialias_fixed.h"
#endif /* HAVE_MIPSDSPR1 */
#endif /* CONFIG_FLOAT */
#endif /* USE_FLOATS */
#ifndef compute_antialias
#if CONFIG_FLOAT
#if USE_FLOATS
#define AA(j) do { \
float tmp0 = ptr[-1-j]; \
float tmp1 = ptr[ j]; \

View File

@ -16,5 +16,5 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define CONFIG_FLOAT 0
#define USE_FLOATS 0
#include "mpegaudiodsp_template.c"

View File

@ -16,5 +16,5 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define CONFIG_FLOAT 1
#define USE_FLOATS 1
#include "mpegaudiodsp_template.c"

View File

@ -27,7 +27,7 @@
#include "mpegaudiodsp.h"
#include "mpegaudio.h"
#if CONFIG_FLOAT
#if USE_FLOATS
#define RENAME(n) n##_float
static inline float round_sample(float *sum)
@ -125,7 +125,7 @@ void RENAME(ff_mpadsp_apply_window)(MPA_INT *synth_buf, MPA_INT *window,
register const MPA_INT *w, *w2, *p;
int j;
OUT_INT *samples2;
#if CONFIG_FLOAT
#if USE_FLOATS
float sum, sum2;
#else
int64_t sum, sum2;
@ -200,7 +200,7 @@ av_cold void RENAME(ff_mpa_synth_init)(MPA_INT *window)
for(i=0;i<257;i++) {
INTFLOAT v;
v = ff_mpa_enwindow[i];
#if CONFIG_FLOAT
#if USE_FLOATS
v *= 1.0 / (1LL<<(16 + FRAC_BITS));
#endif
window[i] = v;

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define USE_FLOATS
#define USE_FLOATS 1
#include "mpegaudioenc_template.c"
AVCodec ff_mp2_encoder = {

View File

@ -64,7 +64,7 @@ typedef struct MpegAudioContext {
int16_t filter_bank[512];
int scale_factor_table[64];
unsigned char scale_diff_table[128];
#ifdef USE_FLOATS
#if USE_FLOATS
float scale_factor_inv_table[64];
#else
int8_t scale_factor_shift[64];
@ -158,7 +158,7 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx)
if (v <= 0)
v = 1;
s->scale_factor_table[i] = v;
#ifdef USE_FLOATS
#if USE_FLOATS
s->scale_factor_inv_table[i] = exp2(-(3 - i) / 3.0) / (float)(1 << 20);
#else
#define P 15
@ -681,7 +681,7 @@ static void encode_frame(MpegAudioContext *s,
for(m=0;m<3;m++) {
sample = s->sb_samples[ch][k][l + m][i];
/* divide by scale factor */
#ifdef USE_FLOATS
#if USE_FLOATS
{
float a;
a = (float)sample * s->scale_factor_inv_table[s->scale_factors[ch][i][k]];