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.

Ienc1_process() fails on TI JPEG encoder with 3840x2748 resolution image

I am trying to use TI's provided jpeg encoder (jpegenc) to encode a 3840x2748 image. I have successfully encoded 720x480 images, and have adjusted the parameters and dynamic parameters for the increased resolution, but the call to Ienc1_process() fails, with 0 bytes generated.

The error code from IIMGENC1_OutArgs.extendedError is 0x48FA9C6C, corresponding to:

XDM_FATALERROR

XDM_CORRUPTEDHEADER

XDM_CORRUPTEDDATA

XDM_INSUFFICIENTDATA

 

The first three error flags seem to indicate a result, rather than a cause. Can anyone elaborate on the meaning of XDM_INSUFFICIENTDATA?

 

Code excerpt:

 

// Initialize Image Encoder Params to defaults

iEncParams = &iEncDefaultParams;

iEncDynamicParams = &iEncDefaultDynamicParams;

 

// Set up Image Encoder Static Params

iEncParams->maxHeight = 2748; //2748;

iEncParams->maxWidth = 3840; //3840;

 

// Set up Image Encoder Dynamic Params

iEncDynamicParams->inputChromaFormat = XDM_YUV_422P;

iEncDynamicParams->inputHeight = 2748;//2748;

iEncDynamicParams->inputWidth = 3840;//3840;

iEncDynamicParams->captureWidth = 3840;//3840;

 

// Create still image encoder

hIe1 = Ienc1_create(hEngine, imgEncName, iEncParams, iEncDynamicParams);

if (hIe1 == NULL) {

   ERR("Failed to create still encoder\n");

   cleanup(THREAD_FAILURE);

}

else

{

   printf("hIe1 created successfully\n");

}

if(Ienc1_process(hIe1, hImgInBuf, hImgOutBuf) != 0)

{

   printf("Ienc1 Failed\n");

}

else

{

   printf("Ienc1 Succeeded\n");

}

 

Any ideas? Thanks.

 

System:

DVSDK 3.10.00.19

Codec Server 1.00.00.10

DMAI 2.10.00.12

XDAIS 6.25.02.11

 

  • Hi Andrew,

    We will check this and get back. Pls give us 2-3 days.

    regards

    YD

  • Hi Andrew,

    Can you please mention the JPEG Encoder codec version used?

     

    Thanks,

    Roopesh

  • Version 02.00.01 (The one packaged with cs2dm6467_1_00_00_10)

     

     

  • Additional information:

    I tried incrementing the image size to see what I could learn.  In the process, I did not update the image itself, forcing the jpeg encoder to try to encode garbage.  Without the source code, I don't know what affect that has.  However, I found that above approximately 1024x2748, the jpeg encoder fails with error code 0x401, corresponding to XDM_INSUFFICIENT_DATA and JPEGENC_OUTPUT_BUFF_SIZE.  I increased the buffer size beyond the size given by Ienc1_getOutBufSize(), and could then go above 1024x2748.  To me this looks like a bug, though I suspect the large outputs I have are because I was encoding garbage. 

    The encoder succeeded all the way up to 3824x2748.  It falied at 3825x2748 and above with error code 0x49930c6c, corresponding to XDM_CORRUPTED_DATA and XDM_INSUFFICIENT_DATA.

    Setting dynamicParams->captureWidth = 3824; and dynamicParams->inputWidth = 1920 succeeded (though with correct but meaningless output).

    Setting dynamicParams->captureWidth = 3840; and dynamicParams->inputWidth = 1920 still failed with error code 0x49930c6c.

    It seems that putting captureWidth past the threshold of 3824 causes the error.

    Hopefully this gives you some ideas for what I should try next.  Thanks.

  • Resolved!

    An input height of 2748 is invalid per the note on page 4-7 of the jpeg encoder manual.  Valid heights for YUV_422P are multiples of 8.  2748 is not a multiple of 8.  Reducing the height to 2744 solved the problem. 

    I am now able to encode 3840x2744 images.

    Thanks to those who were looking into it.