Lines Matching defs:width

39 #define init_buffer(a0, a1, type, width)\
42 randomize_buffers(a0, width * sizeof(type));\
43 memcpy(a1, a0, width*sizeof(type));\
45 static void check_add_bytes(LLVidDSPContext c, int width)
47 uint8_t *dst0 = av_mallocz(width);
48 uint8_t *dst1 = av_mallocz(width);
49 uint8_t *src0 = av_calloc(width, sizeof(*src0));
50 uint8_t *src1 = av_calloc(width, sizeof(*src1));
53 init_buffer(src0, src1, uint8_t, width);
60 call_ref(dst0, src0, width);
61 call_new(dst1, src1, width);
62 if (memcmp(dst0, dst1, width))
64 bench_new(dst1, src1, width);
73 static void check_add_median_pred(LLVidDSPContext c, int width) {
75 uint8_t *dst0 = av_mallocz(width);
76 uint8_t *dst1 = av_mallocz(width);
77 uint8_t *src0 = av_calloc(width, sizeof(*src0));
78 uint8_t *src1 = av_calloc(width, sizeof(*src1));
79 uint8_t *diff0 = av_calloc(width, sizeof(*diff0));
80 uint8_t *diff1 = av_calloc(width, sizeof(*diff1));
85 init_buffer(src0, src1, uint8_t, width);
86 init_buffer(diff0, diff1, uint8_t, width);
95 call_ref(dst0, src0, diff0, width, &A0, &B0);
96 call_new(dst1, src1, diff1, width, &A1, &B1);
97 if (memcmp(dst0, dst1, width) || (A0 != A1) || (B0 != B1))
99 bench_new(dst1, src1, diff1, width, &A1, &B1);
110 static void check_add_left_pred(LLVidDSPContext c, int width, int acc, const char * report)
113 uint8_t *dst0 = av_mallocz(width);
114 uint8_t *dst1 = av_mallocz(width);
115 uint8_t *src0 = av_calloc(width, sizeof(*src0));
116 uint8_t *src1 = av_calloc(width, sizeof(*src1));
119 init_buffer(src0, src1, uint8_t, width);
125 res0 = call_ref(dst0, src0, width, acc);
126 res1 = call_new(dst1, src1, width, acc);
128 memcmp(dst0, dst1, width))
130 bench_new(dst1, src1, width, acc);
139 static void check_add_left_pred_16(LLVidDSPContext c, unsigned mask, int width, unsigned acc, const char * report)
142 uint16_t *dst0 = av_calloc(width, sizeof(*dst0));
143 uint16_t *dst1 = av_calloc(width, sizeof(*dst1));
144 uint16_t *src0 = av_calloc(width, sizeof(*src0));
145 uint16_t *src1 = av_calloc(width, sizeof(*src1));
148 init_buffer(src0, src1, uint16_t, width);
154 res0 = call_ref(dst0, src0, mask, width, acc);
155 res1 = call_new(dst1, src1, mask, width, acc);
157 memcmp(dst0, dst1, width))
159 bench_new(dst1, src1, mask, width, acc);
172 const ptrdiff_t width);
198 int width = 16 * av_clip(rnd(), 16, 128);
203 check_add_bytes(c, width);
206 check_add_median_pred(c, width);
209 check_add_left_pred(c, width, 0, "add_left_pred_zero");
212 check_add_left_pred(c, width, accRnd, "add_left_pred_rnd_acc");
215 check_add_left_pred_16(c, 255, width, accRnd, "add_left_pred_int16");
218 check_add_gradient_pred(c, width);