FFmpeg
Macros | Functions | Variables
hevc_sao.c File Reference
#include <string.h>
#include "libavutil/intreadwrite.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 PIXEL_STRIDE   (2*MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE)
 
#define BUF_SIZE   (PIXEL_STRIDE * (64+2) * 2)
 
#define OFFSET_THRESH   (1 << (bit_depth - 5))
 
#define OFFSET_LENGTH   5
 
#define randomize_buffers(buf0, buf1, size)
 
#define randomize_buffers2(buf, size)
 

Functions

static void check_sao_band (HEVCDSPContext *h, int bit_depth)
 
static void check_sao_edge (HEVCDSPContext *h, int bit_depth)
 
void checkasm_check_hevc_sao (void)
 

Variables

static const uint32_t pixel_mask [3] = { 0xffffffff, 0x03ff03ff, 0x0fff0fff }
 
static const uint32_t sao_size [5] = {8, 16, 32, 48, 64}
 

Macro Definition Documentation

◆ SIZEOF_PIXEL

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

Definition at line 33 of file hevc_sao.c.

◆ PIXEL_STRIDE

#define PIXEL_STRIDE   (2*MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE)

Definition at line 34 of file hevc_sao.c.

◆ BUF_SIZE

#define BUF_SIZE   (PIXEL_STRIDE * (64+2) * 2)

Definition at line 35 of file hevc_sao.c.

◆ OFFSET_THRESH

#define OFFSET_THRESH   (1 << (bit_depth - 5))

Definition at line 36 of file hevc_sao.c.

◆ OFFSET_LENGTH

#define OFFSET_LENGTH   5

Definition at line 37 of file hevc_sao.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 39 of file hevc_sao.c.

◆ randomize_buffers2

#define randomize_buffers2 (   buf,
  size 
)
Value:
do { \
uint32_t max_offset = OFFSET_THRESH; \
int k; \
if (bit_depth == 8) { \
for (k = 0; k < size; k++) { \
uint8_t r = rnd() % max_offset; \
buf[k] = r; \
} \
} else { \
for (k = 0; k < size; k++) { \
uint16_t r = rnd() % max_offset; \
buf[k] = r; \
} \
} \
} while (0)

Definition at line 50 of file hevc_sao.c.

Function Documentation

◆ check_sao_band()

static void check_sao_band ( HEVCDSPContext h,
int  bit_depth 
)
static

Definition at line 67 of file hevc_sao.c.

Referenced by checkasm_check_hevc_sao().

◆ check_sao_edge()

static void check_sao_edge ( HEVCDSPContext h,
int  bit_depth 
)
static

Definition at line 104 of file hevc_sao.c.

Referenced by checkasm_check_hevc_sao().

◆ checkasm_check_hevc_sao()

void checkasm_check_hevc_sao ( void  )

Definition at line 141 of file hevc_sao.c.

Variable Documentation

◆ pixel_mask

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

Definition at line 30 of file hevc_sao.c.

◆ sao_size

const uint32_t sao_size[5] = {8, 16, 32, 48, 64}
static

Definition at line 31 of file hevc_sao.c.

Referenced by check_sao_band(), and check_sao_edge().

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
OFFSET_THRESH
#define OFFSET_THRESH
Definition: hevc_sao.c:36
size
int size
Definition: twinvq_data.h:10344
pixel_mask
static const uint32_t pixel_mask[3]
Definition: hevc_sao.c:30