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.

Question about resizer on DM6437

hello guys,

In my application, I need two resizer,First, 704 * 576 -> 352 * 288, second, 352 * 288 ->88* 72.

my code is


/******************************************************************************************/
#define INWIDTH   704

#define INHEIGHT 576

#define INTERWIDTH 352

#define INTERWIDTH 288

#define OUTWIDTH   88

#define OUTHEIGHT 72

/* Params structure for configuration of parameters for channel 1 */

static PSP_RSZparams s_tRszCtrlParams1 =

{    INWIDTH,

     INHEIGHT,

     INWIDTH * 2,

    PSP_RSZ_INTYPE_YCBCR422_16BIT,

    0,

    0,

    0,

    PSP_RSZ_PIX_FMT_YUYV,

   INTERWIDTH,

   INTERHEIGHT,

   INTERWIDTH * 2,

   0,

   0,

  gRDRV_reszFilter4TapHighQuality,

  gRDRV_reszFilter4TapHighQuality,
  PSP_RSZ_YENH_DISABLE

};


/* Params structure for configuration of parameters for channel 2 */

static PSP_RSZparams s_tRszCtrlParams2 =

{    INTERWIDTH,

     INTEREIGHT,

     INTERWIDTH * 2,

    PSP_RSZ_INTYPE_YCBCR422_16BIT,

    0,

    0,

    0,

    PSP_RSZ_PIX_FMT_YUYV,

   OUTWIDTH,

   OUTHEIGHT,

   OUTWIDTH * 2,

   0,

   0,

  gRDRV_reszFilter7TapHighQuality,

  gRDRV_reszFilter7TapHighQuality,
  PSP_RSZ_YENH_DISABLE

};

static GIO_Handle s_hResizer1;
static GIO_Handle s_hResizer2;

#pragma DATA_ALIGN(s_aucResizeBuf1, 128);
static Uint8 s_aucResizeBuf1[INTERWIDTH*INTERHEIGHT*2];

#pragma DATA_ALIGN(ch2_inBuf,128);
static Uint8 ch2_inBuf[INTERWIDTH*INTERHEIGHT*2];

#pragma DATA_ALIGN(s_aucResizeBuf2,128);
static Uint8 s_aucResizeBuf2[OUTWIDTH*OUTHEIGHT*2];

/* setting parameters for channel 1 */
GIO_control(s_hResizer1, PSP_RSZ_IOCTL_SET_PARAMS, &s_tRSZCtrlParams1);

/* setting parameters for channel 2 */
GIO_control(s_hResizer2, PSP_RSZ_IOCTL_SET_PARAMS, &s_tRSZCtrlParams2);

PSP_RSZresize tRszBuf1;
PSP_RSZresize tRszBuf2;

tRszBuf1.inBuf      = s_ptFemInBuf->frameBufferPtr;
tRszBuf1.outBuf     = s_aucResizeBuf1;
tRszBuf1.inBufSize  = INWIDTH*INHEIGHT*2;
tRszBuf1.outBufSize = INTERWIDTH*INTERHEIGHT*2;

/* first resizing */
GIO_control(s_hResizer1,PSP_RSZ_IOCT_RESIZE, &tRszBuf1);

memcpy(ch2_inBuf,s_aucResizeBuf1,INTERWIDTH*INTERHEIGHT*2);

tRszBuf2.inBuf      = ch2_inBuf;
tRszBuf2.outBuf     = s_aucResizeBuf1;
tRszBuf2.inBufSize  = INWIDTH*INHEIGHT*2;
tRszBuf2.outBufSize = OUTWIDTH*OUTHEIGHT*2;

/* second resizing */
GIO_control(s_hResizer2,PSP_RSZ_IOCT_RESIZE,&tRszBuf2);


/******************************************************************************************/
First resizing is 704 * 576 -> 352 * 288 well done!
But second resizing (352*288->88*72) is terrible, I have experiment so many time and not success!
I need help!

  • Hi Cang_rong,

    I handle OMAP3 Resizer module and as I understand OMAP3 has exactly same IP as on Davinci as far as Resizer is concerned. I have tried exactly same configuration mentioned by you on OMAP platform and it is working fine at my end.

    Just for your reference I am providing you configuration below - 

    ./utrresizer -x 352 -y 288 -p 704 -v 88 -w 72 -q 192

    Where,

         x - input width

         y - input height

         p - input pitch

         v - output width

         w - output height

         q -  output pitch

     

    The important point note down here is that you have to consider pitch alignment for both input and output image. It means, while viewing image you must consider 32 byte alignement of pitch configuration.

     

    Just for your reference I have attached register configuration on (taken from OMAP3 platform), please let me know if you see any differance with your configuration.

    Thanks,

    Vaibhav

  • Hi!  Vaibhav, I do not have utrresizer!

    counld you send it to me?!

    Thanks,

    cang_rong

  • My email is : cang_rong@yahoo.com.cn

    Thanks

    cang_rong