33#define randomize_buffers() \
36 for (i = 0; i < BUF_SIZE; i += 4) { \
37 for (j = 0; j < channels; j++) { \
38 uint32_t r = rnd() & (1 << (bits - 2)) - 1; \
39 AV_WN32A(ref_src[j] + i, r); \
40 AV_WN32A(new_src[j] + i, r); \
45static void check_decorrelate(uint8_t **ref_dst, uint8_t **ref_src, uint8_t **new_dst, uint8_t **new_src,
60 int qlevel =
rnd() % 16;
61 int coeff_prec = (
rnd() % 15) + 1;
72 for (
int i = 0;
i < 32;
i++)
77 const int test_lens[] = {
86 int len = test_lens[k];
101 int qlevel =
rnd() % 16;
102 int coeff_prec = (
rnd() % 15) + 1;
111 for (
int i = 0;
i < 32;
i++)
119 const int test_lens[] = {
128 int len = test_lens[k];
133 call_ref(dst0, residuals, coeffs, pred_order, qlevel,
len);
134 call_new(dst1, residuals, coeffs, pred_order, qlevel,
len);
143 int wasted =
rnd() % 32;
164 int wasted =
rnd() % 33;
172 residuals[
i] =
rnd();
191 static const char *
const names[3] = {
"ls",
"rs",
"ms" };
192 static const struct {
199 static const signed char pred_orders[] = { 13, 16, 29, 32 };
203 for (
i = 0;
i < 2;
i++) {
205 for (j = 0; j < 3; j++)
206 if (
check_func(
h.decorrelate[j + 1],
"flac_decorrelate_%s_%d", names[j], fmts[
i].bits))
210 if (
check_func(
h.decorrelate[0],
"flac_decorrelate_indep%d_%d", j, fmts[
i].bits))
218 if (
check_func(
h.lpc16,
"flac_lpc_16_%d", pred_orders[
i]))
221 if (
check_func(
h.lpc32,
"flac_lpc_32_%d", pred_orders[
i]))
224 if (
check_func(
h.lpc33,
"flac_lpc_33_%d", pred_orders[
i]))
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
#define i(width, name, range_min, range_max)
common internal and external API header
static const uint8_t bits[8]
AVSampleFormat
Audio sample formats.
@ AV_SAMPLE_FMT_S32
signed 32 bits
@ AV_SAMPLE_FMT_S16
signed 16 bits
static int shift(int a, int b)
av_cold void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt, int channels)
common internal API header
static av_const int sign_extend(int val, unsigned bits)
static av_const int64_t sign_extend64(int64_t val, unsigned bits)
#define LOCAL_ALIGNED_16(t, v,...)
#define FF_ARRAY_ELEMS(a)
#define randomize_buffers()
void checkasm_check_flacdsp(void)
static void check_lpc(int pred_order, int bps)
static void check_lpc33(int pred_order)
static void check_decorrelate(uint8_t **ref_dst, uint8_t **ref_src, uint8_t **new_dst, uint8_t **new_src, int channels, int bits)
static void check_wasted33(void)
static void check_wasted32(void)