-/*
- * M is a discrete map where every entry contains the sum of all the entries
- * in the rectangle from the top-left origin of M to its coordinate. In the
- * following schema, "i" contains the sum of the whole map:
- *
- * M = +----------+-----------------+----+
- * | | | |
- * | | | |
- * | a| b| c|
- * +----------+-----------------+----+
- * | | | |
- * | | | |
- * | | X | |
- * | | | |
- * | d| e| f|
- * +----------+-----------------+----+
- * | | | |
- * | g| h| i|
- * +----------+-----------------+----+
- *
- * The sum of the X box can be calculated with:
- * X = e-d-b+a
- *
- * See https://en.wikipedia.org/wiki/Summed_area_table
- *
- * The compute*_ssd functions compute the integral image M where every entry
- * contains the sum of the squared difference of every corresponding pixels of
- * two input planes of the same size as M.
- */
-static inline int get_integral_patch_value(const uint32_t *ii, int ii_lz_32, int x, int y, int p)
-{
- const int e = ii[(y + p ) * ii_lz_32 + (x + p )];
- const int d = ii[(y + p ) * ii_lz_32 + (x - p - 1)];
- const int b = ii[(y - p - 1) * ii_lz_32 + (x + p )];
- const int a = ii[(y - p - 1) * ii_lz_32 + (x - p - 1)];
- return e - d - b + a;
-}
-