int x, y, k = 0;
int c0_point, half_point, c3_point;
uint8_t color[16];
- const int indexMap[8] = {
+ static const int indexMap[8] = {
0 << 30, 2 << 30, 0 << 30, 2 << 30,
3 << 30, 3 << 30, 1 << 30, 1 << 30,
};
* the same inside that subinterval.
*
* Relying on this 1d approximation isn't always optimal in terms of
- * euclidean distance, but it's very close and a lot faster.
+ * Euclidean distance, but it's very close and a lot faster.
*
* http://cbloomrants.blogspot.com/2008/12/12-08-08-dxtc-summary.html */
c0_point = (stops[1] + stops[3]) >> 1;
if (fabs(vfb) > magn)
magn = fabs(vfb);
- /* if magnitudo is too small, default to luminance */
+ /* if magnitude is too small, default to luminance */
if (magn < 4.0f) {
/* JPEG YCbCr luma coefs, scaled by 1000 */
v_r = 299;
/* Additional magic to save a lot of multiplies in the accumulating loop.
* The tables contain precomputed products of weights for least squares
* system, accumulated inside one 32-bit register */
- const int w1tab[4] = { 3, 0, 2, 1 };
- const int prods[4] = { 0x090000, 0x000900, 0x040102, 0x010402 };
+ static const int w1tab[4] = { 3, 0, 2, 1 };
+ static const int prods[4] = { 0x090000, 0x000900, 0x040102, 0x010402 };
/* Check if all pixels have the same index */
if ((mask ^ (mask << 2)) < 4) {
int b = pixel[2];
int t = (2 + r + b) >> 2;
- int y = av_clip_uint8(g + t);
- int co = av_clip_uint8(128 + ((r - b + 1) >> 1));
- int cg = av_clip_uint8(128 + g - t);
-
- dst[0] = (uint8_t) co;
- dst[1] = (uint8_t) cg;
+ dst[0] = av_clip_uint8(128 + ((r - b + 1) >> 1)); /* Co */
+ dst[1] = av_clip_uint8(128 + g - t); /* Cg */
dst[2] = 0;
- dst[3] = (uint8_t) y;
+ dst[3] = av_clip_uint8(g + t); /* Y */
}
/**