28 int firorder,
int iirorder,
30 int blocksize,
int32_t *sample_buffer)
38 for (i = 0; i < blocksize; i++) {
44 for (order = 0; order < firorder; order++)
45 accum += (int64_t) firbuf[order] * fircoeff[order];
46 for (order = 0; order < iirorder; order++)
47 accum += (int64_t) iirbuf[order] * iircoeff[order];
49 accum = accum >> filter_shift;
53 *--iirbuf = result - accum;
55 *sample_buffer = result;
63 const int8_t *noise_buffer,
68 int matrix_noise_shift,
69 int access_unit_size_pow2,
72 unsigned int src_ch, i;
73 int index2 = 2 * index + 1;
74 for (i = 0; i < blockpos; i++) {
77 for (src_ch = 0; src_ch <= maxchan; src_ch++)
78 accum += (int64_t) samples[src_ch] * coeffs[src_ch];
80 if (matrix_noise_shift) {
81 index &= access_unit_size_pow2 - 1;
82 accum += noise_buffer[
index] << (matrix_noise_shift + 7);
86 samples[dest_ch] = ((accum >> 14) & mask) + *bypassed_lsbs;
105 int8_t *output_shift,
106 uint8_t max_matrix_channel,
109 unsigned int i, out_ch = 0;
111 int16_t *data_16 =
data;
113 for (i = 0; i < blockpos; i++) {
114 for (out_ch = 0; out_ch <= max_matrix_channel; out_ch++) {
115 int mat_ch = ch_assign[out_ch];
117 (1
U << output_shift[mat_ch]);
118 lossless_check_data ^= (sample & 0xffffff) << mat_ch;
120 *data_32++ = sample * 256
U;
122 *data_16++ = sample >> 8;
125 return lossless_check_data;
static void mlp_filter_channel(int32_t *state, const int32_t *coeff, int firorder, int iirorder, unsigned int filter_shift, int32_t mask, int blocksize, int32_t *sample_buffer)
void(* mlp_rematrix_channel)(int32_t *samples, const int32_t *coeffs, const uint8_t *bypassed_lsbs, const int8_t *noise_buffer, int index, unsigned int dest_ch, uint16_t blockpos, unsigned int maxchan, int matrix_noise_shift, int access_unit_size_pow2, int32_t mask)
ptrdiff_t const GLvoid * data
void ff_mlp_rematrix_channel(int32_t *samples, const int32_t *coeffs, const uint8_t *bypassed_lsbs, const int8_t *noise_buffer, int index, unsigned int dest_ch, uint16_t blockpos, unsigned int maxchan, int matrix_noise_shift, int access_unit_size_pow2, int32_t mask)
static int32_t(*)(int32_t, uint16_t, int32_t(*)[], void *, uint8_t *, int8_t *, uint8_t, int) mlp_select_pack_output(uint8_t *ch_assign, int8_t *output_shift, uint8_t max_matrix_channel, int is32)
Macro definitions for various function/variable attributes.
#define MAX_FIR_ORDER
The maximum number of taps in IIR and FIR filters.
int32_t ff_mlp_pack_output(int32_t lossless_check_data, uint16_t blockpos, int32_t(*sample_buffer)[MAX_CHANNELS], void *data, uint8_t *ch_assign, int8_t *output_shift, uint8_t max_matrix_channel, int is32)
static const uint16_t mask[17]
int32_t(*(* mlp_select_pack_output)(uint8_t *ch_assign, int8_t *output_shift, uint8_t max_matrix_channel, int is32))(int32_t
av_cold void ff_mlpdsp_init_arm(MLPDSPContext *c)
av_cold void ff_mlpdsp_init(MLPDSPContext *c)
void ff_mlpdsp_init_x86(MLPDSPContext *c)
static const double coeff[2][5]
void(* mlp_filter_channel)(int32_t *state, const int32_t *coeff, int firorder, int iirorder, unsigned int filter_shift, int32_t mask, int blocksize, int32_t *sample_buffer)
int32_t(* mlp_pack_output)(int32_t lossless_check_data, uint16_t blockpos, int32_t(*sample_buffer)[MAX_CHANNELS], void *data, uint8_t *ch_assign, int8_t *output_shift, uint8_t max_matrix_channel, int is32)