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.

The valid range of the "rstInterval"

Hi all:

      As we know DM365 JPEG codec support restart interval, and we can change the interval value by extend JPEG parameters, from JPEG codec user guide, we can find:

 rstInterval Uint16 Input Restart interval in number of MCUs, must be > 3 Default value: 84.

      I can't find out the maximum value for this paramter, anyone we can tell me this?

      I had tryed to set this value to 0xFFFF, 0x3FFF,  but both failed.

      BTW, is there any method that can remove the restart interval(DRI) from JPEG header?

  • Hi,

    The upper limit for the 'rstInterval' parameter is the number of MCUs in the image.  Anything above that and the codec will fail.

     

    Regards,

    Akshay

     

     

  • Hi Akshay:

              Appreciate for you response.

              is there any way that can remove the restart interval in JPEG header? or disable the slice mode?

  • Hi Tracy,

    To disable slice mode, it is sufficient to set value of numAU as 0. If you then invoke a process call with generateHeader = XDM_ENCODE_AU, then codec will process entire image in one shot. 

    There is no way to disable or remove the restart interval in the header. 

     

    Regards,

    Akshay

     

     

     

  • Hi Akshay:

             I'v got a network camea which use DM365 Soc, and we can't find the "FF DD" in JPEG header, but i don't know how to set the codec paramters to get the JPEG image without restart interval(DRI) in JPEG header, anyone can help me?

  • Hi Tracy,

    I have checked the images that we have encoded and I can see the 'FFDD' marker in the JPEG Header. I also cross checked with JPEGSnoop analysis software. 

    Currently, there is no option to prevent insertion of  'FFDD' or Restart Interval Marker in JPEG Header area.

    As discussed previously, if you set the Restart Marker Interval in the config to be equal to the number of MCUs, then the restart marker will not appear in the encoded bitstream. 

     

    Regards,

    Akshay

     

  • Hi Akshay:

                  Thanks for you comments.

    Akshay Panday said:

    As discussed previously, if you set the Restart Marker Interval in the config to be equal to the number of MCUs, then the restart marker will not appear in the encoded bitstream. 

    Tracy>> I had set the resInterval to the totalAU, but  still failed when call "XDM_SETPARAMS", the encode resolution is VGA, and I had add debug and got  the totalAU is 1920, is there any thing wrong?

  • Hi Tracy,

    If you do a XDM_GETSTATUS control call after process call, you can get totalAU as applies to your particular case. 

    If you are encoding a VGA image, then how are you getting totalAU as 1920? Shouldn't it be (640*480)/256 = 1200?

    I tried encoding a VGA image with numAU config parameter as 1200 and it works. Anything above that, however, fails at SETPARAMS. 

    Regards,

    Akshay

     

     

     

  • Hi Akshay:

           Thanks for you patient!

           My RAW data size is 1024x576, and I will cropping a VGA image from the center, so the MCUs size is (1024x480)/256=1920.

           I had tryed several case, but thd DRI still exist in the JPEG header:

                     1). Encode VGA from 1024x576: Set rstInterval to 1200 or set numAU to 1200 or both set.

                     2). Encode 720P from 720P raw data: Set rstInterval to 3600 or set numAU to 3600 or both set.

           It would be appreciate if you can provide these parameter in you test case which can't find the DRI in JPEG header.

     

  • Hi Tracy,

    Thanks for the info.

    The tips I gave you were for avoiding Restart Marker in the encoded data.

    The codec will ALWAYS put a DRI marker in the JPEG Header. Currently, there is no way to avoid that.

     

    Regards,

     

    Akshay

  • Hi Akshay:

           Appreciate for you help!

           It's useful for me.

           As I had said before, I check a Network Camera which use DM365 Soc solution too, and it jpeg image don't contain the DRI, I want to figure out why this would happen? They build the JPEG header by SW?

  • Hi Tracy,

    Perhaps you can write a small piece of code to parse out the DRI Marker from the header of the encoded image in your application.

    You have to look for 'FFDD' pattern and remove that and the next 4 bytes. 

    Hope this helps you close the issue.

     

    Regards,

    Akshay