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.

JPEG encoder problem



Hi all,

I've been trying to get the eval JPEG encoder working which comes with the DVSDK_1_11_00_00_DM648 version of the DVSDK, without success.  What's strange is that I've been able to get the sample application within codecs_1_10_evmDM648\packages-evaluation\ti\sdo\codecs\jpegenc working without problems.  My application is able to create the JPEG instance and initialize the dynamic parameters.  Everything is fine until the call to process() which fails with error 40960 (with 0 bytes generated).  As far as I can tell, the code in my application is configuring the encoder the same way as the sample (including image size and format), so I've been trying to check out the differences between the applications.  Here's what I know differ between the working sample and my application so far:

  1. The sample application is being run on the DM648 EVM board, while my application runs on a custom DM647 board.  Is there a know problem running the JPEG encoder on a 647?  Note that I have been able to get both the AVC and MPEG4 encoders working on the 647.
  2. The sample application is being configured to run only the JPEG encoder while my application is configuring the JPEG encoder along with either the AVC or MPEG4 encoder.  Is there a resource conflict between the JPEG encoder and the AVC/MPEG4 encoders which would cause JPEG to fail?
  3. My application is using the XDC packages to include/link with other packages including the video port driver, AVC/MPEG4 encoders, EDMA, PCI, etc.  From the other sample application in the DVDSK, I assumed this was the correct way to do things, but the JPEG sample application includes and links with external packages directly - actually the alg code in the sample seems to have been modified and linked directly with the application.  Are there known conflicts between the JPEG encoder and other packages when included using the XDC packaging system?

Thanks,

Peter

 

  • Peter,

    This question seems primarily codec related, so I'm going to move this thread to the codecs forum in hopes that it will get a faster response there.

    Dave

  • Hi Peter,

     

    Jpeg Encoder(DM648) is not using DMA resource which implies that there would not any resource conflict when MPEG4 encoder is also in picture.Please configure your appliation to run only JPEG encoder and check whether it still fails.

    The error code(40960) corresponds to "Fatal error" and "Unsupported feature/ parameter in input".Please run the application with some traces for these conditions and share the logs so that it would help in further debugging.

     

    Regards,

    Poornima

     

  • Hi Poornima,

    Ok, I've configured the application to only depend on the JPEG encoder (AVC and MPEG4 have been removed) and it still fails.  I'm attaching some trace information I have added to the application (is there something built into the encoder I can capture and upload?).  I'm currently trying to configure my app exactly like the sample application that comes with the eval encoder since it seems to work.  I think i'm missing somethink very basic here like memory under allocation, or that the DM647 just cannot run this algo.  Anyhow here's my trace info:

    Apr 29 09:28:32 dspmsgd[429]: DSP0: params ------
    Apr 29 09:28:32 dspmsgd[429]: DSP0: size              = 24
    Apr 29 09:28:32 dspmsgd[429]: DSP0: maxHeight         = 512
    Apr 29 09:28:32 dspmsgd[429]: DSP0: maxWidth          = 768
    Apr 29 09:28:32 dspmsgd[429]: DSP0: maxScans          = 0
    Apr 29 09:28:32 dspmsgd[429]: DSP0: dataEndianness    = 3
    Apr 29 09:28:32 dspmsgd[429]: DSP0: forceChromaFormat = 2
    Apr 29 09:28:32 dspmsgd[429]: DSP0: implementationId @ 0xe3f6ac8c
    Apr 29 09:28:32 dspmsgd[429]: DSP0: algActivate      @ 0xe3faffe0
    Apr 29 09:28:32 dspmsgd[429]: DSP0: algAlloc         @ 0xe3ff0620
    Apr 29 09:28:32 dspmsgd[429]: DSP0: algControl       @ 0x0
    Apr 29 09:28:32 dspmsgd[429]: DSP0: algDeactivate    @ 0xe3fef3e0
    Apr 29 09:28:32 dspmsgd[429]: DSP0: algFree          @ 0xe3feff60
    Apr 29 09:28:32 dspmsgd[429]: DSP0: algInit          @ 0xe3fefd60
    Apr 29 09:28:32 dspmsgd[429]: DSP0: algMoved         @ 0x0
    Apr 29 09:28:32 dspmsgd[429]: DSP0: algNumAlloc      @ 0xe3fec560
    Apr 29 09:28:32 dspmsgd[429]: DSP0: process          @ 0xe3fede80
    Apr 29 09:28:32 dspmsgd[429]: DSP0: control          @ 0xe3fef800
    Apr 29 09:28:32 dspmsgd[429]: DSP0: dynamicParams ------
    Apr 29 09:28:32 dspmsgd[429]: DSP0: size              = 32
    Apr 29 09:28:32 dspmsgd[429]: DSP0: numAU             = 0
    Apr 29 09:28:32 dspmsgd[429]: DSP0: inputChromaFormat = 4
    Apr 29 09:28:32 dspmsgd[429]: DSP0: inputHeight       = 512
    Apr 29 09:28:32 dspmsgd[429]: DSP0: inputWidth        = 768
    Apr 29 09:28:32 dspmsgd[429]: DSP0: captureWidth      = 0
    Apr 29 09:28:32 dspmsgd[429]: DSP0: generateHeader    = 0
    Apr 29 09:28:32 dspmsgd[429]: DSP0: qValue            = 73
    Apr 29 09:28:32 dspmsgd[429]: DSP0: InBuf 1 sz: 786432
    Apr 29 09:28:32 dspmsgd[429]: DSP0: OutBuf 1 sz: 574095
    Apr 29 09:28:32 dspmsgd[429]: DSP0: Generated 0 bytes
    Apr 29 09:28:32 dspmsgd[429]: DSP0: Process function returned an Error... 40960

    Thanks,

    Peter

  • So I realized that I've been using the codec engine API to initialize and use the AVC and MPEG encoders while I've used IALG to initialize/use the JPEG encoder (because this is how the sample is structured). So I converted all the IALG calls to codec engine, but end up with the same 40960 error when calling process. So what's the difference between using the codec engine and IALG? I assume that IALG is more general purpose, and that the codec engine may even use IALG under the hood, correct? Which is prefered?

    So back to the main problem: why am I getting the 40960 error when calling process with the JPEG encoder? If anyone from the codec dev team is reading this forum, could you let me know what could internally trigger a 40960 error in the JPEG encoder version 1.12 distributed in the DVSDK 1.11 for the DM648? I'm compeletely blocked at this point and could use any guidance you may have on this issue. Again, could other packages be fighting for resources (vport driver, EDMA, PCI) or does this just not work on a DM647?

     

    Thanks,
    Peter

  • Hi Peter,

    It would be more convenient if you proceed with IALG interface for further debugging.

    Please provide logs by printing the return values of control and process functions, also print the arguments(inargs,outargs,status etc.) being passed to these functions, just before calling the function and after the function returns.

    Also provide the pseudocode or snippet of your test application.

     

    Regards,

    Poornima

     

     

     

  • Hi Poornima,

    Sorry for the delay, I thought there was a problem with the e2e forums, but found out that my upgrade to IE9 killed my ability to send messages.  Oh well.  I'll use the IALG interface for now.  I have my encoder wrapper divided into an init routine and an encode routine.  Both are attached: 4846.jpeg.zip.

    The image_t is a simple image which includes the pixel planes and their widths/heights (using 422 planar in this case), and debugMsg is affectivly printf().  The dumps from my previous post came from this code where jpgEncInit() and then jpgEnc() were called in order.

    I have been able to use the emulator to load and run the sample application on my 647 board, so I don't think there is a compatibility issue between the encoder and the 647.  Again I get error 40960 with in the IIMGEncFxns->process() call.  What can trigger this error within process()?

    Thanks,

    Peter

     

  • 3034.jpeg_mod.zip

    Hi Peter,

    I have attached the wrapper code with some more debug prints added so that it would be of more help for narrowing down the issue.Please run your application with this modified wrapper code and share the logs.

    Also please share the image that you are trying to encode so that I can also do some more testing to debug the issue.

     

    Regards,

    Poornima

     

     

     

     

  • Hi Poornima,

    I've attached the dump: 2021.jpgenc_trace.zip.  However, I had to change your format slightly to be able to get it through our narrow bandwidth debug channel.  Unfortunately I cannot add an image since my jpgenc input is coming from a camera sensor.

    Thanks,

    Peter

     

  • Hi Peter,

    Thanks for the logs shared.

    Please find the attached wrapper code with some more prints incorporated for debugging further.2502.jpeg_mod.zip.Pun your application with this wrapper and share the logs.

    Is there any way to capture the data coming from camera sensor and share the image so that I can also try to encode the image at my end and help you further?

     

    Regards,

    Poornima

  • Hi Poornima,

     

    Here's the latest dump: 8231.jpgenc_trace-2.zip.  I'm still working on a way to get you an image.  Can we go with a synthetic white, black, or mid-gray image?

    Peter

  • 3162.jpeg_mod.zip

     

    Hi Peter,

    Please try with the attached wrapper code with your application and provide the logs.You can provide image in any format.

    Regards,

    Poornima

  • Hi Poornima,

    Whaoooo ! I think your latest trace suggestion pointed out my problem - I was trying to compress image data before I had any available.  The YCC planes I was passing in were NULL, so naturally the endoer did not work.  Sorry for wasting so much of your time on this.  At this point I'm think I'm in good shape, but since I already had such a stupid bug in the code, I will probably have more.

    Thanks again,

    Peter

     

  • It's alright Peter.Keep moving ahead.

    Regards,

    Poornima