28 const int8_t hf_vq[1024][32],
30 ptrdiff_t sb_start, ptrdiff_t sb_end,
31 ptrdiff_t ofs, ptrdiff_t
len)
35 for (i = sb_start; i < sb_end; i++) {
36 const int8_t *
coeff = hf_vq[vq_index[i]];
37 int32_t scale = scale_factors[i][0];
38 for (j = 0; j <
len; j++)
39 dst[i][j + ofs] =
clip23(coeff[j] * scale + (1 << 3) >> 4);
45 ptrdiff_t sb_start, ptrdiff_t sb_end,
46 ptrdiff_t ofs, ptrdiff_t
len)
50 for (i = sb_start; i < sb_end; i++) {
51 int32_t scale = scale_factors[i];
52 for (j = 0; j <
len; j++)
53 dst[i][j + ofs] =
clip23(
mul17(src[i][j + ofs], scale));
58 const float *filter_coeff, ptrdiff_t npcmblocks,
62 int factor = 64 << dec_select;
63 int ncoeffs = 8 >> dec_select;
64 int nlfesamples = npcmblocks >> (dec_select + 1);
67 for (i = 0; i < nlfesamples; i++) {
69 for (j = 0; j < factor / 2; j++) {
73 for (k = 0; k < ncoeffs; k++) {
74 a += filter_coeff[ j * ncoeffs + k] * lfe_samples[-k];
75 b += filter_coeff[255 - j * ncoeffs - k] * lfe_samples[-k];
79 pcm_samples[factor / 2 + j] =
b;
88 const float *filter_coeff, ptrdiff_t npcmblocks)
94 const float *filter_coeff, ptrdiff_t npcmblocks)
100 float *hist, ptrdiff_t
len)
105 for (i = 0; i <
len; i++) {
106 float a = 0.25f * src[i] + 0.75f * prev;
107 float b = 0.75f * src[i] + 0.25f * prev;
121 float *hist1,
int *
offset,
float *hist2,
122 const float *filter_coeff, ptrdiff_t npcmblocks,
128 for (j = 0; j < npcmblocks; j++) {
130 for (i = 0; i < 32; i++) {
132 input[i] = -subband_samples_lo[i][j];
134 input[i] = subband_samples_lo[i][j];
140 pcm_samples, input, scale);
150 float *hist1,
int *
offset,
float *hist2,
151 const float *filter_coeff, ptrdiff_t npcmblocks,
157 if (!subband_samples_hi)
158 memset(&input[32], 0,
sizeof(input[0]) * 32);
160 for (j = 0; j < npcmblocks; j++) {
162 if (subband_samples_hi) {
164 for (i = 0; i < 32; i++) {
166 input[i] = -subband_samples_lo[i][j] - subband_samples_hi[i][j];
168 input[i] = subband_samples_lo[i][j] + subband_samples_hi[i][j];
170 for (i = 32; i < 64; i++) {
172 input[i] = -subband_samples_hi[i][j];
174 input[i] = subband_samples_hi[i][j];
178 for (i = 0; i < 32; i++) {
180 input[i] = -subband_samples_lo[i][j];
182 input[i] = subband_samples_lo[i][j];
189 pcm_samples, input, scale);
195 const int32_t *filter_coeff, ptrdiff_t npcmblocks)
198 int nlfesamples = npcmblocks >> 1;
201 for (i = 0; i < nlfesamples; i++) {
203 for (j = 0; j < 32; j++) {
207 for (k = 0; k < 8; k++) {
208 a += (int64_t)filter_coeff[ j * 8 + k] * lfe_samples[-k];
209 b += (int64_t)filter_coeff[255 - j * 8 - k] * lfe_samples[-k];
227 for (i = 0; i <
len; i++) {
228 int64_t
a = INT64_C(2097471) * src[i] + INT64_C(6291137) * prev;
229 int64_t
b = INT64_C(6291137) * src[i] + INT64_C(2097471) * prev;
244 const int32_t *filter_coeff, ptrdiff_t npcmblocks)
249 for (j = 0; j < npcmblocks; j++) {
251 for (i = 0; i < 32; i++)
252 input[i] = subband_samples_lo[i][j];
268 const int32_t *filter_coeff, ptrdiff_t npcmblocks)
273 if (!subband_samples_hi)
274 memset(&input[32], 0,
sizeof(input[0]) * 32);
276 for (j = 0; j < npcmblocks; j++) {
278 if (subband_samples_hi) {
280 for (i = 0; i < 32; i++)
281 input[i] = subband_samples_lo[i][j] + subband_samples_hi[i][j];
282 for (i = 32; i < 64; i++)
283 input[i] = subband_samples_hi[i][j];
286 for (i = 0; i < 32; i++)
287 input[i] = subband_samples_lo[i][j];
302 for (i = 0; i <
len; i++)
303 dst[i] += src[i] * coeff + (1 << 2) >> 3;
311 for (i = 0; i <
len; i++) {
322 for (i = 0; i <
len; i++)
323 dst[i] -=
mul15(src[i], coeff);
330 for (i = 0; i <
len; i++)
331 dst[i] +=
mul15(src[i], coeff);
338 for (i = 0; i <
len; i++)
339 dst[i] =
mul15(dst[i], scale);
346 for (i = 0; i <
len; i++)
347 dst[i] =
mul16(dst[i], scale_inv);
354 for (i = 0; i <
len; i++)
355 dst[i] -=
mul22(src[i], coeff);
362 for (i = 0; i <
len; i++)
363 dst[i] -=
mul23(src[i], coeff);
371 filter0(src0, src1, coeff[0], len);
372 filter0(src1, src0, coeff[1], len);
373 filter0(src0, src1, coeff[2], len);
374 filter0(src1, src0, coeff[3], len);
376 for (i = 0; i < 8; i++, src0--) {
377 filter1(src0, src1, coeff[i + 4], len);
378 filter1(src1, src0, coeff[i + 12], len);
379 filter1(src0, src1, coeff[i + 4], len);
382 for (i = 0; i <
len; i++) {
void(* lfe_fir_fixed)(int32_t *pcm_samples, int32_t *lfe_samples, const int32_t *filter_coeff, ptrdiff_t npcmblocks)
static void lfe_fir_float_c(float *pcm_samples, int32_t *lfe_samples, const float *filter_coeff, ptrdiff_t npcmblocks, int dec_select)
static int32_t mul22(int32_t a, int32_t b)
static void sub_qmf32_fixed_c(SynthFilterContext *synth, DCADCTContext *imdct, int32_t *pcm_samples, int32_t **subband_samples_lo, int32_t **subband_samples_hi, int32_t *hist1, int *offset, int32_t *hist2, const int32_t *filter_coeff, ptrdiff_t npcmblocks)
static void assemble_freq_bands_c(int32_t *dst, int32_t *src0, int32_t *src1, const int32_t *coeff, ptrdiff_t len)
void(* sub_qmf_float[2])(SynthFilterContext *synth, FFTContext *imdct, float *pcm_samples, int32_t **subband_samples_lo, int32_t **subband_samples_hi, float *hist1, int *offset, float *hist2, const float *filter_coeff, ptrdiff_t npcmblocks, float scale)
static void dmix_scale_c(int32_t *dst, int scale, ptrdiff_t len)
memory handling functions
static void sub_qmf64_fixed_c(SynthFilterContext *synth, DCADCTContext *imdct, int32_t *pcm_samples, int32_t **subband_samples_lo, int32_t **subband_samples_hi, int32_t *hist1, int *offset, int32_t *hist2, const int32_t *filter_coeff, ptrdiff_t npcmblocks)
static void lfe_fir0_float_c(float *pcm_samples, int32_t *lfe_samples, const float *filter_coeff, ptrdiff_t npcmblocks)
static int32_t mul15(int32_t a, int32_t b)
static void filter1(int32_t *dst, const int32_t *src, int32_t coeff, ptrdiff_t len)
void(* dmix_scale_inv)(int32_t *dst, int scale_inv, ptrdiff_t len)
void(* synth_filter_float_64)(FFTContext *imdct, float *synth_buf_ptr, int *synth_buf_offset, float synth_buf2[64], const float window[1024], float out[64], const float in[64], float scale)
static void lfe_fir_fixed_c(int32_t *pcm_samples, int32_t *lfe_samples, const int32_t *filter_coeff, ptrdiff_t npcmblocks)
void(* synth_filter_fixed_64)(DCADCTContext *imdct, int32_t *synth_buf_ptr, int *synth_buf_offset, int32_t synth_buf2[64], const int32_t window[1024], int32_t out[64], const int32_t in[64])
static void filter0(int32_t *dst, const int32_t *src, int32_t coeff, ptrdiff_t len)
static int32_t clip23(int32_t a)
static int32_t mul23(int32_t a, int32_t b)
static int32_t mul16(int32_t a, int32_t b)
av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
void(* dmix_add)(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t len)
av_cold void ff_dcadsp_init(DCADSPContext *s)
static void lfe_x96_fixed_c(int32_t *dst, const int32_t *src, int32_t *hist, ptrdiff_t len)
static void decor_c(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t len)
void(* lfe_fir_float[2])(float *pcm_samples, int32_t *lfe_samples, const float *filter_coeff, ptrdiff_t npcmblocks)
static void lfe_fir1_float_c(float *pcm_samples, int32_t *lfe_samples, const float *filter_coeff, ptrdiff_t npcmblocks)
static void decode_hf_c(int32_t **dst, const int32_t *vq_index, const int8_t hf_vq[1024][32], int32_t scale_factors[32][2], ptrdiff_t sb_start, ptrdiff_t sb_end, ptrdiff_t ofs, ptrdiff_t len)
void(* assemble_freq_bands)(int32_t *dst, int32_t *src0, int32_t *src1, const int32_t *coeff, ptrdiff_t len)
static const uint8_t offset[127][2]
static void dmix_sub_xch_c(int32_t *dst1, int32_t *dst2, const int32_t *src, ptrdiff_t len)
void(* dmix_scale)(int32_t *dst, int scale, ptrdiff_t len)
void(* lfe_x96_float)(float *dst, const float *src, float *hist, ptrdiff_t len)
static void dmix_add_c(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t len)
void(* decode_hf)(int32_t **dst, const int32_t *vq_index, const int8_t hf_vq[1024][32], int32_t scale_factors[32][2], ptrdiff_t sb_start, ptrdiff_t sb_end, ptrdiff_t ofs, ptrdiff_t len)
void(* decode_joint)(int32_t **dst, int32_t **src, const int32_t *scale_factors, ptrdiff_t sb_start, ptrdiff_t sb_end, ptrdiff_t ofs, ptrdiff_t len)
static void decode_joint_c(int32_t **dst, int32_t **src, const int32_t *scale_factors, ptrdiff_t sb_start, ptrdiff_t sb_end, ptrdiff_t ofs, ptrdiff_t len)
static void sub_qmf64_float_c(SynthFilterContext *synth, FFTContext *imdct, float *pcm_samples, int32_t **subband_samples_lo, int32_t **subband_samples_hi, float *hist1, int *offset, float *hist2, const float *filter_coeff, ptrdiff_t npcmblocks, float scale)
static const int factor[16]
static void dmix_scale_inv_c(int32_t *dst, int scale_inv, ptrdiff_t len)
void(* sub_qmf_fixed[2])(SynthFilterContext *synth, DCADCTContext *imdct, int32_t *pcm_samples, int32_t **subband_samples_lo, int32_t **subband_samples_hi, int32_t *hist1, int *offset, int32_t *hist2, const int32_t *filter_coeff, ptrdiff_t npcmblocks)
void(* synth_filter_float)(FFTContext *imdct, float *synth_buf_ptr, int *synth_buf_offset, float synth_buf2[32], const float window[512], float out[32], const float in[32], float scale)
#define LOCAL_ALIGNED(a, t, v,...)
void(* dmix_sub_xch)(int32_t *dst1, int32_t *dst2, const int32_t *src, ptrdiff_t len)
static int32_t mul17(int32_t a, int32_t b)
void(* dmix_sub)(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t len)
void(* synth_filter_fixed)(DCADCTContext *imdct, int32_t *synth_buf_ptr, int *synth_buf_offset, int32_t synth_buf2[32], const int32_t window[512], int32_t out[32], const int32_t in[32])
static const double coeff[2][5]
static int32_t norm23(int64_t a)
void(* lfe_x96_fixed)(int32_t *dst, const int32_t *src, int32_t *hist, ptrdiff_t len)
static void dmix_sub_c(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t len)
void(* decor)(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t len)
static void sub_qmf32_float_c(SynthFilterContext *synth, FFTContext *imdct, float *pcm_samples, int32_t **subband_samples_lo, int32_t **subband_samples_hi, float *hist1, int *offset, float *hist2, const float *filter_coeff, ptrdiff_t npcmblocks, float scale)
static void lfe_x96_float_c(float *dst, const float *src, float *hist, ptrdiff_t len)