Libav
Macros | Functions | Variables
hevc_mc.c File Reference
#include <string.h>
#include "checkasm.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/hevcdsp.h"
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"

Go to the source code of this file.

Macros

#define BUF_SIZE   (FFALIGN(64 + 7, 16) * (64 + 7) * 2)
 
#define PIXEL_SIZE(depth)   ((depth + 7) / 8)
 
#define randomize_buffers(buf, size, depth)
 
#define UNWEIGHTED_PRED(dst0, dst1, src0, width, bit_depth)
 
#define UNWEIGHTED_PRED_AVG(dst0, dst1, src0, src1, width, bit_depth)
 
#define WEIGHTED_PRED(dst0, dst1, src0, width, bit_depth)
 
#define WEIGHTED_PRED_AVG(dst0, dst1, src0, src1, width, bit_depth)
 

Functions

static void check_unweighted_pred (HEVCDSPContext *h, uint8_t *dst0, uint8_t *dst1, int16_t *src0, int16_t *src1, int bit_depth)
 
static void check_weighted_pred (HEVCDSPContext *h, uint8_t *dst0, uint8_t *dst1, int16_t *src0, int16_t *src1, int bit_depth)
 
static void check_epel (HEVCDSPContext *h, int16_t *dst0, int16_t *dst1, uint8_t *src, int16_t *mcbuffer, int bit_depth)
 
static void check_qpel (HEVCDSPContext *h, int16_t *dst0, int16_t *dst1, uint8_t *src, int16_t *mcbuffer, int bit_depth)
 
void checkasm_check_hevc_mc (void)
 

Variables

static const uint32_t pixel_mask [3] = { 0xffffffff, 0x01ff01ff, 0x03ff03ff }
 
static const int pred_heights [][7]
 
static const int pred_widths [] = { 4, 8, 12, 16, 24, 32, 48, 64 }
 
static const char * interp_names [2][2] = { { "pixels", "h" }, { "v", "hv" } }
 

Macro Definition Documentation

◆ BUF_SIZE

#define BUF_SIZE   (FFALIGN(64 + 7, 16) * (64 + 7) * 2)

◆ PIXEL_SIZE

#define PIXEL_SIZE (   depth)    ((depth + 7) / 8)

Definition at line 34 of file hevc_mc.c.

Referenced by check_epel(), check_qpel(), check_unweighted_pred(), and check_weighted_pred().

◆ randomize_buffers

#define randomize_buffers (   buf,
  size,
  depth 
)
Value:
do { \
uint32_t mask = pixel_mask[depth - 8]; \
int i; \
for (i = 0; i < size; i += 4) { \
uint32_t r = rnd() & mask; \
AV_WN32A(buf + i, r); \
} \
} while (0)
int size
#define r
Definition: input.c:51
static const uint16_t mask[17]
Definition: lzw.c:38
static const uint32_t pixel_mask[3]
Definition: hevc_mc.c:46
#define rnd()
Definition: checkasm.h:65

Definition at line 36 of file hevc_mc.c.

Referenced by check_epel(), check_qpel(), check_unweighted_pred(), and check_weighted_pred().

◆ UNWEIGHTED_PRED

#define UNWEIGHTED_PRED (   dst0,
  dst1,
  src0,
  width,
  bit_depth 
)
Value:
do { \
int i; \
for (i = 0; i < FF_ARRAY_ELEMS(pred_heights[i]); i++) { \
int height = pred_heights[width][i]; \
if (!height) \
break; \
call_ref(dst0, dststride, src0, srcstride, height); \
call_new(dst1, dststride, src0, srcstride, height); \
if (memcmp(dst0, dst1, dststride * height)) \
fail(); \
bench_new(dst1, dststride, src0, srcstride, height); \
} \
} while (0)
#define FF_ARRAY_ELEMS(a)
static const int pred_heights[][7]
Definition: hevc_mc.c:48
static int width
Definition: utils.c:156
#define src0
Definition: h264pred.c:138
int height
Definition: gxfenc.c:72

Definition at line 65 of file hevc_mc.c.

Referenced by check_unweighted_pred().

◆ UNWEIGHTED_PRED_AVG

#define UNWEIGHTED_PRED_AVG (   dst0,
  dst1,
  src0,
  src1,
  width,
  bit_depth 
)
Value:
do { \
int i; \
for (i = 0; i < FF_ARRAY_ELEMS(pred_heights[i]); i++) { \
int height = pred_heights[width][i]; \
if (!height) \
break; \
call_ref(dst0, dststride, src0, src1, srcstride, height); \
call_new(dst1, dststride, src0, src1, srcstride, height); \
if (memcmp(dst0, dst1, dststride * height)) \
fail(); \
bench_new(dst1, dststride, src0, src1, srcstride, height); \
} \
} while (0)
#define FF_ARRAY_ELEMS(a)
static const int pred_heights[][7]
Definition: hevc_mc.c:48
static int width
Definition: utils.c:156
#define src1
Definition: h264pred.c:139
#define src0
Definition: h264pred.c:138
int height
Definition: gxfenc.c:72

Definition at line 80 of file hevc_mc.c.

Referenced by check_unweighted_pred().

◆ WEIGHTED_PRED

#define WEIGHTED_PRED (   dst0,
  dst1,
  src0,
  width,
  bit_depth 
)
Value:
do { \
int i; \
for (i = 0; i < FF_ARRAY_ELEMS(pred_heights[i]); i++) { \
int height = pred_heights[width][i]; \
if (!height) \
break; \
call_ref(denom, weight0, offset0, dst0, dststride, src0, srcstride, height); \
call_new(denom, weight0, offset0, dst1, dststride, src0, srcstride, height); \
if (memcmp(dst0, dst1, dststride * height)) \
fail(); \
bench_new(denom, weight0, offset0, dst1, dststride, src0, srcstride, height); \
} \
} while (0)
#define FF_ARRAY_ELEMS(a)
static const int pred_heights[][7]
Definition: hevc_mc.c:48
static int width
Definition: utils.c:156
#define src0
Definition: h264pred.c:138
int height
Definition: gxfenc.c:72

Definition at line 129 of file hevc_mc.c.

Referenced by check_weighted_pred().

◆ WEIGHTED_PRED_AVG

#define WEIGHTED_PRED_AVG (   dst0,
  dst1,
  src0,
  src1,
  width,
  bit_depth 
)
Value:
do { \
int i; \
for (i = 0; i < FF_ARRAY_ELEMS(pred_heights[i]); i++) { \
int height = pred_heights[width][i]; \
if (!height) \
break; \
call_ref(denom, weight0, weight1, offset0, offset1, dst0, dststride, src0, src1, srcstride, height); \
call_new(denom, weight0, weight1, offset0, offset1, dst1, dststride, src0, src1, srcstride, height); \
if (memcmp(dst0, dst1, dststride * height)) \
fail(); \
bench_new(denom, weight0, weight1, offset0, offset1, dst1, dststride, src0, src1, srcstride, height); \
} \
} while (0)
#define FF_ARRAY_ELEMS(a)
static const int pred_heights[][7]
Definition: hevc_mc.c:48
static int width
Definition: utils.c:156
#define src1
Definition: h264pred.c:139
#define src0
Definition: h264pred.c:138
int height
Definition: gxfenc.c:72

Definition at line 144 of file hevc_mc.c.

Referenced by check_weighted_pred().

Function Documentation

◆ check_unweighted_pred()

static void check_unweighted_pred ( HEVCDSPContext h,
uint8_t dst0,
uint8_t dst1,
int16_t *  src0,
int16_t *  src1,
int  bit_depth 
)
static

Definition at line 95 of file hevc_mc.c.

Referenced by checkasm_check_hevc_mc().

◆ check_weighted_pred()

static void check_weighted_pred ( HEVCDSPContext h,
uint8_t dst0,
uint8_t dst1,
int16_t *  src0,
int16_t *  src1,
int  bit_depth 
)
static

Definition at line 159 of file hevc_mc.c.

Referenced by checkasm_check_hevc_mc().

◆ check_epel()

static void check_epel ( HEVCDSPContext h,
int16_t *  dst0,
int16_t *  dst1,
uint8_t src,
int16_t *  mcbuffer,
int  bit_depth 
)
static

Definition at line 202 of file hevc_mc.c.

Referenced by checkasm_check_hevc_mc().

◆ check_qpel()

static void check_qpel ( HEVCDSPContext h,
int16_t *  dst0,
int16_t *  dst1,
uint8_t src,
int16_t *  mcbuffer,
int  bit_depth 
)
static

Definition at line 247 of file hevc_mc.c.

Referenced by checkasm_check_hevc_mc().

◆ checkasm_check_hevc_mc()

void checkasm_check_hevc_mc ( void  )

Definition at line 292 of file hevc_mc.c.

Variable Documentation

◆ pixel_mask

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

Definition at line 46 of file hevc_mc.c.

◆ pred_heights

const int pred_heights[][7]
static
Initial value:
= {
[2] = { 8, 4, 2, 0 },
[4] = { 16, 8, 4, 2, 0 },
[6] = { 8, 0 },
[8] = { 32, 16, 8, 4, 2, 0 },
[12] = { 16, 0 },
[16] = { 64, 32, 16, 12, 8, 4, 0 },
[24] = { 32, 0 },
[32] = { 64, 32, 24, 16, 8, 0 },
[48] = { 64, 0 },
[64] = { 64, 48, 32, 16, 0 },
}

Definition at line 48 of file hevc_mc.c.

Referenced by check_epel(), and check_qpel().

◆ pred_widths

const int pred_widths[] = { 4, 8, 12, 16, 24, 32, 48, 64 }
static

Definition at line 61 of file hevc_mc.c.

Referenced by check_epel(), check_qpel(), check_unweighted_pred(), and check_weighted_pred().

◆ interp_names

const char* interp_names[2][2] = { { "pixels", "h" }, { "v", "hv" } }
static

Definition at line 63 of file hevc_mc.c.

Referenced by check_epel(), and check_qpel().