FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
binkaudio.c
Go to the documentation of this file.
1 /*
2  * Bink Audio decoder
3  * Copyright (c) 2007-2011 Peter Ross (pross@xvid.org)
4  * Copyright (c) 2009 Daniel Verkamp (daniel@drv.nu)
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 /**
24  * @file
25  * Bink Audio decoder
26  *
27  * Technical details here:
28  * http://wiki.multimedia.cx/index.php?title=Bink_Audio
29  */
30 
32 #include "avcodec.h"
33 #define BITSTREAM_READER_LE
34 #include "get_bits.h"
35 #include "dct.h"
36 #include "rdft.h"
37 #include "internal.h"
38 #include "wma_freqs.h"
39 #include "libavutil/intfloat.h"
40 
41 static float quant_table[96];
42 
43 #define MAX_CHANNELS 2
44 #define BINK_BLOCK_MAX_SIZE (MAX_CHANNELS << 11)
45 
46 typedef struct BinkAudioContext {
48  int version_b; ///< Bink version 'b'
49  int first;
50  int channels;
51  int frame_len; ///< transform size (samples)
52  int overlap_len; ///< overlap size (samples)
54  int num_bands;
55  unsigned int *bands;
56  float root;
58  float previous[MAX_CHANNELS][BINK_BLOCK_MAX_SIZE / 16]; ///< coeffs from previous audio block
60  union {
63  } trans;
65 
66 
68 {
69  BinkAudioContext *s = avctx->priv_data;
70  int sample_rate = avctx->sample_rate;
71  int sample_rate_half;
72  int i;
73  int frame_len_bits;
74 
75  /* determine frame length */
76  if (avctx->sample_rate < 22050) {
77  frame_len_bits = 9;
78  } else if (avctx->sample_rate < 44100) {
79  frame_len_bits = 10;
80  } else {
81  frame_len_bits = 11;
82  }
83 
84  if (avctx->channels < 1 || avctx->channels > MAX_CHANNELS) {
85  av_log(avctx, AV_LOG_ERROR, "invalid number of channels: %d\n", avctx->channels);
86  return AVERROR_INVALIDDATA;
87  }
88  avctx->channel_layout = avctx->channels == 1 ? AV_CH_LAYOUT_MONO :
90 
91  s->version_b = avctx->extradata_size >= 4 && avctx->extradata[3] == 'b';
92 
93  if (avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT) {
94  // audio is already interleaved for the RDFT format variant
96  sample_rate *= avctx->channels;
97  s->channels = 1;
98  if (!s->version_b)
99  frame_len_bits += av_log2(avctx->channels);
100  } else {
101  s->channels = avctx->channels;
103  }
104 
105  s->frame_len = 1 << frame_len_bits;
106  s->overlap_len = s->frame_len / 16;
107  s->block_size = (s->frame_len - s->overlap_len) * s->channels;
108  sample_rate_half = (sample_rate + 1) / 2;
109  if (avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT)
110  s->root = 2.0 / (sqrt(s->frame_len) * 32768.0);
111  else
112  s->root = s->frame_len / (sqrt(s->frame_len) * 32768.0);
113  for (i = 0; i < 96; i++) {
114  /* constant is result of 0.066399999/log10(M_E) */
115  quant_table[i] = expf(i * 0.15289164787221953823f) * s->root;
116  }
117 
118  /* calculate number of bands */
119  for (s->num_bands = 1; s->num_bands < 25; s->num_bands++)
120  if (sample_rate_half <= ff_wma_critical_freqs[s->num_bands - 1])
121  break;
122 
123  s->bands = av_malloc((s->num_bands + 1) * sizeof(*s->bands));
124  if (!s->bands)
125  return AVERROR(ENOMEM);
126 
127  /* populate bands data */
128  s->bands[0] = 2;
129  for (i = 1; i < s->num_bands; i++)
130  s->bands[i] = (ff_wma_critical_freqs[i - 1] * s->frame_len / sample_rate_half) & ~1;
131  s->bands[s->num_bands] = s->frame_len;
132 
133  s->first = 1;
134 
135  if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT)
136  ff_rdft_init(&s->trans.rdft, frame_len_bits, DFT_C2R);
137  else if (CONFIG_BINKAUDIO_DCT_DECODER)
138  ff_dct_init(&s->trans.dct, frame_len_bits, DCT_III);
139  else
140  return -1;
141 
142  return 0;
143 }
144 
145 static float get_float(GetBitContext *gb)
146 {
147  int power = get_bits(gb, 5);
148  float f = ldexpf(get_bits_long(gb, 23), power - 23);
149  if (get_bits1(gb))
150  f = -f;
151  return f;
152 }
153 
154 static const uint8_t rle_length_tab[16] = {
155  2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 32, 64
156 };
157 
158 /**
159  * Decode Bink Audio block
160  * @param[out] out Output buffer (must contain s->block_size elements)
161  * @return 0 on success, negative error code on failure
162  */
163 static int decode_block(BinkAudioContext *s, float **out, int use_dct)
164 {
165  int ch, i, j, k;
166  float q, quant[25];
167  int width, coeff;
168  GetBitContext *gb = &s->gb;
169 
170  if (use_dct)
171  skip_bits(gb, 2);
172 
173  for (ch = 0; ch < s->channels; ch++) {
174  FFTSample *coeffs = out[ch];
175 
176  if (s->version_b) {
177  if (get_bits_left(gb) < 64)
178  return AVERROR_INVALIDDATA;
179  coeffs[0] = av_int2float(get_bits_long(gb, 32)) * s->root;
180  coeffs[1] = av_int2float(get_bits_long(gb, 32)) * s->root;
181  } else {
182  if (get_bits_left(gb) < 58)
183  return AVERROR_INVALIDDATA;
184  coeffs[0] = get_float(gb) * s->root;
185  coeffs[1] = get_float(gb) * s->root;
186  }
187 
188  if (get_bits_left(gb) < s->num_bands * 8)
189  return AVERROR_INVALIDDATA;
190  for (i = 0; i < s->num_bands; i++) {
191  int value = get_bits(gb, 8);
192  quant[i] = quant_table[FFMIN(value, 95)];
193  }
194 
195  k = 0;
196  q = quant[0];
197 
198  // parse coefficients
199  i = 2;
200  while (i < s->frame_len) {
201  if (s->version_b) {
202  j = i + 16;
203  } else {
204  int v = get_bits1(gb);
205  if (v) {
206  v = get_bits(gb, 4);
207  j = i + rle_length_tab[v] * 8;
208  } else {
209  j = i + 8;
210  }
211  }
212 
213  j = FFMIN(j, s->frame_len);
214 
215  width = get_bits(gb, 4);
216  if (width == 0) {
217  memset(coeffs + i, 0, (j - i) * sizeof(*coeffs));
218  i = j;
219  while (s->bands[k] < i)
220  q = quant[k++];
221  } else {
222  while (i < j) {
223  if (s->bands[k] == i)
224  q = quant[k++];
225  coeff = get_bits(gb, width);
226  if (coeff) {
227  int v;
228  v = get_bits1(gb);
229  if (v)
230  coeffs[i] = -q * coeff;
231  else
232  coeffs[i] = q * coeff;
233  } else {
234  coeffs[i] = 0.0f;
235  }
236  i++;
237  }
238  }
239  }
240 
241  if (CONFIG_BINKAUDIO_DCT_DECODER && use_dct) {
242  coeffs[0] /= 0.5;
243  s->trans.dct.dct_calc(&s->trans.dct, coeffs);
244  }
245  else if (CONFIG_BINKAUDIO_RDFT_DECODER)
246  s->trans.rdft.rdft_calc(&s->trans.rdft, coeffs);
247  }
248 
249  for (ch = 0; ch < s->channels; ch++) {
250  int j;
251  int count = s->overlap_len * s->channels;
252  if (!s->first) {
253  j = ch;
254  for (i = 0; i < s->overlap_len; i++, j += s->channels)
255  out[ch][i] = (s->previous[ch][i] * (count - j) +
256  out[ch][i] * j) / count;
257  }
258  memcpy(s->previous[ch], &out[ch][s->frame_len - s->overlap_len],
259  s->overlap_len * sizeof(*s->previous[ch]));
260  }
261 
262  s->first = 0;
263 
264  return 0;
265 }
266 
268 {
269  BinkAudioContext * s = avctx->priv_data;
270  av_freep(&s->bands);
271  av_freep(&s->packet_buffer);
272  if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT)
273  ff_rdft_end(&s->trans.rdft);
274  else if (CONFIG_BINKAUDIO_DCT_DECODER)
275  ff_dct_end(&s->trans.dct);
276 
277  return 0;
278 }
279 
281 {
282  int n = (-get_bits_count(s)) & 31;
283  if (n) skip_bits(s, n);
284 }
285 
286 static int decode_frame(AVCodecContext *avctx, void *data,
287  int *got_frame_ptr, AVPacket *avpkt)
288 {
289  BinkAudioContext *s = avctx->priv_data;
290  AVFrame *frame = data;
291  GetBitContext *gb = &s->gb;
292  int ret, consumed = 0;
293 
294  if (!get_bits_left(gb)) {
295  uint8_t *buf;
296  /* handle end-of-stream */
297  if (!avpkt->size) {
298  *got_frame_ptr = 0;
299  return 0;
300  }
301  if (avpkt->size < 4) {
302  av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
303  return AVERROR_INVALIDDATA;
304  }
306  if (!buf)
307  return AVERROR(ENOMEM);
308  memset(buf + avpkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
309  s->packet_buffer = buf;
310  memcpy(s->packet_buffer, avpkt->data, avpkt->size);
311  if ((ret = init_get_bits8(gb, s->packet_buffer, avpkt->size)) < 0)
312  return ret;
313  consumed = avpkt->size;
314 
315  /* skip reported size */
316  skip_bits_long(gb, 32);
317  }
318 
319  /* get output buffer */
320  frame->nb_samples = s->frame_len;
321  if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
322  return ret;
323 
324  if (decode_block(s, (float **)frame->extended_data,
325  avctx->codec->id == AV_CODEC_ID_BINKAUDIO_DCT)) {
326  av_log(avctx, AV_LOG_ERROR, "Incomplete packet\n");
327  return AVERROR_INVALIDDATA;
328  }
329  get_bits_align32(gb);
330 
331  frame->nb_samples = s->block_size / avctx->channels;
332  *got_frame_ptr = 1;
333 
334  return consumed;
335 }
336 
338  .name = "binkaudio_rdft",
339  .long_name = NULL_IF_CONFIG_SMALL("Bink Audio (RDFT)"),
340  .type = AVMEDIA_TYPE_AUDIO,
342  .priv_data_size = sizeof(BinkAudioContext),
343  .init = decode_init,
344  .close = decode_end,
345  .decode = decode_frame,
346  .capabilities = CODEC_CAP_DELAY | CODEC_CAP_DR1,
347 };
348 
350  .name = "binkaudio_dct",
351  .long_name = NULL_IF_CONFIG_SMALL("Bink Audio (DCT)"),
352  .type = AVMEDIA_TYPE_AUDIO,
354  .priv_data_size = sizeof(BinkAudioContext),
355  .init = decode_init,
356  .close = decode_end,
357  .decode = decode_frame,
358  .capabilities = CODEC_CAP_DELAY | CODEC_CAP_DR1,
359 };
union BinkAudioContext::@38 trans
av_cold void ff_rdft_end(RDFTContext *s)
Definition: rdft.c:132
float, planar
Definition: samplefmt.h:70
const struct AVCodec * codec
Definition: avcodec.h:1250
float v
static float get_float(GetBitContext *gb)
Definition: binkaudio.c:145
const char * s
Definition: avisynth_c.h:631
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
#define MAX_CHANNELS
Definition: binkaudio.c:43
This structure describes decoded (raw) audio or video data.
Definition: frame.h:171
Definition: avfft.h:75
void(* dct_calc)(struct DCTContext *s, FFTSample *data)
Definition: dct.h:37
ptrdiff_t const GLvoid * data
Definition: opengl_enc.c:101
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:260
static av_cold int decode_end(AVCodecContext *avctx)
Definition: binkaudio.c:267
Definition: avfft.h:95
static void skip_bits_long(GetBitContext *s, int n)
Definition: get_bits.h:217
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static av_always_inline float av_int2float(uint32_t i)
Reinterpret a 32-bit integer as a float.
Definition: intfloat.h:40
static const uint8_t rle_length_tab[16]
Definition: binkaudio.c:154
int size
Definition: avcodec.h:1163
#define DECLARE_ALIGNED(n, t, v)
Definition: mem.h:53
uint8_t * packet_buffer
Definition: binkaudio.c:59
const uint16_t ff_wma_critical_freqs[25]
Definition: wma_freqs.c:23
#define AV_CH_LAYOUT_STEREO
AVCodec.
Definition: avcodec.h:3181
enum AVSampleFormat sample_fmt
audio sample format
Definition: avcodec.h:1993
uint8_t
#define av_cold
Definition: attributes.h:74
#define av_malloc(s)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
Definition: avcodec.h:1355
unsigned int * bands
Definition: binkaudio.c:55
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:789
static AVFrame * frame
uint8_t * data
Definition: avcodec.h:1162
static int get_bits_count(const GetBitContext *s)
Definition: get_bits.h:212
bitstream reader API header.
float previous[MAX_CHANNELS][BINK_BLOCK_MAX_SIZE/16]
coeffs from previous audio block
Definition: binkaudio.c:58
#define av_log(a,...)
#define expf(x)
Definition: libm.h:72
static int get_bits_left(GetBitContext *gb)
Definition: get_bits.h:588
enum AVCodecID id
Definition: avcodec.h:3195
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
#define BINK_BLOCK_MAX_SIZE
Definition: binkaudio.c:44
#define CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: avcodec.h:824
#define AVERROR(e)
Definition: error.h:43
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:175
static void get_bits_align32(GetBitContext *s)
Definition: binkaudio.c:280
static int decode_block(BinkAudioContext *s, float **out, int use_dct)
Decode Bink Audio block.
Definition: binkaudio.c:163
const char * name
Name of the codec implementation.
Definition: avcodec.h:3188
GLsizei count
Definition: opengl_enc.c:109
float FFTSample
Definition: avfft.h:35
Libavcodec external API header.
uint64_t channel_layout
Audio channel layout.
Definition: avcodec.h:2046
void(* rdft_calc)(struct RDFTContext *s, FFTSample *z)
Definition: rdft.h:60
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
Definition: avcodec.h:630
GetBitContext gb
Definition: binkaudio.c:47
audio channel layout utility functions
#define FFMIN(a, b)
Definition: common.h:66
ret
Definition: avfilter.c:974
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:109
static float quant_table[96]
Definition: binkaudio.c:41
DCTContext dct
Definition: binkaudio.c:62
Definition: dct.h:31
static av_cold int decode_init(AVCodecContext *avctx)
Definition: binkaudio.c:67
int n
Definition: avisynth_c.h:547
AVCodec ff_binkaudio_rdft_decoder
Definition: binkaudio.c:337
int overlap_len
overlap size (samples)
Definition: binkaudio.c:52
sample_rate
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: binkaudio.c:286
int sample_rate
samples per second
Definition: avcodec.h:1985
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
Definition: get_bits.h:441
AVCodec ff_binkaudio_dct_decoder
Definition: binkaudio.c:349
main external API structure.
Definition: avcodec.h:1241
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
Definition: utils.c:1035
#define ldexpf(x, exp)
Definition: libm.h:107
void * buf
Definition: avisynth_c.h:553
int extradata_size
Definition: avcodec.h:1356
static unsigned int get_bits1(GetBitContext *s)
Definition: get_bits.h:304
static void skip_bits(GetBitContext *s, int n)
Definition: get_bits.h:297
av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)
Set up DCT.
Definition: dct.c:177
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
Definition: get_bits.h:337
const uint8_t * quant
int frame_len
transform size (samples)
Definition: binkaudio.c:51
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
Definition: ccaption_dec.c:522
int version_b
Bink version 'b'.
Definition: binkaudio.c:48
common internal api header.
void * av_realloc(void *ptr, size_t size)
Allocate or reallocate a block of memory.
Definition: mem.c:143
RDFTContext rdft
Definition: binkaudio.c:61
FFTSample coeffs[BINK_BLOCK_MAX_SIZE]
Definition: binkaudio.c:57
void * priv_data
Definition: avcodec.h:1283
int channels
number of audio channels
Definition: avcodec.h:1986
#define av_log2
Definition: intmath.h:105
static const double coeff[2][5]
Definition: vf_owdenoise.c:71
av_cold void ff_dct_end(DCTContext *s)
Definition: dct.c:220
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31))))#defineSET_CONV_FUNC_GROUP(ofmt, ifmt) staticvoidset_generic_function(AudioConvert *ac){}voidff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, intsample_rate, intapply_map){AudioConvert *ac;intin_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) returnNULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt)>2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);returnNULL;}returnac;}in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}elseif(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;elseac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);returnac;}intff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){intuse_generic=1;intlen=in->nb_samples;intp;if(ac->dc){av_log(ac->avr, AV_LOG_TRACE,"%dsamples-audio_convert:%sto%s(dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));returnff_convert_dither(ac-> out
#define av_freep(p)
uint8_t ** extended_data
pointers to the data planes/channels.
Definition: frame.h:215
#define AV_CH_LAYOUT_MONO
av_cold int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans)
Set up a real FFT.
Definition: rdft.c:99
This structure stores compressed data.
Definition: avcodec.h:1139
int nb_samples
number of audio samples (per channel) described by this frame
Definition: frame.h:225
static int width