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.

YUV420PSEMI input format with DM365 resize

Hi,

We want to resize image located in SDRAM and put it back to SDRAM. We use DM365 resizer to downscale video size from 1344x720 to 640x480 to display YUV420 on OSD. According to section "4.3.11.4   4:2:0 Input Mode" from Video Processing Front End Users Guide the resizer actually can process 420 image data. The resizer can process 420 image data. In each frame, either Y or Cb/Cr data can be processed at a time. In order to process full 420 image with Y and Cb/Cr, IPIPE needs to run twice. So we get the video data from SDRAM to ipipeif to resize to SDRAM(IPIPE_420SP_Y) and the other process(IPIPE_420SP_C).  But the result we get the video display on OSD, it seems the colorspace is not rght(we get the 640x480 correct size but the wrong color differ from encode data).

Here are the registers from the our problem case:

IPIPE_420SP_Y Processing

Resizer Configuration

RSZ_GCK_MMR         = 0x0001;
RSZ_SRC_EN          = 0x0000;
RSZ_SRC_MODE        = 0x0000;
RSZ_SRC_FMT0        = 0x0001; // 0:from IPIPE,1:from IPIPEIF
RSZ_SRC_FMT1        = 0x0000;
RSZ_SRC_VPS         = 0x0015;
RSZ_SRC_VSZ         = 0x02CF;
RSZ_SRC_HSZ         = 0x053F;
RSZ_SRC_HPS         = 0x0000;
RSZ_DMA_RZA         = 0x0000;
RSZ_DMA_RZB         = 0x0000;
RSZ_DMA_STA         = 0x0000;
RSZ_GCK_SDR         = 0x0001;
RSZ_IRQ_RZA         = 0x1FFF;
RSZ_IRQ_RZB         = 0x1FFF;
RSZ_YUV_Y_MIN       = 0x0000;
RSZ_YUV_Y_MAX       = 0x00FF;
RSZ_YUV_C_MIN       = 0x0000;
RSZ_YUV_C_MAX       = 0x00FF;
RSZ_YUV_PHS         = 0x0000;
RSZ_SEQ             = 0x0000;
RSZ_SRC_EN          = 0x0001;

IPIPEIF Configuration

IPIPEIF_ENABLE   = 0x0000;
IPIPEIF_CFG      = 0xC40C;
IPIPEIF_PPLN     = 0x0548;
IPIPEIF_LPFR     = 0x02DA;
IPIPEIF_HNUM     = 0x0540;
IPIPEIF_VNUM     = 0x02D0;
IPIPEIF_ADDRU    = (y_src/32) >> 16;
IPIPEIF_ADDRL    = (y_src/32) & 0xffff;
IPIPEIF_ADOFS    = 0x002A;
IPIPEIF_RSZ      = 0x0010;
IPIPEIF_GAIN     = 0x0200;
IPIPEIF_DPCM     = 0x0000;
IPIPEIF_CFG2     = 0x0048;
IPIPEIF_INIRSZ   = 0x0000;
IPIPEIF_OCLIP    = 0x0FFF;
IPIPEIF_DTUDF    = 0x0000;
IPIPEIF_CLKDIV   = 0x0001;
IPIPEIF_DPC1     = 0x0000;
IPIPEIF_DPC2     = 0x0000;
IPIPEIF_DFSGVL   = 0x0000;
IPIPEIF_DFSGTH   = 0x0FFF;
IPIPEIF_RSZ3A    = 0x0010;
IPIPEIF_INIRSZ3A = 0x0000;
IPIPEIF_ENABLE   = 0x0001;   // Start IPIPEIF

Resizer A Configuration

RSZ_SRC_FMT1        = 0x0002; //IPIPE_420SP_Y

RSZ_A_EN            = 0x0000;  //Stop resize A
RSZ_A_MODE          = 0x0001;
RSZ_A_420           = 0x0001;
RSZ_A_I_VPS         = 0x0000;
RSZ_A_I_HPS         = 0x0000;
RSZ_A_O_VSZ         = 0x01DF;
RSZ_A_O_HSZ         = 0x027F;
RSZ_A_V_DIF         = 0x0180;
RSZ_SRC_VPS         = 0x0000;
RSZ_A_H_DIF         = 0x010C;
RSZ_A_SDR_Y_BAD_H   = dest >> 16;
RSZ_A_SDR_Y_BAD_L   = dest & 0xfffc;
RSZ_A_SDR_Y_SAD_H   = dest >> 16;
RSZ_A_SDR_Y_SAD_L   = dest & 0xfffc;
RSZ_A_SDR_Y_OFT     = 0x0280;
RSZ_A_SDR_Y_Y_PTR_S = 0x0000;
RSZ_A_SDR_Y_PTR_E   = 0x01E0;
RSZ_A_SDR_C_BAD_H   = 0x0000;
RSZ_A_SDR_C_BAD_L   = 0x0000;
RSZ_A_SDR_C_SAD_H   = 0x0000;
RSZ_A_SDR_C_SAD_L   = 0x0000;
RSZ_A_SDR_C_OFT     = 0x0000;
RSZ_A_SDR_C_PTR_S   = 0x0000;
RSZ_A_SDR_C_PTR_E   = 0x0000;
RSZ_A_EN            = 0x0001;   //Start Resize A

while(RSZ_A_EN&1);

IPIPE_420SP_C Processing

 

So, it's obviously something wrong with our register setting or processing.

Any advice on how to proceed in debugging this problem would be greatly appreciated!

Thanks!

IPIPEIF Configuration

IPIPEIF_ENABLE   = 0x0000;
IPIPEIF_CFG      = 0xC40C;
IPIPEIF_PPLN     = 0x0548;
IPIPEIF_LPFR     = 0x02DA;
IPIPEIF_HNUM     = 0x0540;
IPIPEIF_VNUM     = 0x02D0;
IPIPEIF_ADDRU    = (c_src/32) >> 16;
IPIPEIF_ADDRL    = (c_src/32) & 0xffff;
IPIPEIF_ADOFS    = 0x002A;
IPIPEIF_RSZ      = 0x0010;
IPIPEIF_GAIN     = 0x0200;
IPIPEIF_DPCM     = 0x0000;
IPIPEIF_CFG2     = 0x0048;
IPIPEIF_INIRSZ   = 0x0000;
IPIPEIF_OCLIP    = 0x0FFF;
IPIPEIF_DTUDF    = 0x0000;
IPIPEIF_CLKDIV   = 0x0001;
IPIPEIF_DPC1     = 0x0000;
IPIPEIF_DPC2     = 0x0000;
IPIPEIF_DFSGVL   = 0x0000;
IPIPEIF_DFSGTH   = 0x0FFF;
IPIPEIF_RSZ3A    = 0x0010;
IPIPEIF_INIRSZ3A = 0x0000;
IPIPEIF_ENABLE   = 0x0001;   // Start IPIPEIF

Resizer A Configuration

RSZ_SRC_FMT1        = 0x0006; //IPIPE_420SP_C

RSZ_A_EN            = 0x0000;
RSZ_A_MODE          = 0x0001;
RSZ_A_420           = 0x0003;
RSZ_A_I_VPS         = 0x0000;
RSZ_A_I_HPS         = 0x0000;
RSZ_A_O_VSZ         = 0x01DF;
RSZ_A_O_HSZ         = 0x027F;
RSZ_A_V_DIF         = 0x0180;
RSZ_SRC_VPS         = 0x0000;
RSZ_A_H_DIF         = 0x010C;
RSZ_A_SDR_Y_BAD_H   = 0x0000;
RSZ_A_SDR_Y_BAD_L   = 0x0000;
RSZ_A_SDR_Y_SAD_H   = 0x0000;
RSZ_A_SDR_Y_SAD_L   = 0x0000;
RSZ_A_SDR_Y_OFT     = 0x0000;
RSZ_A_SDR_Y_Y_PTR_S = 0x0000;
RSZ_A_SDR_Y_PTR_E   = 0x0000;
RSZ_A_SDR_C_BAD_H   = (dest+(640 * 480)) >> 16;
RSZ_A_SDR_C_BAD_L   = (dest+(640 * 480)) & 0xfffc;
RSZ_A_SDR_C_SAD_H   = (dest+(640 * 480)) >> 16;
RSZ_A_SDR_C_SAD_L   = (dest+(640 * 480)) & 0xfffc;
RSZ_A_SDR_C_OFT     = 0x0280;
RSZ_A_SDR_C_PTR_S   = 0x0000;
RSZ_A_SDR_C_PTR_E   = 0x00F0;
RSZ_A_EN            = 0x0001;   //Start Resize A

while(RSZ_A_EN&1);