33static const uint32_t
pixel_mask[3] = { 0xffffffff, 0x03ff03ff, 0x0fff0fff };
34#define SIZEOF_PIXEL ((bit_depth + 7) / 8)
36#define randomize_buffers() \
38 uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \
40 for (k = -4; k < SIZEOF_PIXEL * FFMAX(8, size); k += 4) { \
41 uint32_t r = rnd() & mask; \
44 for (k = 0; k < size * SIZEOF_PIXEL; k += 4) { \
45 uint32_t r = rnd() & mask; \
53 uint8_t *
a = &a_buf[32 * 2];
60 const uint8_t *
left,
const uint8_t *top);
81 for (tx = 0; tx < 4; tx++) {
100#undef randomize_buffers
102#define randomize_buffers() \
104 uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \
105 for (y = 0; y < sz; y++) { \
106 for (x = 0; x < sz * SIZEOF_PIXEL; x += 4) { \
107 uint32_t r = rnd() & mask; \
108 AV_WN32A(dst + y * sz * SIZEOF_PIXEL + x, r); \
109 AV_WN32A(src + y * sz * SIZEOF_PIXEL + x, rnd() & mask); \
111 for (x = 0; x < sz; x++) { \
112 if (bit_depth == 8) { \
113 coef[y * sz + x] = src[y * sz + x] - dst[y * sz + x]; \
115 ((int32_t *) coef)[y * sz + x] = \
116 ((uint16_t *) src)[y * sz + x] - \
117 ((uint16_t *) dst)[y * sz + x]; \
126 double t0 = in[0] + in[1];
127 double t3 = in[3] - in[2];
128 double t4 =
trunc((t0 - t3) * 0.5);
129 double t1 = t4 - in[1];
130 double t2 = t4 - in[2];
143 for (k = 0; k < sz; k++) {
145 for (n = 0; n < sz; n++)
146 out[k] += in[n] * cos(
M_PI * (2 * n + 1) * k / (sz * 2.0));
158 for (k = 0; k < sz; k++) {
160 for (n = 0; n < sz; n++)
161 out[k] += in[n] * sin(
M_PI * (n + 1) * (2 * k + 1) / (sz * 2.0 + 1.0));
172 for (k = 0; k < sz; k++) {
174 for (n = 0; n < sz; n++)
175 out[k] += in[n] * sin(
M_PI * (2 * n + 1) * (2 * k + 1) / (sz * 4.0));
183 static const double scaling_factors[5][4] = {
185 { 2.0, 2.0, 2.0, 2.0 },
186 { 1.0, 1.0, 1.0, 1.0 },
190 static const ftx1d_fn ftx1d_tbl[5][4][2] = {
213 double scaling_factor = scaling_factors[tx][txtp];
217 for (
i = 0;
i < sz; ++
i) {
220 ftx1d_tbl[tx][txtp][0](temp_out, &in[
i * sz], sz);
222 for (j = 0; j < sz; ++j)
223 temp[j * sz +
i] = temp_out[j] * scaling_factor;
227 for (
i = 0;
i < sz;
i++)
228 ftx1d_tbl[tx][txtp][1](&
out[
i * sz], &
temp[
i * sz], sz);
234 double ind[1024], outd[1024];
238 for (n = 0; n < sz * sz; n++) {
244 ftx_2d(outd, ind, tx, txtp, sz);
245 for (n = 0; n < sz * sz; n++) {
247 buf[n] =
lrint(outd[n]);
267 for (n = 0; n < sz * sz; n++) {
268 int rc = scan[n], rcx = rc % sz, rcy = rc / sz;
271 if (rcx >= sub || rcy >= sub)
284 for (; n < sz * sz; n++) {
302 for (n = 0; n < sz /
sizeof(int16_t); n += 2)
309#define SIZEOF_COEF (2 * ((bit_depth + 7) / 8))
332 int sz = 4 << (tx & 3);
335 for (txtp = 0; txtp < n_txtps; txtp++) {
341 for (sub = (txtp == 0 && tx < 4) ? 1 : sz; sub <= sz;
342 sub < 4 ? (sub <<= 1) : (sub += 4)) {
344 "vp9_inv_%s_%dx%d_sub%d_add_%d",
345 tx == 4 ?
"wht_wht" : txtp_types[txtp],
379#undef randomize_buffers
381#define setpx(a,b,c) \
383 if (SIZEOF_PIXEL == 1) { \
384 buf0[(a) + (b) * jstride] = av_clip_uint8(c); \
386 ((uint16_t *)buf0)[(a) + (b) * jstride] = av_clip_uintp2(c, bit_depth); \
391#define setdx(a,b,c,d) setpx(a,b,c-(d)+(rnd()%((d)*2+1)))
392#define setsx(a,b,c,d) setdx(a,b,c,(d) << (bit_depth - 8))
395 const int *
F,
const int *
H,
const int *I,
396 uint8_t *buf0, uint8_t *buf1)
399 int off = dir ? lineoff : lineoff * 16;
400 int istride = dir ? 1 : 16;
401 int jstride = dir ? str : 1;
403 for (
i = 0;
i < 2;
i++) {
404 int idx = off +
i * istride, p0,
q0;
406 setsx(idx, -1, p0 =
q0,
E[bidx] >> 2);
407 for (j = 1; j < 8; j++) {
408 setsx(idx, -1 - j, p0,
F[bidx]);
412 for (
i = 2;
i < 4;
i++) {
413 int idx = off +
i * istride, p0,
q0;
415 setsx(idx, -1, p0 =
q0,
E[bidx] >> 2);
416 for (j = 1; j < 4; j++) {
417 setsx(idx, -1 - j, p0,
F[bidx]);
420 for (j = 4; j < 8; j++) {
425 for (
i = 4;
i < 6;
i++) {
426 int idx = off +
i * istride, p2, p1, p0,
q0,
q1, q2;
429 setsx(idx, 2, q2 =
q1, I[bidx]);
430 setsx(idx, 3, q2, I[bidx]);
431 setsx(idx, -1, p0 =
q0,
E[bidx] >> 2);
432 setsx(idx, -2, p1 = p0, I[bidx]);
433 setsx(idx, -3, p2 = p1, I[bidx]);
434 setsx(idx, -4, p2, I[bidx]);
435 for (j = 4; j < 8; j++) {
440 for (
i = 6;
i < 8;
i++) {
441 int idx = off +
i * istride;
442 for (j = 0; j < 8; j++) {
448#define randomize_buffers(bidx, lineoff, str) \
449 randomize_loopfilter_buffers(bidx, lineoff, str, bit_depth, dir, \
450 E, F, H, I, buf0, buf1)
458 static const char *
const dir_name[2] = {
"h",
"v" };
459 static const int E[2] = { 20, 28 }, I[2] = { 10, 16 };
460 static const int H[2] = { 7, 11 },
F[2] = { 1, 1 };
466 for (dir = 0; dir < 2; dir++) {
469 uint8_t *buf0 = base0 + midoff_aligned;
470 uint8_t *buf1 = base1 + midoff_aligned;
472 for (wd = 0; wd < 3; wd++) {
475 "vp9_loop_filter_%s_%d_8_%dbpp",
478 memcpy(buf1 - midoff, buf0 - midoff,
482 if (memcmp(buf0 - midoff, buf1 - midoff, 16 * 8 *
SIZEOF_PIXEL))
491 buf0 = base0 + midoff_aligned;
492 buf1 = base1 + midoff_aligned;
496 "vp9_loop_filter_%s_16_16_%dbpp",
500 memcpy(buf1 - midoff, buf0 - midoff, 16 * 16 *
SIZEOF_PIXEL);
503 if (memcmp(buf0 - midoff, buf1 - midoff, 16 * 16 *
SIZEOF_PIXEL))
508 for (wd = 0; wd < 2; wd++) {
509 for (wd2 = 0; wd2 < 2; wd2++) {
512 "vp9_loop_filter_mix2_%s_%d%d_16_%dbpp",
513 dir_name[dir], 4 << wd, 4 << wd2,
bit_depth)) {
516 memcpy(buf1 - midoff, buf0 - midoff, 16 * 16 *
SIZEOF_PIXEL);
517#define M(a) (((a)[1] << 8) | (a)[0])
520 if (memcmp(buf0 - midoff, buf1 - midoff, 16 * 16 *
SIZEOF_PIXEL))
535#undef randomize_buffers
537#define DST_BUF_SIZE (size * size * SIZEOF_PIXEL)
538#define SRC_BUF_STRIDE 72
539#define SRC_BUF_SIZE ((size + 7) * SRC_BUF_STRIDE * SIZEOF_PIXEL)
540#define src (buf + 3 * SIZEOF_PIXEL * (SRC_BUF_STRIDE + 1))
542#define randomize_buffers() \
544 uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \
546 for (k = 0; k < SRC_BUF_SIZE; k += 4) { \
547 uint32_t r = rnd() & mask; \
548 AV_WN32A(buf + k, r); \
551 for (k = 0; k < DST_BUF_SIZE; k += 4) { \
552 uint32_t r = rnd() & mask; \
553 AV_WN32A(dst0 + k, r); \
554 AV_WN32A(dst1 + k, r); \
567 const uint8_t *
ref, ptrdiff_t ref_stride,
568 int h,
int mx,
int my);
569 static const char *
const filter_names[4] = {
570 "8tap_smooth",
"8tap_regular",
"8tap_sharp",
"bilin"
572 static const char *
const subpel_names[2][2] = { {
"",
"h" }, {
"v",
"hv" } };
573 static const char *
const op_names[2] = {
"put",
"avg" };
576 for (
op = 0;
op < 2;
op++) {
579 for (hsize = 0; hsize < 5; hsize++) {
580 int size = 64 >> hsize;
583 for (dx = 0; dx < 2; dx++) {
584 for (dy = 0; dy < 2; dy++) {
587 "%s_%s_%d%s", op_names[
op],
589 subpel_names[dy][dx]);
592 "%s%d", op_names[
op],
size);
596 int mx = dx ? 1 + (
rnd() % 14) : 0;
597 int my = dy ? 1 + (
rnd() % 14) : 0;
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t my
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t mx
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static void bit_depth(AudioStatsContext *s, const uint64_t *const mask, uint8_t *depth)
static int BS_FUNC left(const BSCTX *bc)
Return the number of the bits left in a buffer.
#define i(width, name, range_min, range_max)
common internal and external API header
static __device__ float trunc(float a)
#define declare_func_emms
#define VERT_PRED
Prediction types.
#define DIAG_DOWN_LEFT_PRED
#define TM_VP8_PRED
"True Motion", used instead of plane
#define DIAG_DOWN_RIGHT_PRED
static int op(uint8_t **dst, const uint8_t *dst_end, GetByteContext *gb, int pixel, int count, int *x, int width, int linesize)
Perform decode operation.
av_cold void ff_vp9dsp_init(VP9DSPContext *dsp, int bpp, int bitexact)
#define AV_CPU_FLAG_MMXEXT
SSE integer functions or AMD MMX ext.
#define AV_CPU_FLAG_MMX
standard MMX
common internal API header
static const uint16_t mask[17]
#define LOCAL_ALIGNED_32(t, v,...)
#define LOCAL_ALIGNED_64(t, v,...)
void(* itxfm_add[N_TXFM_SIZES+1][N_TXFM_TYPES])(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob)
void(* intra_pred[N_TXFM_SIZES][N_INTRA_PRED_MODES])(uint8_t *dst, ptrdiff_t stride, const uint8_t *left, const uint8_t *top)
void(* loop_filter_mix2[2][2][2])(uint8_t *dst, ptrdiff_t stride, int mb_lim, int lim, int hev_thr)
void(* loop_filter_8[3][2])(uint8_t *dst, ptrdiff_t stride, int mb_lim, int lim, int hev_thr)
void(* loop_filter_16[2])(uint8_t *dst, ptrdiff_t stride, int mb_lim, int lim, int hev_thr)
vp9_mc_func mc[5][N_FILTERS][2][2][2]
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)
static const uint32_t pixel_mask[5]
static void check_ipred(void)
#define randomize_buffers()
static void check_mc(void)
#define setsx(a, b, c, d)
static void fadst_1d(double *out, const double *in, int sz)
static void ftx(int16_t *buf, enum TxfmMode tx, enum TxfmType txtp, int sz, int bit_depth)
static void check_itxfm(void)
static void check_loopfilter(void)
static void fadst4_1d(double *out, const double *in, int sz)
static void randomize_loopfilter_buffers(int bidx, int lineoff, int str, int bit_depth, int dir, const int *E, const int *F, const int *H, const int *I, uint8_t *buf0, uint8_t *buf1)
void checkasm_check_vp9dsp(void)
static void fwht_1d(double *out, const double *in, int sz)
static int copy_subcoefs(int16_t *out, const int16_t *in, enum TxfmMode tx, enum TxfmType txtp, int sz, int sub, int bit_depth)
static void fdct_1d(double *out, const double *in, int sz)
static void ftx_2d(double *out, const double *in, enum TxfmMode tx, enum TxfmType txtp, int sz)
void(* ftx1d_fn)(double *out, const double *in, int sz)
static int is_zero(const int16_t *c, int sz)
static int ref[MAX_W *MAX_W]
static const uint8_t q1[256]
static const uint8_t q0[256]
const int16_t *const ff_vp9_scans[5][4]