annotate mpegaudiodec_float.c @ 11974:356b20a6566d libavcodec

VP8 bilinear filter
author conrad
date Sun, 27 Jun 2010 01:46:29 +0000
parents 5e8770f9d8f1
children 3f3d08bb5cf8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11707
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
1 /*
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
2 * Float MPEG Audio decoder
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
3 * Copyright (c) 2010 Michael Niedermayer
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
4 *
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
5 * This file is part of FFmpeg.
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
6 *
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
11 *
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
15 * Lesser General Public License for more details.
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
16 *
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
20 */
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
21
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
22 #define CONFIG_FLOAT 1
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
23 #include "mpegaudiodec.c"
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
24
11935
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
25 void ff_mpa_synth_filter_float(MPADecodeContext *s, float *synth_buf_ptr,
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
26 int *synth_buf_offset,
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
27 float *window, int *dither_state,
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
28 float *samples, int incr,
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
29 float sb_samples[SBLIMIT])
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
30 {
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
31 float *synth_buf;
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
32 int offset;
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
33
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
34 offset = *synth_buf_offset;
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
35 synth_buf = synth_buf_ptr + offset;
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
36
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
37 dct32(synth_buf, sb_samples);
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
38 s->apply_window_mp3(synth_buf, window, dither_state, samples, incr);
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
39
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
40 offset = (offset - 32) & 511;
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
41 *synth_buf_offset = offset;
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
42 }
5e8770f9d8f1 Move float-specific function to mpegaudiodec_float.c
vitor
parents: 11707
diff changeset
43
11707
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
44 #if CONFIG_MP1FLOAT_DECODER
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
45 AVCodec mp1float_decoder =
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
46 {
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
47 "mp1float",
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
48 AVMEDIA_TYPE_AUDIO,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
49 CODEC_ID_MP1,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
50 sizeof(MPADecodeContext),
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
51 decode_init,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
52 NULL,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
53 NULL,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
54 decode_frame,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
55 CODEC_CAP_PARSE_ONLY,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
56 .flush= flush,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
57 .long_name= NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"),
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
58 };
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
59 #endif
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
60 #if CONFIG_MP2FLOAT_DECODER
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
61 AVCodec mp2float_decoder =
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
62 {
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
63 "mp2float",
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
64 AVMEDIA_TYPE_AUDIO,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
65 CODEC_ID_MP2,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
66 sizeof(MPADecodeContext),
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
67 decode_init,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
68 NULL,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
69 NULL,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
70 decode_frame,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
71 CODEC_CAP_PARSE_ONLY,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
72 .flush= flush,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
73 .long_name= NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
74 };
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
75 #endif
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
76 #if CONFIG_MP3FLOAT_DECODER
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
77 AVCodec mp3float_decoder =
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
78 {
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
79 "mp3float",
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
80 AVMEDIA_TYPE_AUDIO,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
81 CODEC_ID_MP3,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
82 sizeof(MPADecodeContext),
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
83 decode_init,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
84 NULL,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
85 NULL,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
86 decode_frame,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
87 CODEC_CAP_PARSE_ONLY,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
88 .flush= flush,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
89 .long_name= NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
90 };
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
91 #endif
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
92 #if CONFIG_MP3ADUFLOAT_DECODER
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
93 AVCodec mp3adufloat_decoder =
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
94 {
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
95 "mp3adufloat",
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
96 AVMEDIA_TYPE_AUDIO,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
97 CODEC_ID_MP3ADU,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
98 sizeof(MPADecodeContext),
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
99 decode_init,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
100 NULL,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
101 NULL,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
102 decode_frame_adu,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
103 CODEC_CAP_PARSE_ONLY,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
104 .flush= flush,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
105 .long_name= NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"),
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
106 };
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
107 #endif
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
108 #if CONFIG_MP3ON4FLOAT_DECODER
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
109 AVCodec mp3on4float_decoder =
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
110 {
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
111 "mp3on4float",
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
112 AVMEDIA_TYPE_AUDIO,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
113 CODEC_ID_MP3ON4,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
114 sizeof(MP3On4DecodeContext),
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
115 decode_init_mp3on4,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
116 NULL,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
117 decode_close_mp3on4,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
118 decode_frame_mp3on4,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
119 .flush= flush,
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
120 .long_name= NULL_IF_CONFIG_SMALL("MP3onMP4"),
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
121 };
eb9e142ea51f float based mp1/mp2/mp3 decoders.
michael
parents:
diff changeset
122 #endif