Project Name: RGBtoYCbCr.dpj Project Group Name: RGBtoYCbCr.dpg Project Type: ADSP-BF533 [ ] ADSP-BF537 [ ] ADSP-BF561 [X] Hardware Used: ADSP-BF561 EZ-Kit VisualDSP++ Emulator System Services Components Used: None OVERVIEW ======== The RGBtoYCbCr function takes input (R, G, B) in the range of 0 to 255 and outputs (Y, Cb and Cr) also in the range of 0 to 255. The formula’s implementation is represented by the diagram below. Y = 0.299R + 0.587G + 0.114B Cb = -0.169R - 0.331G + 0.500B + 128 Cr = 0.500R - 0.419G - 0.081B + 128 128 is added to Cb and Cr to get the output in the range 0 to 255. For this function to work properly, the input must be gamma corrected values in the order RGB order and the result will be stored in YCbCr order. Prototype : void RGBtoYCbCr(unsigned char input[], unsigned char out[], int N); Arguments: input[] - Input RGB array out[] - Out put array to store in YCbCr format N - Number of inputs Registers Used : A0, A1, R0-R3, R5-R7, I1, B1, M0, L1, P0-P2, LC0. RUNNING THE APPLICATION (on the ADSP-BF561 EZ-KIT Lite) =========================================================== 1) Load project group "RGBtoYCbCr.dpg". 2) Select "Project->Rebuild Project" 3) Click OK in the "Load Multiprocessor Confirmation" window to load p0.dxe and p1.dxe. 4) Select "Debug->Multiprocessor Run". 5) Observe output on VisualDSP++ console window. Files in This Application ========================== This example consists of the following files: "./RGBtoYCbCr.ldf" - linker description file "./RGBtoYCbCr.dpj" - project file "./RGBtoYCbCr.dpg" - project group file "corea/corea.dpj" - Core A project file "../../src/t_RGBtoYCbCr.c" - Core A source file "../../src/RGBtoYCbCr.asm" - Core A source file "../../../../BFinUtils/ADSP-BF561/SDK-cycle_count.asm" - Core A source file "../../include/color_cnvr.h" - Core A include file "../../../../Include/SDK-cycle_count.h" - Core A include file "coreb/coreb.dpj" - Core B project file "../../../../BFinUtils/ADSP-BF561/SDK-coreb_idle.c - Core B source file "sml2/sml2.dpj" - Shared Memory L2 project file "../../../../BFinUtils/ADSP-BF561/SDK-dummy.c - Shared Memory L2 source file "sml3/sml3.dpj" - Shared Memory L3 project file "../../../../BFinUtils/ADSP-BF561/SDK-dummy.c - Shared Memory L3 source file