FFmpeg
Macros | Functions | Variables
h264pred.c File Reference
#include <string.h>
#include "checkasm.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/h264pred.h"
#include "libavutil/common.h"
#include "libavutil/internal.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 BUF_SIZE   (3 * 16 * 17)
 
#define check_pred_func(func, name, mode_name)
 
#define randomize_buffers()
 
#define src0   (buf0 + 4 * 16) /* Offset to allow room for top and left */
 
#define src1   (buf1 + 4 * 16)
 

Functions

static void check_pred4x4 (H264PredContext *h, uint8_t *buf0, uint8_t *buf1, int codec, int chroma_format, int bit_depth)
 
static void check_pred8x8 (H264PredContext *h, uint8_t *buf0, uint8_t *buf1, int codec, int chroma_format, int bit_depth)
 
static void check_pred16x16 (H264PredContext *h, uint8_t *buf0, uint8_t *buf1, int codec, int chroma_format, int bit_depth)
 
static void check_pred8x8l (H264PredContext *h, uint8_t *buf0, uint8_t *buf1, int codec, int chroma_format, int bit_depth)
 
void checkasm_check_h264pred (void)
 

Variables

static const int codec_ids [4] = { AV_CODEC_ID_H264, AV_CODEC_ID_VP8, AV_CODEC_ID_RV40, AV_CODEC_ID_SVQ3 }
 
static const char *const pred4x4_modes [4][15]
 
static const char *const pred8x8_modes [4][11]
 
static const char *const pred16x16_modes [4][9]
 
static const uint32_t pixel_mask [3] = { 0xffffffff, 0x01ff01ff, 0x03ff03ff }
 

Macro Definition Documentation

◆ SIZEOF_PIXEL

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

Definition at line 120 of file h264pred.c.

◆ BUF_SIZE

#define BUF_SIZE   (3 * 16 * 17)

Definition at line 121 of file h264pred.c.

◆ check_pred_func

#define check_pred_func (   func,
  name,
  mode_name 
)
Value:
(mode_name && ((codec_ids[codec] == AV_CODEC_ID_H264) ? \
check_func(func, "pred%s_%s_%d", name, mode_name, bit_depth) : \
check_func(func, "pred%s_%s", name, mode_name)))

Definition at line 123 of file h264pred.c.

◆ randomize_buffers

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

Definition at line 128 of file h264pred.c.

◆ src0

#define src0   (buf0 + 4 * 16) /* Offset to allow room for top and left */

Definition at line 139 of file h264pred.c.

◆ src1

#define src1   (buf1 + 4 * 16)

Definition at line 140 of file h264pred.c.

Function Documentation

◆ check_pred4x4()

static void check_pred4x4 ( H264PredContext h,
uint8_t *  buf0,
uint8_t *  buf1,
int  codec,
int  chroma_format,
int  bit_depth 
)
static

Definition at line 142 of file h264pred.c.

Referenced by checkasm_check_h264pred().

◆ check_pred8x8()

static void check_pred8x8 ( H264PredContext h,
uint8_t *  buf0,
uint8_t *  buf1,
int  codec,
int  chroma_format,
int  bit_depth 
)
static

Definition at line 163 of file h264pred.c.

Referenced by checkasm_check_h264pred().

◆ check_pred16x16()

static void check_pred16x16 ( H264PredContext h,
uint8_t *  buf0,
uint8_t *  buf1,
int  codec,
int  chroma_format,
int  bit_depth 
)
static

Definition at line 182 of file h264pred.c.

Referenced by checkasm_check_h264pred().

◆ check_pred8x8l()

static void check_pred8x8l ( H264PredContext h,
uint8_t *  buf0,
uint8_t *  buf1,
int  codec,
int  chroma_format,
int  bit_depth 
)
static

Definition at line 202 of file h264pred.c.

Referenced by checkasm_check_h264pred().

◆ checkasm_check_h264pred()

void checkasm_check_h264pred ( void  )

Definition at line 233 of file h264pred.c.

Variable Documentation

◆ codec_ids

Definition at line 30 of file h264pred.c.

Referenced by check_pred8x8l(), and checkasm_check_h264pred().

◆ pred4x4_modes

const char* const pred4x4_modes[4][15]
static

Definition at line 32 of file h264pred.c.

Referenced by check_pred4x4(), and check_pred8x8l().

◆ pred8x8_modes

const char* const pred8x8_modes[4][11]
static
Initial value:
= {
{
[DC_PRED8x8 ] = "dc",
[HOR_PRED8x8 ] = "horizontal",
[VERT_PRED8x8 ] = "vertical",
[PLANE_PRED8x8 ] = "plane",
[LEFT_DC_PRED8x8 ] = "left_dc",
[TOP_DC_PRED8x8 ] = "top_dc",
[DC_128_PRED8x8 ] = "dc_128",
[ALZHEIMER_DC_L0T_PRED8x8] = "mad_cow_dc_l0t",
[ALZHEIMER_DC_0LT_PRED8x8] = "mad_cow_dc_0lt",
[ALZHEIMER_DC_L00_PRED8x8] = "mad_cow_dc_l00",
[ALZHEIMER_DC_0L0_PRED8x8] = "mad_cow_dc_0l0",
},
{
[PLANE_PRED8x8 ] = "tm_vp8",
[DC_127_PRED8x8] = "dc_127_vp8",
[DC_129_PRED8x8] = "dc_129_vp8",
},
{
[DC_PRED8x8 ] = "dc_rv40",
[LEFT_DC_PRED8x8] = "left_dc_rv40",
[TOP_DC_PRED8x8 ] = "top_dc_rv40",
},
}

Definition at line 68 of file h264pred.c.

Referenced by check_pred8x8().

◆ pred16x16_modes

const char* const pred16x16_modes[4][9]
static
Initial value:
= {
{
[DC_PRED8x8 ] = "dc",
[HOR_PRED8x8 ] = "horizontal",
[VERT_PRED8x8 ] = "vertical",
[PLANE_PRED8x8 ] = "plane",
[LEFT_DC_PRED8x8] = "left_dc",
[TOP_DC_PRED8x8 ] = "top_dc",
[DC_128_PRED8x8 ] = "dc_128",
},
{
[PLANE_PRED8x8 ] = "tm_vp8",
[DC_127_PRED8x8] = "dc_127_vp8",
[DC_129_PRED8x8] = "dc_129_vp8",
},
{
[PLANE_PRED8x8] = "plane_rv40",
},
{
[PLANE_PRED8x8] = "plane_svq3",
},
}

Definition at line 95 of file h264pred.c.

Referenced by check_pred16x16().

◆ pixel_mask

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

Definition at line 118 of file h264pred.c.

func
int(* func)(AVBPrint *dst, const char *in, const char *arg)
Definition: jacosubdec.c:68
HOR_PRED8x8
#define HOR_PRED8x8
Definition: h264pred.h:69
bit_depth
static void bit_depth(AudioStatsContext *s, uint64_t mask, uint64_t imask, AVRational *depth)
Definition: af_astats.c:254
name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
r
const char * r
Definition: vf_curves.c:116
DC_PRED8x8
#define DC_PRED8x8
Definition: h264pred.h:68
check_func
#define check_func(func,...)
Definition: checkasm.h:127
rnd
#define rnd()
Definition: checkasm.h:120
pixel_mask
static const uint32_t pixel_mask[3]
Definition: h264pred.c:118
mask
static const uint16_t mask[17]
Definition: lzw.c:38
DC_129_PRED8x8
#define DC_129_PRED8x8
Definition: h264pred.h:86
AV_CODEC_ID_H264
@ AV_CODEC_ID_H264
Definition: codec_id.h:77
TOP_DC_PRED8x8
#define TOP_DC_PRED8x8
Definition: h264pred.h:75
codec_ids
static const int codec_ids[4]
Definition: h264pred.c:30
BUF_SIZE
#define BUF_SIZE
Definition: h264pred.c:121
VERT_PRED8x8
#define VERT_PRED8x8
Definition: h264pred.h:70
DC_127_PRED8x8
#define DC_127_PRED8x8
Definition: h264pred.h:85
DC_128_PRED8x8
#define DC_128_PRED8x8
Definition: h264pred.h:76
PLANE_PRED8x8
#define PLANE_PRED8x8
Definition: h264pred.h:71
i
int i
Definition: input.c:406
ALZHEIMER_DC_L00_PRED8x8
#define ALZHEIMER_DC_L00_PRED8x8
Definition: h264pred.h:81
LEFT_DC_PRED8x8
#define LEFT_DC_PRED8x8
Definition: h264pred.h:74
ALZHEIMER_DC_0L0_PRED8x8
#define ALZHEIMER_DC_0L0_PRED8x8
Definition: h264pred.h:82
ALZHEIMER_DC_L0T_PRED8x8
#define ALZHEIMER_DC_L0T_PRED8x8
Definition: h264pred.h:79
ALZHEIMER_DC_0LT_PRED8x8
#define ALZHEIMER_DC_0LT_PRED8x8
Definition: h264pred.h:80