1 /*
2 * iLBC decoder/encoder stub
3 * Copyright (c) 2012 Martin Storsjo
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #include <ilbc.h>
23
29
31 {
33 return 20;
35 return 30;
37 return avctx->
bit_rate <= 14000 ? 30 : 20;
38 else
39 return -1;
40 }
41
48
52 };
53
59 };
60
62 {
65
69 }
70
74
79
80 return 0;
81 }
82
85 {
87 int buf_size = avpkt->
size;
89 int ret;
90
91 if (s->
decoder.no_of_bytes > buf_size) {
93 buf_size, s->
decoder.no_of_bytes);
95 }
96
100 return ret;
101 }
102
103 WebRtcIlbcfix_DecodeImpl((WebRtc_Word16*) s->
frame.
data[0],
104 (
const WebRtc_UWord16*) buf, &s->
decoder, 1);
105
106 *got_frame_ptr = 1;
108
110 }
111
122 };
123
129
133 };
134
140 };
141
143 {
146
150 }
151
155 }
156
159 else
162
165 #if FF_API_OLD_ENCODE_AUDIO
169 #endif
170
171 return 0;
172 }
173
175 {
176 #if FF_API_OLD_ENCODE_AUDIO
178 #endif
179 return 0;
180 }
181
184 {
186 int ret;
187
190 return ret;
191 }
192
193 WebRtcIlbcfix_EncodeImpl((WebRtc_UWord16*) avpkt->
data, (
const WebRtc_Word16*) frame->
data[0], &s->
encoder);
194
196 *got_packet_ptr = 1;
197 return 0;
198 }
199
201 { "b", "0" },
203 };
204
218 };