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.

[DM8127 IPNC 3.0] JPEG Codec

hi, all

In my application, I need encode some area of picture , not all of the picture.

the all area of picture is encode from topLeft to bottomRight.

I want to encode not from topLeft (0,0), but from , for example,(0, 144) to the bottomRight.

what should I do?

I read the encLink_jpeg.c,  but  fail to change the topLeft point.

pls, give some suggestions.  Thank you!

regards,

Haitao

  • For this, you can move the start of the frame to (0,144) (as in example) and give the frame width as the pitch.

    Pitch can be specified in "captureWidth" params

    But in the encode width and height, you can specify the actualwidth and heigth needed for encode

    Hope you got the details , let me know if need further details

    Regards,

    Raghu

  • Hi, Raghu.

    Thank you for your reply.

    You noted that,

    But in the encode width and height, you can specify the actualwidth and heigth needed for encode

    Does it mean like this.  for example, the whole picture's resolution is 1920*1080, I want to just encode 540*480 which the topleft point is (0, 144), and bottomright point is (540, 524).   To get it, I should change actualwidth and heigth. I try as follow but it does work?

    Or, I am in a wrong place?

    I change enclink_jpeg_set_algObject() function in encLink_jpeg.c as follow,

    /*------------------------------------------------------------------------*/
    /* Set entire Image region in the buffer by using config parameters */
    /*------------------------------------------------------------------------*/
    inputBufDesc->imageRegion.topLeft.x = algDynamicParams->startX;
    inputBufDesc->imageRegion.topLeft.y = algDynamicParams->startY;
                                                                              //algDynamicParams->startY + 144;
    inputBufDesc->imageRegion.bottomRight.x = algDynamicParams->startX +
    algObj->dynamicParams.videnc2DynamicParams.inputWidth;
    inputBufDesc->imageRegion.bottomRight.y = algDynamicParams->startY +
    algObj->dynamicParams.videnc2DynamicParams.inputHeight;
    /*------------------------------------------------------------------------*/
    /* Set proper Image region in the buffer by using config parameters */
    /*------------------------------------------------------------------------*/
    inputBufDesc->activeFrameRegion.topLeft.x = algDynamicParams->startX;
    inputBufDesc->activeFrameRegion.topLeft.y = algDynamicParams->startY;
                                                                                        //algDynamicParams->startY + 144;
    inputBufDesc->activeFrameRegion.bottomRight.x = algDynamicParams->startX + algObj->dynamicParams.videnc2DynamicParams.inputWidth;
                                                                                        //algDynamicParams->startX + 1280;
    inputBufDesc->activeFrameRegion.bottomRight.y = algDynamicParams->startY + algObj->dynamicParams.videnc2DynamicParams.inputHeight;
                                                                                         //algDynamicParams->startY + 720;

    however, It looks like enclink_jpeg_set_algObject() do not run, because I add some debug information, but in LOG there are no informations.

    Thank you, Raghu.

    Regards,

    Haitao