29 const uint8_t *src2, ptrdiff_t stride2,
34 for (y = 0; y <
h; y++) {
35 for (x = 0; x < w; x++)
36 sum += abs(src1[x] - src2[x]);
43 #define DECLARE_BLOCK_FUNCTIONS(size) \
44 static int block_sad_##size##x##size##_c(const uint8_t *src1, ptrdiff_t stride1, \
45 const uint8_t *src2, ptrdiff_t stride2) \
47 return sad_wxh(src1, stride1, src2, stride2, size, size); \
50 DECLARE_BLOCK_FUNCTIONS(2)
51 DECLARE_BLOCK_FUNCTIONS(4)
52 DECLARE_BLOCK_FUNCTIONS(8)
53 DECLARE_BLOCK_FUNCTIONS(16)
66 #if !CONFIG_PIXELUTILS
68 "but libavutil is not compiled with it\n");
73 memcpy(sad, sad_c,
sizeof(sad));
85 return sad[w_bits - 1];
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn *sad, int aligned)
int(* av_pixelutils_sad_fn)(const uint8_t *src1, ptrdiff_t stride1, const uint8_t *src2, ptrdiff_t stride2)
Sum of abs(src1[x] - src2[x])
common internal API header
#define FF_ARRAY_ELEMS(a)
av_pixelutils_sad_fn av_pixelutils_get_sad_fn(int w_bits, int h_bits, int aligned, void *log_ctx)
Get a potentially optimized pointer to a Sum-of-absolute-differences function (see the av_pixelutils_...
common internal and external API header