FFmpeg
Macros | Functions | Variables
vvc_mc.c File Reference
#include <string.h>
#include "checkasm.h"
#include "libavcodec/vvc/ctu.h"
#include "libavcodec/vvc/data.h"
#include "libavcodec/vvc/dsp.h"
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem_internal.h"

Go to the source code of this file.

Macros

#define SIZEOF_PIXEL   ((bit_depth + 7) / 8)
 
#define PIXEL_STRIDE   (MAX_CTU_SIZE * 2)
 
#define EXTRA_BEFORE   3
 
#define EXTRA_AFTER   4
 
#define SRC_EXTRA   (EXTRA_BEFORE + EXTRA_AFTER) * 2
 
#define SRC_BUF_SIZE   (PIXEL_STRIDE + SRC_EXTRA) * (PIXEL_STRIDE + SRC_EXTRA)
 
#define DST_BUF_SIZE   (MAX_CTU_SIZE * MAX_CTU_SIZE * 2)
 
#define SRC_OFFSET   ((PIXEL_STRIDE + EXTRA_BEFORE * 2) * EXTRA_BEFORE)
 
#define randomize_buffers(buf0, buf1, size, mask)
 
#define randomize_pixels(buf0, buf1, size)
 
#define randomize_avg_src(buf0, buf1, size)
 
#define randomize_prof_src(buf0, buf1, size)
 
#define AVG_SRC_BUF_SIZE   (MAX_CTU_SIZE * MAX_CTU_SIZE)
 
#define AVG_DST_BUF_SIZE   (MAX_PB_SIZE * MAX_PB_SIZE * 2)
 
#define SR_RANGE   2
 
#define BDOF_BLOCK_SIZE   16
 
#define BDOF_SRC_SIZE   (MAX_PB_SIZE* (BDOF_BLOCK_SIZE + 2))
 
#define BDOF_SRC_OFFSET   (MAX_PB_SIZE + 1)
 
#define BDOF_DST_SIZE   (BDOF_BLOCK_SIZE * BDOF_BLOCK_SIZE * 2)
 

Functions

static void check_put_vvc_luma (void)
 
static void check_put_vvc_luma_uni (void)
 
static void check_put_vvc_chroma (void)
 
static void check_put_vvc_chroma_uni (void)
 
static void check_avg (void)
 
static void check_dmvr (void)
 
static void check_bdof (void)
 
static void check_vvc_sad (void)
 
void checkasm_check_vvc_mc (void)
 

Variables

static const uint32_t pixel_mask [] = { 0xffffffff, 0x03ff03ff, 0x0fff0fff, 0x3fff3fff, 0xffffffff }
 
static const int sizes [] = { 2, 4, 8, 16, 32, 64, 128 }
 

Macro Definition Documentation

◆ SIZEOF_PIXEL

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

Definition at line 36 of file vvc_mc.c.

◆ PIXEL_STRIDE

#define PIXEL_STRIDE   (MAX_CTU_SIZE * 2)

Definition at line 37 of file vvc_mc.c.

◆ EXTRA_BEFORE

#define EXTRA_BEFORE   3

Definition at line 38 of file vvc_mc.c.

◆ EXTRA_AFTER

#define EXTRA_AFTER   4

Definition at line 39 of file vvc_mc.c.

◆ SRC_EXTRA

#define SRC_EXTRA   (EXTRA_BEFORE + EXTRA_AFTER) * 2

Definition at line 40 of file vvc_mc.c.

◆ SRC_BUF_SIZE

#define SRC_BUF_SIZE   (PIXEL_STRIDE + SRC_EXTRA) * (PIXEL_STRIDE + SRC_EXTRA)

Definition at line 41 of file vvc_mc.c.

◆ DST_BUF_SIZE

#define DST_BUF_SIZE   (MAX_CTU_SIZE * MAX_CTU_SIZE * 2)

Definition at line 42 of file vvc_mc.c.

◆ SRC_OFFSET

#define SRC_OFFSET   ((PIXEL_STRIDE + EXTRA_BEFORE * 2) * EXTRA_BEFORE)

Definition at line 43 of file vvc_mc.c.

◆ randomize_buffers

#define randomize_buffers (   buf0,
  buf1,
  size,
  mask 
)
Value:
do { \
int k; \
for (k = 0; k < size; k += 4 / sizeof(*buf0)) { \
uint32_t r = rnd() & mask; \
AV_WN32A(buf0 + k, r); \
AV_WN32A(buf1 + k, r); \
} \
} while (0)

Definition at line 45 of file vvc_mc.c.

◆ randomize_pixels

#define randomize_pixels (   buf0,
  buf1,
  size 
)
Value:
do { \
uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \
randomize_buffers(buf0, buf1, size, mask); \
} while (0)

Definition at line 55 of file vvc_mc.c.

◆ randomize_avg_src

#define randomize_avg_src (   buf0,
  buf1,
  size 
)
Value:
do { \
uint32_t mask = 0x3fff3fff; \
randomize_buffers(buf0, buf1, size, mask); \
} while (0)

Definition at line 61 of file vvc_mc.c.

◆ randomize_prof_src

#define randomize_prof_src (   buf0,
  buf1,
  size 
)
Value:
do { \
const int shift = 14 - bit_depth; \
const int mask16 = 0x3fff >> shift << shift; \
uint32_t mask = (mask16 << 16) | mask16; \
randomize_buffers(buf0, buf1, size, mask); \
} while (0)

Definition at line 67 of file vvc_mc.c.

◆ AVG_SRC_BUF_SIZE

#define AVG_SRC_BUF_SIZE   (MAX_CTU_SIZE * MAX_CTU_SIZE)

Definition at line 273 of file vvc_mc.c.

◆ AVG_DST_BUF_SIZE

#define AVG_DST_BUF_SIZE   (MAX_PB_SIZE * MAX_PB_SIZE * 2)

Definition at line 274 of file vvc_mc.c.

◆ SR_RANGE

#define SR_RANGE   2

Definition at line 335 of file vvc_mc.c.

◆ BDOF_BLOCK_SIZE

#define BDOF_BLOCK_SIZE   16

Definition at line 393 of file vvc_mc.c.

◆ BDOF_SRC_SIZE

#define BDOF_SRC_SIZE   (MAX_PB_SIZE* (BDOF_BLOCK_SIZE + 2))

Definition at line 394 of file vvc_mc.c.

◆ BDOF_SRC_OFFSET

#define BDOF_SRC_OFFSET   (MAX_PB_SIZE + 1)

Definition at line 395 of file vvc_mc.c.

◆ BDOF_DST_SIZE

#define BDOF_DST_SIZE   (BDOF_BLOCK_SIZE * BDOF_BLOCK_SIZE * 2)

Definition at line 396 of file vvc_mc.c.

Function Documentation

◆ check_put_vvc_luma()

static void check_put_vvc_luma ( void  )
static

Definition at line 75 of file vvc_mc.c.

Referenced by checkasm_check_vvc_mc().

◆ check_put_vvc_luma_uni()

static void check_put_vvc_luma_uni ( void  )
static

Definition at line 123 of file vvc_mc.c.

Referenced by checkasm_check_vvc_mc().

◆ check_put_vvc_chroma()

static void check_put_vvc_chroma ( void  )
static

Definition at line 174 of file vvc_mc.c.

Referenced by checkasm_check_vvc_mc().

◆ check_put_vvc_chroma_uni()

static void check_put_vvc_chroma_uni ( void  )
static

Definition at line 222 of file vvc_mc.c.

Referenced by checkasm_check_vvc_mc().

◆ check_avg()

static void check_avg ( void  )
static

Definition at line 276 of file vvc_mc.c.

Referenced by checkasm_check_vvc_mc().

◆ check_dmvr()

static void check_dmvr ( void  )
static

Definition at line 336 of file vvc_mc.c.

Referenced by checkasm_check_vvc_mc().

◆ check_bdof()

static void check_bdof ( void  )
static

Definition at line 397 of file vvc_mc.c.

Referenced by checkasm_check_vvc_mc().

◆ check_vvc_sad()

static void check_vvc_sad ( void  )
static

Definition at line 434 of file vvc_mc.c.

Referenced by checkasm_check_vvc_mc().

◆ checkasm_check_vvc_mc()

void checkasm_check_vvc_mc ( void  )

Definition at line 471 of file vvc_mc.c.

Variable Documentation

◆ pixel_mask

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

Definition at line 33 of file vvc_mc.c.

◆ sizes

const int sizes[] = { 2, 4, 8, 16, 32, 64, 128 }
static

Definition at line 34 of file vvc_mc.c.

r
const char * r
Definition: vf_curves.c:127
mask
int mask
Definition: mediacodecdec_common.c:154
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:172
pixel_mask
static const uint32_t pixel_mask[]
Definition: vvc_mc.c:33
shift
static int shift(int a, int b)
Definition: bonk.c:261
size
int size
Definition: twinvq_data.h:10344