54 const int16_t *window,
unsigned int len);
56 const int16_t *window,
unsigned int len);
58 const int16_t *window,
unsigned int len);
60 const int16_t *window,
unsigned int len);
62 const int16_t *window,
unsigned int len);
64 const int16_t *window,
unsigned int len);
66 #if HAVE_SSE_INLINE && HAVE_7REGS 71 #define MIX5(mono, stereo) \ 73 "movss 0(%1), %%xmm5 \n" \ 74 "movss 8(%1), %%xmm6 \n" \ 75 "movss 24(%1), %%xmm7 \n" \ 76 "shufps $0, %%xmm5, %%xmm5 \n" \ 77 "shufps $0, %%xmm6, %%xmm6 \n" \ 78 "shufps $0, %%xmm7, %%xmm7 \n" \ 80 "movaps (%0, %2), %%xmm0 \n" \ 81 "movaps (%0, %3), %%xmm1 \n" \ 82 "movaps (%0, %4), %%xmm2 \n" \ 83 "movaps (%0, %5), %%xmm3 \n" \ 84 "movaps (%0, %6), %%xmm4 \n" \ 85 "mulps %%xmm5, %%xmm0 \n" \ 86 "mulps %%xmm6, %%xmm1 \n" \ 87 "mulps %%xmm5, %%xmm2 \n" \ 88 "mulps %%xmm7, %%xmm3 \n" \ 89 "mulps %%xmm7, %%xmm4 \n" \ 90 stereo("addps %%xmm1, %%xmm0 \n") \ 91 "addps %%xmm1, %%xmm2 \n" \ 92 "addps %%xmm3, %%xmm0 \n" \ 93 "addps %%xmm4, %%xmm2 \n" \ 94 mono("addps %%xmm2, %%xmm0 \n") \ 95 "movaps %%xmm0, (%0, %2) \n" \ 96 stereo("movaps %%xmm2, (%0, %3) \n") \ 101 "r"(samples[0] + len), \ 102 "r"(samples[1] + len), \ 103 "r"(samples[2] + len), \ 104 "r"(samples[3] + len), \ 105 "r"(samples[4] + len) \ 106 : XMM_CLOBBERS("%xmm0", "%xmm1", "%xmm2", "%xmm3", \ 107 "%xmm4", "%xmm5", "%xmm6", "%xmm7",) \ 111 #define MIX_MISC(stereo) \ 115 "mov -%c7(%6, %2, %c8), %3 \n" \ 116 "movaps (%3, %0), %%xmm0 \n" \ 117 stereo("movaps %%xmm0, %%xmm1 \n") \ 118 "mulps %%xmm4, %%xmm0 \n" \ 119 stereo("mulps %%xmm5, %%xmm1 \n") \ 121 "mov (%6, %2, %c8), %1 \n" \ 122 "movaps (%1, %0), %%xmm2 \n" \ 123 stereo("movaps %%xmm2, %%xmm3 \n") \ 124 "mulps (%4, %2, 8), %%xmm2 \n" \ 125 stereo("mulps 16(%4, %2, 8), %%xmm3 \n") \ 126 "addps %%xmm2, %%xmm0 \n" \ 127 stereo("addps %%xmm3, %%xmm1 \n") \ 131 stereo("mov (%6, %2, %c8), %1 \n") \ 132 "movaps %%xmm0, (%3, %0) \n" \ 133 stereo("movaps %%xmm1, (%1, %0) \n") \ 136 : "+&r"(i), "=&r"(j), "=&r"(k), "=&r"(m) \ 137 : "r"(matrix_simd + in_ch), \ 138 "g"((intptr_t) - 4 * (in_ch - 1)), \ 140 "i"(sizeof(float *)), "i"(sizeof(float *)/4) \ 144 static void ac3_downmix_sse(
float **samples,
float (*matrix)[2],
145 int out_ch,
int in_ch,
int len)
147 int (*matrix_cmp)[2] = (int(*)[2])matrix;
150 i = -len *
sizeof(float);
151 if (in_ch == 5 && out_ch == 2 &&
152 !(matrix_cmp[0][1] | matrix_cmp[2][0] |
153 matrix_cmp[3][1] | matrix_cmp[4][0] |
154 (matrix_cmp[1][0] ^ matrix_cmp[1][1]) |
155 (matrix_cmp[0][0] ^ matrix_cmp[2][1]))) {
157 }
else if (in_ch == 5 && out_ch == 1 &&
158 matrix_cmp[0][0] == matrix_cmp[2][0] &&
159 matrix_cmp[3][0] == matrix_cmp[4][0]) {
165 for (j = 0; j < in_ch; j++)
166 samp[j] = samples[j] + len;
168 j = 2 * in_ch *
sizeof(float);
172 "movss (%2, %0), %%xmm4 \n" 173 "movss 4(%2, %0), %%xmm5 \n" 174 "shufps $0, %%xmm4, %%xmm4 \n" 175 "shufps $0, %%xmm5, %%xmm5 \n" 176 "movaps %%xmm4, (%1, %0, 4) \n" 177 "movaps %%xmm5, 16(%1, %0, 4) \n" 180 :
"r"(matrix_simd),
"r"(matrix)
249 #if HAVE_SSE_INLINE && HAVE_7REGS #define EXTERNAL_MMX(flags)
int ff_ac3_max_msb_abs_int16_sse2(const int16_t *src, int len)
memory handling functions
int ff_ac3_max_msb_abs_int16_mmx(const int16_t *src, int len)
#define DECLARE_ALIGNED(n, t, v)
#define EXTERNAL_SSE(flags)
void ff_float_to_fixed24_3dnow(int32_t *dst, const float *src, unsigned int len)
Macro definitions for various function/variable attributes.
void(* extract_exponents)(uint8_t *exp, int32_t *coef, int nb_coefs)
void ff_float_to_fixed24_sse2(int32_t *dst, const float *src, unsigned int len)
void(* apply_window_int16)(int16_t *output, const int16_t *input, const int16_t *window, unsigned int len)
Apply symmetric window in 16-bit fixed-point.
void ff_ac3_extract_exponents_ssse3(uint8_t *exp, int32_t *coef, int nb_coefs)
void ff_ac3_rshift_int32_mmx(int32_t *src, unsigned int len, unsigned int shift)
void ff_ac3_lshift_int16_mmx(int16_t *src, unsigned int len, unsigned int shift)
void ff_ac3_lshift_int16_sse2(int16_t *src, unsigned int len, unsigned int shift)
#define AV_CPU_FLAG_ATOM
Atom processor, some SSSE3 instructions are slower.
#define EXTERNAL_SSE2_FAST(flags)
#define EXTERNAL_SSE2(flags)
void ff_ac3_exponent_min_sse2(uint8_t *exp, int num_reuse_blocks, int nb_coefs)
void ff_apply_window_int16_ssse3_atom(int16_t *output, const int16_t *input, const int16_t *window, unsigned int len)
av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact)
void ff_apply_window_int16_round_mmxext(int16_t *output, const int16_t *input, const int16_t *window, unsigned int len)
#define AC3_MAX_CHANNELS
maximum number of channels, including coupling channel
void ff_ac3_rshift_int32_sse2(int32_t *src, unsigned int len, unsigned int shift)
int(* ac3_max_msb_abs_int16)(const int16_t *src, int len)
Calculate the maximum MSB of the absolute value of each element in an array of int16_t.
void(* ac3_lshift_int16)(int16_t *src, unsigned int len, unsigned int shift)
Left-shift each value in an array of int16_t by a specified amount.
void(* ac3_rshift_int32)(int32_t *src, unsigned int len, unsigned int shift)
Right-shift each value in an array of int32_t by a specified amount.
void ff_apply_window_int16_round_sse2(int16_t *output, const int16_t *input, const int16_t *window, unsigned int len)
int ff_ac3_max_msb_abs_int16_ssse3(const int16_t *src, int len)
void ff_apply_window_int16_sse2(int16_t *output, const int16_t *input, const int16_t *window, unsigned int len)
#define INLINE_SSE(flags)
void ff_ac3_exponent_min_mmx(uint8_t *exp, int num_reuse_blocks, int nb_coefs)
void ff_ac3_exponent_min_mmxext(uint8_t *exp, int num_reuse_blocks, int nb_coefs)
void ff_apply_window_int16_mmxext(int16_t *output, const int16_t *input, const int16_t *window, unsigned int len)
void ff_apply_window_int16_ssse3(int16_t *output, const int16_t *input, const int16_t *window, unsigned int len)
void(* downmix)(float **samples, float(*matrix)[2], int out_ch, int in_ch, int len)
int ff_ac3_max_msb_abs_int16_mmxext(const int16_t *src, int len)
void ff_float_to_fixed24_sse(int32_t *dst, const float *src, unsigned int len)
#define EXTERNAL_SSSE3(flags)
int(* compute_mantissa_size)(uint16_t mant_cnt[6][16])
Calculate the number of bits needed to encode a set of mantissas.
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
void(* ac3_exponent_min)(uint8_t *exp, int num_reuse_blocks, int nb_coefs)
Set each encoded exponent in a block to the minimum of itself and the exponents in the same frequency...
#define EXTERNAL_MMXEXT(flags)
int ff_ac3_compute_mantissa_size_sse2(uint16_t mant_cnt[6][16])
void ff_ac3_extract_exponents_sse2(uint8_t *exp, int32_t *coef, int nb_coefs)
#define EXTERNAL_AMD3DNOW(flags)
Common code between the AC-3 encoder and decoder.
void(* float_to_fixed24)(int32_t *dst, const float *src, unsigned int len)
Convert an array of float in range [-1.0,1.0] to int32_t with range [-(1<<24),(1<<24)].