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 };
61 const int32_t *tc,
const uint8_t *no_p,
const uint8_t *no_q);
63 if (
check_func(
c ?
h->hevc_h_loop_filter_chroma_c :
h->hevc_h_loop_filter_chroma,
64 "hevc_h_loop_filter_chroma%d%s",
bit_depth,
c ?
"_full" :
""))
75 if (
check_func(
c ?
h->hevc_v_loop_filter_chroma_c :
h->hevc_v_loop_filter_chroma,
76 "hevc_v_loop_filter_chroma%d%s",
bit_depth,
c ?
"_full" :
""))
88 #define P3 buf[-4 * xstride]
89 #define P2 buf[-3 * xstride]
90 #define P1 buf[-2 * xstride]
91 #define P0 buf[-1 * xstride]
92 #define Q0 buf[0 * xstride]
93 #define Q1 buf[1 * xstride]
94 #define Q2 buf[2 * xstride]
95 #define Q3 buf[3 * xstride]
97 #define TC25(x) ((tc[x] * 5 + 1) >> 1)
98 #define MASK(x) (uint16_t)(x & ((1 << (bit_depth)) - 1))
99 #define GET(x) ((SIZEOF_PIXEL == 1) ? *(uint8_t*)(&x) : *(uint16_t*)(&x))
100 #define SET(x, y) do { \
101 uint16_t z = MASK(y); \
102 if (SIZEOF_PIXEL == 1) \
103 *(uint8_t*)(&x) = z; \
105 *(uint16_t*)(&x) = z; \
107 #define RANDCLIP(x, diff) av_clip(GET(x) - (diff), 0, \
108 (1 << (bit_depth)) - 1) + rnd() % FFMAX(2 * (diff), 1)
119 uint8_t *buf, ptrdiff_t xstride, ptrdiff_t ystride,
int bit_depth)
121 int i, j,
b3, tc25, tc25diff, b3diff;
124 tc[0] = (
rnd() % 25) + 1;
125 tc[1] = (
rnd() % 25) + 1;
127 *beta = (
rnd() % 57) + 8;
131 for (j = 0; j < 2; j++) {
133 tc25diff =
FFMAX(tc25 - 1, 0);
135 for (
i = 0;
i < 4;
i++) {
165 for (j = 0; j < 2; j++) {
167 tc25diff =
FFMAX(tc25 - 1, 0);
169 for (
i = 0;
i < 4;
i++) {
180 (tc25diff >> 1) * (
P0 < (1 << (
bit_depth - 1))) ? 1 : -1);
207 for (
i = 0;
i < 8;
i++) {
220 const char *types[3] = {
"strong",
"weak",
"skip" };
223 uint8_t no_p[2] = {
rnd() &
c,
rnd() &
c };
224 uint8_t no_q[2] = {
rnd() &
c,
rnd() &
c };
231 const int32_t *tc,
const uint8_t *no_p,
const uint8_t *no_q);
234 for (
int j = 0; j < 3; j++) {
236 if (
check_func(
c ?
h->hevc_h_loop_filter_luma_c :
h->hevc_h_loop_filter_luma,
237 "hevc_h_loop_filter_luma%d_%s%s",
bit_depth,
type,
c ?
"_full" :
""))
249 if (
check_func(
c ?
h->hevc_v_loop_filter_luma_c :
h->hevc_v_loop_filter_luma,
250 "hevc_v_loop_filter_luma%d_%s%s",
bit_depth,
type,
c ?
"_full" :
""))
void ff_hevc_dsp_init(HEVCDSPContext *hevcdsp, int bit_depth)
#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 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)