Go to the documentation of this file.
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]];
38 for (j = 0; j <
len; j++)
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++) {
52 for (j = 0; j <
len; j++)
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;
122 float *hist1,
int *
offset,
float *hist2,
123 const float *filter_coeff, ptrdiff_t npcmblocks,
129 for (j = 0; j < npcmblocks; j++) {
131 for (
i = 0;
i < 32;
i++) {
133 input[
i] = -subband_samples_lo[
i][j];
135 input[
i] = subband_samples_lo[
i][j];
152 float *hist1,
int *
offset,
float *hist2,
153 const float *filter_coeff, ptrdiff_t npcmblocks,
159 if (!subband_samples_hi)
162 for (j = 0; j < npcmblocks; j++) {
164 if (subband_samples_hi) {
166 for (
i = 0;
i < 32;
i++) {
168 input[
i] = -subband_samples_lo[
i][j] - subband_samples_hi[
i][j];
170 input[
i] = subband_samples_lo[
i][j] + subband_samples_hi[
i][j];
172 for (
i = 32;
i < 64;
i++) {
174 input[
i] = -subband_samples_hi[
i][j];
176 input[
i] = subband_samples_hi[
i][j];
180 for (
i = 0;
i < 32;
i++) {
182 input[
i] = -subband_samples_lo[
i][j];
184 input[
i] = subband_samples_lo[
i][j];
197 const int32_t *filter_coeff, ptrdiff_t npcmblocks)
200 int nlfesamples = npcmblocks >> 1;
203 for (
i = 0;
i < nlfesamples;
i++) {
205 for (j = 0; j < 32; j++) {
209 for (k = 0; k < 8; k++) {
210 a += (int64_t)filter_coeff[ j * 8 + k] * lfe_samples[-k];
211 b += (int64_t)filter_coeff[255 - j * 8 - k] * lfe_samples[-k];
229 for (
i = 0;
i <
len;
i++) {
230 int64_t
a = INT64_C(2097471) *
src[
i] + INT64_C(6291137) * prev;
231 int64_t
b = INT64_C(6291137) *
src[
i] + INT64_C(2097471) * prev;
246 const int32_t *filter_coeff, ptrdiff_t npcmblocks)
251 for (j = 0; j < npcmblocks; j++) {
253 for (
i = 0;
i < 32;
i++)
254 input[
i] = subband_samples_lo[
i][j];
270 const int32_t *filter_coeff, ptrdiff_t npcmblocks)
275 if (!subband_samples_hi)
278 for (j = 0; j < npcmblocks; j++) {
280 if (subband_samples_hi) {
282 for (
i = 0;
i < 32;
i++)
283 input[
i] = subband_samples_lo[
i][j] + subband_samples_hi[
i][j];
284 for (
i = 32;
i < 64;
i++)
285 input[
i] = subband_samples_hi[
i][j];
288 for (
i = 0;
i < 32;
i++)
289 input[
i] = subband_samples_lo[
i][j];
313 for (
i = 0;
i <
len;
i++) {
349 dst[
i] =
mul16(dst[
i], scale_inv);
378 for (
i = 0;
i < 8;
i++,
src0--) {
384 for (
i = 0;
i <
len;
i++) {
391 const float *
coeff, ptrdiff_t ofs, ptrdiff_t
len)
393 float SW0 =
coeff[0];
394 float SW1 =
coeff[1];
395 float SW2 =
coeff[2];
396 float SW3 =
coeff[3];
403 float AL1 =
coeff[8];
404 float AL2 =
coeff[9];
409 for (
i = 0;
i <
len;
i++) {
412 float a =
src[-4] * SW0 -
src[-1] * SW3;
413 float b =
src[-3] * SW1 -
src[-2] * SW2;
414 float c =
src[ 2] * SW1 +
src[ 1] * SW2;
415 float d =
src[ 3] * SW0 +
src[ 0] * SW3;
424 for (
i = 12;
i <
len - 1;
i++) {
437 const float iir[5][4],
float hist[5][2],
443 for (
i = 0;
i < 64;
i++) {
446 for (j = 0; j <
factor; j++) {
447 for (k = 0; k < 5; k++) {
448 tmp = hist[k][0] * iir[k][0] + hist[k][1] * iir[k][1] + res;
449 res = hist[k][0] * iir[k][2] + hist[k][1] * iir[k][3] +
tmp;
451 hist[k][0] = hist[k][1];
static int32_t mul22(int32_t a, int32_t b)
static void lfe_iir_c(float *output, const float *input, const float iir[5][4], float hist[5][2], ptrdiff_t factor)
static int32_t mul17(int32_t a, int32_t b)
static void sub_qmf64_float_c(SynthFilterContext *synth, AVTXContext *imdct, av_tx_fn imdct_fn, 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 filter1(SUINT32 *dst, const int32_t *src, int32_t coeff, ptrdiff_t len)
static int32_t mul15(int32_t a, int32_t b)
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
static void dmix_sub_xch_c(int32_t *dst1, int32_t *dst2, const int32_t *src, ptrdiff_t len)
void(* synth_filter_float_64)(AVTXContext *imdct, float *synth_buf_ptr, int *synth_buf_offset, float synth_buf2[64], const float window[1024], float out[64], float in[64], float scale, av_tx_fn imdct_fn)
static int32_t mul23(int32_t a, int32_t b)
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)
static void lbr_bank_c(float output[32][4], float **input, const float *coeff, ptrdiff_t ofs, ptrdiff_t len)
static av_always_inline float scale(float x, float s)
static int32_t clip23(int32_t a)
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 dmix_sub_c(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t len)
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)
void(* av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride)
Function pointer to a function to perform the transform.
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 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 dmix_add_c(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t len)
static void lfe_fir0_float_c(float *pcm_samples, int32_t *lfe_samples, const float *filter_coeff, ptrdiff_t npcmblocks)
static int32_t mul16(int32_t a, int32_t b)
static void lfe_fir_float_c(float *pcm_samples, int32_t *lfe_samples, const float *filter_coeff, ptrdiff_t npcmblocks, int dec_select)
static void assemble_freq_bands_c(int32_t *dst, int32_t *src0, int32_t *src1, const int32_t *coeff, ptrdiff_t len)
static void dmix_scale_inv_c(int32_t *dst, int scale_inv, ptrdiff_t len)
static void dmix_scale_c(int32_t *dst, int scale, ptrdiff_t len)
#define LOCAL_ALIGNED_32(t, v,...)
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 sub_qmf32_float_c(SynthFilterContext *synth, AVTXContext *imdct, av_tx_fn imdct_fn, 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)
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
av_cold void ff_dcadsp_init(DCADSPContext *s)
static void decor_c(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t len)
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
static void lfe_x96_float_c(float *dst, const float *src, float *hist, ptrdiff_t len)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
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
static void lfe_fir1_float_c(float *pcm_samples, int32_t *lfe_samples, const float *filter_coeff, ptrdiff_t npcmblocks)
static void lfe_x96_fixed_c(int32_t *dst, const int32_t *src, int32_t *hist, ptrdiff_t len)
#define i(width, name, range_min, range_max)
static int32_t norm23(int64_t a)
static const int factor[16]
static void filter0(SUINT32 *dst, const int32_t *src, int32_t coeff, ptrdiff_t len)
void(* synth_filter_float)(AVTXContext *imdct, float *synth_buf_ptr, int *synth_buf_offset, float synth_buf2[32], const float window[512], float out[32], float in[32], float scale, av_tx_fn imdct_fn)
av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
static void lfe_fir_fixed_c(int32_t *pcm_samples, int32_t *lfe_samples, const int32_t *filter_coeff, ptrdiff_t npcmblocks)
static const double coeff[2][5]