26static const uint32_t
pixel_mask[3] = { 0xffffffff, 0x03ff03ff, 0x0fff0fff };
29#define SIZEOF_PIXEL ((bit_depth + 7) / 8)
30#define PIXEL_STRIDE (MAX_TB_SIZE * 2)
31#define BUF_SIZE (2 * PIXEL_STRIDE * 64)
33#define REF_BYTES FFALIGN(2 * (6 * MAX_TB_SIZE + 5), 4)
34#define REF_OFFSET (MAX_TB_SIZE + 3)
36#define randomize_buffers() \
38 uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \
39 for (int i = 0; i < BUF_SIZE; i += 4) { \
40 uint32_t r = rnd() & mask; \
41 AV_WN32A(buf0 + i, r); \
42 AV_WN32A(buf1 + i, r); \
45 for (int i = -(REF_OFFSET * SIZEOF_PIXEL); \
46 i < REF_BYTES - REF_OFFSET * SIZEOF_PIXEL; i += 4) { \
47 AV_WN32A(top + i, rnd() & mask); \
48 AV_WN32A(left + i, rnd() & mask); \
58 const int intra_hor_ver_dist_thres[] = {24, 14, 2, 0, 0};
60 return min_dist_ver_hor > intra_hor_ver_dist_thres[ntbs - 2];
64 uint8_t *buf0, uint8_t *buf1,
68 const uint8_t *
left,
const int w,
const int h,
const ptrdiff_t
stride);
71 for (
int log2_w = 2; log2_w <= 6; log2_w++) {
72 for (
int log2_h = 2; log2_h <= 6; log2_h++) {
77 if (
check_func(
c->intra.pred_dc,
"vvc_pred_dc_%dx%d_%d",
94 uint8_t *buf0, uint8_t *buf1,
98 const uint8_t *
left,
const int w,
const int h,
const ptrdiff_t
stride);
102 for (
int log2_w = 2; log2_w <= 6; log2_w++) {
103 for (
int log2_h = 0; log2_h <= 6; log2_h++) {
108 if (
check_func(
c->intra.pred_planar,
"vvc_pred_planar_%dx%d_%d",
125 uint8_t *buf0, uint8_t *buf1,
129 const int w,
const int h,
const ptrdiff_t
stride);
132 for (
int log2_w = 2; log2_w <= 6; log2_w++) {
133 for (
int log2_h = 2; log2_h <= 6; log2_h++) {
138 if (
check_func(
c->intra.pred_v,
"vvc_pred_v_%dx%d_%d",
149 if (
check_func(
c->intra.pred_h,
"vvc_pred_h_%dx%d_%d",
166 uint8_t *buf0, uint8_t *buf1,
170 const uint8_t *
left,
const int w,
const int h,
171 const ptrdiff_t
stride,
int mode_id,
int is_transposed);
174 for (
int log2_w = 2; log2_w <= 6; log2_w++) {
175 for (
int log2_h = 2; log2_h <= 6; log2_h++) {
181 for (
int mode_id = 0; mode_id <
mip_modes[size_id]; mode_id++) {
182 if (
check_func(
c->intra.pred_mip,
"vvc_pred_mip_%dx%d_mode%d_%d",
208 uint8_t *buf0, uint8_t *buf1,
215 const int w,
const int h,
const ptrdiff_t
stride,
const int c_idx,
216 const int mode,
const int ref_idx,
const int filter_flag,
217 const int need_pdpc);
220 for (
int log2_w = 2; log2_w <= 6; log2_w++) {
221 for (
int log2_h = 2; log2_h <= 6; log2_h++) {
232 const char *mode_category;
235 mode_category =
"Hdiag";
237 mode_category =
"Hpos";
239 mode_category =
"Hneg";
241 mode_category =
"Diag";
243 mode_category =
"Vneg";
245 mode_category =
"Vpos";
247 mode_category =
"Vdiag";
249 for (
int ref_idx = 0; ref_idx <= 2; ref_idx++) {
250 if (
check_func(dir ?
c->intra.pred_angular_v :
c->intra.pred_angular_h,
"vvc_pred_angular_%c_%dx%d_%s_mode%d_ref%d_%d",
256 call_ref(buf0, top,
left,
w,
h,
stride, 0,
mode, ref_idx, filter_flag, need_pdpc);
257 call_new(buf1, top,
left,
w,
h,
stride, 0,
mode, ref_idx, filter_flag, need_pdpc);
261 if (
mode == bench_modes[
i] &&
w ==
h && ref_idx == 0)
262 bench_new(buf1, top,
left,
w,
h,
stride, 0,
mode, ref_idx, filter_flag, need_pdpc);
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)
int ff_vvc_need_pdpc(int w, int h, uint8_t bdpcm_flag, int mode, int ref_idx)
int ff_vvc_ref_filter_flag_derive(int mode)
int ff_vvc_get_mip_size_id(int w, int h)
#define LOCAL_ALIGNED_32(t, v,...)
#define FF_ARRAY_ELEMS(a)
static const uint32_t pixel_mask[5]
static int ref[MAX_W *MAX_W]
void ff_vvc_dsp_init(VVCDSPContext *vvcdsp, int bit_depth)
static void check_pred_vh(VVCDSPContext *c, uint8_t *buf0, uint8_t *buf1, uint8_t *top, uint8_t *left, int bit_depth)
#define randomize_buffers()
static const int mip_modes[]
static void check_pred_planar(VVCDSPContext *c, uint8_t *buf0, uint8_t *buf1, uint8_t *top, uint8_t *left, int bit_depth)
static void check_pred_mip(VVCDSPContext *c, uint8_t *buf0, uint8_t *buf1, uint8_t *top, uint8_t *left, int bit_depth)
static void check_pred_dc(VVCDSPContext *c, uint8_t *buf0, uint8_t *buf1, uint8_t *top, uint8_t *left, int bit_depth)
static void check_pred_angular(VVCDSPContext *c, uint8_t *buf0, uint8_t *buf1, uint8_t *top, uint8_t *left, int bit_depth)
void checkasm_check_vvc_pred(void)
static int derive_filter_flag(const int mode, const int ref_idx, const int w, const int h)