42 -0.00001461907, -0.00009205479,-0.000056157569,0.00030117269,
43 0.0002422519, -0.00085293897,-0.0005205574, 0.0020340169,
44 0.00078333891, -0.0042153862, -0.00075614988, 0.0078402944,
45 -0.000061169922,-0.01344162, 0.0024626821, 0.021736089,
46 -0.007801671, -0.034090221, 0.01880949, 0.054326009,
47 -0.043596379, -0.099384367, 0.13207909, 0.46424159
53 for (
int i = 0;
i < 64;
i++)
57 for (
int i = 0;
i < 24;
i++) {
79 for (i = 0; i < 16; i++)
83 for (i = -15; i < 16; i++)
89 int num_samples,
float *
out)
91 float lev, gc_scale, gain_inc;
98 for (pos = 0; pos < num_samples; pos++)
99 out[pos] = in[pos] * gc_scale + prev[pos];
112 for (; pos < lastpos; pos++)
113 out[pos] = (in[pos] * gc_scale + prev[pos]) *
lev;
116 for (; pos < lastpos + gctx->
loc_size; pos++) {
117 out[
pos] = (in[
pos] * gc_scale + prev[
pos]) * lev;
122 for (; pos < num_samples; pos++)
123 out[pos] = in[pos] * gc_scale + prev[pos];
127 memcpy(prev, &in[num_samples], num_samples *
sizeof(
float));
131 float *delayBuf,
float *
temp)
136 memcpy(temp, delayBuf, 46*
sizeof(
float));
141 for(i=0; i<nIn; i+=2){
142 p3[2*i+0] = inlo[
i ] + inhi[
i ];
143 p3[2*i+1] = inlo[
i ] - inhi[
i ];
144 p3[2*i+2] = inlo[i+1] + inhi[i+1];
145 p3[2*i+3] = inlo[i+1] - inhi[i+1];
150 for (j = nIn; j != 0; j--) {
154 for (i = 0; i < 48; i += 2) {
156 s2 += p1[i+1] * qmf_window[i+1];
167 memcpy(delayBuf, temp + nIn*2, 46*
sizeof(
float));
static av_cold void atrac_generate_tables(void)
void ff_atrac_iqmf(float *inlo, float *inhi, unsigned int nIn, float *pOut, float *delayBuf, float *temp)
Quadrature mirror synthesis filter.
int lev_code[7]
level at corresponding control point
static float qmf_window[48]
float ff_atrac_sf_table[64]
float gain_tab1[16]
gain compensation level table
int loc_code[7]
location of gain control points
Gain compensation context structure.
av_cold void ff_atrac_init_gain_compensation(AtracGCContext *gctx, int id2exp_offset, int loc_scale)
Initialize gain compensation context.
float gain_tab2[31]
gain compensation interpolation table
int loc_scale
scale of location code = 2^loc_scale samples
Gain control parameters for one subband.
Libavcodec external API header.
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31))))#define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac){}void ff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map){AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;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);return NULL;}return ac;}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;}else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->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);return ac;}int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){int use_generic=1;int len=in->nb_samples;int p;if(ac->dc){av_log(ac->avr, AV_LOG_TRACE,"%d samples - audio_convert: %s to %s (dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> in
int loc_size
size of location code in samples
int id2exp_offset
offset for converting level index into level exponent
int num_points
number of gain control points
static const float qmf_48tap_half[24]
static int ff_thread_once(char *control, void(*routine)(void))
static LevelCodes lev[4+3+3]
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.
av_cold void ff_atrac_generate_tables(void)
Generate common tables.