65 const float *loop_end = src +
count;
76 "lw %[temp0], 0(%[src]) \n\t"
77 "lw %[temp1], 4(%[src]) \n\t"
78 "lw %[temp2], 8(%[src]) \n\t"
79 "lw %[temp3], 12(%[src]) \n\t"
80 "lw %[temp4], 16(%[src]) \n\t"
81 "lw %[temp5], 20(%[src]) \n\t"
82 "lw %[temp6], 24(%[src]) \n\t"
83 "lw %[temp7], 28(%[src]) \n\t"
85 "sw %[temp0], 0(%[dst]) \n\t"
86 "sw %[temp1], 4(%[dst]) \n\t"
87 "sw %[temp2], 8(%[dst]) \n\t"
88 "sw %[temp3], 12(%[dst]) \n\t"
89 "sw %[temp4], 16(%[dst]) \n\t"
90 "sw %[temp5], 20(%[dst]) \n\t"
91 "sw %[temp6], 24(%[dst]) \n\t"
92 "sw %[temp7], 28(%[dst]) \n\t"
93 "bne %[src], %[loop_end], 1b \n\t"
97 : [temp0]
"=&r"(temp[0]), [temp1]
"=&r"(temp[1]),
98 [temp2]
"=&r"(temp[2]), [temp3]
"=&r"(temp[3]),
99 [temp4]
"=&r"(temp[4]), [temp5]
"=&r"(temp[5]),
100 [temp6]
"=&r"(temp[6]), [temp7]
"=&r"(temp[7]),
101 [
src]
"+r"(
src), [dst]
"+r"(dst)
102 : [loop_end]
"r"(loop_end)
109 union {
unsigned u;
int s; } v = { previous_val * 1664525u + 1013904223 };
118 float *saved = sce->
saved;
126 for (i = 0; i < 1024; i += 128)
141 float_copy(out, saved, 448);
148 float temp0, temp1, temp2, temp3;
149 float *dst0 = out + 448 + 0*128;
150 float *dst1 = dst0 + 64 + 63;
151 float *dst2 = saved + 63;
152 float *win0 = (
float*)swindow;
153 float *win1 = win0 + 64 + 63;
154 float *win0_prev = (
float*)swindow_prev;
155 float *win1_prev = win0_prev + 64 + 63;
156 float *src0_prev = saved + 448;
157 float *src1_prev = buf + 0*128 + 63;
158 float *
src0 = buf + 0*128 + 64;
159 float *
src1 = buf + 1*128 + 63;
161 for(i = 0; i < 64; i++)
163 temp0 = src0_prev[0];
164 temp1 = src1_prev[0];
169 dst0[0] = temp0 * wj - temp1 * wi;
170 dst1[0] = temp0 * wi + temp1 * wj;
177 dst0[128] = temp2 * wj - temp3 * wi;
178 dst1[128] = temp2 * wi + temp3 * wj;
182 dst0[256] = temp0 * wj - temp1 * wi;
183 dst1[256] = temp0 * wi + temp1 * wj;
184 dst0[384] = temp2 * wj - temp3 * wi;
185 dst1[384] = temp2 * wi + temp3 * wj;
189 dst0[512] = temp0 * wj - temp1 * wi;
190 dst2[0] = temp0 * wi + temp1 * wj;
207 float_copy(out + 576, buf + 64, 448);
216 float_copy(saved + 448, buf + 7*128 + 64, 64);
218 float_copy(saved, buf + 512, 448);
219 float_copy(saved + 448, buf + 7*128 + 64, 64);
221 float_copy(saved, buf + 512, 512);
233 float *predTime = sce->
ret;
236 int16_t num_samples = 2048;
239 num_samples = ltp->
lag + 1024;
240 j = (2048 - num_samples) >> 2;
241 k = (2048 - num_samples) & 3;
242 p_predTime = &predTime[num_samples];
244 for (i = 0; i < num_samples; i++)
246 for (i = 0; i < j; i++) {
250 "sw $0, 0(%[p_predTime]) \n\t"
251 "sw $0, 4(%[p_predTime]) \n\t"
252 "sw $0, 8(%[p_predTime]) \n\t"
253 "sw $0, 12(%[p_predTime]) \n\t"
254 PTR_ADDIU "%[p_predTime], %[p_predTime], 16 \n\t"
256 : [p_predTime]
"+r"(p_predTime)
261 for (i = 0; i < k; i++) {
264 "sw $0, 0(%[p_predTime]) \n\t"
265 PTR_ADDIU "%[p_predTime], %[p_predTime], 4 \n\t"
267 : [p_predTime]
"+r"(p_predTime)
280 for (i = offsets[sfb]; i < offsets[sfb + 1]; i++)
281 sce->
coeffs[i] += predFreq[i];
298 for (; count > 0; count -= 4){
303 "lwc1 %[temp0], 0(%[ptr2]) \n\t"
304 "lwc1 %[temp1], -4(%[ptr2]) \n\t"
305 "lwc1 %[temp2], -8(%[ptr2]) \n\t"
306 "lwc1 %[temp3], -12(%[ptr2]) \n\t"
307 "lwc1 %[temp4], 0(%[ptr3]) \n\t"
308 "lwc1 %[temp5], -4(%[ptr3]) \n\t"
309 "lwc1 %[temp6], -8(%[ptr3]) \n\t"
310 "lwc1 %[temp7], -12(%[ptr3]) \n\t"
311 "mul.s %[temp8], %[temp0], %[temp4] \n\t"
312 "mul.s %[temp9], %[temp1], %[temp5] \n\t"
313 "mul.s %[temp10], %[temp2], %[temp6] \n\t"
314 "mul.s %[temp11], %[temp3], %[temp7] \n\t"
315 "swc1 %[temp8], 0(%[ptr1]) \n\t"
316 "swc1 %[temp9], 4(%[ptr1]) \n\t"
317 "swc1 %[temp10], 8(%[ptr1]) \n\t"
318 "swc1 %[temp11], 12(%[ptr1]) \n\t"
323 : [temp0]
"=&f"(temp[0]), [temp1]
"=&f"(temp[1]),
324 [temp2]
"=&f"(temp[2]), [temp3]
"=&f"(temp[3]),
325 [temp4]
"=&f"(temp[4]), [temp5]
"=&f"(temp[5]),
326 [temp6]
"=&f"(temp[6]), [temp7]
"=&f"(temp[7]),
327 [temp8]
"=&f"(temp[8]), [temp9]
"=&f"(temp[9]),
328 [temp10]
"=&f"(temp[10]), [temp11]
"=&f"(temp[11]),
329 [ptr1]
"+r"(dst), [ptr2]
"+r"(src0), [ptr3]
"+r"(
src1)
339 float *saved = sce->
saved;
340 float *saved_ltp = sce->
coeffs;
343 float temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
346 float *p_saved_ltp = saved_ltp + 576;
347 float *loop_end1 = p_saved_ltp + 448;
349 float_copy(saved_ltp, saved, 512);
354 "sw $0, 0(%[p_saved_ltp]) \n\t"
355 "sw $0, 4(%[p_saved_ltp]) \n\t"
356 "sw $0, 8(%[p_saved_ltp]) \n\t"
357 "sw $0, 12(%[p_saved_ltp]) \n\t"
358 "sw $0, 16(%[p_saved_ltp]) \n\t"
359 "sw $0, 20(%[p_saved_ltp]) \n\t"
360 "sw $0, 24(%[p_saved_ltp]) \n\t"
361 "sw $0, 28(%[p_saved_ltp]) \n\t"
362 PTR_ADDIU "%[p_saved_ltp],%[p_saved_ltp], 32 \n\t"
363 "bne %[p_saved_ltp], %[loop_end1], 1b \n\t"
365 : [p_saved_ltp]
"+r"(p_saved_ltp)
366 : [loop_end1]
"r"(loop_end1)
371 fmul_and_reverse(saved_ltp + 512, ac->
buf_mdct + 960, swindow, 64);
373 float *buff0 = saved;
374 float *buff1 = saved_ltp;
375 float *loop_end = saved + 448;
380 ".set noreorder \n\t"
382 "lw %[temp0], 0(%[src]) \n\t"
383 "lw %[temp1], 4(%[src]) \n\t"
384 "lw %[temp2], 8(%[src]) \n\t"
385 "lw %[temp3], 12(%[src]) \n\t"
386 "lw %[temp4], 16(%[src]) \n\t"
387 "lw %[temp5], 20(%[src]) \n\t"
388 "lw %[temp6], 24(%[src]) \n\t"
389 "lw %[temp7], 28(%[src]) \n\t"
391 "sw %[temp0], 0(%[dst]) \n\t"
392 "sw %[temp1], 4(%[dst]) \n\t"
393 "sw %[temp2], 8(%[dst]) \n\t"
394 "sw %[temp3], 12(%[dst]) \n\t"
395 "sw %[temp4], 16(%[dst]) \n\t"
396 "sw %[temp5], 20(%[dst]) \n\t"
397 "sw %[temp6], 24(%[dst]) \n\t"
398 "sw %[temp7], 28(%[dst]) \n\t"
399 "sw $0, 2304(%[dst]) \n\t"
400 "sw $0, 2308(%[dst]) \n\t"
401 "sw $0, 2312(%[dst]) \n\t"
402 "sw $0, 2316(%[dst]) \n\t"
403 "sw $0, 2320(%[dst]) \n\t"
404 "sw $0, 2324(%[dst]) \n\t"
405 "sw $0, 2328(%[dst]) \n\t"
406 "sw $0, 2332(%[dst]) \n\t"
407 "bne %[src], %[loop_end], 1b \n\t"
411 : [temp0]
"=&r"(temp0), [temp1]
"=&r"(temp1),
412 [temp2]
"=&r"(temp2), [temp3]
"=&r"(temp3),
413 [temp4]
"=&r"(temp4), [temp5]
"=&r"(temp5),
414 [temp6]
"=&r"(temp6), [temp7]
"=&r"(temp7),
415 [
src]
"+r"(buff0), [dst]
"+r"(buff1)
416 : [loop_end]
"r"(loop_end)
420 fmul_and_reverse(saved_ltp + 512, ac->
buf_mdct + 960, swindow, 64);
423 fmul_and_reverse(saved_ltp + 512, ac->
buf_mdct + 512, lwindow, 512);
428 float_copy(sce->
ltp_state + 2048, saved_ltp, 1024);
uint8_t use_kb_window[2]
If set, use Kaiser-Bessel window, otherwise use a sine window.
MIPS assembly defines from sys/asm.h but rewritten for use with C inline assembly (rather than from w...
INTFLOAT * ret
PCM output.
void(* update_ltp)(AACContext *ac, SingleChannelElement *sce)
void(* imdct_and_windowing)(AACContext *ac, SingleChannelElement *sce)
void(* vector_fmul_reverse)(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...
Reference: libavcodec/aacdec.c.
static av_always_inline int lcg_random(unsigned previous_val)
linear congruential pseudorandom number generator
const uint16_t * swb_offset
table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular wind...
void(* vector_fmul_window)(float *dst, const float *src0, const float *src1, const float *win, int len)
Overlap/add with window function.
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
float ff_aac_kbd_long_1024[1024]
uint8_t max_sfb
number of scalefactor bands per group
enum WindowSequence window_sequence[2]
INTFLOAT ltp_state[3072]
time signal for LTP
AAC definitions and structures.
float ff_aac_kbd_short_128[128]
IndividualChannelStream ics
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-> in
void(* imdct_half)(struct FFTContext *s, FFTSample *output, const FFTSample *input)
void(* apply_tns)(INTFLOAT coef[1024], TemporalNoiseShaping *tns, IndividualChannelStream *ics, int decode)
INTFLOAT coeffs[1024]
coefficients for IMDCT, maybe processed
void(* apply_ltp)(AACContext *ac, SingleChannelElement *sce)
INTFLOAT saved[1536]
overlap
Single Channel Element - used for both SCE and LFE elements.
void(* windowing_and_mdct_ltp)(AACContext *ac, INTFLOAT *out, INTFLOAT *in, IndividualChannelStream *ics)
Individual Channel Stream.
int8_t used[MAX_LTP_LONG_SFB]
void ff_aacdec_init_mips(AACContext *c)