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.

Capture cropping issue with DM8148

Hi,

We have a DM8148 based custom board, with EZSDK_5_05_02_00 and overlay code. We have a HD camera, which is connected to DM8148 using 16bit capture mode.

The camera can be configured either 720p/60 or 720p/30. We can capture the video in either mode if we don't use cropping (in that case, the captured image has lots of blank area).  We can capture 1280x720 video with cropping if the camera is 720p/60.

The problem is, when the camera is 720p/30 and cropping is used, then the captured image is shifted to the right.

I attached the timing diagrams in both 720p/30 and 720p/60 and the images captured in each mode.  The timing is pretty much the same for both modes.  The difference is, in 720p/30, one H line consists of 3,300 pixel clocks.  Those images were captured with the same exact settings, and only the camera mode was changed.

Can you think of any way to make the cropping work for this 720p/30 mode?

Since the camera doesn't generate 'Active Data' signal, we would like to use the cropping feature.

5672.CroppingProblem.pdf

Thanks,
tamo2

  • Hi Tamo,

     

    The registers size where we specify cropping window is only 11 bits, so we cannot specify window size and position more than 2047 pixels. In 720p30 case, i guess the horizontal blanking is more than 2047, may be beccause of thi, you are not able to specify the cropping window. in this case, the only solution is to use crop in the application.

     

    Rgds,

    Brijesh

  • Hi Brijesh,

    Brijesh Jadav said:
    cropping window is only 11 bits

    OK, that explains the symptom. 

    Then, would it be possible to crop only vertically?

    Thanks,
    tamo2

  • Even on vertical side, it is 11 bits, so we cannot crop beyond 2047 lines.

    Rgds,
    Brijesh
  • Brijesh Jadav said:
    Even on vertical side, it is 11 bits, so we cannot crop beyond 2047 lines.

    Vertical lines are less than 2047, so I was thinking of cropping vertical only.

    Looking at the code:

    Int32 VpsHal_vipSetVipActCropCfg(VpsHal_VipHandle handle,
                                     const VpsHal_VipCropConfig *vipHalCropCfg)
    {
            ...
            tempRegsX = (vipHalCropCfg->channelNum <<
                            CSL_VPS_VIP_PARSER_X_CROP_CFG_SRC_NUM_CFG_SHIFT);
            tempRegsX |= (vipHalCropCfg->vipCropCfg.cropStartX <<
                            CSL_VPS_VIP_PARSER_X_CROP_CFG_SKIP_NUM_PIX_SHIFT);
            tempRegsX |= (vipHalCropCfg->vipCropCfg.cropWidth <<
                            CSL_VPS_VIP_PARSER_X_CROP_CFG_USE_NUM_PIX_SHIFT);
            if (TRUE == vipHalCropCfg->vipCropEnable)
            {
                tempRegsX |= CSL_VPS_VIP_PARSER_X_CROP_CFG_BYPASS_CROP_MASK;
            }
    
            tempRegsY = (vipHalCropCfg->vipCropCfg.cropStartY <<
                            CSL_VPS_VIP_PARSER_Y_CROP_CFG_SKIP_NUM_LINES_SHIFT);
            tempRegsY |= (vipHalCropCfg->vipCropCfg.cropHeight <<
                            CSL_VPS_VIP_PARSER_Y_CROP_CFG_USE_NUM_LINES_SHIFT);
    
            if (instInfo->portId == VPSHAL_VIP_PORT_A)
            {
                instInfo->regs->PORT_A_ACT_X_CROP_CFG = tempRegsX;
                instInfo->regs->PORT_A_ACT_Y_CROP_CFG = tempRegsY;
            }
            else
            {
                instInfo->regs->PORT_B_ACT_X_CROP_CFG = tempRegsX;
                instInfo->regs->PORT_B_ACT_Y_CROP_CFG = tempRegsY;
            }
            ...
    }
    

    It looks like cropping is enabled/disabled by just a single bit ( CSL_VPS_VIP_PARSER_X_CROP_CFG_BYPASS_CROP_MASK ), but is there any trick to crop only vertical lines?

     

  • Hi Tamo2,

    No, it is just one bit, which enabled cropping module, which does cropping on both the sides. 

    Once enabled, both horizontal and vertical size must be less than 2048.

    Rgds,

    Brijesh