my chains like:
capture - > out vpss ---process link->in dsp -> alg link
---> next link --> hdmi/sd display
now,i want to get rgb to process in my algrithem , can you help me?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
You need to write your own function to convert YUV to RGB . mcfw does not have any link etc. that has this functionality.
thank you very much,
but my function to convert YUV to RGB costs too much times(about 50ms), I saw the iss have rgb output ,and i want to know can i get the iss's rgb in dsp to my algrithem, and back it after my algrithem,this is only my idea
I dont have expertise on this part. I have f/wed your query to relevant person.
Hi,
There is a CPIS API available for color space conversions (YUV->RGB and RGB->YUV) namely (CPIS_colorSpcConv) which runs on SIMCOP.
You need to call this API on VPSS M3.
The CPIS module is initialized as part of ISS init so you can directly call the CPIS_colorSpcConv() API in your code
Pl. refer to the attached example code.
#include <ti/psp/iss/alg/evf/inc/cpisCore.h> #include <ti/psp/iss/alg/evf/inc/cpisImgproc.h> typedef struct { CPIS_Format srcFormat[CPIS_MAX_SRC_CHANNELS]; CPIS_Buffer srcBuf[CPIS_MAX_SRC_CHANNELS]; CPIS_Format dstFormat[CPIS_MAX_DST_CHANNELS]; CPIS_Buffer dstBuf[CPIS_MAX_DST_CHANNELS]; CPIS_Size roiSize; CPIS_Size procBlockSize; Uint16 numInput; /* Number of input buffers */ Uint16 numOutput; /* Number of ouput buffers */ } CPIS_BaseParms; typedef struct { Int16 matrix[9]; Uint32 qShift; Int16 preOffset[3]; /* offset to add to each component before matrix multiplication */ Int16 postOffset[3]; /* offset to add to each component after matrix multiplication */ Int16 signedInput[3]; Int16 signedOutput[3]; CPIS_ColorDsMode colorDsMode; /* color downsampling mode */ } CPIS_ColorSpcConvParms; Int32 colorSpaceConvert() { Int32 ret; UInt32 i; CPIS_Handle handle; CPIS_BaseParms basePrm; CPIS_ColorSpcConvParms colorSpcConvPrm; float yuv2rgb[9] = {1.0, 1.0, 1.0, -0.0009, -0.3437, 1.7722, 1.4017, -0.7142, 0.0010}; /* Base parameters */ /* Input */ basePrm.srcBuf[0].ptr = (Uint8*)SRC; basePrm.srcBuf[0].stride = WIDTH; basePrm.srcFormat[0] = CPIS_YUV_422ILE; /* Output */ basePrm.dstBuf[0].ptr = (Uint8*)DST; basePrm.dstBuf[0].stride = WIDTH; basePrm.dstFormat[0] = CPIS_RGB_888; basePrm.roiSize.width = WIDTH; basePrm.roiSize.height = HEIGHT; basePrm.procBlockSize.width = 0; // Auto calculate basePrm.procBlockSize.height = 0; // Auto calculate basePrm.numInput = 1; basePrm.numOutput = 1; /* Color space conversion parameters */ /* For YCbCr->RGB Real number matrix is : [ a= 1.0 b= -0.0009 c= 1.4017 d= 1.0 e= -0.3437 f= -0.7142 g= 1.0 h= 1.7722 i= 0.0010 ] The matrix order is colorSpcConvPrm.matrix[9] = {a, d, g, b, e, h, c, f, i}; */ /* The above matrix is converted to Q16 format by multiplying 32765 */ for(i = 0;i < 9;i++) { colorSpcConvPrm.matrix[i] = (Int16)(yuv2rgb[i] * 32765.0); } colorSpcConvPrm.qShift = 15; for(i = 0;i < 3;i++) { colorSpcConvPrm.preOffset[i] = 0; colorSpcConvPrm.postOffset[i] = 0; } /* No color Down Sampling */ colorSpcConvPrm.colorDsMode = CPIS_DS_NONE; ret = CPIS_colorSpcConv(&handle, &basePrm, &colorSpcConvPrm, CPIS_SYNC); return ret; }
regards,
Anand