utvideoenc: optimize and simplify mangle_rgb_planes
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
3699960690
commit
4fced11df7
@ -196,16 +196,13 @@ static void mangle_rgb_planes(uint8_t *src, int step, int stride, int width,
|
||||
int height)
|
||||
{
|
||||
int i, j;
|
||||
uint8_t r, g, b;
|
||||
unsigned g;
|
||||
|
||||
for (j = 0; j < height; j++) {
|
||||
for (i = 0; i < width * step; i += step) {
|
||||
r = src[i];
|
||||
g = src[i + 1];
|
||||
b = src[i + 2];
|
||||
|
||||
src[i] = r - g + 0x80;
|
||||
src[i + 2] = b - g + 0x80;
|
||||
g = src[i + 1] + 0x80;
|
||||
src[i] -= g;
|
||||
src[i + 2] -= g;
|
||||
}
|
||||
src += stride;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user