1 /*
2 * RealAudio Lossless decoder
3 *
4 * Copyright (c) 2012 Konstantin Shishkov
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 * This is a decoder for Real Audio Lossless format.
26 * Dedicated to the mastermind behind it, Ralph Wiggum.
27 */
28
37
39 #define FILTER_RAW 642
40
49
50 #define RALF_MAX_PKT_SIZE 8192
51
57
58 int filter_params;
///< combined filter parameters for the current channel data
59 int filter_length;
///< length of the filter for the current channel data
60 int filter_bits;
///< filter precision for the current channel data
62
63 int bias[2];
///< a constant value added to channel data after filtering
64
68 int block_pts[1 << 12];
///< block start time (in milliseconds)
69
73
74 #define MAX_ELEMS 644 // no RALF table uses more than that
75
77 {
80 int counts[17], prefixes[18];
81 int i, cur_len;
82 int max_bits = 0;
83 int nb = 0;
84
85 for (i = 0; i <= 16; i++)
86 counts[i] = 0;
87 for (i = 0; i < elems; i++) {
88 cur_len = (nb ? *data & 0xF : *data >> 4) + 1;
89 counts[cur_len]++;
90 max_bits =
FFMAX(max_bits, cur_len);
91 lens[i] = cur_len;
92 data += nb;
93 nb ^= 1;
94 }
95 prefixes[1] = 0;
96 for (i = 1; i <= 16; i++)
97 prefixes[i + 1] = (prefixes[i] + counts[i]) << 1;
98
99 for (i = 0; i < elems; i++)
100 codes[i] = prefixes[lens[i]]++;
101
103 lens, 1, 1, codes, 2, 2,
NULL, 0, 0, 0);
104 }
105
107 {
109 int i, j, k;
110
111 for (i = 0; i < 3; i++) {
115 for (j = 0; j < 10; j++)
116 for (k = 0; k < 11; k++)
118 for (j = 0; j < 15; j++)
120 for (j = 0; j < 125; j++)
122 }
123
124 return 0;
125 }
126
128 {
130 int i, j, k;
131 int ret;
132
136 }
137
142 }
143
151 }
155
160 }
162
163 for (i = 0; i < 3; i++) {
166 if (ret < 0) {
168 return ret;
169 }
171 if (ret < 0) {
173 return ret;
174 }
177 if (ret < 0) {
179 return ret;
180 }
181 for (j = 0; j < 10; j++) {
182 for (k = 0; k < 11; k++) {
186 if (ret < 0) {
188 return ret;
189 }
190 }
191 }
192 for (j = 0; j < 15; j++) {
195 if (ret < 0) {
197 return ret;
198 }
199 }
200 for (j = 0; j < 125; j++) {
203 if (ret < 0) {
205 return ret;
206 }
207 }
208 }
209
210 return 0;
211 }
212
214 {
215 if (val == 0) {
217 } else if (val == range * 2) {
219 } else {
220 val -= range;
221 }
222 if (bits)
225 }
226
229 {
230 int i, t;
231 int code_params;
235
239
241 for (i = 0; i <
length; i++)
244 return 0;
245 }
246
249
251 memset(dst, 0, sizeof(*dst) * length);
252 return 0;
253 }
254
256 int cmode = 0,
coeff = 0;
258
260
264 if (!cmode)
265 coeff -= 12 << add_bits;
268
269 cmode = coeff >> add_bits;
270 if (cmode < 0) {
272 if (cmode < -5)
273 cmode = -5;
274 } else if (cmode > 0) {
276 if (cmode > 5)
277 cmode = 5;
278 }
279 }
280 }
281
283 if (code_params >= 15) {
284 add_bits = av_clip((code_params / 5 - 3) / 2, 0, 10);
285 if (add_bits > 9 && (code_params % 5) != 2)
286 add_bits--;
287 range = 10;
288 range2 = 21;
289 code_vlc = set->
long_codes + code_params - 15;
290 } else {
291 add_bits = 0;
292 range = 6;
293 range2 = 13;
295 }
296
297 for (i = 0; i <
length; i += 2) {
298 int code1, code2;
299
301 code1 = t / range2;
302 code2 = t % range2;
303 dst[i] =
extend_code(gb, code1, range, 0) << add_bits;
304 dst[i + 1] =
extend_code(gb, code2, range, 0) << add_bits;
305 if (add_bits) {
307 dst[i + 1] |=
get_bits(gb, add_bits);
308 }
309 }
310
311 return 0;
312 }
313
315 {
319 int max_clip = (1 <<
bits) - 1, min_clip = -max_clip - 1;
320
321 for (i = 1; i <
length; i++) {
323
324 acc = 0;
325 for (j = 0; j < flen; j++)
326 acc += ctx->
filter[j] * audio[i - j - 1];
329 acc =
FFMAX(acc, min_clip);
330 } else {
332 acc =
FFMIN(acc, max_clip);
333 }
335 }
336 }
337
339 int16_t *dst0, int16_t *dst1)
340 {
344 int *ch0, *ch1;
346
348
349 if (len <= 7) len ^= 1; // codes for length = 6 and 7 are swapped
351
354 "Decoder's stomach is crying, it ate too many samples\n");
356 }
357
360 else
361 dmode = 0;
362
363 mode[0] = (dmode == 4) ? 1 : 0;
364 mode[1] = (dmode >= 2) ? 2 : 0;
365 bits[0] = 16;
366 bits[1] = (mode[1] == 2) ? 17 : 16;
367
368 for (ch = 0; ch < avctx->
channels; ch++) {
369 if ((ret =
decode_channel(ctx, gb, ch, len, mode[ch], bits[ch])) < 0)
370 return ret;
374 }
377 }
380 switch (dmode) {
381 case 0:
382 for (i = 0; i <
len; i++)
383 dst0[i] = ch0[i] + ctx->
bias[0];
384 break;
385 case 1:
386 for (i = 0; i <
len; i++) {
387 dst0[i] = ch0[i] + ctx->
bias[0];
388 dst1[i] = ch1[i] + ctx->
bias[1];
389 }
390 break;
391 case 2:
392 for (i = 0; i <
len; i++) {
393 ch0[i] += ctx->
bias[0];
394 dst0[i] = ch0[i];
395 dst1[i] = ch0[i] - (ch1[i] + ctx->
bias[1]);
396 }
397 break;
398 case 3:
399 for (i = 0; i <
len; i++) {
400 t = ch0[i] + ctx->
bias[0];
401 t2 = ch1[i] + ctx->
bias[1];
403 dst1[i] = t;
404 }
405 break;
406 case 4:
407 for (i = 0; i <
len; i++) {
408 t = ch1[i] + ctx->
bias[1];
409 t2 = ((ch0[i] + ctx->
bias[0]) << 1) | (t & 1);
410 dst0[i] = (t2 + t) / 2;
411 dst1[i] = (t2 - t) / 2;
412 }
413 break;
414 }
415
417
418 return 0;
419 }
420
423 {
426 int16_t *samples0;
427 int16_t *samples1;
428 int ret;
430 int table_size, table_bytes, i;
432 int src_size;
433 int bytes_left;
434
441 }
442 if (memcmp(ctx->
pkt, avpkt->
data, 2 + table_bytes)) {
445 }
446
450 avpkt->
size - 2 - table_bytes);
451 } else {
455 *got_frame_ptr = 0;
456
458 }
460 src_size = avpkt->
size;
461 }
462
465 return ret;
466 samples0 = (int16_t *)frame->
data[0];
467 samples1 = (int16_t *)frame->
data[1];
468
469 if (src_size < 5) {
472 }
474 table_bytes = (table_size + 7) >> 3;
475 if (src_size < table_bytes + 3) {
478 }
485 } else {
487 }
489 }
490
491 block_pointer = src + table_bytes + 2;
492 bytes_left = src_size - table_bytes - 2;
495 if (bytes_left < ctx->block_size[i]) {
497 break;
498 }
502 av_log(avctx,
AV_LOG_ERROR,
"Sir, I got carsick in your office. Not decoding the rest of packet.\n");
503 break;
504 }
507 }
508
511
513 }
514
516 {
518
520 }
521
522
536 };
const char const char void * val
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
static void flush(AVCodecContext *avctx)
int num_blocks
number of blocks inside the frame
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static av_cold int init(AVCodecContext *avctx)
int ff_init_vlc_sparse(VLC *vlc_arg, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, const void *symbols, int symbols_wrap, int symbols_size, int flags)
#define AV_CH_LAYOUT_STEREO
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
static void set(uint8_t *a[], int ch, int index, int ch_count, enum AVSampleFormat f, double v)
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Macro definitions for various function/variable attributes.
static const uint8_t bias_def[3][128]
static const uint8_t filter_coeffs_def[3][10][11][24]
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
enum AVSampleFormat sample_fmt
audio sample format
uint8_t pi<< 24) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_U8,(uint64_t)((*(constuint8_t *) pi-0x80U))<< 56) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_S16,(uint64_t)(*(constint16_t *) pi)<< 48) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_S32,(uint64_t)(*(constint32_t *) pi)<< 32) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S64,(*(constint64_t *) pi >>56)+0x80) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S64,*(constint64_t *) pi *(1.0f/(INT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S64,*(constint64_t *) pi *(1.0/(INT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_FLT, llrintf(*(constfloat *) pi *(INT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31)))) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_DBL, llrint(*(constdouble *) pi *(INT64_C(1)<< 63)))#defineFMT_PAIR_FUNC(out, in) staticconv_func_type *constfmt_pair_to_conv_functions[AV_SAMPLE_FMT_NB *AV_SAMPLE_FMT_NB]={FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S64),};staticvoidcpy1(uint8_t **dst, constuint8_t **src, intlen){memcpy(*dst,*src, len);}staticvoidcpy2(uint8_t **dst, constuint8_t **src, intlen){memcpy(*dst,*src, 2 *len);}staticvoidcpy4(uint8_t **dst, constuint8_t **src, intlen){memcpy(*dst,*src, 4 *len);}staticvoidcpy8(uint8_t **dst, constuint8_t **src, intlen){memcpy(*dst,*src, 8 *len);}AudioConvert *swri_audio_convert_alloc(enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, constint *ch_map, intflags){AudioConvert *ctx;conv_func_type *f=fmt_pair_to_conv_functions[av_get_packed_sample_fmt(out_fmt)+AV_SAMPLE_FMT_NB *av_get_packed_sample_fmt(in_fmt)];if(!f) returnNULL;ctx=av_mallocz(sizeof(*ctx));if(!ctx) returnNULL;if(channels==1){in_fmt=av_get_planar_sample_fmt(in_fmt);out_fmt=av_get_planar_sample_fmt(out_fmt);}ctx->channels=channels;ctx->conv_f=f;ctx->ch_map=ch_map;if(in_fmt==AV_SAMPLE_FMT_U8||in_fmt==AV_SAMPLE_FMT_U8P) memset(ctx->silence, 0x80, sizeof(ctx->silence));if(out_fmt==in_fmt &&!ch_map){switch(av_get_bytes_per_sample(in_fmt)){case1:ctx->simd_f=cpy1;break;case2:ctx->simd_f=cpy2;break;case4:ctx->simd_f=cpy4;break;case8:ctx->simd_f=cpy8;break;}}if(HAVE_X86ASM &&1) swri_audio_convert_init_x86(ctx, out_fmt, in_fmt, channels);if(ARCH_ARM) swri_audio_convert_init_arm(ctx, out_fmt, in_fmt, channels);if(ARCH_AARCH64) swri_audio_convert_init_aarch64(ctx, out_fmt, in_fmt, channels);returnctx;}voidswri_audio_convert_free(AudioConvert **ctx){av_freep(ctx);}intswri_audio_convert(AudioConvert *ctx, AudioData *out, AudioData *in, intlen){intch;intoff=0;constintos=(out->planar?1:out->ch_count)*out->bps;unsignedmisaligned=0;av_assert0(ctx->channels==out->ch_count);if(ctx->in_simd_align_mask){intplanes=in->planar?in->ch_count:1;unsignedm=0;for(ch=0;ch< planes;ch++) m|=(intptr_t) in->ch[ch];misaligned|=m &ctx->in_simd_align_mask;}if(ctx->out_simd_align_mask){intplanes=out->planar?out->ch_count:1;unsignedm=0;for(ch=0;ch< planes;ch++) m|=(intptr_t) out->ch[ch];misaligned|=m &ctx->out_simd_align_mask;}if(ctx->simd_f &&!ctx->ch_map &&!misaligned){off=len &~15;av_assert1(off >=0);av_assert1(off<=len);av_assert2(ctx->channels==SWR_CH_MAX||!in->ch[ctx->channels]);if(off >0){if(out->planar==in->planar){intplanes=out->planar?out->ch_count:1;for(ch=0;ch< planes;ch++){ctx->simd_f(out-> ch ch
static int decode_block(AVCodecContext *avctx, GetBitContext *gb, int16_t *dst0, int16_t *dst1)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
bitstream reader API header.
static int get_bits_left(GetBitContext *gb)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int get_ue_golomb(GetBitContext *gb)
Read an unsigned Exp-Golomb code in the range 0 to 8190.
int filter_bits
filter precision for the current channel data
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
static void decode_flush(AVCodecContext *avctx)
static const struct endianess table[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_cold int decode_close(AVCodecContext *avctx)
static int decode_channel(RALFContext *ctx, GetBitContext *gb, int ch, int length, int mode, int bits)
static const uint8_t long_codes_def[3][125][224]
#define RALF_MAX_PKT_SIZE
const char * name
Name of the codec implementation.
uint64_t channel_layout
Audio channel layout.
int32_t channel_data[2][4096]
audio channel layout utility functions
#define FILTER_COEFFS_ELEMENTS
#define SHORT_CODES_ELEMENTS
static const uint8_t coding_mode_def[3][72]
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
int filter_params
combined filter parameters for the current channel data
Libavcodec external API header.
AVSampleFormat
Audio sample formats.
int sample_rate
samples per second
#define FILTERPARAM_ELEMENTS
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
static unsigned int get_bits1(GetBitContext *s)
static av_cold int init_ralf_vlc(VLC *vlc, const uint8_t *data, int elems)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
VLC filter_coeffs[10][11]
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int block_size[1<< 12]
size of the blocks
int block_pts[1<< 12]
block start time (in milliseconds)
#define CODING_MODE_ELEMENTS
common internal api header.
static int get_unary(GetBitContext *gb, int stop, int len)
Get unary code of limited length.
static const uint8_t short_codes_def[3][15][88]
int filter_length
length of the filter for the current channel data
static av_cold int decode_init(AVCodecContext *avctx)
static int extend_code(GetBitContext *gb, int val, int range, int bits)
int channels
number of audio channels
VLC_TYPE(* table)[2]
code, bits
static const uint8_t filter_param_def[3][324]
static const double coeff[2][5]
int bias[2]
a constant value added to channel data after filtering
static enum AVSampleFormat sample_fmts[]
#define LONG_CODES_ELEMENTS
#define AV_CH_LAYOUT_MONO
static void apply_lpc(RALFContext *ctx, int ch, int length, int bits)
This structure stores compressed data.
void ff_free_vlc(VLC *vlc)
mode
Use these values in ebur128_init (or'ed).
int nb_samples
number of audio samples (per channel) described by this frame
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.