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
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((int16_t *) frame->
data[0], (
const uint16_t *) buf, &s->
decoder, 1);
100
101 *got_frame_ptr = 1;
102
104 }
105
115 .priv_class = &ilbc_dec_class,
116 };
117
123
127 };
128
134 };
135
137 {
140
144 }
145
149 }
150
153 else
156
159
160 return 0;
161 }
162
165 {
168
171
172 WebRtcIlbcfix_EncodeImpl((uint16_t *) avpkt->
data, (
const int16_t *) frame->
data[0], &s->
encoder);
173
175 *got_packet_ptr = 1;
176 return 0;
177 }
178
180 { "b", "0" },
182 };
183
196 };