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 resize problem



Hi, everyone

     I'm using DM365 to decode 4 channel MPEG4 stream from net and  display it on TV in 1280x720,  when the stream resolution is 432x240, so I need to resize it to 640x360 each channel, but when I do the resize using DMAI API, for one channel, I got an jitter frame, for several channel, you know I use one resizer to resize 4 channel after it decode in 4 thread, got frames confuse each other like picture followed, and I try to resize it smaller than 432x240 it works well, or when I  make the horizontal or vertical not change and only change the other one, it can works well when lower 2x, and when the other direction bigger than 2x, the problem appeared, anyone meet this before, any suggest will be appreciate

I'm using 4 thread to decode and resize stream but to share on resizer and tmpbuf like

  if (channel == 0) {   
  hRsz = Resize_create(&rszAttrs);
  if (hRsz == NULL) {
      printf("Failed to create resize job\n");
      goto cleanup;
  }
  
  gfxAttrs.dim.x = 0;
  gfxAttrs.dim.y = 0;
  gfxAttrs.dim.width = DST_WIDTH;
  gfxAttrs.dim.height = DST_HEIGHT;
  gfxAttrs.colorSpace = colorSpace;   
  gfxAttrs.dim.lineLength =((Int32)((BufferGfx_calcLineLength(gfxAttrs.dim.width,colorSpace)+31)/32))*32; 

  int tmpsize = 0;
  if(colorSpace == ColorSpace_YUV420PSEMI){
   tmpsize = gfxAttrs.dim.lineLength * gfxAttrs.dim.height*3/2; 
  }else{
   tmpsize = gfxAttrs.dim.lineLength * gfxAttrs.dim.height;
  } 
  htmpBuf = Buffer_create(tmpsize, BufferGfx_getBufferAttrs(&gfxAttrs));
  if (htmpBuf == NULL) {
   ERR("Failed to allocate htmpBuf %s\n", serverIP);
   goto cleanup;
  }
 
  if (Resize_config(hRsz, BufTab_getBuf(BufTab, 0), htmpBuf) < 0) {
      printf("Failed to configure resize job\n");
      goto cleanup;
  }
  
 }

 

and pictures to make clearly for the problem, first one is the right display, and second is what I mentioned above, you should notice that the 3 channel have some pixel should be channel 2 on top and a lot should be channel 1 in middle, 

 

  • Hi Eric,

    Try changing the clock divider M and N values in resizer configuration of DMAI code. Looks like your resizer is not completing operation due to DDR bandwidth and reducing the resizer clocking to a slower value can give more time to finish resize operation.

     

    Regards,

    Anshuman

  • Hi, Anshuman

       Thank you for your reply, and may be I'm not familiar with this modules, because I haven't found how to modify the clock for resizer, may be you could make me clearly on where can I change the M and N, also, I just resize one frame from 432x240 to 640x360 got an jitter frame, but resize 1280x720 to 640x360 works well, Is that normal? confused me!

  • Hi Eric,

    There is a difference between your two operations. One is for upscaling (which is failing0 and the other is downscaling. The downscaling one is simpler as the resizer gets more time to complete the operation for dumping out smaller data as compared to the bigger input data.

    i was suggesting that you refer to resize.c file in packages/ti/sdo/dmai/linux folder. You can find this structure  struct rsz_single_shot_config rsz_ss_config;. The structure has one filed as clk_div, which internally has values m and n. When the RSZ_G_CONFIG IOCTL is called, you can print these values as  rsz_ss_config.clk_div.m and rsz_ss_config.clk_div.n. Based on these values, you can try changing (increasing n) such that you can slow down resize operation and again try your experiment. to change these values, you have to call rSZ_S_CONFIG, which already exist in the resize.c file

     

    Regards,

    Anshuman