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.

VICP Library Function : CPIS_colorSpcConv

Other Parts Discussed in Thread: CCSTUDIO

Hi,  I used the DM648 chip and call the VICP library function: CPIS_colorSpcConv( ) Func, However I find the function has some problems, my code is that: 

Int16 g_VICP_iCoeffMatrix[9] = {0, 0, 0, 0, -401, 0, 0, 0 0}; //系数矩阵

Int16 g_VICP_i16PreOffset[3] = {0, -128, -128}; //运算前输入加上的值

 

Int16  g_VICP_i16PostOffset[3] = {0, 0, 0}; //运算后输出加上的值

Int16  g_VICP_i16SignedInput[3] = {0, 0, 0}; //输入数据符号

Int16  g_VICP_i16SignedOutput[3] = {0, 0, 0}; //输出数据符号

 

Uint32 g_VICP_ui32QShift = 10; //结果左移10位


SpacConvBase->srcFormat[0] = CPIS_YUV_444P;

SpacConvBase->srcBuf[0].ptr = pui8YComponent;

SpacConvBase->srcBuf[0].stride = iWidth;

SpacConvBase->srcBuf[1].ptr = (char*)pui8UComponent;

SpacConvBase->srcBuf[1].stride = iWidth;

SpacConvBase->srcBuf[2].ptr = (char*)pui8VComponent;

SpacConvBase->srcBuf[2].stride = iWidth;

 

SpacConvBase->dstFormat[0] = CPIS_RGB_P; //

SpacConvBase->dstBuf[0].ptr = pui8RComponent;

SpacConvBase->dstBuf[0].stride = iWidth;

SpacConvBase->dstBuf[1].ptr = pui8GComponent;

SpacConvBase->dstBuf[1].stride = iWidth;

SpacConvBase->dstBuf[2].ptr = pui8BComponent;

SpacConvBase->dstBuf[2].stride = iWidth;

 

SpacConvBase->roiSize.width = iWidth;

SpacConvBase->roiSize.height = iHeight;

SpacConvBase->procBlockSize.width = g_VICP_ui32BlockWidth;

SpacConvBase->procBlockSize.height = g_VICP_ui32BlockHeight;

SpacConvBase->numInput = (iWidth * iHeight);

SpacConvBase->numOutput = (iWidth * iHeight);

SpacConvParams->matrix[0] = g_VICP_i16CoeffMatrixff[0];

SpacConvParams->matrix[1] = g_VICP_i16CoeffMatrixff[1];

SpacConvParams->matrix[2] = g_VICP_i16CoeffMatrixff[2];

SpacConvParams->matrix[3] = g_VICP_i16CoeffMatrixff[3];

SpacConvParams->matrix[4] = g_VICP_i16CoeffMatrixff[4];

SpacConvParams->matrix[5] = g_VICP_i16CoeffMatrixff[5];

SpacConvParams->matrix[6] = g_VICP_i16CoeffMatrixff[6];

SpacConvParams->matrix[7] = g_VICP_i16CoeffMatrixff[7];

SpacConvParams->matrix[8] = g_VICP_i16CoeffMatrixff[8];

SpacConvParams->qShift = g_VICP_ui32QShift;

SpacConvParams->preOffset[0] = g_VICP_i16PreOffset[0];

SpacConvParams->preOffset[1] = g_VICP_i16PreOffset[1];

SpacConvParams->preOffset[2] = g_VICP_i16PreOffset[2];  

SpacConvParams->postOffset[0] = g_VICP_i16PostOffset[0];

SpacConvParams->postOffset[1] = g_VICP_i16PostOffset[1];

SpacConvParams->postOffset[2] = g_VICP_i16PostOffset[2];

SpacConvParams->signedInput[0] = g_VICP_i16SignedInput[0];

SpacConvParams->signedInput[1] = g_VICP_i16SignedInput[1];

SpacConvParams->signedInput[2] = g_VICP_i16SignedInput[2];

SpacConvParams->signedOutput[0] = g_VICP_i16SignedOutput[0];

SpacConvParams->signedOutput[1] = g_VICP_i16SignedOutput[1];

SpacConvParams->signedOutput[2] = g_VICP_i16SignedOutput[2];

SpacConvParams->colorDsMode = g_VICP_ColorDsMode;

the formula is:

R = 0*(Y - 0) + 0*(U - 128) + 0*(V  -  128)

G = 0*(Y - 0) + 0.392*(U - 128) + 0*(V - 128)

B = 0*(Y - 0) + 0*(U - 128) + 0*(V  -  128)

the result show blow: 

the first data of Cb is 113, the difference between it and 128 is -15, and the -15*( -0.392), the result  is 6, however the result is -94. I suppose the compiler execute 113-128, the result is 67.

I hope you can reply as soon as possible, thanks!

  • Hello,

    There could be a bug in _colorSpcConv.c, line 303:

    info.cmdlen+= imxenc_color_spc_conv(
    info.comp[0],
    info.coefptr,
    outputPtr,
    width, height,
    3,
    width, height,
    3,
    width, height,
    offsetComp,
    width,
    offsetComp,
    width,
    IMXTYPE_UBYTE,  -> IMXTYPE_BYTE 
    IMXTYPE_SHORT,
    IMXOTYPE_BYTE,
    params->qShift,
    info.cmdptr + info.cmdlen
    );

    Could you make the change and recompile src/src_hw/build/imgproclib.pjt ?

  •       Thanks for your reply.

          However, I have a problem that I recompile the imgproclib.pjt, but it only generate imgproc644x.lib.

          And the _colorSpcConv.c have only 240 lines

          The information show as: 

    [Archiving...] "C:\Program Files\Texas Instruments\C6000 Code Generation Tools 6.1.12\bin\ar6x" @"DM6446.lkf"
    ==> new archive 'D:\CCStudio_v3.3\c64plus\vicplib_v330\lib\DM6446\imgproc644x.lib'
    ==> building archive 'D:\CCStudio_v3.3\c64plus\vicplib_v330\lib\DM6446\imgproc644x.lib'

           I hope you can give guidance, thank you!

  •  Thanks for your reply.

          However, I have a problem that I recompile the imgproclib.pjt, but it only generate imgproc644x.lib.

          The information show as: 

    [Archiving...] "C:\Program Files\Texas Instruments\C6000 Code Generation Tools 6.1.12\bin\ar6x" @"DM6446.lkf"
    ==> new archive 'D:\CCStudio_v3.3\c64plus\vicplib_v330\lib\DM6446\imgproc644x.lib'
    ==> building archive 'D:\CCStudio_v3.3\c64plus\vicplib_v330\lib\DM6446\imgproc644x.lib'

           I hope you can give guidance, thank you!

  • Hi,

    In CCS, there is drop down menu for the project that allows you to choose which configuration (dm64x or dm644x) you want to build.

  • Hi,

    Thank you for your reply. It is so helpful for me.

    I try again in accordance with your reply, however I find the last result have negative number, and VICP don't clear it to zero.


  • Hi, I find in the _colorSpcConv.c have a line is that: 

    info.cmdlen+=imxenc_set_saturation(255, 255, -256, -256, info.cmdptr + info.cmdlen);

    It set the sat_low is -256, however the last result may be the Uint8 type.

    And then I set the info.cmdlen+=imxenc_set_saturation(255, 255, 0, 0, info.cmdptr + info.cmdlen) before the info.cmdlen+= imxenc_color_spc_conv()

    I find the data which less than 0, to be set 0

    However the data which greater than 255, to be set the (data - 255)

    for example: 

    I don't understand that, can you tell me the reason?

    Thank you!

  • Hi,

    Can you try to use the natural C version GPP_CPIS_colorSpcConv() and see if you can modify it to produce the desired results.  Once you get the correct results with GPP_CPIS_colorSpcConv(), please send it to me and I can try to fix CPIS_colorSpcConv().

  • Hi.

    Thank you for your reply and I try again in accordance with that.

    I find some bugs and modify the code, as follows:

    Int32 _GPP_CPIS_setColorSpcConvProcessing(
    CPIS_IpRun *ipRun,
    CPIS_BaseParms *base,
    void *p,
    GPP_CPIS_Func *func){

    Int32 offsetComp, i;
    CPIS_Info infoTmp;

    params= *((CPIS_ColorSpcConvParms *)p);

    infoSrc.imgbufptr= (Uint32)(GPP_CPIS_imgBuf + ipRun->imgbufInOfst);
    infoSrc.imgbuflen= ipRun->imgbufLen;
    infoSrc.coefptr= (Int16*) (GPP_CPIS_coef + GPP_CPIS_obj.coefOfst);
    infoSrc.coeflen= 0;
    infoSrc.procBlockSize= base->procBlockSize;

    width= base->procBlockSize.width;
    height= base->procBlockSize.height;

    highSat=255;
    setHighSat= 255;
    lowSat= -256;
    setLowSat= -256;

    for (infoSrc.coeflen=0;infoSrc.coeflen<9;infoSrc.coeflen++)
    *(infoSrc.coefptr + infoSrc.coeflen)= params.matrix[infoSrc.coeflen];

    infoSrc.format= base->srcFormat[0];

    preOffset_pos= infoSrc.coeflen;

    for (i=0;i<3;i++) {
    *(infoSrc.coefptr + infoSrc.coeflen++)= params.preOffset[i];
    signedInput[i]= params.signedInput[i];
    }

    if (_GPP_CPIS_unpackSetup(&infoSrc)== -1)
    return -1;

    offsetComp= (infoSrc.comp[1]-infoSrc.comp[0])<<1;

    infoDst= infoSrc;

    infoDst.comp[0]+= 3*(offsetComp>>1);
    infoDst.comp[1]+= 3*(offsetComp>>1);
    infoDst.comp[2]+= 3*(offsetComp>>1);

    postOffset_pos= infoDst.coeflen;

    for (i=0;i<3;i++) {
    *(infoDst.coefptr + infoDst.coeflen++)= params.postOffset[i];
    signedOutput[i]= params.signedOutput[i];
    }

    infoDst.format= base->dstFormat[0];
    infoDst.colorDsMode= params.colorDsMode;

    infoTmp= infoDst;

    if (_GPP_CPIS_packSetup(&infoTmp)== -1)
    return -1;

    ipRun->imgbufOutOfst[0]= (infoTmp.comp[0] - (Int16*)GPP_CPIS_imgBuf)<<1;
    ipRun->imgbufOutOfst[1]= (infoTmp.comp[1] - (Int16*)GPP_CPIS_imgBuf)<<1;
    ipRun->imgbufOutOfst[2]= (infoTmp.comp[2] - (Int16*)GPP_CPIS_imgBuf)<<1;

    if (base->srcFormat[0] & CPIS_ALPHA) {
    if ((base->dstFormat[0] & ~CPIS_ALPHA)<= CPIS_BAYER_P)
    ipRun->imgbufOutOfst[3]= (infoTmp.comp[3] - (Int16*)GPP_CPIS_imgBuf)<<1;
    else
    ipRun->imgbufOutOfst[1]= (infoTmp.comp[3] - (Int16*)GPP_CPIS_imgBuf)<<1;
    }

    ipRun->imgbufLen= infoDst.imgbuflen;
    ipRun->coefLen= infoDst.coeflen << 1;

    *func= &_GPP_CPIS_setColorSpcConvProcessingFunc;

    return 0;
    }

    Int32 _GPP_CPIS_setColorSpcConvProcessingFunc() {
    Int16 C0, C1, C2, rndofst;
    Int32 i, j;
    Int16 temp;

    if (_GPP_CPIS_unpack(&infoSrc)== -1)
    return -1;

    /****************** add code ******************/
    highSat = 255;
    setHighSat = 255;
    lowSat= -256;
    setLowSat= -256;

    /***************** add end ********************/
    for (i=0;i<3;i++)
    for(j=0;j<width*height;j++) {

    if (signedInput[i])
    temp = (Int16)(*((signed char*)infoSrc.comp[i] + j));
    else
    temp = (Int16)(*((unsigned char*)infoSrc.comp[i] + j));

    C0= (Int16)temp + (Int16)(*(infoSrc.coefptr + preOffset_pos + i));
    if (C0 >= highSat)
    C0= setHighSat;
    else if (C0 < lowSat)
    C0= setLowSat;

    //*((Uint8*)infoSrc.comp[i] + j)= (Int8)C0;
    *((Int8*)infoSrc.comp[i] + j)= (Int8)C0;
    }

    /************ add the code ************/

    highSat = 255;
    setHighSat = 255;
    lowSat= 0;
    setLowSat= 0;

    /************ add end ***************/
    rndofst= (1<<(params.qShift-1));

    for(i=0;i<width*height;i++) {

    /****************   following code modified  *****************/

     /*

    C0 = ( *((Uint8*)infoSrc.comp[0] + i) * infoDst.coefptr[0] \
    + *((Uint8*)infoSrc.comp[1] + i) * infoDst.coefptr[3] \
    + *((Uint8*)infoSrc.comp[2] + i) * infoDst.coefptr[6] + rndofst) >> params.qShift;

    C1 = ( *((Uint8*)infoSrc.comp[0] + i) * infoDst.coefptr[1] \
    + *((Uint8*)infoSrc.comp[1] + i) * infoDst.coefptr[4] \
    + *((Uint8*)infoSrc.comp[2] + i) * infoDst.coefptr[7] + rndofst) >> params.qShift;

    C2 = ( *((Uint8*)infoSrc.comp[0] + i) * infoDst.coefptr[2] \
    + *((Uint8*)infoSrc.comp[1] + i) * infoDst.coefptr[5] \
    + *((Uint8*)infoSrc.comp[2] + i) * infoDst.coefptr[8] + rndofst) >> params.qShift;
    */
    C0 = ( *((Uint8*)infoSrc.comp[0] + i) * infoDst.coefptr[0] \
    + *((Int8*)infoSrc.comp[1] + i) * infoDst.coefptr[3] \
    + *((Int8*)infoSrc.comp[2] + i) * infoDst.coefptr[6] + rndofst) >> params.qShift;

    C1 = ( *((Uint8*)infoSrc.comp[0] + i) * infoDst.coefptr[1] \
    + *((Int8*)infoSrc.comp[1] + i) * infoDst.coefptr[4] \
    + *((Int8*)infoSrc.comp[2] + i) * infoDst.coefptr[7] + rndofst) >> params.qShift;

    C2 = ( *((Uint8*)infoSrc.comp[0] + i) * infoDst.coefptr[2] \
    + *((Int8*)infoSrc.comp[1] + i) * infoDst.coefptr[5] \
    + *((Int8*)infoSrc.comp[2] + i) * infoDst.coefptr[8] + rndofst) >> params.qShift;
    if (C0 >= highSat)
    C0= setHighSat;
    else if (C0 < lowSat)
    C0= setLowSat;

    if (C1 >= highSat)
    C1= setHighSat;
    else if (C1 < lowSat)
    C1= setLowSat;

    if (C2 >= highSat)
    C2= setHighSat;
    else if (C2 < lowSat)
    C2= setLowSat;

    /****************   code modified end *****************/

    *((Uint8*)infoDst.comp[0] + i)= (Int8)C0;
    *((Uint8*)infoDst.comp[1] + i)= (Int8)C1;
    *((Uint8*)infoDst.comp[2] + i)= (Int8)C2;

    }

    for (i=0;i<3;i++)
    for(j=0;j<width*height;j++){

    if (signedOutput[i])
    temp = (Int16)(*((signed char*)infoDst.comp[i] + j));
    else
    temp = (Int16)(*((unsigned char*)infoDst.comp[i] + j));

    C0= temp + (Int16)(*(infoDst.coefptr + postOffset_pos + i));

    if (C0 >= highSat)
    C0= setHighSat;
    else if (C0 < lowSat)
    C0= setLowSat;

    *((Uint8*)infoDst.comp[i] + j)= (Int8)C0;

    }

    if (_GPP_CPIS_pack(&infoDst)== -1)
    return -1;

    return 0;
    }

    Then the result is correct.

    In addition, I want to know the function of _CPIS_unpack() and _CPIS_pack()

    I have another question:

           The VICP address 0x00100000 data and the U component is show in the picture

    and then I run the program and I find the U data is forer than the 0x00100000 some circle.

  • Hi,

    Three days passed, if you have some suggestions for me.

    For us, this is demand very urgent.

    Thank you!

  • Hi,

    I won't be able to translate to VICP one of the changes you made that I highlighted in red:

    C0 = ( *((Uint8*)infoSrc.comp[0] + i) * infoDst.coefptr[0] \
    + *((Int8*)infoSrc.comp[1] + i) * infoDst.coefptr[3] \
    + *((Int8*)infoSrc.comp[2] + i) * infoDst.coefptr[6] + rndofst) >> params.qShift;

    C1 = ( *((Uint8*)infoSrc.comp[0] + i) * infoDst.coefptr[1] \
    + *((Int8*)infoSrc.comp[1] + i) * infoDst.coefptr[4] \
    + *((Int8*)infoSrc.comp[2] + i) * infoDst.coefptr[7] + rndofst) >> params.qShift;

    C2 = ( *((Uint8*)infoSrc.comp[0] + i) * infoDst.coefptr[2] \
    + *((Int8*)infoSrc.comp[1] + i) * infoDst.coefptr[5] \
    + *((Int8*)infoSrc.comp[2] + i) * infoDst.coefptr[8] + rndofst) >> params.qShift;

    On VICP, all the types in each formula to calculate C0, C1, C2  must be the same. If the highlighted type was changed to (Int8*), would the result still be correct ?

    If not, can you try the following:

    1) Revert to the original code for CPIS_colorSpcConv(), and GPP_CPIS_colorSpcConv()

    2) Change your formula from:

    R = 0*(Y - 0) + 0*(U - 128) + 0*(V  -  128)

    G = 0*(Y - 0) + 0.392*(U - 128) + 0*(V - 128)

    B = 0*(Y - 0) + 0*(U - 128) + 0*(V  -  128)

    to

    R = 0*(Y - 0) + 0*U + 0*V

    G = 0*(Y - 0) + 0.392*U  + 0*V - 0.392*128

    B = 0*(Y - 0) + 0*U + 0*V

    By setting the following:

    Int16 g_VICP_iCoeffMatrix[9] = {0, 0, 0, 0, -401, 0, 0, 0 0}; //系数矩阵

    Int16 g_VICP_i16PreOffset[3] = {0, 0, 0}; //运算前输入加上的值

    Int16  g_VICP_i16PostOffset[3] = {0, -50, 0}; // -0.392*128= -50

    Int16  g_VICP_i16SignedInput[3] = {0, 0, 0}; //输入数据符号

    Int16  g_VICP_i16SignedOutput[3] = {0, 0, 0}; //输出数据符号


    The functions  _CPIS_unpack() and _CPIS_pack() are effective when the color format used is an interleaved format. In your case, you are using planar format so these functions don't do anything internally.

    regards,

    Victor

  • Hi,

    Thank you for your reply.

    My problem is that, the last result of R,G,B have negative data, and VICP's sat_low_set = -256, so the negative would be a very large positive data, for example:

    if the G = -16, VICP's result is 240.

    My result figure would have many noise points.

                                                        error image

                                                                               normal image

  • Does it happen after the changes I suggested, which are:

    Int16 g_VICP_i16PreOffset[3] = {0, 0, 0}; //运算前输入加上的值

    Int16  g_VICP_i16PostOffset[3] = {0, -50, 0}; // -0.392*128= -50


    You can try adding a imxenc_set_saturation(), before postoffset and replace if (params->postOffset[i]) with if(1):

    info.cmdlen+=imxenc_set_saturation(255, 255, 0, 0, info.cmdptr + info.cmdlen);

    for (i=0;i<3;i++)
    if (params->postOffset[i]){

    if (1){

    *(info.coefptr + info.coeflen)= params->postOffset[i];

    if (params->signedOutput[i]== 1)
    type= IMXTYPE_BYTE;
    else
    type= IMXTYPE_UBYTE;

    info.cmdlen+= imxenc_array_scalar_op(
    info.comp[i],
    info.coefptr + info.coeflen,
    info.comp[i],
    width, height,
    1, 1,
    width, height,
    width, height,
    type,
    IMXTYPE_SHORT,
    IMXOTYPE_BYTE,
    0,
    IMXOP_ADD,
    info.cmdptr + info.cmdlen
    );
    info.coeflen++;
    }

  • Hello Victor, Thank you for your reply.

    There are problems either with your suggestion or my  own formula.

    I have tried your suggestion three days ago, however I found the G,B component is corrected, and the R component is incorrect.

    the R component is beyond the 255, vicp will set it to R-256, for example the R = 320, the result is 320-256=64.

  • Hi,

    Could you please contact your local FAE for further assistance ? Thanks.

    regards,

    Victor

  • Hello,

    I have sorted out the most recent experimental results, the main problem is that:

    1. If the result is negative, the VICP will save it as a very large positive number,  before it as the input argument of imxenc_array_scalar_op( ).

    2. Though I write the info.cmdlen+=imxenc_set_saturation(255, 255, 0, 0, info.cmdptr + info.cmdlen); before the info.cmdlen+= imxenc_color_spc_conv(), the result of data will less than the correct result.

    And I have asked the local FAE three days age, however they did not respond to me. 

    Would you have some others suggestions. It is so urgent for us.

    Thanks. 


  • Hellp, Victor.

    I would like to try set the type of input argument as Int16.

    Could you give me some suggestions.

    Thanks.

  • Hello, Victor.

    I have solved my problem.

    The parameters are that:

    Int16 g_VICP_i16PreOffset[3] = {-128, -128, -128};

    Int16 g_VICP_i16PostOffset[3] = {128, 128, 128};

    Int16 g_VICP_i16SignedInput[3] = {0, 0, 0};

    Int16 g_VICP_i16SignedOutput[3] = {1, 1, 1};

    And I modify the _colorSpcConv.c:

    info.cmdlen+=imxenc_set_saturation(255, 255, -256, -256, info.cmdptr + info.cmdlen);     => info.cmdlen+=imxenc_set_saturation(255, 255, -128, -128, info.cmdptr + info.cmdlen); 

    info.format= base->srcFormat[0];
    info.colorDsMode= params->colorDsMode;

    if (_CPIS_unpack(&info)== -1)
    return -1;

    for (i=0;i<3;i++)
    if (params->preOffset[i]){

    *(info.coefptr + info.coeflen)= params->preOffset[i];

    if (params->signedInput[i]== 1)
    type= IMXTYPE_BYTE;
    else
    type= IMXTYPE_UBYTE;

    info.cmdlen+= imxenc_array_scalar_op(
    info.comp[i],
    info.coefptr + info.coeflen,
    info.comp[i],
    width, height,
    1, 1,
    width, height,
    width, height,
    type,
    IMXTYPE_SHORT,
    IMXOTYPE_BYTE,
    0,
    IMXOP_ADD,
    info.cmdptr + info.cmdlen
    );

    info.coeflen++;
    }

    offsetComp= (info.comp[1]-info.comp[0])<<1;

    if ((base->dstFormat[0] & ~CPIS_ALPHA)== CPIS_YUV_422ILE) {
    outputPtr= info.coefptr + info.coeflen;
    outputPtr = (Int16*)(((Uint32)outputPtr + 15) & 0xFFFFFFF0); /* align 128 bits */
    info.coeflen+= outputPtr - (info.coefptr + info.coeflen)+ 3*(offsetComp>>1);
    }
    else
    outputPtr= info.comp[0] + 3*(offsetComp>>1);

    info.cmdlen+= imxenc_color_spc_conv(
    info.comp[0],
    info.coefptr,
    outputPtr,
    width, height,
    3,
    width, height,
    3,
    width, height,
    offsetComp,
    width,
    offsetComp,
    width,
    IMXTYPE_BYTE,
    IMXTYPE_SHORT,
    IMXOTYPE_BYTE,
    params->qShift,
    info.cmdptr + info.cmdlen
    );

    if ((base->dstFormat[0] & ~CPIS_ALPHA)== CPIS_YUV_422ILE) {
    info.comp[0]= outputPtr;
    info.comp[1]= outputPtr + (offsetComp>>1);
    info.comp[2]= outputPtr + 2*(offsetComp>>1);
    }
    else {
    info.comp[0]+= 3*(offsetComp>>1);
    info.comp[1]+= 3*(offsetComp>>1);
    info.comp[2]+= 3*(offsetComp>>1);
    }

    info.cmdlen+=imxenc_set_saturation(255, 255, 0, 0, info.cmdptr + info.cmdlen);
    for (i=0;i<3;i++)
    if (params->postOffset[i]){
    *(info.coefptr + info.coeflen)= params->postOffset[i];

    if (params->signedOutput[i]== 1)
    type= IMXTYPE_BYTE;
    else
    type= IMXTYPE_UBYTE;

    info.cmdlen+= imxenc_array_scalar_op(
    info.comp[i],
    info.coefptr + info.coeflen,
    info.comp[i],
    width, height,
    1, 1,
    width, height,
    width, height,
    type,
    IMXTYPE_SHORT,
    IMXOTYPE_BYTE,
    0,
    IMXOP_ADD,
    info.cmdptr + info.cmdlen
    );
    info.coeflen++;
    }

    Thanks for your help very much.