00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #define CONFIG_FLOAT 1
00023 #include "mpegaudiodec.c"
00024
00025 void ff_mpa_synth_filter_float(MPADecodeContext *s, float *synth_buf_ptr,
00026 int *synth_buf_offset,
00027 float *window, int *dither_state,
00028 float *samples, int incr,
00029 float sb_samples[SBLIMIT])
00030 {
00031 float *synth_buf;
00032 int offset;
00033
00034 offset = *synth_buf_offset;
00035 synth_buf = synth_buf_ptr + offset;
00036
00037 s->dct.dct32(synth_buf, sb_samples);
00038 s->apply_window_mp3(synth_buf, window, dither_state, samples, incr);
00039
00040 offset = (offset - 32) & 511;
00041 *synth_buf_offset = offset;
00042 }
00043
00044 static void compute_antialias_float(MPADecodeContext *s,
00045 GranuleDef *g)
00046 {
00047 float *ptr;
00048 int n, i;
00049
00050
00051 if (g->block_type == 2) {
00052 if (!g->switch_point)
00053 return;
00054
00055 n = 1;
00056 } else {
00057 n = SBLIMIT - 1;
00058 }
00059
00060 ptr = g->sb_hybrid + 18;
00061 for(i = n;i > 0;i--) {
00062 float tmp0, tmp1;
00063 float *csa = &csa_table_float[0][0];
00064 #define FLOAT_AA(j)\
00065 tmp0= ptr[-1-j];\
00066 tmp1= ptr[ j];\
00067 ptr[-1-j] = tmp0 * csa[0+4*j] - tmp1 * csa[1+4*j];\
00068 ptr[ j] = tmp0 * csa[1+4*j] + tmp1 * csa[0+4*j];
00069
00070 FLOAT_AA(0)
00071 FLOAT_AA(1)
00072 FLOAT_AA(2)
00073 FLOAT_AA(3)
00074 FLOAT_AA(4)
00075 FLOAT_AA(5)
00076 FLOAT_AA(6)
00077 FLOAT_AA(7)
00078
00079 ptr += 18;
00080 }
00081 }
00082
00083 static av_cold int decode_end(AVCodecContext * avctx)
00084 {
00085 MPADecodeContext *s = avctx->priv_data;
00086 ff_dct_end(&s->dct);
00087 return 0;
00088 }
00089
00090 #if CONFIG_MP1FLOAT_DECODER
00091 AVCodec ff_mp1float_decoder =
00092 {
00093 "mp1float",
00094 AVMEDIA_TYPE_AUDIO,
00095 CODEC_ID_MP1,
00096 sizeof(MPADecodeContext),
00097 decode_init,
00098 NULL,
00099 decode_end,
00100 decode_frame,
00101 CODEC_CAP_PARSE_ONLY,
00102 .flush= flush,
00103 .long_name= NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"),
00104 };
00105 #endif
00106 #if CONFIG_MP2FLOAT_DECODER
00107 AVCodec ff_mp2float_decoder =
00108 {
00109 "mp2float",
00110 AVMEDIA_TYPE_AUDIO,
00111 CODEC_ID_MP2,
00112 sizeof(MPADecodeContext),
00113 decode_init,
00114 NULL,
00115 decode_end,
00116 decode_frame,
00117 CODEC_CAP_PARSE_ONLY,
00118 .flush= flush,
00119 .long_name= NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
00120 };
00121 #endif
00122 #if CONFIG_MP3FLOAT_DECODER
00123 AVCodec ff_mp3float_decoder =
00124 {
00125 "mp3float",
00126 AVMEDIA_TYPE_AUDIO,
00127 CODEC_ID_MP3,
00128 sizeof(MPADecodeContext),
00129 decode_init,
00130 NULL,
00131 decode_end,
00132 decode_frame,
00133 CODEC_CAP_PARSE_ONLY,
00134 .flush= flush,
00135 .long_name= NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
00136 };
00137 #endif
00138 #if CONFIG_MP3ADUFLOAT_DECODER
00139 AVCodec ff_mp3adufloat_decoder =
00140 {
00141 "mp3adufloat",
00142 AVMEDIA_TYPE_AUDIO,
00143 CODEC_ID_MP3ADU,
00144 sizeof(MPADecodeContext),
00145 decode_init,
00146 NULL,
00147 decode_end,
00148 decode_frame_adu,
00149 CODEC_CAP_PARSE_ONLY,
00150 .flush= flush,
00151 .long_name= NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"),
00152 };
00153 #endif
00154 #if CONFIG_MP3ON4FLOAT_DECODER
00155 AVCodec ff_mp3on4float_decoder =
00156 {
00157 "mp3on4float",
00158 AVMEDIA_TYPE_AUDIO,
00159 CODEC_ID_MP3ON4,
00160 sizeof(MP3On4DecodeContext),
00161 decode_init_mp3on4,
00162 NULL,
00163 decode_close_mp3on4,
00164 decode_frame_mp3on4,
00165 .flush= flush,
00166 .long_name= NULL_IF_CONFIG_SMALL("MP3onMP4"),
00167 };
00168 #endif