mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
fixed grayscale SW JPEG compression for YCbCr colorspace (subtracting 128)
This commit is contained in:
parent
61739d6c40
commit
4a61bf9bee
@ -920,8 +920,8 @@ void jpeg_get_mcu(image_t *img, int mcu_w, int mcu_h, int x_offs, int y_offs, in
|
|||||||
uint32_t *mcu32 = (uint32_t *)mcu;
|
uint32_t *mcu32 = (uint32_t *)mcu;
|
||||||
for (int y=y_offs; y<y_offs+mcu_h; y++) {
|
for (int y=y_offs; y<y_offs+mcu_h; y++) {
|
||||||
uint32_t *pRow = (uint32_t *)&img->data[(y * img->w) + x_offs];
|
uint32_t *pRow = (uint32_t *)&img->data[(y * img->w) + x_offs];
|
||||||
mcu32[0] = pRow[0] - 0x80808080; // do 4 pixels at a time and "subtract" 128
|
mcu32[0] = pRow[0] ^ 0x80808080; // do 4 pixels at a time and "subtract" 128
|
||||||
mcu32[1] = pRow[1] - 0x80808080;
|
mcu32[1] = pRow[1] ^ 0x80808080;
|
||||||
mcu32 += 2;
|
mcu32 += 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user