FFmpeg
Macros | Functions | Variables
hevc_deblock.c File Reference
#include <string.h>
#include "libavutil/intreadwrite.h"
#include "libavutil/macros.h"
#include "libavutil/mem_internal.h"
#include "libavcodec/hevc/dsp.h"
#include "checkasm.h"

Go to the source code of this file.

Macros

#define SIZEOF_PIXEL   ((bit_depth + 7) / 8)
 
#define BUF_STRIDE   (16 * 2)
 
#define BUF_LINES   (16)
 
#define BUF_OFFSET   (2 * BUF_STRIDE * BUF_LINES)
 
#define BUF_SIZE   (2 * BUF_STRIDE * BUF_LINES + BUF_OFFSET * 2)
 
#define randomize_buffers(buf0, buf1, size)
 
#define P3   buf[-4 * xstride]
 
#define P2   buf[-3 * xstride]
 
#define P1   buf[-2 * xstride]
 
#define P0   buf[-1 * xstride]
 
#define Q0   buf[0 * xstride]
 
#define Q1   buf[1 * xstride]
 
#define Q2   buf[2 * xstride]
 
#define Q3   buf[3 * xstride]
 
#define TC25(x)   ((tc[x] * 5 + 1) >> 1)
 
#define MASK(x)   (uint16_t)(x & ((1 << (bit_depth)) - 1))
 
#define GET(x)   ((SIZEOF_PIXEL == 1) ? *(uint8_t*)(&x) : *(uint16_t*)(&x))
 
#define SET(x, y)
 
#define RANDCLIP(x, diff)
 

Functions

static void check_deblock_chroma (HEVCDSPContext *h, int bit_depth, int c)
 
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 void check_deblock_luma (HEVCDSPContext *h, int bit_depth, int c)
 
void checkasm_check_hevc_deblock (void)
 

Variables

static const uint32_t pixel_mask [3] = { 0xffffffff, 0x03ff03ff, 0x0fff0fff }
 

Macro Definition Documentation

◆ SIZEOF_PIXEL

#define SIZEOF_PIXEL   ((bit_depth + 7) / 8)

Definition at line 31 of file hevc_deblock.c.

◆ BUF_STRIDE

#define BUF_STRIDE   (16 * 2)

Definition at line 32 of file hevc_deblock.c.

◆ BUF_LINES

#define BUF_LINES   (16)

Definition at line 33 of file hevc_deblock.c.

◆ BUF_OFFSET

#define BUF_OFFSET   (2 * BUF_STRIDE * BUF_LINES)

Definition at line 35 of file hevc_deblock.c.

◆ BUF_SIZE

#define BUF_SIZE   (2 * BUF_STRIDE * BUF_LINES + BUF_OFFSET * 2)

Definition at line 36 of file hevc_deblock.c.

◆ randomize_buffers

#define randomize_buffers (   buf0,
  buf1,
  size 
)
Value:
do { \
uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \
int k; \
for (k = 0; k < size; k += 4) { \
uint32_t r = rnd() & mask; \
AV_WN32A(buf0 + k, r); \
AV_WN32A(buf1 + k, r); \
} \
} while (0)

Definition at line 38 of file hevc_deblock.c.

◆ P3

#define P3   buf[-4 * xstride]

Definition at line 88 of file hevc_deblock.c.

◆ P2

#define P2   buf[-3 * xstride]

Definition at line 89 of file hevc_deblock.c.

◆ P1

#define P1   buf[-2 * xstride]

Definition at line 90 of file hevc_deblock.c.

◆ P0

#define P0   buf[-1 * xstride]

Definition at line 91 of file hevc_deblock.c.

◆ Q0

#define Q0   buf[0 * xstride]

Definition at line 92 of file hevc_deblock.c.

◆ Q1

#define Q1   buf[1 * xstride]

Definition at line 93 of file hevc_deblock.c.

◆ Q2

#define Q2   buf[2 * xstride]

Definition at line 94 of file hevc_deblock.c.

◆ Q3

#define Q3   buf[3 * xstride]

Definition at line 95 of file hevc_deblock.c.

◆ TC25

#define TC25 (   x)    ((tc[x] * 5 + 1) >> 1)

Definition at line 97 of file hevc_deblock.c.

◆ MASK

#define MASK (   x)    (uint16_t)(x & ((1 << (bit_depth)) - 1))

Definition at line 98 of file hevc_deblock.c.

◆ GET

#define GET (   x)    ((SIZEOF_PIXEL == 1) ? *(uint8_t*)(&x) : *(uint16_t*)(&x))

Definition at line 99 of file hevc_deblock.c.

◆ SET

#define SET (   x,
 
)
Value:
do { \
uint16_t z = MASK(y); \
if (SIZEOF_PIXEL == 1) \
*(uint8_t*)(&x) = z; \
else \
*(uint16_t*)(&x) = z; \
} while (0)

Definition at line 100 of file hevc_deblock.c.

◆ RANDCLIP

#define RANDCLIP (   x,
  diff 
)
Value:
av_clip(GET(x) - (diff), 0, \
(1 << (bit_depth)) - 1) + rnd() % FFMAX(2 * (diff), 1)

Definition at line 107 of file hevc_deblock.c.

Function Documentation

◆ check_deblock_chroma()

static void check_deblock_chroma ( HEVCDSPContext h,
int  bit_depth,
int  c 
)
static

Definition at line 49 of file hevc_deblock.c.

Referenced by checkasm_check_hevc_deblock().

◆ randomize_luma_buffers()

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

Definition at line 118 of file hevc_deblock.c.

Referenced by check_deblock_luma().

◆ check_deblock_luma()

static void check_deblock_luma ( HEVCDSPContext h,
int  bit_depth,
int  c 
)
static

Definition at line 217 of file hevc_deblock.c.

Referenced by checkasm_check_hevc_deblock().

◆ checkasm_check_hevc_deblock()

void checkasm_check_hevc_deblock ( void  )

Definition at line 264 of file hevc_deblock.c.

Variable Documentation

◆ pixel_mask

const uint32_t pixel_mask[3] = { 0xffffffff, 0x03ff03ff, 0x0fff0fff }
static

Definition at line 29 of file hevc_deblock.c.

SIZEOF_PIXEL
#define SIZEOF_PIXEL
Definition: hevc_deblock.c:31
av_clip
#define av_clip
Definition: common.h:100
r
const char * r
Definition: vf_curves.c:127
mask
int mask
Definition: mediacodecdec_common.c:154
FFMAX
#define FFMAX(a, b)
Definition: macros.h:47
bit_depth
static void bit_depth(AudioStatsContext *s, const uint64_t *const mask, uint8_t *depth)
Definition: af_astats.c:246
rnd
#define rnd()
Definition: checkasm.h:177
size
int size
Definition: twinvq_data.h:10344
diff
static av_always_inline int diff(const struct color_info *a, const struct color_info *b, const int trans_thresh)
Definition: vf_paletteuse.c:166
MASK
#define MASK(x)
Definition: hevc_deblock.c:98
pixel_mask
static const uint32_t pixel_mask[3]
Definition: hevc_deblock.c:29
GET
#define GET(x)
Definition: hevc_deblock.c:99