117 static const uint32_t
pixel_mask[3] = { 0xffffffff, 0x01ff01ff, 0x03ff03ff };
119 #define SIZEOF_PIXEL ((bit_depth + 7) / 8)
120 #define BUF_SIZE (3 * 16 * 17)
122 #define check_pred_func(func, name, mode_name) \
123 (mode_name && ((codec_ids[codec] == AV_CODEC_ID_H264) ? \
124 check_func(func, "pred%s_%s_%d", name, mode_name, bit_depth) : \
125 check_func(func, "pred%s_%s", name, mode_name)))
127 #define randomize_buffers() \
129 uint32_t mask = pixel_mask[bit_depth - 8]; \
131 for (i = 0; i < BUF_SIZE; i += 4) { \
132 uint32_t r = rnd() & mask; \
133 AV_WN32A(buf0 + i, r); \
134 AV_WN32A(buf1 + i, r); \
138 #define src0 (buf0 + 4 * 16)
139 #define src1 (buf1 + 4 * 16)
142 int codec,
int chroma_format,
int bit_depth)
144 if (chroma_format == 1) {
145 uint8_t *topright = buf0 + 2*16;
149 for (pred_mode = 0; pred_mode < 15; pred_mode++) {
163 int codec,
int chroma_format,
int bit_depth)
168 for (pred_mode = 0; pred_mode < 11; pred_mode++) {
182 int codec,
int chroma_format,
int bit_depth)
184 if (chroma_format == 1) {
188 for (pred_mode = 0; pred_mode < 9; pred_mode++) {
202 int codec,
int chroma_format,
int bit_depth)
208 for (pred_mode = 0; pred_mode < 12; pred_mode++) {
211 for (neighbors = 0; neighbors <= 0xc000; neighbors += 0x4000) {
212 int has_topleft = neighbors & 0x8000;
213 int has_topright = neighbors & 0x4000;
234 static const struct {
250 for (codec = 0; codec < 4; codec++) {
252 for (bit_depth = 8; bit_depth <= (codec_id ==
AV_CODEC_ID_H264 ? 10 : 8); bit_depth++)
253 for (chroma_format = 1; chroma_format <= (codec_id ==
AV_CODEC_ID_H264 ? 2 : 1); chroma_format++) {
255 tests[
test].func(&h, buf0, buf1, codec, chroma_format, bit_depth);
static const char *const pred16x16_modes[4][9]
static const struct @195 tests[]
av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id, const int bit_depth, int chroma_format_idc)
Set the intra prediction function pointers.
#define DIAG_DOWN_LEFT_PRED_RV40_NODOWN
static const uint32_t pixel_mask[3]
#define HOR_UP_PRED_RV40_NODOWN
Context for storing H.264 prediction functions.
void(* pred8x8[4+3+4])(uint8_t *src, ptrdiff_t stride)
void(* pred4x4[9+3+3])(uint8_t *src, const uint8_t *topright, ptrdiff_t stride)
static void check_pred4x4(H264PredContext *h, uint8_t *buf0, uint8_t *buf1, int codec, int chroma_format, int bit_depth)
#define ALZHEIMER_DC_0LT_PRED8x8
#define check_pred_func(func, name, mode_name)
#define ALZHEIMER_DC_L0T_PRED8x8
#define declare_func(ret,...)
static const char *const pred4x4_modes[4][15]
static const char *const pred8x8_modes[4][11]
static void check_pred8x8(H264PredContext *h, uint8_t *buf0, uint8_t *buf1, int codec, int chroma_format, int bit_depth)
Libavcodec external API header.
common internal API header
static void test(const char *pattern, const char *host)
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
#define FF_ARRAY_ELEMS(a)
static void check_pred16x16(H264PredContext *h, uint8_t *buf0, uint8_t *buf1, int codec, int chroma_format, int bit_depth)
static const int codec_ids[4]
void checkasm_check_h264pred(void)
#define ALZHEIMER_DC_0L0_PRED8x8
void(* pred16x16[4+3+2])(uint8_t *src, ptrdiff_t stride)
static void check_pred8x8l(H264PredContext *h, uint8_t *buf0, uint8_t *buf1, int codec, int chroma_format, int bit_depth)
int(* func)(AVBPrint *dst, const char *in, const char *arg)
H.264 / AVC / MPEG4 prediction functions.
#define VERT_LEFT_PRED_RV40_NODOWN
GLint GLenum GLboolean GLsizei stride
common internal and external API header
#define randomize_buffers()
static unsigned bit_depth(uint64_t mask)
#define ALZHEIMER_DC_L00_PRED8x8
#define LOCAL_ALIGNED_16(t, v,...)
void(* pred8x8l[9+3])(uint8_t *src, int topleft, int topright, ptrdiff_t stride)