mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #1612 from openmv/jpeg_fix
imlib: Fix SIMD YCbCr to RGB conversion.
This commit is contained in:
commit
c9f0d8e0d0
@ -2277,7 +2277,9 @@ static void JPEGPixelLE(uint16_t *pDest, int iY, int iCb, int iCr)
|
||||
{
|
||||
uint32_t ulPixel;
|
||||
uint32_t ulCbCr = (iCb | (iCr << 16));
|
||||
uint32_t ulTmp = -1409 | (-2925 << 16); // for green calc
|
||||
uint32_t ulTmp; // for green calc
|
||||
ulTmp = -1409;
|
||||
ulTmp = (ulTmp & 0xffff) | (-2925 << 16);
|
||||
ulCbCr = __SSUB16(ulCbCr, 0x00800080); // dual 16-bit subtraction
|
||||
ulPixel = __SMLAD(ulCbCr, ulTmp, iY) >> 14; // G
|
||||
ulPixel = __USAT16(ulPixel, 6) << 5; // range limit to 6 bits
|
||||
@ -2294,7 +2296,9 @@ static void JPEGPixel2LE(uint16_t *pDest, int iY1, int iY2, int iCb, int iCr)
|
||||
{
|
||||
uint32_t ulPixel1, ulPixel2;
|
||||
uint32_t ulCbCr = (iCb | (iCr << 16));
|
||||
uint32_t ulTmp2, ulTmp = -1409 | (-2925 << 16); // for green calc
|
||||
uint32_t ulTmp2, ulTmp; // for green calc
|
||||
ulTmp = -1409;
|
||||
ulTmp = (ulTmp & 0xffff) | (-2925 << 16);
|
||||
ulCbCr = __SSUB16(ulCbCr, 0x00800080); // dual 16-bit subtraction
|
||||
ulPixel1 = __SMLAD(ulCbCr, ulTmp, iY1) >> 14; // G for pixel 1
|
||||
ulPixel2 = __SMLAD(ulCbCr, ulTmp, iY2) >> 14; // G for pixel 2
|
||||
|
||||
Loading…
Reference in New Issue
Block a user