cc [ flag... ] file... –lmlib [ library... ] #include <mlib.h> mlib_s32 mlib_VideoSumAbsDiff(mlib_u8 *curr_block, const mlib_u8 *ref_block, mlib_s32 width, mlib_s32 height, mlib_s32 stride);
The mlib_VideoSumAbsDiff() function computes the sum of absolute differences between the pixels in the current block and the corresponding pixels in the reference block.
Both the current block and the reference block belong to frames with the same dimension. (The stride is applicable to both.) Motion estimation computes the sum of the absolute differences between the current block and reference blocks at different locations in the reference frame, choosing the best fit (least sum of absolute difference) to calculate the motion vector.
The function takes the following arguments:
Pointer to the current block. curr_block must be 8-byte aligned.
Pointer to the reference block.
Width of the block.
Height of the block.
Stride, in bytes, between adjacent rows in a block. stride must be a multiple of eight.
The function returns a value of type mlib_s32.
See attributes(5) for descriptions of the following attributes: