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.

DM365 JPEG decoder problem

Hi,


Recently I've been working on decoding a video using MJPEG. The problem I encountered is that some of the buffers (JPEG images) were syntactically correct, meaning that the header and EOI code were correct, but the decoder wasn't able to decode it. This happened randomly, without a specific pattern or order. Looking around on the internet I found this:

http://linux.omap.com/pipermail/davinci-linux-open-source/2010-December/021286.html

We implemented that solution on Diego Dompe's plugins branch for the DM365 and can confirm this behavior, we also noticed that adding less than 1024 bytes to the buffer wouldn't work as well.

 

Is there an explanation for this? If so, is there a "cleaner" way to solve this issue? I can provide example images for both cases.

  • Hi Pablo,

    Are the images encoded with the DM365 JPEG Encoder only? 

    It would be great if you could send some samples across so that we can examine them and try to establish the cause of the problem.

    I will also need the version number of the JPEG Decoder & Encoder and the parameters for the JPEG Encoder (if using DM365 based one).

    Can you also detail the steps you've taken so far?

     

    Regards,

    Akshay

  • Hi Akshay,

    I'm attaching some sample images that were encoded using the DM365 JPEG codec, files 0 and 3 can be decoded while 1 and 2 can't.

    The encoder/decoder version used is the one in DVSDK 4.02, according to the codec release notes both the decoder and the encoder version is 01.00.00 and the parameters used are the default ones.


    Now the steps:

    1. Recorded a video using

    gst-launch -e videotestsrc ! 'video/x-raw-yuv,format=(fourcc)UYVY,width=720,height=480,pitch=736' ! dmaienc_mjpeg qValue=30 ! queue ! qtmux ! filesink location=test_mjpeg.mp4

     

    2. Tried to decode using

    gst-launch filesrc location = test_mjpeg.mp4 ! qtdemux name=demux .video_00 ! queue ! dmaidec_mjpeg ! 'video/x-raw-yuv, format=(fourcc)NV12' ! fakesink

     
    3. Adding DMAI_DEBUG=2 to the previous pipeline got this error messages:

    @0x000f4f82:[T:0x41b28490] ti.sdo.dmai - [Idec1] IMGDEC1_process() failed with error (-1 ext: 0x8800)

    @0x000f87a4:[T:0x41b28490] ti.sdo.dmai - [Idec1] IMGDEC1_process() failed with error (-1 ext: 0xc000)

     

    4. Separated the video in different images (buffers) using:

    gst-launch filesrc location = test_mjpeg.mp4 ! qtdemux name=demux .video_00 ! queue ! multifilesink location=test_%d.jpeg

     

    5. Tried to decode the images individually using:

    DMAI_DEBUG=2 gst-launch filesrc location = test_X.jpeg  ! dmaidec_jpeg ! fakesink

    and got:

    @0x00068c70:[T:0x4125a490] ti.sdo.dmai - [Idec1] IMGDEC1_process() failed with error (-1 ext: 0x8800)

     

    samples.zip
  • Hi Pablo,

     

    Apologies for the delay.

    I checked your files with version 1.00.00.10 of the JPEG Decoder and they are decoding fine. 

     

    Regards,

    Akshay

  • Hi,

    Were you using a large input buffer as inidicated on the link above? (http://linux.omap.com/pipermail/davinci-linux-open-source/2010-December/021286.html).



    Thanks,

    Pablo

  • Hi Pablo,

    I tried with both cases - with a much larger input buffer and with an input buffer which is the exact size of the codec requirement.

     

    Regards,

    Akshay

  • Hi,

    I am also working on JPEG decoder and I am also getting a similar error.

    I am using dvsdk_4_02_00_06 and linux 2.6.32.17. 

    I am getting an extended error as "err: 0x8800" (XDM_FATALERROR) according to user guide.

    Can anyone please tell me the reason for this error and how to avoid this error??

    Thanks a lot

    Thanks,

    Rohan

  • Hi Rohan,

    Dis you follow the link on the very first post in this thread? They used a larger buffer and it worked fine, also that worked for me.


    Regards,

    --Pablo

  • Hi,

    Extended error code "0x8800" corresponds to corrupted input JPEG data. Please check the input buffer size and make sure to provide complete JPEG frame data to decoder.

    Regards, RSV

  • Hi Pablo,

    thanks for the reply. Even if I increase the buffer size, the same problem is observed but little later. 

    Also

    1. I observed that when the decoder fails the bytes consumed by the decoder are less than the actual number of bytes present in the buffer. i.e even if the data is present in the buffer the decoder is not reading the complete buffer. Any idea why this might be happening?

    2. Is there any "End of Frame" or "Start of frame" sequence in case of MJPEG encoded data which I can look for? If there is please let me know.

    3. I am also running H.264 decoder along with JPEG decoder. Can these two be run simultaneously? Is any synchronization required between these two?

    4. Once the JPEG decoder fails with FATAL_ERROR, it does not recover. I tried XDM_RESET but it didn't help. Is there any way to recover the Jpeg decoder if it fails once?

    Thanks for help.

    Thanks and Regards,

    Rohan