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
47
50 { NULL }
51 };
52
58 };
59
61 {
64
68 }
69
71
76
77 return 0;
78 }
79
82 {
84 int buf_size = avpkt->
size;
88
89 if (s->
decoder.no_of_bytes > buf_size) {
91 buf_size, s->
decoder.no_of_bytes);
93 }
94
98
99 WebRtcIlbcfix_DecodeImpl((WebRtc_Word16*) frame->
data[0],
100 (
const WebRtc_UWord16*) buf, &s->
decoder, 1);
101
102 *got_frame_ptr = 1;
103
105 }
106
116 .priv_class = &ilbc_dec_class,
117 };
118
124
127 { NULL }
128 };
129
135 };
136
138 {
141
145 }
146
150 }
151
154 else
157
160
161 return 0;
162 }
163
166 {
169
172
173 WebRtcIlbcfix_EncodeImpl((WebRtc_UWord16*) avpkt->
data, (
const WebRtc_Word16*) frame->
data[0], &s->
encoder);
174
176 *got_packet_ptr = 1;
177 return 0;
178 }
179
181 { "b", "0" },
182 { NULL }
183 };
184
197 };