- It fixes a small bug where a byte value is divided by 255.0 to convert

to a float within [0.0, 1.0] and later multiplied by 256.0 to convert
back. This makes the luminance lookup table more correct, although the
visual difference is relatively small.
- speedup of inner loop, using dst[i] instead of *dst++
based on patch by Linards Ticmanis <[email protected]>


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8350 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi committed 2002-12-04 22:00:03 +00:00
1 parent 630f58aa8a
commit 930cfcdbe2
1 file changed
+6 -5
+6 -5
View File
@@ -70,7 +70,9 @@ void create_lut (vf_eq2_t *eq2)
eq2->lut[i] = 255;
}
else {
eq2->lut[i] = (unsigned char) (256.0 * v);
/* we divided by 255.0 so now we also multiply by 255.0, not
by 256.0. "+ 0.5" ensures proper rounding */
eq2->lut[i] = (unsigned char) (255.0 * v + 0.5);
}
}
}
@@ -85,11 +87,10 @@ void process (unsigned char *dst, int dstride, unsigned char *src, int sstride,
for (j = 0; j < h; j++) {
for (i = 0; i < w; i++) {
*(dst++) = lut[*(src++)];
dst[i] = lut[src[i]];
}
src += sstride - w;
dst += dstride - w;
src += sstride;
dst += dstride;
}
}