Skip to content

Commit

Permalink
Fix rgb888 to rgb565 conversion (#7)
Browse files Browse the repository at this point in the history
* Fix rgb888 to rgb565 conversion

Old variants of LCD swapped R and B channels, so the corresponding hack was
added to the DSP modules.
Now LCD display works correctly, so this hack is not needed anymore.

Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>

* Update binaries

Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
  • Loading branch information
KirillSmirnov authored Jun 13, 2022
1 parent 214607d commit 40426d9
Show file tree
Hide file tree
Showing 22 changed files with 10 additions and 10 deletions.
Binary file modified trik/ov7670/edge_line_sensor/dsp_server/bin/dsp_server.xe674
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class BallDetector<TRIK_VIDTRANSCODE_CV_VIDEO_FORMAT_YUV422P, TRIK_VIDTRANSCODE_
static void __attribute__((always_inline)) writeOutputPixel(uint16_t* restrict _rgb565ptr,
const uint32_t _rgb888)
{
*_rgb565ptr = ((_rgb888>>19)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888<<8)&0xf800);
*_rgb565ptr = ((_rgb888>>3)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888>>8)&0xf800);
}

void __attribute__((always_inline)) drawOutputPixelBound(const int32_t _srcCol,
Expand Down
Binary file modified trik/ov7670/jpeg_encoder/dsp_server/bin/dsp_server.xe674
Binary file not shown.
Binary file modified trik/ov7670/line_sensor/dsp_server/bin/dsp_server.xe674
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class LineDetector<TRIK_VIDTRANSCODE_CV_VIDEO_FORMAT_YUV422P, TRIK_VIDTRANSCODE_
static void __attribute__((always_inline)) writeOutputPixel(uint16_t* restrict _rgb565ptr,
const uint32_t _rgb888)
{
*_rgb565ptr = ((_rgb888>>19)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888<<8)&0xf800);
*_rgb565ptr = ((_rgb888>>3)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888>>8)&0xf800);
}

void __attribute__((always_inline)) drawOutputPixelBound(const int32_t _srcCol,
Expand Down
Binary file modified trik/ov7670/motion_sensor/dsp_server/bin/dsp_server.xe674
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class MotionDetector<TRIK_VIDTRANSCODE_CV_VIDEO_FORMAT_YUV422P, TRIK_VIDTRANSCOD
static void __attribute__((always_inline)) writeOutputPixel(uint16_t* restrict _rgb565ptr,
const uint32_t _rgb888)
{
*_rgb565ptr = ((_rgb888>>19)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888<<8)&0xf800);
*_rgb565ptr = ((_rgb888>>3)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888>>8)&0xf800);
}

void __attribute__((always_inline)) drawOutputPixelBound(const int32_t _srcCol,
Expand Down
Binary file modified trik/ov7670/mxn_sensor/dsp_server/bin/dsp_server.xe674
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class BallDetector<TRIK_VIDTRANSCODE_CV_VIDEO_FORMAT_YUV422P, TRIK_VIDTRANSCODE_
static void __attribute__((always_inline)) writeOutputPixel(uint16_t* restrict _rgb565ptr,
const uint32_t _rgb888)
{
*_rgb565ptr = ((_rgb888>>19)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888<<8)&0xf800);
*_rgb565ptr = ((_rgb888>>3)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888>>8)&0xf800);
}

void __attribute__((always_inline)) drawOutputPixelBound(const int32_t _srcCol,
Expand Down
Binary file modified trik/ov7670/object_sensor/dsp_server/bin/dsp_server.xe674
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class BallDetector<TRIK_VIDTRANSCODE_CV_VIDEO_FORMAT_YUV422P, TRIK_VIDTRANSCODE_
static void __attribute__((always_inline)) writeOutputPixel(uint16_t* restrict _rgb565ptr,
const uint32_t _rgb888)
{
*_rgb565ptr = ((_rgb888>>19)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888<<8)&0xf800);
*_rgb565ptr = ((_rgb888>>3)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888>>8)&0xf800);
}

void __attribute__((always_inline)) drawOutputPixelBound(const int32_t _srcCol,
Expand Down
Binary file modified trik/webcam/edge_line_sensor/dsp_server/bin/dsp_server.xe674
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class BallDetector<TRIK_VIDTRANSCODE_CV_VIDEO_FORMAT_YUV422, TRIK_VIDTRANSCODE_C
static void __attribute__((always_inline)) writeOutputPixel(uint16_t* restrict _rgb565ptr,
const uint32_t _rgb888)
{
*_rgb565ptr = ((_rgb888>>19)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888<<8)&0xf800);
*_rgb565ptr = ((_rgb888>>3)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888>>8)&0xf800);
}

void __attribute__((always_inline)) drawOutputPixelBound(const int32_t _srcCol,
Expand Down
Binary file modified trik/webcam/jpeg_encoder/dsp_server/bin/dsp_server.xe674
Binary file not shown.
Binary file modified trik/webcam/line_sensor/dsp_server/bin/dsp_server.xe674
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class LineDetector<TRIK_VIDTRANSCODE_CV_VIDEO_FORMAT_YUV422, TRIK_VIDTRANSCODE_C
static void __attribute__((always_inline)) writeOutputPixel(uint16_t* restrict _rgb565ptr,
const uint32_t _rgb888)
{
*_rgb565ptr = ((_rgb888>>19)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888<<8)&0xf800);
*_rgb565ptr = ((_rgb888>>3)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888>>8)&0xf800);
}

void __attribute__((always_inline)) drawOutputPixelBound(const int32_t _srcCol,
Expand Down
Binary file modified trik/webcam/motion_sensor/dsp_server/bin/dsp_server.xe674
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class MotionDetector<TRIK_VIDTRANSCODE_CV_VIDEO_FORMAT_YUV422, TRIK_VIDTRANSCODE
static void __attribute__((always_inline)) writeOutputPixel(uint16_t* restrict _rgb565ptr,
const uint32_t _rgb888)
{
*_rgb565ptr = ((_rgb888>>19)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888<<8)&0xf800);
*_rgb565ptr = ((_rgb888>>3)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888>>8)&0xf800);
}

void __attribute__((always_inline)) drawOutputPixelBound(const int32_t _srcCol,
Expand Down
Binary file modified trik/webcam/mxn_sensor/dsp_server/bin/dsp_server.xe674
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class BallDetector<TRIK_VIDTRANSCODE_CV_VIDEO_FORMAT_YUV422, TRIK_VIDTRANSCODE_C
static void __attribute__((always_inline)) writeOutputPixel(uint16_t* restrict _rgb565ptr,
const uint32_t _rgb888)
{
*_rgb565ptr = ((_rgb888>>19)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888<<8)&0xf800);
*_rgb565ptr = ((_rgb888>>3)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888>>8)&0xf800);
}

void __attribute__((always_inline)) drawOutputPixelBound(const int32_t _srcCol,
Expand Down
Binary file modified trik/webcam/object_sensor/dsp_server/bin/dsp_server.xe674
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class BallDetector<TRIK_VIDTRANSCODE_CV_VIDEO_FORMAT_YUV422, TRIK_VIDTRANSCODE_C
static void __attribute__((always_inline)) writeOutputPixel(uint16_t* restrict _rgb565ptr,
const uint32_t _rgb888)
{
*_rgb565ptr = ((_rgb888>>19)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888<<8)&0xf800);
*_rgb565ptr = ((_rgb888>>3)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888>>8)&0xf800);
}

void __attribute__((always_inline)) drawOutputPixelBound(const int32_t _srcCol,
Expand Down

0 comments on commit 40426d9

Please sign in to comment.