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.

Resizing issue using Camera Interface Subsystem (ISP) in OMAP3530

Other Parts Discussed in Thread: OMAP3530

Hello guys,

I am using OMAP3530 ISP and ADV7180 for camera video capture and preview.

- It can work well using the video data path as (CVBS signal) -> ADV7180 -> (BT656 signal) -> OMAP3530 ISP CCDC -> memory -> OMAP3530 DISP -> LCD.   But just one field video is displayed, and the height is half of original size.  For example, PAL video is interlaced and it has the resolution of 720 x 576,  but using above video path, the displayed video  is 720 x 288.

- It doesn't work using  the video data path as (CVBS signal) -> ADV7180 -> (BT656 signal) -> OMAP3530 ISP CCDC -> OMAP3530 ISP RESIZER -> memory -> OMAP3530 DISP -> LCD. The screen just displays green first and then displays color stripe.

- Filter coefficients

  /* input image pixels/line  = 716 */
  /* output image pixels/line  = 400 */
  /* horizontal starting phase  = 0 */
  /* horizontal filter type  = LOWPASS */
  /* window type  = BLACKMAN */
  /* hrsz = 456  */

  /*horizontal resizing filter coefficients: */
  {
   35,
   186,
   35,
   0,
   21,
   182,
   53,
   0,
   12,
   168,
   76,
   0,
   6,
   149,
   100,
   1,
   2,
   126,
   126,
   2,
   1,
   100,
   149,
   6,
   0,
   76,
   168,
   12,
   0,
   53,
   182,
   21,
  },
  


  /* input image # lines  = 570 */
  /* output image # lines  = 240 */
  /* vertical starting phase  = 0 */
  /* vertical filter type  = LOWPASS */
  /* window type  = BLACKMAN */
  /* vrsz = 603 */ 

  /*vertical resizing filter coefficients: */
  {
   0,
   25,
   103,
   103,
   25,
   0,
   0,
   0,
   0,
   13,
   84,
   116,
   42,
   1,
   0,
   0,
   0,
   5,
   63,
   120,
   63,
   5,
   0,
   0,
   0,
   1,
   42,
   116,
   84,
   13,
   0,
   0,
  },

 

- Dumpped register values:

ISPCTRL: ###ISP_IRQ0STATUS=0x300
ISPCTRL: ###ISPMMU_CNTL=0x0
ISPCCDC: Module in use =1
ISPCCDC: Accepted CCDC Input (width = 720,Height = 576)
ISPCCDC: Accepted CCDC Output (width = 720,Height = 575)
ISPCCDC: ###CCDC PCR=0x1
ISPCCDC: ISP_CTRL =0x392300
ISPCCDC: ccdc input format is CCDC_YUV_BT
ISPCCDC: ccdc output format is CCDC_YUV_RSZ
ISPCCDC: ###ISP_IRQ0ENABLE in ccdc =0x81000000
ISPCCDC: ###ISP_IRQ0STATUS in ccdc =0x300
ISPCCDC: ###CCDC SYN_MODE=0x9af84
ISPCCDC: ###ISPCCDC_PIX_LINES=0x0
ISPCCDC: ###CCDC HORZ_INFO=0x100
ISPCCDC: ###CCDC VERT_START=0x0
ISPCCDC: ###CCDC VERT_LINES=0x0
ISPCCDC: ###CCDC HSIZE_OFF=0x5a0
ISPCCDC: ###CCDC SDOFST=0x0
ISPCCDC: ###CCDC CFG=0x8800
ISPCCDC: ###CCDC_SDR_ADDR= 0x0
ISPCCDC: ###CCDC BT.656 CONFIGURATION REGISTER=0x3
ISPRESZ: ###ISP_CTRL in resizer =0x392300
ISPRESZ: ###ISP_IRQ0ENABLE in resizer =0x81000000
ISPRESZ: ###ISP_IRQ0STATUS in resizer =0x300
ISPRESZ: ###RSZ PCR =0x3
ISPRESZ: ###RSZ CNT =0x969c6
ISPRESZ: ###RSZ OUT SIZE =0xf00190
ISPRESZ: ###RSZ IN START =0x0
ISPRESZ: ###RSZ IN SIZE =0x23a02cc
ISPRESZ: ###RSZ SDR INADD =0x0
ISPRESZ: ###RSZ SDR INOFF =0x0
ISPRESZ: ###RSZ SDR OUTADD =0x8aeb0000
ISPRESZ: ###RSZ SDR OTOFF =0x320
ISPRESZ: ###RSZ HFILT98 =0xa8000c
ISPRESZ: ###RSZ VFILT98 =0xd0000
ISPRESZ: ###RSZ YENH =0x0

Could anybody help me on it?

Thanks.

  • Hi Alvin,

     

    Have you had figured out what the problem was? I am having similar issue, could you share your experience?

     

    Thanks,

    Bin

  • Hi Bin,

     

    I had already resolved this issue Sep of 2009. But I almost forget the detail.

    Anyway, the code below is just for my case.

    Also, both the source code of linux ISP driver and local TI  FAE are helpful. :)

     

     

     

    const static short filter_coefs[2][32] = {

     

    /* input image pixels/line  = 716 */

    /* output image pixels/line  = 400 */

    /* horizontal starting phase  = 0 */

    /* horizontal filter type  = LOWPASS */

    /* window type  = BLACKMAN */

    /* hrsz = 456 */

     

    /*horizontal resizing filter coefficients: */

    {

    35,

    186,

    35,

    0,

    21,

    182,

    53,

    0,

    12,

    168,

    76,

    0,

    6,

    149,

    100,

    1,

    2,

    126,

    126,

    2,

    1,

    100,

    149,

    6,

    0,

    76,

    168,

    12,

    0,

    53,

    182,

    21,

    },

     

     

    /* input image # lines  = 570 */

    /* output image # lines  = 240 */

    /* vertical starting phase  = 0 */

    /* vertical filter type  = LOWPASS */

    /* window type  = BLACKMAN */

    /* vrsz = 603 */

     

    /*vertical resizing filter coefficients: */

    {

    0,

    25,

    103,

    103,

    25,

    0,

    0,

    0,

    0,

    13,

    84,

    116,

    42,

    1,

    0,

    0,

    0,

    5,

    63,

    120,

    63,

    5,

    0,

    0,

    0,

    1,

    42,

    116,

    84,

    13,

    0,

    0,

    },

    };

     

     

    int ispresizer_config_outlineoffset(u32 offset)

    {

    if (offset%32)

    return -EINVAL;

    omap_writel(offset << ISPRSZ_SDR_OUTOFF_OFFSET_SHIFT,

    ISPRSZ_SDR_OUTOFF);

    return 0;

    }

     

     

     

    /**

     * ispccdc_resizer_init - Initial configuration of CCDC and Resizer.

     **/

    void ispccdc_resizer_init(void)

    {

    int i, j;

    omap_writel(0x392300, ISP_CTRL);//CCDC->Resizer->Memory

    omap_writel(0x9af84, ISPCCDC_SYN_MODE);//CCDC->Resizer->Memory

    omap_writel(0, ISPCCDC_HD_VD_WID);

     

        /*

         *  sph = 0, nph = 1439, according to page 1580-1584 of the CCDC spec

         *  for BT.656 mode, this setting captures only the 720x576 of the

         *  active PAL video window

         */

    omap_writel((PAL_WIDTH * 2 - 1), ISPCCDC_HORZ_INFO); // Horizontal lines (720 * 2 - 1 = 1439)

    omap_writel(PAL_WIDTH * 2, ISPCCDC_HSIZE_OFF); // Horizontal line offset (720*2)

    omap_writel(0, ISPCCDC_VERT_START); // Vertical start line // 0x20002?

    omap_writel((PAL_HEIGHT / 2 - 1), ISPCCDC_VERT_LINES); // Vertical lines

    omap_writel(0xFFFF00FF, ISPCCDC_CULLING); // Disable cullng

     

        /*

         *  Interleave the two fields 

         */

    omap_writel(0x00000249, ISPCCDC_SDOFST);

     

    omap_writel(0, ISPCCDC_CLAMP);

    omap_writel(0, ISPCCDC_DCSUB);

    omap_writel(0xEE44EE44, ISPCCDC_COLPTN); //?

    omap_writel(0, ISPCCDC_BLKCMP);

    omap_writel(0x86800000, ISPCCDC_FPC_ADDR); //?

    omap_writel(0, ISPCCDC_FPC);

    omap_writel(0, ISPCCDC_VDINT);

    omap_writel(0, ISPCCDC_ALAW);

     

    omap_writel(0x00000003, ISPCCDC_REC656IF);

     

     

        /*

         *  Input format is Cb:Y:Cr:Y, w/ Y in odd-pixel position 

         */

    omap_writel(0x00008800, ISPCCDC_CFG);

     

    omap_writel(0, ISPCCDC_FMTCFG);

    omap_writel(0x000002D0, ISPCCDC_FMT_HORZ); //720

    omap_writel(0x00000240, ISPCCDC_FMT_VERT); //576

    omap_writel(0, ISPCCDC_FMT_ADDR0);

    omap_writel(0, ISPCCDC_FMT_ADDR1);

    omap_writel(0, ISPCCDC_FMT_ADDR2);

    omap_writel(0, ISPCCDC_FMT_ADDR3);

    omap_writel(0, ISPCCDC_FMT_ADDR4);

    omap_writel(0, ISPCCDC_FMT_ADDR5);

    omap_writel(0, ISPCCDC_FMT_ADDR6);

    omap_writel(0, ISPCCDC_FMT_ADDR7);

    omap_writel(0, ISPCCDC_PRGEVEN0);

    omap_writel(0, ISPCCDC_PRGEVEN1);

    omap_writel(0, ISPCCDC_PRGODD0);

    omap_writel(0, ISPCCDC_PRGODD1);

     

    omap_writel(0x047E2D00, ISPCCDC_VP_OUT); // VERT_NUM: 0x47E >>1 = 0x23F = 575 HORZ_NUM: 0x2D0 = 720

     

    /* Set horizontal and vertical starting phase */

    /*Set horizontal and vertical resize ratios*/

    omap_writel(0x969c6, ISPRSZ_CNT); // YCPOS=0 VSTPH=0 HSTPH=0 VRSZ=0x968/4=602 HRSZ=454

    /* Set horizontal and vertical start pixel */

    omap_writel(0, ISPRSZ_IN_START);

    /*Set input width and height*/

    omap_writel(0x23a02cc, ISPRSZ_IN_SIZE); // 570 716

    /*Set output width and height*/

    omap_writel(0xf00190, ISPRSZ_OUT_SIZE); // 240 400

    /*Set the horizontal/vertical filter coefficients depending on the

    * resize values

    */

    j = 0;

    for (i = 0; i < 16; i++) {

    omap_writel((filter_coefs[0][j] << ISPRSZ_HFILT10_COEF0_SHIFT) |

    (filter_coefs[0][j+1] << ISPRSZ_HFILT10_COEF1_SHIFT),

    ISPRSZ_HFILT10 + (i * 0x04));

    j += 2;

    }

    j = 0;

    for (i = 0; i < 16; i++) {

    omap_writel((filter_coefs[1][j] << ISPRSZ_VFILT10_COEF0_SHIFT) |

    (filter_coefs[1][j+1] << ISPRSZ_VFILT10_COEF1_SHIFT),

    ISPRSZ_VFILT10 + (i * 0x04));

    j += 2;

    }

     

    /* Configure the outline offset to outputwidth*2*/

    ispresizer_config_outlineoffset(400*2); //0x320

    }

     

     

    Regards,

    Alvin

  • Alvin,

    Thank you so much for your help!

    My hardware setup is very similar to yours, only difference is the phy, but it produces YUV422 BT.656 frames as well. And am also trying to get video downsize 50%, so I could use you coefficient table, however, even if I configure the CCDC and RSZ registers the same way as yours, am still getting green screen first then color stripes. (I am using Continuous mode as well.)    

    I am still waiting for TI local AFE response, in the meantime, do you have any other suggestions?

     

    Thanks!!

    Bin

  • Bin,

     

    You are welcome. so far I undertand your feeling. :)

    To find out  the root cause of color stripes, there are several things you can do.

    -  configure video path CCDC-> Memory, and check if the YUV422 data in the memory buffer is right, and then check if the rendering is right. e.g. can YUV pixel format be supported by the layer you select? 

    - If CCDC output is OK, then configure video path CCDC-> RSZ -> Memory, and check if the YUV422 data in the memory buffer is right, and then check if the rendering is right.

     

    Regards,

    Alvin

  • Hi,Alvin,

    My CCDC output is OK, but I don't known how to display is at VIDn, do you have any DEMO code about the part?

    And may I have your email address? My email : markmin123@google.com

    Thanks very much!

    Regards,

    Michael