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+DVR_RDK 4.0 DEI->ENC issue

Hi,

I am working on DM8168 with DVR_RDK 4.0. My data flow is DEC->SELECT->DEI->MERGE->ENC. The problem is that there has a gray rectangle on the left side of the output ES. It seems that the frames data has a fixed offset on the x axis.

I have tried many ways to figure it out but got nothing.

1. Replace DEI with SCLR (DEC->SELECT->SCLR->MERGE->ENC). It works and prove that DEC/ENC is OK, which means the root cause may be DEI.

2. Crop gray rectangle before frame is delivered to ENC. The gray rectangle disappeared but the frame is not intact because the output from DEI  is not intact (has a fixed offset on the x axis).

Does anyone have any idea?

  • Hi,

    Attached is the patch

    6114.deiLink_output_offset_correction.patch.txt
    diff --git a/mcfw/src_bios6/links_m3vpss/dei/deiLink_drv.c b/mcfw/src_bios6/links_m3vpss/dei/deiLink_drv.c
    index ba0a655..3697d64 100755
    --- a/mcfw/src_bios6/links_m3vpss/dei/deiLink_drv.c
    +++ b/mcfw/src_bios6/links_m3vpss/dei/deiLink_drv.c
    @@ -1412,6 +1412,43 @@ Int32 DeiLink_drvUpdateInputRtPrm(DeiLink_Obj * pObj, FVID2_Frame *pInFrame, UIn
         return FVID2_SOK;
     }
     
    +Int32 DeiLink_drvModifyInputFramePointer(FVID2_Frame *pInFrame,Bool addOffset)
    +{
    +    System_FrameInfo *pFrameInfo;   
    +    Int32 offset[2],bytesPerPixel;
    +
    +    pFrameInfo = (System_FrameInfo *) pInFrame->appData;
    +    if(pFrameInfo == NULL)
    +    {
    +        Vps_printf("DEILINK : Frameinfo not present!!!\n");
    +        return FVID2_SOK;
    +    }
    +
    +    if(pFrameInfo->rtChInfo.dataFormat == SYSTEM_DF_YUV422I_YUYV)
    +        bytesPerPixel = 2;
    +    else
    +        bytesPerPixel = 1;
    +   
    +    offset[0] = ( pFrameInfo->rtChInfo.pitch[0] * pFrameInfo->rtChInfo.startY ) + 
    +                ( pFrameInfo->rtChInfo.startX * bytesPerPixel );
    +    offset[1] = ( pFrameInfo->rtChInfo.pitch[1] * pFrameInfo->rtChInfo.startY / 2 ) + 
    +                ( pFrameInfo->rtChInfo.startX * bytesPerPixel );
    +
    +    
    +    if(addOffset == TRUE)
    +    {
    +        pInFrame->addr[0][0] = (Ptr)((Int32)pInFrame->addr[0][0] + offset[0]);
    +        pInFrame->addr[0][1] = (Ptr)((Int32)pInFrame->addr[0][1] + offset[1]);
    +    }
    +    else
    +    {
    +        pInFrame->addr[0][0] = (Ptr)((Int32)pInFrame->addr[0][0] - offset[0]);
    +        pInFrame->addr[0][1] = (Ptr)((Int32)pInFrame->addr[0][1] - offset[1]);
    +    }
    +    
    +    return FVID2_SOK;
    +}
    +
     Int32 DeiLink_drvMakeFrameLists(DeiLink_Obj * pObj,
                                     FVID2_FrameList * inFrameList,
                                     FVID2_FrameList
    @@ -1523,6 +1560,7 @@ Int32 DeiLink_drvMakeFrameLists(DeiLink_Obj * pObj,
                 pInFrameInfo = (System_FrameInfo *) pInFrame->appData;
     
                 DeiLink_drvUpdateInputRtPrm(pObj, pInFrame, chId);
    +            DeiLink_drvModifyInputFramePointer(pInFrame, TRUE);
     
                 pChObj->inFrameProcessCount++;
     
    @@ -2019,6 +2057,10 @@ Int32 DeiLink_drvReleaseFrames(DeiLink_Obj * pObj,
     #endif
     
         pObj->inFramePutCount += inFrameList->numFrames;
    +    for(frameId = 0 ; frameId < inFrameList->numFrames ; frameId++)
    +    {
    +        DeiLink_drvModifyInputFramePointer(inFrameList->frames[frameId], FALSE);
    +    }
     
         DeiLink_putLinksEmptyFrames(pObj,
                                     pInQueParams->prevLinkId,
    
     for correcting dei output offsets.

    Please try this at your end and see if it works.

    Regards,

    Reshma

  • Hi Reshma,

    It works. Thank you very much.

    Peng.