FFmpeg
Macros | Functions | Variables
hevc_sao.c File Reference
#include <string.h>
#include "libavutil/intreadwrite.h"
#include "libavutil/mem_internal.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/hevcdsp.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 35 of file hevc_sao.c.

◆ PIXEL_STRIDE

#define PIXEL_STRIDE   (2*MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE)

Definition at line 36 of file hevc_sao.c.

◆ BUF_SIZE

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

Definition at line 37 of file hevc_sao.c.

◆ OFFSET_THRESH

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

Definition at line 38 of file hevc_sao.c.

◆ OFFSET_LENGTH

#define OFFSET_LENGTH   5

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

Function Documentation

◆ check_sao_band()

static void check_sao_band ( HEVCDSPContext  h,
int  bit_depth 
)
static

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

Referenced by checkasm_check_hevc_sao().

◆ checkasm_check_hevc_sao()

void checkasm_check_hevc_sao ( void  )

Definition at line 132 of file hevc_sao.c.

Variable Documentation

◆ pixel_mask

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

Definition at line 32 of file hevc_sao.c.

◆ sao_size

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

Definition at line 33 of file hevc_sao.c.

Referenced by check_sao_band(), and check_sao_edge().

bit_depth
static void bit_depth(AudioStatsContext *s, uint64_t mask, uint64_t imask, AVRational *depth)
Definition: af_astats.c:226
r
const char * r
Definition: vf_curves.c:116
rnd
#define rnd()
Definition: checkasm.h:111
mask
static const uint16_t mask[17]
Definition: lzw.c:38
OFFSET_THRESH
#define OFFSET_THRESH
Definition: hevc_sao.c:38
size
int size
Definition: twinvq_data.h:10344
pixel_mask
static const uint32_t pixel_mask[3]
Definition: hevc_sao.c:32