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.

DM8168 RDK4.01, Can the captrueLink do fieldMerge, top field and bottom field are merged as one frame?

Other Parts Discussed in Thread: TVP5151

Hi All,

I use the RDK4 on DM8168 platform, and TVP5151 as SD video decoder,  it's output is single channel interlaced video data. Now I can get top filed data and bottom filed data separately when using captureLink, but I need one whole frame that contains top and bottom filed, so I have the two questions as follows:

1. Whether can  I  get one meragedFileded frame when the video decoder(such as TVP5151) is interlaced output? If yes, how to do it( DVRRDK4 and DM8168)?

2. If I can't,  how the DEILink deals with the top/bottom field data when the chain is captureLink->nsfLink->deiLink?  we know that the DEI deals with the fieldMeraged frame and deinterlace, but the top/bottom field data is in separated buffer now.


Thanks and Regards,


Jason Lee

 

  • Hi Jason,

     

    There is a driver feature by which you can get field merged frames in a single buffer, just enable field merge mode in the VIP driver, there is an separate ioctl for doing this.

    For the second question, you could pass interlaced individual fields to the DEI link, it will deinterlace ie convert into frame and give complete frame. 60 field per second would become 60 frames per second after DEI link.

     

    Rgds,

    Brijesh

  • Hi Brijesh,

    Thanks for the reply.  Could you give the detail or example about filed mode in the VIP driver,  is it in captureLink_drv.c of DVRRDK?  I can't find the ioctl method.

    DEI link:  I use the chain captureLink->deiLink->ipcFramesOutVpss->ipcFramesInHost,

    and the DEI Link para as follows:

       UInt32 captureId    = SYSTEM_LINK_ID_CAPTURE;
       UInt32 nsfId            = SYSTEM_LINK_ID_NSF_0;
       UInt32 deiId            = SYSTEM_LINK_ID_DEI_HQ_0;
       UInt32 ipcFramesOutVpssId= SYSTEM_VPSS_LINK_ID_IPC_FRAMES_OUT_0;
       UInt32 ipcFramesInHostId    = SYSTEM_HOST_LINK_ID_IPC_FRAMES_IN_1;
       UInt32 deiOutQue                  = DEI_LINK_OUT_QUE_DEI_SC;
     
        for(i=0; i<1; i++){
            Int32 chId;
     
            DeiLink_CreateParams_Init(&deiPrm[i]);
            deiPrm[i].inQueParams.prevLinkId                        = captureId;
            deiPrm[i].inQueParams.prevLinkQueId                 = 0;
            deiPrm[i].outQueParams[deiOutQue].nextLink    = ipcFramesOutVpssId;
            deiPrm[i].outQueParams[deiOutQue^1].nextLink= SYSTEM_LINK_ID_INVALID;
            deiPrm[i].enableOut[deiOutQue]                             = TRUE;
            deiPrm[i].enableOut[deiOutQue^1]                        = FALSE;
            deiPrm[i].tilerEnable[DEI_LINK_OUT_QUE_VIP_SC] = FALSE;
     
            deiPrm[i].comprEnable                    = FALSE;
            deiPrm[i].setVipScYuv422Format  = FALSE;
     
            deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_DEI_SC][0].scaleMode = DEI_SCALE_MODE_RATIO;
            deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_DEI_SC][0].ratio.widthRatio.numerator      = 1;
            deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_DEI_SC][0].ratio.widthRatio.denominator  = 1;
            deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_DEI_SC][0].ratio.heightRatio.numerator     = 1;
            deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_DEI_SC][0].ratio.heightRatio.denominator = 1;
            for (chId=1; chId < DEI_LINK_MAX_CH; chId++)
                deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_DEI_SC][chId] = deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_DEI_SC][0];
     
            deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC][0].scaleMode = DEI_SCALE_MODE_RATIO;
            deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC][0].ratio.widthRatio.numerator    = 1;
            deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC][0].ratio.widthRatio.denominator= 1;
            deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC][0].ratio.heightRatio.numerator   = 1;
            deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC][0].ratio.heightRatio.denominator= 1;
            for (chId=1; chId < DEI_LINK_MAX_CH; chId++)
                deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC][chId] = deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC][0];
     
        deiPrm[i].interlacedBypassMode = FALSE;
        deiPrm[i].enableDeiForceBypass = FALSE;//TRUE;
        }

    I got the fields not complete frames data,  is the configure of DEI link wrong?

    Thanks.

    Jason.

  • Hi Jason,

     

    You will need to call below ioctl to change the storage format to frame for the interlaced capture. Please call this ioctl after createing the driver in the capture link. You could get more information about this ioctl from driver useguide/api guide.

    IOCTL_VPS_CAPT_SET_STORAGE_FMT

     

    Rgds,

    Brijesh

     

  • Hi Brijesh,

     I have tried to use IOCTL_VPS_CAPT_SET_STORAGE_FMT,

          pInst->captureVipHandle=FVID2_create(...)

          ....

            struct Vps_CaptStoragePrms storagePrms;
            Int32 status;
            storagePrms.chNum       = 0;
            storagePrms.bufferFmt   = FVID2_BUF_FMT_FRAME; /* FVID2_BUF_FMT_FIELD for field capture */
            storagePrms.fieldMerged = TRUE;
            status = FVID2_control( pInst->captureVipHandle,
                                    IOCTL_VPS_CAPT_SET_STORAGE_FMT,
                                    &storagePrms, NULL  );
            UTILS_assert( status == FVID2_SOK );   

         ...

       CaptureLink_drvAllocAndQueueFrames(pObj, pInst);

    I also modified the function CaptureLink_drvAllocAndQueueFrames() and alloc the memory for top field and bottom field, but I failed,  it seems like the ioctl(IOCTL_VPS_CAPT_SET_STORAGE_FMT) is no useful;  I tried to modify the frame->pitch[x], and got the same result.

    Rgds,

    Jason

  • Hi Jason,

     

    I could not get, what is actually failing? is the call to this ioctl failing? or ioctl is not taking effect?

     

    Rgds,

    Brijesh

  • Hi Brijesh,

    In my usecase I got successful return value but same Interlaced output ???

    Kindly suggest ??? I'm using IPNC RDK 3.5

    Regards,

    Rajesh Kannan.S