Go to the documentation of this file.
29 static const uint32_t
pixel_mask[3] = { 0xffffffff, 0x03ff03ff, 0x0fff0fff };
31 #define SIZEOF_PIXEL ((bit_depth + 7) / 8)
32 #define BUF_STRIDE (16 * 2)
33 #define BUF_LINES (16)
35 #define BUF_OFFSET (2 * BUF_STRIDE * BUF_LINES)
36 #define BUF_SIZE (2 * BUF_STRIDE * BUF_LINES + BUF_OFFSET * 2)
38 #define randomize_buffers(buf0, buf1, size) \
40 uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \
42 for (k = 0; k < size; k += 4) { \
43 uint32_t r = rnd() & mask; \
44 AV_WN32A(buf0 + k, r); \
45 AV_WN32A(buf1 + k, r); \
55 uint8_t no_p[2] = {
rnd() &
c,
rnd() &
c };
56 uint8_t no_q[2] = {
rnd() &
c,
rnd() &
c };
62 if (
check_func(
c ?
h->hevc_h_loop_filter_chroma_c :
h->hevc_h_loop_filter_chroma,
63 "hevc_h_loop_filter_chroma%d%s",
bit_depth,
c ?
"_full" :
""))
74 if (
check_func(
c ?
h->hevc_v_loop_filter_chroma_c :
h->hevc_v_loop_filter_chroma,
75 "hevc_v_loop_filter_chroma%d%s",
bit_depth,
c ?
"_full" :
""))
87 #define P3 buf[-4 * xstride]
88 #define P2 buf[-3 * xstride]
89 #define P1 buf[-2 * xstride]
90 #define P0 buf[-1 * xstride]
91 #define Q0 buf[0 * xstride]
92 #define Q1 buf[1 * xstride]
93 #define Q2 buf[2 * xstride]
94 #define Q3 buf[3 * xstride]
96 #define TC25(x) ((tc[x] * 5 + 1) >> 1)
97 #define MASK(x) (uint16_t)(x & ((1 << (bit_depth)) - 1))
98 #define GET(x) ((SIZEOF_PIXEL == 1) ? *(uint8_t*)(&x) : *(uint16_t*)(&x))
99 #define SET(x, y) do { \
100 uint16_t z = MASK(y); \
101 if (SIZEOF_PIXEL == 1) \
102 *(uint8_t*)(&x) = z; \
104 *(uint16_t*)(&x) = z; \
106 #define RANDCLIP(x, diff) av_clip(GET(x) - (diff), 0, \
107 (1 << (bit_depth)) - 1) + rnd() % FFMAX(2 * (diff), 1)
118 uint8_t *buf, ptrdiff_t xstride, ptrdiff_t ystride,
int bit_depth)
120 int i, j,
b3, tc25, tc25diff, b3diff;
123 tc[0] = (
rnd() % 25) + 1;
124 tc[1] = (
rnd() % 25) + 1;
126 *beta = (
rnd() % 57) + 8;
130 for (j = 0; j < 2; j++) {
132 tc25diff =
FFMAX(tc25 - 1, 0);
134 for (
i = 0;
i < 4;
i++) {
164 for (j = 0; j < 2; j++) {
166 tc25diff =
FFMAX(tc25 - 1, 0);
168 for (
i = 0;
i < 4;
i++) {
179 (tc25diff >> 1) * (
P0 < (1 << (
bit_depth - 1))) ? 1 : -1);
206 for (
i = 0;
i < 8;
i++) {
219 const char *types[3] = {
"strong",
"weak",
"skip" };
222 uint8_t no_p[2] = {
rnd() &
c,
rnd() &
c };
223 uint8_t no_q[2] = {
rnd() &
c,
rnd() &
c };
232 for (
int j = 0; j < 3; j++) {
234 if (
check_func(
c ?
h->hevc_h_loop_filter_luma_c :
h->hevc_h_loop_filter_luma,
235 "hevc_h_loop_filter_luma%d_%s%s",
bit_depth,
type,
c ?
"_full" :
""))
247 if (
check_func(
c ?
h->hevc_v_loop_filter_luma_c :
h->hevc_v_loop_filter_luma,
248 "hevc_v_loop_filter_luma%d_%s%s",
bit_depth,
type,
c ?
"_full" :
""))
#define check_func(func,...)
static void bit_depth(AudioStatsContext *s, const uint64_t *const mask, uint8_t *depth)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
static double b3(void *priv, double x, double y)
#define randomize_buffers(buf0, buf1, size)
#define LOCAL_ALIGNED_32(t, v,...)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
static void check_deblock_luma(HEVCDSPContext *h, int bit_depth, int c)
#define i(width, name, range_min, range_max)
static void randomize_luma_buffers(int type, int *beta, int32_t tc[2], uint8_t *buf, ptrdiff_t xstride, ptrdiff_t ystride, int bit_depth)
static const uint32_t pixel_mask[3]
void ff_hevc_dsp_init(HEVCDSPContext *hevcdsp, int bit_depth)
void checkasm_check_hevc_deblock(void)
static void check_deblock_chroma(HEVCDSPContext *h, int bit_depth, int c)
#define declare_func(ret,...)
#define RANDCLIP(x, diff)