Go to the documentation of this file.
51 #define MIN_CHANNELS 1
52 #define MAX_CHANNELS 8
53 #define MAX_JS_PAIRS 8 / 2
55 #define JOINT_STEREO 0x12
58 #define SAMPLES_PER_FRAME 1024
140 for (
i = 0;
i < 128;
i++)
160 off = (intptr_t)
input & 3;
161 buf = (
const uint32_t *)(
input - off);
163 c =
av_be2ne32((0x537F6103U >> (off * 8)) | (0x537F6103U << (32 - (off * 8))));
167 for (
i = 0;
i < bytes / 4;
i++)
182 for (
i = 0, j = 255;
i < 128;
i++, j--) {
183 float wi = sin(((
i + 0.5) / 256.0 - 0.5) *
M_PI) + 1.0;
184 float wj = sin(((j + 0.5) / 256.0 - 0.5) *
M_PI) + 1.0;
185 float w = 0.5 * (wi * wi + wj * wj);
213 int coding_flag,
int *mantissas,
216 int i,
code, huff_symb;
221 if (coding_flag != 0) {
226 for (
i = 0;
i < num_codes;
i++) {
234 for (
i = 0;
i < num_codes;
i++) {
246 for (
i = 0;
i < num_codes;
i++) {
250 code = huff_symb >> 1;
256 for (
i = 0;
i < num_codes;
i++) {
273 int num_subbands, coding_mode,
i, j,
first, last, subband_size;
274 int subband_vlc_index[32], sf_index[32];
282 for (
i = 0;
i <= num_subbands;
i++)
286 for (
i = 0;
i <= num_subbands;
i++) {
287 if (subband_vlc_index[
i] != 0)
291 for (
i = 0;
i <= num_subbands;
i++) {
295 subband_size = last -
first;
297 if (subband_vlc_index[
i] != 0) {
302 mantissas, subband_size);
333 int nb_components, coding_mode_selector, coding_mode;
334 int band_flags[4], mantissa[8];
335 int component_count = 0;
340 if (nb_components == 0)
343 coding_mode_selector =
get_bits(gb, 2);
344 if (coding_mode_selector == 2)
347 coding_mode = coding_mode_selector & 1;
349 for (
i = 0;
i < nb_components;
i++) {
350 int coded_values_per_component, quant_step_index;
352 for (
b = 0;
b <= num_bands;
b++)
355 coded_values_per_component =
get_bits(gb, 3);
358 if (quant_step_index <= 1)
361 if (coding_mode_selector == 3)
364 for (
b = 0;
b < (num_bands + 1) * 4;
b++) {
365 int coded_components;
367 if (band_flags[
b >> 2] == 0)
372 for (
c = 0;
c < coded_components;
c++) {
374 int sf_index, coded_values, max_coded_values;
378 if (component_count >= 64)
384 coded_values = coded_values_per_component + 1;
385 coded_values =
FFMIN(max_coded_values, coded_values);
391 mantissa, coded_values);
393 cmp->num_coefs = coded_values;
396 for (m = 0; m < coded_values; m++)
397 cmp->coef[m] = mantissa[m] * scale_factor;
404 return component_count;
421 for (
b = 0;
b <= num_bands;
b++) {
429 if (j && loc[j] <= loc[j - 1])
436 gain[
b].num_points = 0;
452 int i, j, last_pos = -1;
455 for (
i = 0;
i < num_components;
i++) {
456 last_pos =
FFMAX(components[
i].pos + components[
i].num_coefs, last_pos);
460 for (j = 0; j < components[
i].num_coefs; j++)
467 #define INTERPOLATE(old, new, nsample) \
468 ((old) + (nsample) * 0.125 * ((new) - (old)))
473 int i, nsample, band;
474 float mc1_l, mc1_r, mc2_l, mc2_r;
476 for (
i = 0, band = 0; band < 4 * 256; band += 256,
i++) {
477 int s1 = prev_code[
i];
478 int s2 = curr_code[
i];
489 for (; nsample < band + 8; nsample++) {
490 float c1 = su1[nsample];
491 float c2 = su2[nsample];
495 su2[nsample] =
c1 * 2.0 -
c2;
502 for (; nsample < band + 256; nsample++) {
503 float c1 = su1[nsample];
504 float c2 = su2[nsample];
505 su1[nsample] =
c2 * 2.0;
506 su2[nsample] = (
c1 -
c2) * 2.0;
510 for (; nsample < band + 256; nsample++) {
511 float c1 = su1[nsample];
512 float c2 = su2[nsample];
513 su1[nsample] = (
c1 +
c2) * 2.0;
514 su2[nsample] =
c2 * -2.0;
519 for (; nsample < band + 256; nsample++) {
520 float c1 = su1[nsample];
521 float c2 = su2[nsample];
522 su1[nsample] =
c1 +
c2;
523 su2[nsample] =
c1 -
c2;
539 ch[1] = sqrt(2 -
ch[0] *
ch[0]);
551 if (p3[1] != 7 || p3[3] != 7) {
555 for (band = 256; band < 4 * 256; band += 256) {
556 for (nsample = band; nsample < band + 8; nsample++) {
557 su1[nsample] *=
INTERPOLATE(
w[0][0],
w[0][1], nsample - band);
558 su2[nsample] *=
INTERPOLATE(
w[1][0],
w[1][1], nsample - band);
560 for(; nsample < band + 256; nsample++) {
561 su1[nsample] *=
w[1][0];
562 su2[nsample] *=
w[1][1];
578 int channel_num,
int coding_mode)
580 int band,
ret, num_subbands, last_tonal, num_bands;
584 if (coding_mode ==
JOINT_STEREO && (channel_num % 2) == 1) {
619 num_bands =
FFMAX((last_tonal + 256) >> 8, num_bands);
623 for (band = 0; band < 4; band++) {
625 if (band <= num_bands)
634 256, &
output[band * 256]);
656 int js_pair, js_block_align;
662 js_databuf = databuf + js_pair * js_block_align;
666 js_databuf, js_block_align * 8);
679 for (
i = 0;
i < js_block_align / 2;
i++, ptr1++, ptr2--)
682 const uint8_t *ptr2 = js_databuf + js_block_align - 1;
683 for (
i = 0;
i < js_block_align;
i++)
689 for (
i = 4; *ptr1 == 0xF8;
i++, ptr1++) {
690 if (
i >= js_block_align)
707 for (
i = 0;
i < 4;
i++) {
744 float *p1 = out_samples[
i];
745 float *p2 = p1 + 256;
746 float *p3 = p2 + 256;
747 float *p4 = p3 + 256;
757 int size,
float **out_samples)
778 float *p1 = out_samples[
i];
779 float *p2 = p1 + 256;
780 float *p3 = p2 + 256;
781 float *p4 = p3 + 256;
791 int *got_frame_ptr,
AVPacket *avpkt)
795 int buf_size = avpkt->
size;
800 if (buf_size < avctx->block_align) {
802 "Frame too small (%d bytes). Truncated file?\n", buf_size);
831 int *got_frame_ptr,
AVPacket *avpkt)
841 (
float **)
frame->extended_data);
860 for (
i = 0;
i < 7;
i++) {
872 static int static_init_done;
874 int version, delay, samples_per_frame, frame_factor;
883 if (!static_init_done)
885 static_init_done = 1;
896 bytestream_get_le16(&edata_ptr));
900 bytestream_get_le16(&edata_ptr));
901 frame_factor = bytestream_get_le16(&edata_ptr);
903 bytestream_get_le16(&edata_ptr));
922 version = bytestream_get_be32(&edata_ptr);
923 samples_per_frame = bytestream_get_be16(&edata_ptr);
924 delay = bytestream_get_be16(&edata_ptr);
947 if (delay != 0x88E) {
993 for (
i = 0;
i < 4;
i++) {
1028 .long_name =
NULL_IF_CONFIG_SMALL(
"ATRAC3 AL (Adaptive TRansform Acoustic Coding 3 Advanced Lossless)"),
static const int8_t mantissa_vlc_tab[18]
@ AV_SAMPLE_FMT_FLTP
float, planar
static av_cold int init(AVCodecContext *avctx)
static int get_bits_left(GetBitContext *gb)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static void imlt(ATRAC3Context *q, float *input, float *output, int odd_band)
Regular 512 points IMDCT without overlapping, with the exception of the swapping of odd bands caused ...
#define FFSWAP(type, a, b)
static enum AVSampleFormat sample_fmts[]
uint8_t pi<< 24) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_U8,(uint64_t)((*(const uint8_t *) pi - 0x80U))<< 56) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16,(*(const int16_t *) pi >>8)+0x80) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_S16,(uint64_t)(*(const int16_t *) pi)<< 48) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32,(*(const int32_t *) pi >>24)+0x80) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_S32,(uint64_t)(*(const int32_t *) pi)<< 32) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S64,(*(const int64_t *) pi >>56)+0x80) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S64, *(const int64_t *) pi *(1.0f/(INT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S64, *(const int64_t *) pi *(1.0/(INT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_FLT, llrintf(*(const float *) pi *(INT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_DBL, llrint(*(const double *) pi *(INT64_C(1)<< 63))) #define FMT_PAIR_FUNC(out, in) static conv_func_type *const fmt_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), };static void cpy1(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, len);} static void cpy2(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, 2 *len);} static void cpy4(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, 4 *len);} static void cpy8(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, 8 *len);} AudioConvert *swri_audio_convert_alloc(enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, const int *ch_map, int flags) { 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) return NULL;ctx=av_mallocz(sizeof(*ctx));if(!ctx) return NULL;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)){ case 1:ctx->simd_f=cpy1;break;case 2:ctx->simd_f=cpy2;break;case 4:ctx->simd_f=cpy4;break;case 8: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);return ctx;} void swri_audio_convert_free(AudioConvert **ctx) { av_freep(ctx);} int swri_audio_convert(AudioConvert *ctx, AudioData *out, AudioData *in, int len) { int ch;int off=0;const int os=(out->planar ? 1 :out->ch_count) *out->bps;unsigned misaligned=0;av_assert0(ctx->channels==out->ch_count);if(ctx->in_simd_align_mask) { int planes=in->planar ? in->ch_count :1;unsigned m=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) { int planes=out->planar ? out->ch_count :1;unsigned m=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){ int planes=out->planar ? out->ch_count :1;for(ch=0;ch< planes;ch++){ ctx->simd_f(out-> ch ch
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce output
This structure describes decoded (raw) audio or video data.
#define SAMPLES_PER_FRAME
AVCodec ff_atrac3al_decoder
float delay_buf1[46]
qmf delay buffers
#define init_vlc(vlc, nb_bits, nb_codes, bits, bits_wrap, bits_size, codes, codes_wrap, codes_size, flags)
static void channel_weighting(float *su1, float *su2, int *p3)
static const uint16_t table[]
void * av_mallocz_array(size_t nmemb, size_t size)
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
int matrix_coeff_index_now[MAX_JS_PAIRS][4]
static const uint8_t clc_length_tab[8]
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
TonalComponent components[64]
float spectrum[SAMPLES_PER_FRAME]
static void skip_bits(GetBitContext *s, int n)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static const float inv_max_quant[8]
int flags
AV_CODEC_FLAG_*.
av_cold void ff_atrac_init_gain_compensation(AtracGCContext *gctx, int id2exp_offset, int loc_scale)
Initialize gain compensation context.
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But first
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static const int8_t mantissa_clc_tab[4]
static int decode_tonal_components(GetBitContext *gb, TonalComponent *components, int num_bands)
Restore the quantized tonal components.
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
int num_points
number of gain control points
static int get_sbits(GetBitContext *s, int n)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Gain compensation context structure.
static int decode_bytes(const uint8_t *input, uint8_t *out, int bytes)
static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby, const int size, const int h, int ref_index, int src_index, me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags)
compares a block (either a full macroblock or a partition thereof) against a proposed motion-compensa...
static int add_tonal_components(float *spectrum, int num_components, TonalComponent *components)
Combine the tonal band spectrum and regular band spectrum.
static unsigned int get_bits1(GetBitContext *s)
#define INIT_VLC_USE_NEW_STATIC
float ff_atrac_sf_table[64]
Gain control parameters for one subband.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
static void read_quant_spectral_coeffs(GetBitContext *gb, int selector, int coding_flag, int *mantissas, int num_codes)
Mantissa decoding.
int matrix_coeff_index_next[MAX_JS_PAIRS][4]
static const uint8_t *const huff_codes[7]
void(* imdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
void(* vector_fmul)(float *dst, const float *src0, const float *src1, int len)
Calculate the entry wise product of two vectors of floats and store the result in a vector of floats.
enum AVSampleFormat sample_fmt
audio sample format
int loc_code[7]
location of gain control points
static int atrac3_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
AVCodec ff_atrac3_decoder
static const uint16_t atrac3_vlc_offs[9]
static av_cold void init_imdct_window(void)
float imdct_buf[SAMPLES_PER_FRAME]
static int decode_spectrum(GetBitContext *gb, float *output)
Restore the quantized band spectrum coefficients.
static void get_channel_weights(int index, int flag, float ch[2])
av_cold void ff_atrac_generate_tables(void)
Generate common tables.
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some input
int channels
number of audio channels
#define DECLARE_ALIGNED(n, t, v)
#define i(width, name, range_min, range_max)
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some it can consider them to be part of the FIFO and delay acknowledging a status change accordingly Example code
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static unsigned int show_bits(GetBitContext *s, int n)
Show 1-25 bits.
int coding_mode
stream data
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
AVSampleFormat
Audio sample formats.
static const uint8_t *const huff_bits[7]
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
static VLC_TYPE atrac3_vlc_table[4096][2]
const char * name
Name of the codec implementation.
static av_cold int atrac3_decode_close(AVCodecContext *avctx)
int scrambled_stream
extradata
static int decode_channel_sound_unit(ATRAC3Context *q, GetBitContext *gb, ChannelUnit *snd, float *output, int channel_num, int coding_mode)
Decode a Sound Unit.
static const uint8_t huff_tab_sizes[7]
static int decode_frame(AVCodecContext *avctx, const uint8_t *databuf, float **out_samples)
static av_cold int atrac3_decode_init(AVCodecContext *avctx)
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
static int atrac3al_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
int lev_code[7]
level at corresponding control point
#define AV_INPUT_BUFFER_PADDING_SIZE
main external API structure.
void ff_atrac_gain_compensation(AtracGCContext *gctx, float *in, float *prev, AtracGainInfo *gc_now, AtracGainInfo *gc_next, int num_samples, float *out)
Apply gain compensation and perform the MDCT overlapping part.
static VLC spectral_coeff_tab[7]
static const uint16_t subband_tab[33]
static int al_decode_frame(AVCodecContext *avctx, const uint8_t *databuf, int size, float **out_samples)
float prev_frame[SAMPLES_PER_FRAME]
int matrix_coeff_index_prev[MAX_JS_PAIRS][4]
joint-stereo related variables
#define AV_CODEC_CAP_SUBFRAMES
Codec can output multiple frames per AVPacket Normally demuxers return one frame at a time,...
#define AV_CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
#define avpriv_request_sample(...)
This structure stores compressed data.
av_cold AVFloatDSPContext * avpriv_float_dsp_alloc(int bit_exact)
Allocate a float DSP context.
int weighting_delay[MAX_JS_PAIRS][6]
#define INTERPOLATE(old, new, nsample)
static void reverse_matrixing(float *su1, float *su2, int *prev_code, int *curr_code)
The exact code depends on how similar the blocks are and how related they are to the block
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static const float matrix_coeffs[8]
static av_cold void atrac3_init_static_data(void)
uint8_t * decoded_bytes_buffer
data buffers
VLC_TYPE(* table)[2]
code, bits
void ff_atrac_iqmf(float *inlo, float *inhi, unsigned int nIn, float *pOut, float *delayBuf, float *temp)
Quadrature mirror synthesis filter.
static int decode_gain_control(GetBitContext *gb, GainBlock *block, int num_bands)
Decode gain parameters for the coded bands.
static float mdct_window[MDCT_SIZE]