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.

IPNC_RDK 3.5 Deinterlacer Support

Hi All,

I'm working customized DM385 platform.

Analog capture --> DEI ---> Scaler ---> display

My usecase is getting input from Analog camera and displayed  interlaced scanformat in LCD display

But  I want to display in progressive scanformat. Then I added deinterlacer to convert the scan format !!!

For scaler to convert and give SYSTEM_DF_YUV422I_YUYV fomat to display 

But I did n't !!!

I mentioned the logs kindly let me know the results !!!

[host] 
********* RAJESHKANNAN : Entered Capture + Display usecase - H264 1080p @60 fps, H264 D1 @30fps ********


[host] RAJESHKANNAN : Capture Link ready to start

[host] RAJESHKANNAN : ###Capture link connected to DEI link###......

[host] AV Scalar Params settings

[host] RAJESHKANNAN : Changed Resolution from D1 to 720*480 successfully
[m3vpss ] VPS_DCTRL_INST_0
[m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_DVO2
[m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_HDMI
[m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_SD
[m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_HDCOMP
[m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_CLK_SRC VPS_DC_VENC_HDMI | VPS_DC_VENC_HDCOMP
[m3vpss ] HDCOMPCLK
[m3vpss ] 10048: CAPTURE: Create in progress !!!
[m3vpss ] RAJESHKANNAN : Checking else to change the capture mode from 16 to 8 bit
[m3vpss ] 10084: CAPTURE: VIP0 PortA capture mode is [ 8-bit, Non-mux Embedded Sync] !!!

[host] RAJESHKANNAN : Checking Capture link created successfully......

[host] AV Scalar Create 
[m3vpss ] CAPTURE::HEAPID:0 USED:192
[m3vpss ] 10244: CAPTURE: Create Done !!!
[m3vpss ] 10244: DEI : Create in progress !!!
[m3vpss ] RAJESHKANNAN : In Fn(DeiLink_drvCreateOutObj) Entered
[m3vpss ] RAJESHKANNAN : In no.of channel Entered
[m3vpss ] 10252: DEI: OUT1: 0: 0xa1fcbc80, 720 x 240, 4 frames
[m3vpss ] RAJESHKANNAN : In Fn(DeiLink_drvCreateChObj) Entered
[m3vpss ] RAJESHKANNAN : Checking ###SCAN_FORMAT = 0
[m3vpss ] RAJESHKANNAN : DeiBypass setted to False
[m3vpss ] RAJESHKANNAN : !DeiBypass value is = 1
[m3vpss ] RAJESHKANNAN : DeiBypass value is = 0
[m3vpss ] RAJESHKANNAN : After Bypass to check FieldMerge
[m3vpss ] RAJESHKANNAN : Checking ScanFormat ( 0 to INTERLACED )= 0
[m3vpss ] RAJESHKANNAN : FieldMerge setted to TRUE.......
[m3vpss ] RAJESHKANNAN : Checking Configuration in DEI
[m3vpss ] RAJESHKANNAN : In Configuration in DEI bypass = 0
[m3vpss ] 10268: DEI : Loading Down-scaling Co-effs
[m3vpss ] 10268: DEI : Co-effs Loading ... DONE !!!
[m3vpss ] DEI:HEAPID:0 USED:64
[m3vpss ] DEI:HEAPID:1 USED:5040
[m3vpss ] 10268: DEI : Create Done !!!
[m3vpss ] 10269: SCLR: Create in progress !!!
[m3vpss ] RAJESHKANNAN : Checking sclr create
[m3vpss ] RAJESHKANNAN : Checking Before linkGetInfo
[m3vpss ] RAJESHKANNAN : Checking sclr prevLinkQueId = 0
[m3vpss ] RAJESHKANNAN : Checking sclr pObj->inTskInfo.numQue =3
[m3vpss ] RAJESHKANNAN : Checking After linkGetInfo
[m3vpss ] RAJESHKANNAN : Checking After Memcopy Que-Id's
[m3vpss ] RAJESHKANNAN : Checking Exited After TI_814X_BUILD
[m3vpss ] RAJESHKANNAN : Checking ready to enter SclrLink_resetStatistics
[m3vpss ] RAJESHKANNAN : Checking Exited from SclrLink_resetStatistics
ApproDrvInit: 3
queue id:163845

[host] RAJESH : total mem size is 126812160
queue id:32769
queue id:65538
queue id:32769
ApproDrvInit: 7
queue id:163845

[host] RAJESH : total mem size is 126812160
TimeOut occure in boot_proc.
Program exit.
TimeOut occure in boot_proc.
Program exit.
ApproDrvExit: 7
Error: WaitStreamReady Fail.
Error: SemWait: Invalid Semaphore handler

[host] RAJESHKANNAN : Checking Force IDR on Channel: 0
[host] RAJESHKANNAN : Before sending system_link_control Enc-id

[host] SYSTEM: Invalid proc ID ( procID = 15, linkID = 0xffffffff, cmd = 0x00005007) 
ASSERT (system_linkApi.c|System_linkControl|42)

Regards,

Rajesh Kannan.S

  • I will notify the IPNC RDK team for help.

    BR
    Pavel
  • Hi TI,

    I'm waitng for the reply ....

    Kindly support IPNC RDK team !!!

    Regards,

    Rajesh Kannan.S
  • Hi,

    We have not tested the DEI link in the IPNC RDK.

    Can you pl. share your complete use case and the display screen shots?

    I will check with the DVR RDK team.

    regards,

    Anand

  • Hi Anand,

    Thanks for your reply ...,

    My Usecase is Input from the decoder (720 * 240 )------> Analog camera ------> DUP ------> Encode ------> display (Now HDMI) (YUV420 SP format)

    In HDMI I'm getting Interlaced output... I'm trying to convert Progressive scan format ???

    Whether I can convert from CaptureLink_drv file and send to next link ??? or Convert in usecase file using Deinterlacer ???

    I'm in IPNC RDK 3.5 Is it support to do the conversion ???   Find the attached usecase file .

    Regards,

    Rajesh Kannan.S

    8712.multich_capturedisplay.c
    /** ==================================================================
     *  @file   multich_Stream_CaptureDisplay.c
     *
     *  @path    ipnc_mcfw/mcfw/src_linux/mcfw_api/usecases/
     *
     *  @desc   This  File contains.
     * ===================================================================
     *  Copyright (c) Texas Instruments Inc 2011, 2012
     *
     *  Use of this software is controlled by the terms and conditions found
     *  in the license agreement under which this software has been supplied
     * ===================================================================*/
    
    /*------------------------------ TRIPLE OUT <1080p + D1 + MJPEG> ----------------------------------
    
                                        Capture
    								 RSZA     RSZB
                                   1080P60    D130
                                  (YUV420)  (YUV420)
                                      |          |
                                 (0)-DUP0-(1)   (0)-DUP1-(1)
                                  |        |    |         |
                          HDMI DISPLAY  NULL1  TVOUT      NULL0
    
    ------------------------------------------------------------------------------------------*/
    
    #include "mcfw/src_linux/mcfw_api/usecases/multich_common.h"
    #include "mcfw/src_linux/mcfw_api/usecases/multich_ipcbits.h"
    #include "demos/mcfw_api_demos/multich_usecase/ti_mcfw_ipnc_main.h"
    
    /*
        Scaler-id Added for testing RAJESHKANNAN JUN-1
    */
    //UInt32 AV_scalerId = SYSTEM_LINK_ID_INVALID  ;
    
    /* =============================================================================
     * Externs
     * ============================================================================= */
    
    /* =============================================================================
     * Use case code
     * ============================================================================= */
    static SystemVideo_Ivahd2ChMap_Tbl systemVid_encDecIvaChMapTbl = {
        .isPopulated = 1,
        .ivaMap[0] = {
                      .EncNumCh = 2,
                      .EncChList = {0, 1},
                      .DecNumCh = 2,
                      .DecChList = {0, 1},
                      },
    
    };
    #define NUM_DUP_LINK           (3)
    #define HDMIDIS_DUP_IDX        (0)
    #define RAW_DUP_IDX            (2)
    
    
    /* ===================================================================
     *  @func     MultiCh_createStreamCaptureDisplay
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Void MultiCh_createStreamCaptureDisplay()
    {
    
         UInt32 i;
        //CameraLink_CreateParams cameraPrm;
        CaptureLink_CreateParams capturePrm;
    
        IpcLink_CreateParams ipcOutVpssPrm;
        IpcLink_CreateParams ipcInVideoPrm;
        EncLink_CreateParams encPrm;
        
        DupLink_CreateParams dupPrm[NUM_DUP_LINK];
        DisplayLink_CreateParams displayPrm;
       
        IpcBitsOutLinkRTOS_CreateParams ipcBitsOutVideoPrm;
        IpcBitsInLinkHLOS_CreateParams ipcBitsInHostPrm0;
        IpcFramesOutLinkRTOS_CreateParams ipcFramesOutVpssPrm;
    
        //CameraLink_VipInstParams *pCameraInstPrm;
        //CameraLink_OutParams *pCameraOutPrm;
    	CaptureLink_VipInstParams *pCaptureInstPrm;
    	CaptureLink_OutParams *pCaptureOutPrm;
    
        UInt32 ipcOutVpssId;
        UInt32 ipcInVideoId;
        UInt32 ipcFramesOutVpssId;
    
        UInt32 dupId[NUM_DUP_LINK];
    
        /* IPC struct init */
        MULTICH_INIT_STRUCT(IpcLink_CreateParams, ipcOutVpssPrm);
        MULTICH_INIT_STRUCT(IpcLink_CreateParams, ipcInVideoPrm);
        MULTICH_INIT_STRUCT(IpcBitsOutLinkRTOS_CreateParams, ipcBitsOutVideoPrm);
        MULTICH_INIT_STRUCT(IpcBitsInLinkHLOS_CreateParams, ipcBitsInHostPrm0);
    
            MULTICH_INIT_STRUCT(IpcFramesOutLinkRTOS_CreateParams, ipcFramesOutVpssPrm);
    
        OSA_printf("\n********* RAJESHKANNAN : Entered Capture + Display usecase - H264 1080p @60 fps, H264 D1 @30fps ********\n\n");
    
        MultiCh_detectBoard();
    
        System_linkControl(SYSTEM_LINK_ID_M3VPSS,
                           SYSTEM_M3VPSS_CMD_RESET_VIDEO_DEVICES, NULL, 0, TRUE);
    
        //System_linkControl(SYSTEM_LINK_ID_M3VPSS,SYSTEM_M3VPSS_CMD_GET_AVSYNC_SHAREDOBJ_PTR, NULL, 0, TRUE);
    
    
        System_linkControl(SYSTEM_LINK_ID_M3VIDEO,
                           SYSTEM_COMMON_CMD_SET_CH2IVAHD_MAP_TBL,
                           &systemVid_encDecIvaChMapTbl,
                           sizeof(SystemVideo_Ivahd2ChMap_Tbl), TRUE);
    
         /* Link IDs */
        //gVcamModuleContext.cameraId = SYSTEM_LINK_ID_CAMERA;
        gVcapModuleContext.captureId = SYSTEM_LINK_ID_CAPTURE;
        //AV_scalerId = SYSTEM_LINK_ID_SCLR_INST_1;
        gVencModuleContext.encId = SYSTEM_LINK_ID_VENC_0;
        /* dup Link IDs*/
        dupId[HDMIDIS_DUP_IDX] = SYSTEM_VPSS_LINK_ID_DUP_0;
    
        /* display IDs */
    
        gVdisModuleContext.displayId[VDIS_DEV_HDMI] = SYSTEM_LINK_ID_DISPLAY_0;
        ipcOutVpssId = SYSTEM_VPSS_LINK_ID_IPC_OUT_M3_0;
        ipcInVideoId = SYSTEM_VIDEO_LINK_ID_IPC_IN_M3_0;
        gVencModuleContext.ipcBitsOutRTOSId = SYSTEM_VIDEO_LINK_ID_IPC_BITS_OUT_0;
        gVencModuleContext.ipcBitsInHLOSId = SYSTEM_HOST_LINK_ID_IPC_BITS_IN_0;
            ipcFramesOutVpssId = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_OUT_0;
    
    #if 0
        /* Camera Link params */
        OSA_printf("RAJESHKANNAN : Camera Link ready to start\n");
        CameraLink_CreateParams_Init(&cameraPrm);
    	cameraPrm.captureMode = CAMERA_LINK_CAPMODE_ISIF;
        cameraPrm.outQueParams[0].nextLink = dupId[HDMIDIS_DUP_IDX] ;
        
        /* This is for TVP5158 Audio Channels - Change it to 16 if there are 16
         * audio channels connected in cascade */
        cameraPrm.numAudioChannels = 0;
        cameraPrm.numVipInst = 1;
        cameraPrm.tilerEnable = FALSE;
    
    	cameraPrm.vsEnable = 0;
        pCameraInstPrm = &cameraPrm.vipInst[0];
        pCameraInstPrm->vipInstId = SYSTEM_CAMERA_INST_VP_CSI2;
        pCameraInstPrm->videoDecoderId = MultiCh_getSensorId(gUI_mcfw_config.sensorId);
    #ifdef RAW_SENSOR
        pCameraInstPrm->inDataFormat = SYSTEM_DF_YUV420SP_UV;
    #else
        pCameraInstPrm->inDataFormat = SYSTEM_DF_YUV420SP_UV ; //SYSTEM_DF_YUV422I_UYVY;
    #endif
    	pCameraInstPrm->sensorOutWidth  = 1280; //1920;    RAJESHKANNAN 
    	pCameraInstPrm->sensorOutHeight = 720;  //1080;
            OSA_printf("RAJESHKANNAN Setted sensor stream as HD instead of FULL HD");
    #ifdef YUV_FRAMES_TO_A8
    	pCameraInstPrm->standard = SYSTEM_STD_1080P_30;
    #else
    	pCameraInstPrm->standard = SYSTEM_STD_1080P_60;
    #endif
        //pCameraInstPrm->numOutput = 2;    //RAJESHKANNAN
        pCameraInstPrm->numOutput = 1;
    
        /* First stream */
        pCameraOutPrm = &pCameraInstPrm->outParams[0];
    #ifdef RAW_SENSOR
        pCameraOutPrm->dataFormat = SYSTEM_DF_YUV420SP_UV; //SYSTEM_DF_YUV420SP_VU;//SYSTEM_DF_YUV422I_VYUY;
    #else
        pCameraOutPrm->dataFormat = SYSTEM_DF_YUV420SP_UV;//SYSTEM_DF_YUV422I_UYVY; //SYSTEM_DF_YUV422I_UYVY; //SYSTEM_DF_YUV420SP_VU;//SYSTEM_DF_YUV422I_VYUY;
    #endif
        
        pCameraOutPrm->scEnable = FALSE; 
        pCameraOutPrm->scOutWidth = 1280;    //RAJESHKANNAN changed resolution from 1920 to 1280
        pCameraOutPrm->scOutHeight = 720;
        OSA_printf("RAJESH KANNAN : FIRST STREAM RESOLUTION changed from FULL HD TO HD and displayed\n");
     
        pCameraOutPrm->outQueId = 0;
    
        /* 2A config */
        cameraPrm.t2aConfig.n2A_vendor = gUI_mcfw_config.n2A_vendor;
        cameraPrm.t2aConfig.n2A_mode = gUI_mcfw_config.n2A_mode;
    
    #endif
    
    	/* Capture Link params */
    
            OSA_printf("RAJESHKANNAN : Capture Link ready to start\n");
    
    	CaptureLink_CreateParams_Init(&capturePrm);
    	capturePrm.numVipInst		    = 1;
     	capturePrm.tilerEnable		    = FALSE;
    	capturePrm.numBufsPerCh		    =  10; //4;    // 10;
    //~~~~~~~~~~
        capturePrm.fakeHdMode                 = FALSE;
        capturePrm.enableSdCrop               = FALSE;
        capturePrm.doCropInCapture            = FALSE;
    
    //~~~~~~~~~~
    	pCaptureInstPrm                     = &capturePrm.vipInst[0];
    	pCaptureInstPrm->vipInstId          = SYSTEM_CAPTURE_INST_VIP0_PORTA;
    	pCaptureInstPrm->videoDecoderId     = 0; 
    	pCaptureInstPrm->standard           = SYSTEM_STD_PAL ; 
    	pCaptureInstPrm->numOutput          = 1;
    	pCaptureInstPrm->inDataFormat       = SYSTEM_DF_YUV422P;
    	pCaptureOutPrm                      = &pCaptureInstPrm->outParams[0];
    	
    	pCaptureOutPrm->dataFormat          = /*SYSTEM_DF_YUV422I_YUYV; */ SYSTEM_DF_YUV420SP_UV;
    	pCaptureOutPrm->scEnable            = FALSE;
    	pCaptureOutPrm->scOutWidth          = 720; //0;
    	pCaptureOutPrm->scOutHeight         = 240; //576; //0;
    	pCaptureOutPrm->outQueId            = 0;
    
    //	pCaptureOutPrm->frameSkipMask		= 0x0; // Drop to 15fps
    
    	capturePrm.outQueParams[0].nextLink = /*AV_scalerId;*/ dupId[HDMIDIS_DUP_IDX] ; 
    	OSA_printf("RAJESHKANNAN : ###Capture link connected to DUP link###......\n");
    
        /* dup link parameters*/
    #ifdef RAW_FRAMES_TO_A8
        dupPrm[HDMIDIS_DUP_IDX].inQueParams.prevLinkId = ispId;
    #else
        dupPrm[HDMIDIS_DUP_IDX].inQueParams.prevLinkId = gVcapModuleContext.captureId ; 
    #endif
        dupPrm[HDMIDIS_DUP_IDX].inQueParams.prevLinkQueId = 0;
        dupPrm[HDMIDIS_DUP_IDX].numOutQue = 2;
        dupPrm[HDMIDIS_DUP_IDX].outQueParams[0].nextLink = ipcOutVpssId; 
        dupPrm[HDMIDIS_DUP_IDX].outQueParams[1].nextLink = gVdisModuleContext.displayId[VDIS_DEV_HDMI]; //ipcOutVpssId;
        dupPrm[HDMIDIS_DUP_IDX].notifyNextLink = TRUE;
    
            /* display link params */
            MULTICH_INIT_STRUCT(DisplayLink_CreateParams,displayPrm);
            displayPrm.inQueParams[0].prevLinkId = dupId[HDMIDIS_DUP_IDX];
            displayPrm.inQueParams[0].prevLinkQueId = 1;
            displayPrm.displayRes = gVdisModuleContext.vdisConfig.deviceParams[VDIS_DEV_HDMI].resolution;
            displayPrm.displayId  = DISPLAY_LINK_DISPLAY_SC2;
    
        /* IPC Out VPSS link params */
            ipcOutVpssPrm.inQueParams.prevLinkId = dupId[HDMIDIS_DUP_IDX];
        ipcOutVpssPrm.inQueParams.prevLinkQueId = 0;
        ipcOutVpssPrm.numOutQue = 1;
        ipcOutVpssPrm.outQueParams[0].nextLink = ipcInVideoId;
        ipcOutVpssPrm.notifyNextLink = TRUE;
        ipcOutVpssPrm.notifyPrevLink = TRUE;
        ipcOutVpssPrm.noNotifyMode = FALSE;
    
        /* IPC In VIDEO params */
        ipcInVideoPrm.inQueParams.prevLinkId = ipcOutVpssId;
        ipcInVideoPrm.inQueParams.prevLinkQueId = 0;
        ipcInVideoPrm.numOutQue = 1;
        ipcInVideoPrm.outQueParams[0].nextLink = gVencModuleContext.encId;
        ipcInVideoPrm.notifyNextLink = TRUE;
        ipcInVideoPrm.notifyPrevLink = TRUE;
        ipcInVideoPrm.noNotifyMode = FALSE;
    
      /* ENC link */
            MULTICH_INIT_STRUCT(EncLink_CreateParams,encPrm);
            {
                EncLink_ChCreateParams   *pLinkChPrm;
            EncLink_ChDynamicParams  *pLinkDynPrm;
            VENC_CHN_DYNAMIC_PARAM_S *pDynPrm;
            VENC_CHN_PARAMS_S        *pChPrm;
    
                    for (i = 0; i < 1; i++)
                    {
                            pLinkChPrm  = &encPrm.chCreateParams[i];
                            pLinkDynPrm = &pLinkChPrm->defaultDynamicParams;
    
                            pChPrm      = &gVencModuleContext.vencConfig.encChannelParams[i];
                            pDynPrm     = &pChPrm->dynamicParam;
    
                            pLinkChPrm->format                  = IVIDEO_H264HP;
                            pLinkChPrm->profile                 = gVencModuleContext.vencConfig.h264Profile[i];
                            pLinkChPrm->dataLayout              = IVIDEO_PROGRESSIVE;
                            pLinkChPrm->fieldMergeEncodeEnable  = FALSE;
                            pLinkChPrm->enableAnalyticinfo      = 0 ;//pChPrm->enableAnalyticinfo;
                            OSA_printf("RAJESHKANNAN : Checking the value enableAnalyticinfo = %d\n", pChPrm->enableAnalyticinfo);
                            pLinkChPrm->maxBitRate              = pChPrm->maxBitRate;
                            pLinkChPrm->encodingPreset          = pChPrm->encodingPreset;
                            OSA_printf("RAJESHKANNAN : In Encoder EncodingPreset[%d]=%d\n", i ,  pChPrm->encodingPreset ) ; 
                            pLinkChPrm->rateControlPreset       = IVIDEO_USER_DEFINED;
                            pLinkChPrm->enableHighSpeed         = FALSE;
                            pLinkChPrm->enableWaterMarking      = pChPrm->enableWaterMarking;
    
                            pLinkChPrm->StreamPreset            = gUI_mcfw_config.StreamPreset[i];
    
                            pLinkDynPrm->intraFrameInterval     = pDynPrm->intraFrameInterval;
                            pLinkDynPrm->targetBitRate          = pDynPrm->targetBitRate;
                            pLinkDynPrm->interFrameInterval     = 1;
                            pLinkDynPrm->mvAccuracy             = IVIDENC2_MOTIONVECTOR_QUARTERPEL;
                            pLinkDynPrm->inputFrameRate         = pDynPrm->inputFrameRate;
                            pLinkDynPrm->rcAlg                  = pDynPrm->rcAlg;
                            pLinkDynPrm->qpMin                  = pDynPrm->qpMin;
                            pLinkDynPrm->qpMax                  = pDynPrm->qpMax;
                            pLinkDynPrm->qpInit                 = pDynPrm->qpInit;
                            pLinkDynPrm->vbrDuration            = pDynPrm->vbrDuration;
                            pLinkDynPrm->vbrSensitivity         = pDynPrm->vbrSensitivity;
    
                            encPrm.numBufPerCh[i]                   = 4;//3;
                            gVencModuleContext.encFormat[i] = pLinkChPrm->format;
                    }
            }
    
    
        encPrm.chCreateParams[0].defaultDynamicParams.inputFrameRate = 30;
        //encPrm.chCreateParams[1].defaultDynamicParams.inputFrameRate = 30;
            encPrm.vsEnable                                              = 0;
            encPrm.isVaUseCase                                           = 0;
        encPrm.inQueParams.prevLinkId                                = ipcInVideoId;
        encPrm.inQueParams.prevLinkQueId                             = 0;
    
    #ifdef DIR_DEC
        encPrm.outQueParams.nextLink                                 = gDecId;
    #else
        encPrm.outQueParams.nextLink                                 = gVencModuleContext.ipcBitsOutRTOSId; //ipcBitsOutVideoId;
    #endif
    
       /* IPC Bits Out VIDEO Link params */
        ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkId =
        gVencModuleContext.encId;
        ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
        ipcBitsOutVideoPrm.baseCreateParams.numOutQue = 1;
        ipcBitsOutVideoPrm.baseCreateParams.outQueParams[0].nextLink =
        gVencModuleContext.ipcBitsInHLOSId;
        MultiCh_ipcBitsInitCreateParams_BitsOutRTOS(&ipcBitsOutVideoPrm, TRUE);
    
        /* IPC Bits In HOST Link params */
        ipcBitsInHostPrm0.baseCreateParams.inQueParams.prevLinkId =
        gVencModuleContext.ipcBitsOutRTOSId;
        ipcBitsInHostPrm0.baseCreateParams.inQueParams.prevLinkQueId = 0;
        MultiCh_ipcBitsInitCreateParams_BitsInHLOS(&ipcBitsInHostPrm0);
    
        /* Links Creation */
        /* Camera Link */
        //System_linkCreate(gVcamModuleContext.cameraId, &cameraPrm,
         //                 sizeof(cameraPrm));
        
        System_linkCreate( gVcapModuleContext.captureId, &capturePrm,  sizeof(capturePrm));
        OSA_printf("RAJESHKANNAN : Checking Capture link created successfully......\n");
    
        //System_linkControl(gVcapModuleContext.captureId,CAPTURE_LINK_CMD_DETECT_VIDEO, NULL, 0, TRUE);
    
    
        /*dup link*/
        System_linkCreate(dupId[HDMIDIS_DUP_IDX], &dupPrm[HDMIDIS_DUP_IDX], sizeof(dupPrm[HDMIDIS_DUP_IDX]));
    
    //RAJESHKANNAN ADDED For Testing
        /* IPC Links */
        System_linkCreate(ipcOutVpssId, &ipcOutVpssPrm, sizeof(ipcOutVpssPrm));
        System_linkCreate(ipcInVideoId, &ipcInVideoPrm, sizeof(ipcInVideoPrm));
    
        /* Video Encoder Link */
        System_linkCreate(gVencModuleContext.encId, &encPrm, sizeof(encPrm));
    
    /* IPC Bits Links */
        System_linkCreate(gVencModuleContext.ipcBitsOutRTOSId, &ipcBitsOutVideoPrm,
                          sizeof(ipcBitsOutVideoPrm));
        System_linkCreate(gVencModuleContext.ipcBitsInHLOSId, &ipcBitsInHostPrm0,
                          sizeof(ipcBitsInHostPrm0));
    
        /* display link */
        System_linkCreate(gVdisModuleContext.displayId[VDIS_DEV_HDMI], &displayPrm,
                          sizeof(displayPrm));
    
        OSA_printf("RAJESH KANNAN : USECASE SETUP DONE\n");
    }
    
    /* ===================================================================
     *  @func     MultiCh_deleteStreamCaptureDisplay
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Void MultiCh_deleteStreamCaptureDisplay()
    {
        UInt32 ipcOutVpssId;
        UInt32 ipcInVideoId;
        UInt32 ipcFramesOutVpssId;
    	UInt32 dupId[NUM_DUP_LINK];
        ipcOutVpssId = SYSTEM_VPSS_LINK_ID_IPC_OUT_M3_0;
        ipcInVideoId = SYSTEM_VIDEO_LINK_ID_IPC_IN_M3_0;
        ipcFramesOutVpssId = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_OUT_0;
    
        /* Links Deletion in reverse order */
    
      /* display link */
        System_linkDelete(gVdisModuleContext.displayId[VDIS_DEV_HDMI]);
    
        /* IPC Bits Links */
        System_linkDelete(gVencModuleContext.ipcBitsOutRTOSId);
        System_linkDelete(gVencModuleContext.ipcBitsInHLOSId);
    
        /* Video Encoder Link */
        System_linkDelete(gVencModuleContext.encId);
    
      /* IPC Links */
        System_linkDelete(ipcOutVpssId);
        System_linkDelete(ipcInVideoId);
    
        /* dup Link IDs*/
        dupId[HDMIDIS_DUP_IDX] = SYSTEM_VPSS_LINK_ID_DUP_0;
    
    	/* Dup links */
    	System_linkDelete(dupId[HDMIDIS_DUP_IDX]);
    
    
        /* Camera Link */
    //    System_linkDelete(gVcamModuleContext.cameraId);
        System_linkDelete(gVcapModuleContext.captureId);
        /* Print the HWI, SWI and all tasks load */
        /* Reset the accumulated timer ticks */
        MultiCh_prfLoadCalcEnable(FALSE, TRUE, FALSE);
        
        OSA_printf("USECASE TEARDOWN DONE\n");
    }
    

  • Hi Anand,

    In IPNC RDK  file location

    ipnc_rdk/ipnc_mcfw/mcfw/src_bios6/links_m3vpss/capture/captureLink_drv.c

    I tried to merge the fields into frames by using the following ioctl API before storing the buffers

                           Vps_CaptStorageParams StoragePrms;

                           StoragePrms.channelNum = 0;

                           StoragePrms.bufferFmt = FVID2_BUF_FMT_FRAME;

                           StoragePrms.fieldMerged = 1;

                           status = FVID2_control(pDrvObj->captureVipHandle,IOCTL_VPS_CAPT_SET_STORAGE_FMT, &StoragePrms, NULL);

                           Vps_printf("RAJESHKANNAN : Checking ###status### value = (%d)\n", status);

    I'm getting the successful value but still output is 720 * 240  !!! ( The output is interlaced )

    I'm expecting 720*480 ????

    Kindly suggest ???

    Regards,

    Rajesh Kannan.S

    Find the attached screenshot 

  • Hi,

    Your capture driver is created with the 'inScanFormat = FVID2_SF_PROGRESSIVE' because you are creating the capture link with the following standard:

    pCaptureInstPrm->standard           = SYSTEM_STD_PAL ; 

    This standard 'SYSTEM_STD_PAL' is not handled in the capture link therefore it is creating the capture driver with the PROGRESSIVE scan format (default case).

    And if the scan format is PROGRESSIVE then the ioctl 'IOCTL_VPS_CAPT_SET_STORAGE_FMT' has no effect.

    Pl. create the capture with the following standard:

    pCaptureInstPrm->standard           = FVID2_STD_480I ;

    regards,

    Anand

  • Hi Anand,

    Thanks for your reply..,

    I have a look and update you....

    I have one more clarification whether I can include the ioctl command in capture create side or start side ???

    Now I added the ioctl command in the Fn CaptureLink_drvAllocAndQueueFrames() before
    /** Set rtParams for every frame in perFrameCfg **/ allocating memory for frames ???

    Need to change the pitch value ???

    Kindly suggest ?

    Thanks & Regards,

    Rajesh Kannan.S
  • Hi,

    You can call the ioctl at any point of time after the FVID2_create().

    You have to double the height while allocating memory for the output buffers.

    regards,

    Anand

  • Hi Anand,

    I setted the std FVID2_STD_480I here it's  ( In captureLink drv) setting the pObj->maxHeight = 240;

    But I want to display as 720*480

    Now I'm getting 720*240 but the image is in zigzag view  it's going up and down ???  In down unable to see ???

       if(format.height < CAPTURE_LINK_HEIGHT_MIN_LINES)

                   format.height = CAPTURE_LINK_HEIGHT_MIN_LINES * 2;    // Here I doubled the height

               format.pitch[0] = pOutInfo->pitch[0];

               format.pitch[1] = pOutInfo->pitch[1];

               format.pitch[2] = pOutInfo->pitch[2];

               format.fieldMerged[0] = FALSE;

               format.fieldMerged[1] = FALSE;

               format.fieldMerged[2] = FALSE;

               format.dataFormat = pOutInfo->dataFormat;

               format.scanFormat = FVID2_SF_PROGRESSIVE;

               format.bpp = FVID2_BPP_BITS8;                  /* ignored */

     [m3vpss ]  RAJESHKANNAN : CAPTURE:ALLOCINFO: FMT[7]  / PITCH[736] / HEIGHT [576]  / NUMBUFS[10]

    Getting Height as 576

    Need to change the pitch value or field merge ?

    Kindly suggest ???

    I attached the Image 

  • Hi,

    Pl. undo the height doubling that you did in the 'CaptureLink_drvAllocAndQueueFrames()' fn and instead double the pitch in the 'CaptureLink_drvCreateInst()' fn before FVID2_create() fn call:

    pVipOutPrm->pitch[0] *= 2;

    pVipOutPrm->pitch[1] *= 2;

    regards,

    Anand

  • Hi Anand,

    //pVipOutPrm->pitch[0] = VpsUtils_align(pObj->maxWidth, VPS_BUFFER_ALIGNMENT * 2);
    pVipOutPrm->pitch[0] *= 2;   //FOR TESTING JULY_1

    //pVipOutPrm->pitch[1] = pVipOutPrm->pitch[0];
    pVipOutPrm->pitch[1] *= 2;  // FOR TESTING JULY_1

    After changed the pitch value I'm getting the following log

    pitch value is 0 !!!

    [m3vpss ] RAJESHKANNAN : Checking maxHeight = 240

    [m3vpss ] RAJESHKANNAN : Checking else to change the capture mode from 16 to 8 bit

    [m3vpss ]  10313: CAPTURE: VIP0 PortA capture mode is [ 8-bit, Non-mux Embedded Sync] !!!

    [m3vpss ] RAJESHKANNAN : Checking ###pitch[0] = 0

    [m3vpss ] RAJESHKANNAN : Checking ###pitch[1] = 0

    [m3vpss ] RAJESHKANNAN : In Fn CaptureLink_drvAllocAndQueueFrames Entered......

    [m3vpss ] RAJESHKANNAN : ###Checking format scanFormat (0 to interlaced )= 6664

    [m3vpss ] RAJESHKANNAN : ###Checking format maxwidth = 720

    [m3vpss ] RAJESHKANNAN : ###Checking format maxheight = 240

    [m3vpss ] RAJESHKANNAN : Checking After changed the height = 288

    [m3vpss ] CAPTURE:ALLOCINFO:FMT[7]/PITCH[0]/HEIGHT[288]/NUMBUFS[10]

    [m3vpss ] RAJESHKANNAN : Checking ###status### value = (0)     //  IOCTL success 

    ApproDrvInit: 3

    queue id:131076

    queue id:0

    queue id:32769

    queue id:0

    ApproDrvInit: 7

    queue id:131076

    TimeOut occure in boot_proc.

    Program exit.

    Regards,

    Rajesh Kannan.S

  • Hi,

    Why did you comment out the pitch calculation code?:

    //pVipOutPrm->pitch[0] = VpsUtils_align(pObj->maxWidth, VPS_BUFFER_ALIGNMENT * 2);

    //pVipOutPrm->pitch[1] = pVipOutPrm->pitch[0];

    I asked you to only double the already calculated pitch value just before FVID2_create() call.

    regards,

    Anand

  • Hi Anand,

    After Added the pitch value before FVID2_create () I got the attached image for your reference 

       pVipOutPrm->pitch[0] *= 2;   // FOR TESTING JULY_1

       pVipOutPrm->pitch[1] *= 2;    // FOR TESTING JULY_1

       pInst->captureVipHandle = FVID2_create(FVID2_VPS_CAPT_VIP_DRV,

                                              pInst->instId,

                                              pVipCreateArgs,

                                              &pInst->createStatus, &pInst->cbPrm);

    Regards,

    Rajesh Kannan.S

  • Hi,

    Are you calling 'IOCTL_VPS_CAPT_SET_STORAGE_FMT' ioctl?

    regards,

    Anand

  • Hi Anand ,

    Yes ,

    StoragePrms.channelNum = 0;
    StoragePrms.bufferFmt = FVID2_BUF_FMT_FRAME;
    StoragePrms.fieldMerged = 1;
    status = FVID2_control(pDrvObj->captureVipHandle,IOCTL_VPS_CAPT_SET_STORAGE_FMT, &StoragePrms, NULL);
    Vps_printf("RAJESHKANNAN : Checking ###status### value = (%d)\n", status);

    Regards,

    Rajesh Kannan.S
  • Hi,

    I really cannot test the interlaced capture on my side,so whatever changes i am suggesting are untested so pl. bear with me.

    I think the pitch doubling is not correct change so pl. undo it.

    Also go back to doubling the height during memory allocation for the output buffers.

    Another changes required is that the the height parameter being propagated to the next link should be 480 and not 240,so pl. double the the value of 'pQueChInfo->height' in the 'CaptureLink_drvCreateInst()' fn and check.

    regards,

    Anand 

  • Hi Anand,

    I understood ..,

    After increased the height value in Fn CaptureLink_drvCreateInst()  and doubled the height into two..,

    I got 720 * 480 but still the video scanformat in INTERLACED  

    The filed merge is not happened !!!

    In Fn CaptureLink_drvAllocAndQueueFrames

    The structure FVID2_Format says that the fieldMerged

    /**< This field tells whether both the fields have to be merged,

    i.e line interleaved or not.

    Used only for interlaced format. The effective pitch is calculated

    based on this information along with pitch parameter. If fields are

    merged, effective pitch = pitch * 2 else effective pitch = pitch. */

    Can I try this to merge the fields into frames ???  It will take effect ???

    Find the Image 

  • Hi,

    It looks like proper filed merged image.

    Where are you checking the scanFormat?

    If the next link is checking for the scanFormat then you need to set 'pQueChInfo->scanFormat = FVID2_SF_PROGRESSIVE;' in the CaptureLink_drvCreateInst() fn so that the next link will treat the frames as progressive.

    regards,

    Anand

  • Hi Anand ,

    In Encoding side, I was Checking the scanFormat  INTERLACED ..,

    After changed the  pQueChInfo->scanFormat = FVID2_SF_PROGRESSIVE I'm getting the scan Format PROGRESSIVE it's showing

    [m3vpss ] CAPTURE:ALLOCINFO:FMT[7]/PITCH[736]/HEIGHT[576]/NUMBUFS[10]

    [m3vpss ] RAJESHKANNAN : Checking ###status### value = (0)

    [m3video] 10408: ENCODE: Creating CH0 of 720 x 480, pitch = (736, 736)  [PROGRESSIVE]  [NON-TILED ], bitrate = 8000 Kbps ...

    But still the screenshot looks like the fields are not arranged properly ???

    Regards,

    Rajesh Kannan.S

  • Hi,

    I cannot makeout the issue clearly in the image that you have shared.

    Pl. capture some good image may color checker board and share.

    Do you see that one of the fields is missing or not interlaced properly?

    regards,

    Anand

  • Hi Anand,

    Find the attached file for your reference ..,

    I think the field's are coming but not interlaced properly..,

    Regards,

    Rajesh Kannan.S

    Image.tar.gz

  • Hi,

    Can you pl. connect to CCS and dump the output of the capture link?

    regards,

    Anand

  • Hi Anand,

    We don't have CCS right now ???

    Any other way to dump the output ???

    Regards,

    Rajesh Kannan.S
  • Hi Anand,

    Whatever I sent the images it's ok for you ??? or it's not clear ? Can you find the difference ???

    Field merge is not happening properly !!!

    Kindly suggest ...

    Regards,

    Rajesh Kannan.S
  • Hi Anand,

    In Fn(CaptureLink_drvCreateInst) I multiplied the pitch value into two I'm getting

       pQueChInfo->pitch[0] = pVipOutPrm->pitch[0] * 2; //TESTING JULY_3

       pQueChInfo->pitch[1] = pVipOutPrm->pitch[1] * 2;

       pQueChInfo->pitch[2] = pVipOutPrm->pitch[2] * 2;

    the progressive (Field merged )attached Image but not 720*480

    Kindly suggest ????

    Regards,

    Rajesh Kannan.S  

  • Hi Anand,

    In my usecase I added scaler link to upscale the incoming data (720*480 to 1080P)  

    I tried before converting to progressive .., scaler was not effected

    But now It's upscaling..., Still I'm facing the same problem for field merge !!! I attached the image for your reference..,

    Kindly give some suggestion to solve this issue..

    Regards,

    Rajesh Kannan.S

  • Hi,

    The 'pQueChInfo->pitch[0] = pVipOutPrm->pitch[0] * 2; //TESTING JULY_3' is not the correct change.

    It allows the next link to pick only one of the fields.

    I am checking with the DVR team on this.

    regards,

    Anand

  • Hi Anand,

    Thanks for your reply..,

    Kindly let me know where I can do the changes to get the properly field arranged frames (PROGRESSIVE)

    I am waiting for your reply ..,

    Thanks & Regards,

    Rajesh Kannan.S
  • Hi,

    Instead of merging the fields in the capture link you can run the Deinterlacer on the captured fields.

    The Deinterlacer will convert each input field into a frame,so if the input is 60 fields per second then the Deinterlacer will generate 60 frames per second.

    regards,

    Anand

  • Hi Anand,

    As per your suggestion I added Deinterlacer in my usecase I'm getting the following logs !!

    For first case it's getting success then it's failing alternatively ..,

    After dei, the data is not entered to next link !!!

    In display side I'm getting 720 * 480 blank white screen

    I attached the usecase file for your reference

    [m3vpss ] RAJESHKANNAN : Checking Fn(DeiLink_drvProcessData) Entered.....

    [m3vpss ]  10937: RAJESHKANNAN : DEI    : Received 1 IN frames !!!

    [m3vpss ] RAJESHKANNAN Checking pFrame->fid = 0

    [m3vpss ] RAJESHKANNAN : Checking Ready to submit data......

    [m3vpss ] RAJESHKANNAN Fn(DeiLink_drvSubmitData) Entered......

    [m3vpss ] RAJESHKANNAN : Checking after checking (que_get) status value = 0

    [m3vpss ] RAJESHKANNAN :  DeiLink_drvMakeFrameLists Fn ready to call.....

    [m3vpss ] RAJESHKANNAN : FN(DeiLink_drvMakeFrameLists) Entered......

    [m3vpss ] RAJESHKANNAN : Checking  ###pObj->inQueInfo.numCh = 1

    [m3vpss ] RAJESHKANNAN : Exited from DeiLink_drvMakeFrameLists Fn Successfully......

    [m3vpss ]  10938: ###DEI###    : Submitting 1 frames !!!

    [m3vpss ] RAJESHKANNAN : No.of frames in loop.....

    [m3vpss ] RAJESHKANNAN : Checking Frames = 1

    [m3vpss ] RAJESHKANNAN : DeiLink_drvGetProcessedData Fn entered

    [m3vpss ]  10942: RAJESHKANNAN : DEI    : Completed 1 frames !!!

    [m3vpss ] RAJESHKANNAN : ###Checking status value### = 0

    [m3vpss ] RAJESHKANNAN : Checking after submitted data......

    [m3vpss ] RAJESHKANNAN : Checking Ready to submit data......

    [m3vpss ] RAJESHKANNAN Fn(DeiLink_drvSubmitData) Entered......

    [m3vpss ] RAJESHKANNAN : Checking after checking (que_get) status value = 0

    [m3vpss ] RAJESHKANNAN :  DeiLink_drvMakeFrameLists Fn ready to call.....

    [m3vpss ] RAJESHKANNAN : FN(DeiLink_drvMakeFrameLists) Entered......

    [m3vpss ] RAJESHKANNAN : Checking  ###pObj->inQueInfo.numCh = 1

    [m3vpss ] RAJESHKANNAN : Exited from DeiLink_drvMakeFrameLists Fn Successfully......

    [m3vpss ]  10943: ###DEI###    : Submitting 0 frames !!!

    [m3vpss ] RAJESHKANNAN : !!! ERROR !!! NO MORE FRAMES TO PROCESS !!!

    [m3vpss ] RAJESHKANNAN : ###Checking status value### = -1

    1300.multich_capturedisplay.c
    /** ==================================================================
     *  @file   multich_Stream_CaptureDisplay.c
     *
     *  @path    ipnc_mcfw/mcfw/src_linux/mcfw_api/usecases/
     *
     *  @desc   This  File contains.
     * ===================================================================
     *  Copyright (c) Texas Instruments Inc 2011, 2012
     *
     *  Use of this software is controlled by the terms and conditions found
     *  in the license agreement under which this software has been supplied
     * ===================================================================*/
    
    /*------------------------------ TRIPLE OUT <1080p + D1 + MJPEG> ----------------------------------
    
                                        Capture
    								 RSZA     RSZB
                                   1080P60    D130
                                  (YUV420)  (YUV420)
                                      |          |
                                 (0)-DUP0-(1)   (0)-DUP1-(1)
                                  |        |    |         |
                          HDMI DISPLAY  NULL1  TVOUT      NULL0
    
    ------------------------------------------------------------------------------------------*/
    
    #include "mcfw/src_linux/mcfw_api/usecases/multich_common.h"
    #include "mcfw/src_linux/mcfw_api/usecases/multich_ipcbits.h"
    #include "demos/mcfw_api_demos/multich_usecase/ti_mcfw_ipnc_main.h"
    
    /*
        Scaler-id Added for testing RAJESHKANNAN JUN-1
    */
    //UInt32 AV_scalerId = SYSTEM_LINK_ID_INVALID  ;
    UInt32 gDeiId; //ADDED JUN_2
    Int32 AV_nsfId ;
    
    #define DEI_OUT_MAIN_STRAMER    (DEI_LINK_OUT_QUE_DEI_SC)   // YUV422I WB0/1
    #define DEI_OUT_SUB_STRAMER             (DEI_LINK_OUT_QUE_VIP_SC) // (or) DEI_LINK_OUT_QUE_VIP_SC_SECONDARY_OUT  => YUV422I, YUV420SP on VIP0/1,
    
    /* =============================================================================
     * Externs
     * ============================================================================= */
    
    /* =============================================================================
     * Use case code
     * ============================================================================= */
    static SystemVideo_Ivahd2ChMap_Tbl systemVid_encDecIvaChMapTbl = {
        .isPopulated = 1,
        .ivaMap[0] = {
                      .EncNumCh = 2,
                      .EncChList = {0, 1},
                      .DecNumCh = 2,
                      .DecChList = {0, 1},
                      },
    
    };
    #define NUM_DUP_LINK           (3)
    #define HDMIDIS_DUP_IDX        (0)
    #define RAW_DUP_IDX            (2)
    
    
    /* ===================================================================
     *  @func     MultiCh_createStreamCaptureDisplay
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Void MultiCh_createStreamCaptureDisplay()
    {
    
    
        OSA_printf("\n ELANGO: : in MultiCh_createStreamCaptureDisplay\n\n");
    
         UInt32 i;
        //CameraLink_CreateParams cameraPrm;
        CaptureLink_CreateParams capturePrm;
        DeiLink_CreateParams      deiPrm ;    //RAJESHKANNAN JUN_2
        NsfLink_CreateParams AV_nsfPrm ;  
    
        IpcLink_CreateParams ipcOutVpssPrm;
        IpcLink_CreateParams ipcInVideoPrm;
        EncLink_CreateParams encPrm;
        
        DupLink_CreateParams dupPrm[NUM_DUP_LINK];
        DisplayLink_CreateParams displayPrm;
       
        IpcBitsOutLinkRTOS_CreateParams ipcBitsOutVideoPrm;
        IpcBitsInLinkHLOS_CreateParams ipcBitsInHostPrm0;
        IpcFramesOutLinkRTOS_CreateParams ipcFramesOutVpssPrm;
    
        //CameraLink_VipInstParams *pCameraInstPrm;
        //CameraLink_OutParams *pCameraOutPrm;
    	CaptureLink_VipInstParams *pCaptureInstPrm;
    	CaptureLink_OutParams *pCaptureOutPrm;
    
        UInt32 ipcOutVpssId;
        UInt32 ipcInVideoId;
        UInt32 ipcFramesOutVpssId;
    
        UInt32 dupId[NUM_DUP_LINK];
    
        /* IPC struct init */
        MULTICH_INIT_STRUCT(IpcLink_CreateParams, ipcOutVpssPrm);
        MULTICH_INIT_STRUCT(IpcLink_CreateParams, ipcInVideoPrm);
        MULTICH_INIT_STRUCT(IpcBitsOutLinkRTOS_CreateParams, ipcBitsOutVideoPrm);
        MULTICH_INIT_STRUCT(IpcBitsInLinkHLOS_CreateParams, ipcBitsInHostPrm0);
    
        MULTICH_INIT_STRUCT(DeiLink_CreateParams, deiPrm);    //RAJESHKANNAN JUN_2
    
            MULTICH_INIT_STRUCT(IpcFramesOutLinkRTOS_CreateParams, ipcFramesOutVpssPrm);
    
        OSA_printf("\n********* RAJESHKANNAN : Entered Capture + Display usecase - H264 1080p @60 fps, H264 D1 @30fps ********\n\n");
    
        MultiCh_detectBoard();
    
        System_linkControl(SYSTEM_LINK_ID_M3VPSS,
                           SYSTEM_M3VPSS_CMD_RESET_VIDEO_DEVICES, NULL, 0, TRUE);
    
        //System_linkControl(SYSTEM_LINK_ID_M3VPSS,SYSTEM_M3VPSS_CMD_GET_AVSYNC_SHAREDOBJ_PTR, NULL, 0, TRUE);
    
    
        System_linkControl(SYSTEM_LINK_ID_M3VIDEO,
                           SYSTEM_COMMON_CMD_SET_CH2IVAHD_MAP_TBL,
                           &systemVid_encDecIvaChMapTbl,
                           sizeof(SystemVideo_Ivahd2ChMap_Tbl), TRUE);
    
         /* Link IDs */
        //gVcamModuleContext.cameraId = SYSTEM_LINK_ID_CAMERA;
        gVcapModuleContext.captureId = SYSTEM_LINK_ID_CAPTURE;
        gDeiId = SYSTEM_LINK_ID_DEI_0 ; //SYSTEM_LINK_ID_DEI_HQ_1 ; //ADDED JUN_2
        //gDeiId = SYSTEM_LINK_ID_DEI_1 ; //ADDED JUN_2
        AV_nsfId = SYSTEM_LINK_ID_NSF_0 ;
    
    //    AV_scalerId = SYSTEM_LINK_ID_SCLR_INST_1;
        gVencModuleContext.encId = SYSTEM_LINK_ID_VENC_0;
        /* dup Link IDs*/
        dupId[HDMIDIS_DUP_IDX] = SYSTEM_VPSS_LINK_ID_DUP_0;
    
        /* display IDs */
    
        gVdisModuleContext.displayId[VDIS_DEV_HDMI] = SYSTEM_LINK_ID_DISPLAY_0;
        //gVdisModuleContext.displayId[VDIS_DEV_SD] = SYSTEM_LINK_ID_DISPLAY_2; 
        ipcOutVpssId = SYSTEM_VPSS_LINK_ID_IPC_OUT_M3_0;
        ipcInVideoId = SYSTEM_VIDEO_LINK_ID_IPC_IN_M3_0;
        gVencModuleContext.ipcBitsOutRTOSId = SYSTEM_VIDEO_LINK_ID_IPC_BITS_OUT_0;
        gVencModuleContext.ipcBitsInHLOSId = SYSTEM_HOST_LINK_ID_IPC_BITS_IN_0;
            ipcFramesOutVpssId = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_OUT_0;
    
    #if 0
        /* Camera Link params */
        OSA_printf("RAJESHKANNAN : Camera Link ready to start\n");
        CameraLink_CreateParams_Init(&cameraPrm);
    	cameraPrm.captureMode = CAMERA_LINK_CAPMODE_ISIF;
        cameraPrm.outQueParams[0].nextLink = dupId[HDMIDIS_DUP_IDX] ;
        
        /* This is for TVP5158 Audio Channels - Change it to 16 if there are 16
         * audio channels connected in cascade */
        cameraPrm.numAudioChannels = 0;
        cameraPrm.numVipInst = 1;
        cameraPrm.tilerEnable = FALSE;
    
    	cameraPrm.vsEnable = 0;
        pCameraInstPrm = &cameraPrm.vipInst[0];
        pCameraInstPrm->vipInstId = SYSTEM_CAMERA_INST_VP_CSI2;
        pCameraInstPrm->videoDecoderId = MultiCh_getSensorId(gUI_mcfw_config.sensorId);
    #ifdef RAW_SENSOR
        pCameraInstPrm->inDataFormat = SYSTEM_DF_YUV420SP_UV;
    #else
        pCameraInstPrm->inDataFormat = SYSTEM_DF_YUV420SP_UV ; //SYSTEM_DF_YUV422I_UYVY;
    #endif
    	pCameraInstPrm->sensorOutWidth  = 1280; //1920;    RAJESHKANNAN 
    	pCameraInstPrm->sensorOutHeight = 720;  //1080;
            OSA_printf("RAJESHKANNAN Setted sensor stream as HD instead of FULL HD");
    #ifdef YUV_FRAMES_TO_A8
    	pCameraInstPrm->standard = SYSTEM_STD_1080P_30;
    #else
    	pCameraInstPrm->standard = SYSTEM_STD_1080P_60;
    #endif
        //pCameraInstPrm->numOutput = 2;    //RAJESHKANNAN
        pCameraInstPrm->numOutput = 1;
    
        /* First stream */
        pCameraOutPrm = &pCameraInstPrm->outParams[0];
    #ifdef RAW_SENSOR
        pCameraOutPrm->dataFormat = SYSTEM_DF_YUV420SP_UV; //SYSTEM_DF_YUV420SP_VU;//SYSTEM_DF_YUV422I_VYUY;
    #else
        pCameraOutPrm->dataFormat = SYSTEM_DF_YUV420SP_UV;//SYSTEM_DF_YUV422I_UYVY; //SYSTEM_DF_YUV422I_UYVY; //SYSTEM_DF_YUV420SP_VU;//SYSTEM_DF_YUV422I_VYUY;
    #endif
        
        pCameraOutPrm->scEnable = FALSE; 
        pCameraOutPrm->scOutWidth = 1280;    //RAJESHKANNAN changed resolution from 1920 to 1280
        pCameraOutPrm->scOutHeight = 720;
        OSA_printf("RAJESH KANNAN : FIRST STREAM RESOLUTION changed from FULL HD TO HD and displayed\n");
     
        pCameraOutPrm->outQueId = 0;
    
        /* 2A config */
        cameraPrm.t2aConfig.n2A_vendor = gUI_mcfw_config.n2A_vendor;
        cameraPrm.t2aConfig.n2A_mode = gUI_mcfw_config.n2A_mode;
    
    #endif
    
    	/* Capture Link params */
    
            OSA_printf("RAJESHKANNAN : Capture Link ready to start\n");
    
    	CaptureLink_CreateParams_Init(&capturePrm);
    	capturePrm.numVipInst		    = 1;
     	capturePrm.tilerEnable		    = FALSE;
    	capturePrm.numBufsPerCh		    =  10; //4;    // 10;
    
    //~~~~~~~~~~
        capturePrm.fakeHdMode                 = FALSE;
        capturePrm.enableSdCrop               = FALSE;
        capturePrm.doCropInCapture            = FALSE;
    
    //~~~~~~~~~~
    	pCaptureInstPrm                     = &capturePrm.vipInst[0];
    	pCaptureInstPrm->vipInstId          = SYSTEM_CAPTURE_INST_VIP0_PORTA;
    	pCaptureInstPrm->videoDecoderId     = 0;//SYSTEM_DEVICE_VID_DEC_TVP5158_DRV ; //SYSTEM_DEVICE_VID_DEC_OV10635_DRV;
    	pCaptureInstPrm->standard           = SYSTEM_STD_480I; //SYSTEM_STD_PAL; //SYSTEM_STD_NTSC; //SYSTEM_STD_AUTO_DETECT;//SYSTEM_STD_MUX_4CH_D1; //SYSTEM_STD_NTSC;//SYSTEM_STD_1080P_30;/ //SYSTEM_STD_AUTO_DETECT;   //SYSTEM_STD_720P_60;
    	pCaptureInstPrm->numOutput          = 1;
    	pCaptureInstPrm->inDataFormat       = SYSTEM_DF_YUV422P; //SYSTEM_DF_YUV422SP_UV; //SYSTEM_DF_YUV422I_UYVY; //SYSTEM_DF_YUV422P;
    	pCaptureOutPrm                      = &pCaptureInstPrm->outParams[0];
    	
    	pCaptureOutPrm->dataFormat          = SYSTEM_DF_YUV420SP_UV; //SYSTEM_DF_YUV420SP_UV; //SYSTEM_DF_YUV420P; //SYSTEM_DF_YUV420SP_UV;
    	OSA_printf("RAJESHKANNAN : Checking Capture ###OutDataFormat = %d\n", pCaptureOutPrm->dataFormat);
    	pCaptureOutPrm->scEnable            = FALSE;
    	pCaptureOutPrm->scOutWidth          = 720; //0;
    	pCaptureOutPrm->scOutHeight         = 480; //0;
    	pCaptureOutPrm->outQueId            = 0;
    //~~~~~~~~~~~~~~~~~~~~~
    
    //pCaptureInstPrm->videoCaptureMode = SYSTEM_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_DISCRETE_SYNC_ACTVID_VSYNC;
    //SYSTEM_CAPT_VIDEO_IF_MODE_16BIT
    
    
    //~~~~~~~~~~~~~~~~
    
    //	pCaptureOutPrm->frameSkipMask		= 0x0; // Drop to 15fps
    
    	capturePrm.outQueParams[0].nextLink =   gDeiId ;//AV_scalerId; //dupId[HDMIDIS_DUP_IDX] ; //gIspId[1];    //RAJESHKANNAN ADDED FOR TESTING MAY_27
    	OSA_printf("RAJESHKANNAN : ###Capture link connected to Deinterlacer link###......\n");
    
    //	ispPrm[0].inQueParams.prevLinkId    = gVcamModuleContext.cameraId;
    //	ispPrm[0].inQueParams.prevLinkQueId = 0;
    //	ispPrm[0].numOutQueue               = 1;
    //        gVcapModuleContext.vnfId = SYSTEM_LINK_ID_VNF;
    
            /*DEI*/
            deiPrm.inQueParams.prevLinkId = gVcapModuleContext.captureId ;
            deiPrm.inQueParams.prevLinkQueId  = 0 ;
            deiPrm.enableLineSkipSc = FALSE;
            deiPrm.enableDeiForceBypass = FALSE; //Input is progressive TRUE
            deiPrm.inputDeiFrameRate = 60;
            deiPrm.outputDeiFrameRate = 60;
            //deiPrm.outQueParams[DEI_OUT_SUB_STRAMER].nextLink = dupId[DIS_DUP_IDX] ;      
      
            deiPrm.outQueParams[DEI_OUT_SUB_STRAMER].nextLink = AV_nsfId; //AV_scalerId;//dupId[HDMIDIS_DUP_IDX] ;      
            deiPrm.enableOut[DEI_OUT_MAIN_STRAMER] = FALSE;
            deiPrm.enableOut[DEI_OUT_SUB_STRAMER] = TRUE;
    	deiPrm.comprEnable = FALSE;
            deiPrm.setVipScYuv422Format = TRUE; //FALSE ;    // FALSE->yuv420sp,  TRUE->yuv422i //From DEI o/p to 422I
            deiPrm.inputFrameRate[DEI_OUT_SUB_STRAMER] = 60;
            deiPrm.outputFrameRate[DEI_OUT_SUB_STRAMER] = 60;
    
            deiPrm.outScaleFactor[DEI_OUT_SUB_STRAMER][0].scaleMode = DEI_SCALE_MODE_ABSOLUTE ;
            deiPrm.outScaleFactor[DEI_OUT_SUB_STRAMER][0].absoluteResolution.outWidth  = 720;  //1280 ;
            deiPrm.outScaleFactor[DEI_OUT_SUB_STRAMER][0].absoluteResolution.outHeight = 480 ; // 720 ; 
    
    //#if 0
            //if (gUI_mcfw_config.noisefilterMode == DSS_VNF_ON)
    	    OSA_printf("RAJESHKANNAN : NoiseFilter Entered......\n");
        /*Noise Filter Configration*/
            /* NSF Link params */
            NsfLink_CreateParams_Init(&AV_nsfPrm);
            AV_nsfPrm.bypassNsf = NSF_LINK_BYPASS_SNF_TNF; //NSF_LINK_BYPASS_NONE;
            OSA_printf("RAJESHKANNAN : NoiseFilter setted by ###NSF_LINK_BYPASS_SNF_TNF......\n");
    #if (TILER_ENABLE == TRUE)
            AV_nsfPrm.tilerEnable = TRUE;
    #else
            AV_nsfPrm.tilerEnable = FALSE;
    #endif
            AV_nsfPrm.inQueParams.prevLinkId = gDeiId ;
    
            AV_nsfPrm.inQueParams.prevLinkQueId = DEI_OUT_SUB_STRAMER;
            OSA_printf("RAJESHKANNAN : NoiseFilter QueueID changed !!!......\n");
            AV_nsfPrm.numOutQue = 1;
            AV_nsfPrm.numBufsPerCh = 10;
            AV_nsfPrm.inputFrameRate = 30;
            AV_nsfPrm.outputFrameRate = 30;
            AV_nsfPrm.outQueParams[0].nextLink = dupId[HDMIDIS_DUP_IDX];
            AV_nsfPrm.nsfStrength = gUI_mcfw_config.vnfStrength;
        
    //#endif
    
    #if 0
            OSA_printf("RAJESH: Vnf Param\n") ;
    	 OSA_printf("RAJESHKANNAN : DSS_VNF_OFF......\n");
           VnfLink_ChCreateParams *vnfParams;
    
            /* Vnf Link Params */
                    //if(gUI_mcfw_config.glbceEnable)
                      //      vnfPrm.inQueParams.prevLinkId =ispId;
                   // else
                            vnfPrm.inQueParams.prevLinkId = gDeiId;
    
            vnfPrm.inQueParams.prevLinkQueId = 0;
            vnfPrm.outQueParams.nextLink = dupId[HDMIDIS_DUP_IDX];
    
            vnfParams = &vnfPrm.chCreateParams[0];
            vnfParams->sParams.eOutputFormat = SYSTEM_DF_YUV420SP_UV;
                    if (gUI_mcfw_config.ldcEnable)
                    {
                            vnfParams->sParams.eOperateMode = VNF_LINK_LDC_AFFINE_NSF_TNF;
                    }
            else
                    {
    #ifdef USE_TNF2_FILTER
                    vnfParams->sParams.eOperateMode =  VNF_LINK_3DNF;
    #elif defined (USE_TNF3_FILTER)
                    vnfParams->sParams.eOperateMode =  VNF_LINK_LDC_AFFINE_NSF_TNF; //VNF_LINK_AFFINE_NSF_TNF; //VNF_LINK_TNF3;
    	        OSA_printf("VNF OPERATING MODE SELECTED : ***VNF_LINK_AFFINE_NSF_TNF");
    #else
                    vnfParams->sParams.eOperateMode = VNF_LINK_AFFINE_NSF_TNF;
    #endif
                            vnfParams->sParams.eNsfSet = VNF_LINK_NSF_LUMA_CHROMA;
                    }
    
         //if ((vnfParams->sParams.eOperateMode == VNF_LINK_TNF3) && (vnfParams->sParams.eNsfSet == VNF_LINK_NSF_LUMA_CHROMA))
         //           {
        //                    if (gUI_mcfw_config.glbceEnable)
         //                   {
          //                          ispPrm.vnfFullResolution = TRUE;
         //                           cameraPrm.vnfFullResolution = FALSE;
           //                 }
          //                  else
          //                  {
          //                          ispPrm.vnfFullResolution = FALSE;
          //                          cameraPrm.vnfFullResolution = TRUE;
          //                  }
         //           }
    
            vnfParams->dParams.ldcParams.eInterpolationLuma =
                VNF_LINK_YINTERPOLATION_BILINEAR;
            vnfParams->dParams.ldcParams.unPixelPad = 4;
    
            vnfParams->dParams.nsfParams.bLumaEn = TRUE;
            vnfParams->dParams.nsfParams.bChromaEn = TRUE;
            vnfParams->dParams.nsfParams.eSmoothVal = VNF_LINK_SMOOTH_0;
            vnfParams->dParams.nsfParams.bSmoothLumaEn = TRUE;
            vnfParams->dParams.nsfParams.bSmoothChromaEn = TRUE;
    
            vnfParams->dParams.tnfParams.useDefault = TRUE;
    
            vnfParams->dParams.nsfFilter.eFilterParam = VNF_LINK_PARAM_DEFAULT;
            vnfParams->dParams.nsfEdge.eEdgeParam = VNF_LINK_PARAM_DISABLE;
            vnfParams->dParams.nsfShading.eShdParam = VNF_LINK_PARAM_DISABLE;
            vnfParams->dParams.nsfDesaturation.eDesatParam = VNF_LINK_PARAM_DISABLE;
    
            vnfPrm.chCreateParams[0].bSnfEnable = gUI_mcfw_config.snfEnable;
            vnfPrm.chCreateParams[0].bTnfEnable = gUI_mcfw_config.tnfEnable;
                    vnfPrm.chCreateParams[0].strength       = gUI_mcfw_config.vnfStrength;
    #endif
    
    #if 0
    // AV Scaler Support Start
       OSA_printf("AV Scalar Params settings\n");
            /* AV Scaler*/
            SclrLink_CreateParams_Init(&AV_sclrPrm);
            AV_sclrPrm.inQueParams.prevLinkId             = gDeiId; //gVcapModuleContext.captureId ; //dupId[SCALER_DUP_IDX] ;
            AV_sclrPrm.inQueParams.prevLinkQueId          = 0;
            AV_sclrPrm.outQueParams.nextLink              = dupId[HDMIDIS_DUP_IDX] ;//mergeId[CAM_STREAM_MERGE_IDX] ;
            AV_sclrPrm.tilerEnable                        = FALSE;
            AV_sclrPrm.enableLineSkipSc                   = FALSE;
            AV_sclrPrm.inputFrameRate                     = 30; //30;
            AV_sclrPrm.outputFrameRate                    = 30; //30;
            AV_sclrPrm.scaleMode                          = DEI_SCALE_MODE_ABSOLUTE;
            AV_sclrPrm.scaleMode                          = DEI_SCALE_MODE_ABSOLUTE;
    
            AV_sclrPrm.outScaleFactor.absoluteResolution.outWidth   = 1920;
            AV_sclrPrm.outScaleFactor.absoluteResolution.outHeight  = 1080;
    	OSA_printf("RAJESHKANNAN : Changed Resolution from D1 to FULL_HD successfully\n");
            AV_sclrPrm.outDataFormat = SYSTEM_DF_YUV420SP_UV ; //SYSTEM_DF_YUV420P;//SYSTEM_DF_YUV422SP_VU; //SYSTEM_DF_YUV420SP_UV; //VF_YUV420SP_UV;
            AV_sclrPrm.pathId = SCLR_LINK_SEC0_SC3;
    // AV Support End
    #endif
    
        /* dup link parameters*/
    #ifdef RAW_FRAMES_TO_A8
        dupPrm[HDMIDIS_DUP_IDX].inQueParams.prevLinkId = ispId;
    #else
        dupPrm[HDMIDIS_DUP_IDX].inQueParams.prevLinkId = AV_nsfId;//gVcapModuleContext.vnfId; //nsfId;//AV_scalerId; //gDeiId; //gVcapModuleContext.captureId ; // gVcamModuleContext.cameraId; RAJESHKANNAN
    #endif
        dupPrm[HDMIDIS_DUP_IDX].inQueParams.prevLinkQueId = 0;
        dupPrm[HDMIDIS_DUP_IDX].numOutQue = 2;
        dupPrm[HDMIDIS_DUP_IDX].outQueParams[0].nextLink = ipcOutVpssId; 
        dupPrm[HDMIDIS_DUP_IDX].outQueParams[1].nextLink = gVdisModuleContext.displayId[VDIS_DEV_HDMI]; //ipcOutVpssId; RAJESHKANNAN
        dupPrm[HDMIDIS_DUP_IDX].notifyNextLink = TRUE;
    
            /* display link params */
            MULTICH_INIT_STRUCT(DisplayLink_CreateParams,displayPrm);
            displayPrm.inQueParams[0].prevLinkId = dupId[HDMIDIS_DUP_IDX];
            displayPrm.inQueParams[0].prevLinkQueId = 1;
            displayPrm.displayRes = gVdisModuleContext.vdisConfig.deviceParams[VDIS_DEV_HDMI].resolution;
            displayPrm.displayId  = DISPLAY_LINK_DISPLAY_SC2;
    
        /* IPC Out VPSS link params */
            ipcOutVpssPrm.inQueParams.prevLinkId = dupId[HDMIDIS_DUP_IDX];
        ipcOutVpssPrm.inQueParams.prevLinkQueId = 0;
        ipcOutVpssPrm.numOutQue = 1;
        ipcOutVpssPrm.outQueParams[0].nextLink = ipcInVideoId;
        ipcOutVpssPrm.notifyNextLink = TRUE;
        ipcOutVpssPrm.notifyPrevLink = TRUE;
        ipcOutVpssPrm.noNotifyMode = FALSE;
    
        /* IPC In VIDEO params */
        ipcInVideoPrm.inQueParams.prevLinkId = ipcOutVpssId;
        ipcInVideoPrm.inQueParams.prevLinkQueId = 0;
        ipcInVideoPrm.numOutQue = 1;
        ipcInVideoPrm.outQueParams[0].nextLink = gVencModuleContext.encId;
        ipcInVideoPrm.notifyNextLink = TRUE;
        ipcInVideoPrm.notifyPrevLink = TRUE;
        ipcInVideoPrm.noNotifyMode = FALSE;
    
      /* ENC link */
            MULTICH_INIT_STRUCT(EncLink_CreateParams,encPrm);
            {
                EncLink_ChCreateParams   *pLinkChPrm;
            EncLink_ChDynamicParams  *pLinkDynPrm;
            VENC_CHN_DYNAMIC_PARAM_S *pDynPrm;
            VENC_CHN_PARAMS_S        *pChPrm;
    
                    for (i = 0; i < 1; i++)
                    {
                            pLinkChPrm  = &encPrm.chCreateParams[i];
                            pLinkDynPrm = &pLinkChPrm->defaultDynamicParams;
    
                            pChPrm      = &gVencModuleContext.vencConfig.encChannelParams[i];
                            pDynPrm     = &pChPrm->dynamicParam;
    
                            pLinkChPrm->format                  = IVIDEO_H264HP;
                            pLinkChPrm->profile                 = gVencModuleContext.vencConfig.h264Profile[i];
                            pLinkChPrm->dataLayout              = IVIDEO_PROGRESSIVE;
                            pLinkChPrm->fieldMergeEncodeEnable  = FALSE;
                            pLinkChPrm->enableAnalyticinfo      = 0 ;//pChPrm->enableAnalyticinfo;
                            OSA_printf("RAJESHKANNAN : Checking the value enableAnalyticinfo = %d\n", pChPrm->enableAnalyticinfo);
                            pLinkChPrm->maxBitRate              = pChPrm->maxBitRate;
                            pLinkChPrm->encodingPreset          = pChPrm->encodingPreset;
                            OSA_printf("RAJESHKANNAN : In Encoder EncodingPreset[%d]=%d\n", i ,  pChPrm->encodingPreset ) ; 
                            pLinkChPrm->rateControlPreset       = IVIDEO_USER_DEFINED;
                            pLinkChPrm->enableHighSpeed         = FALSE;
                            pLinkChPrm->enableWaterMarking      = pChPrm->enableWaterMarking;
    
                            pLinkChPrm->StreamPreset            = gUI_mcfw_config.StreamPreset[i];
    
                            pLinkDynPrm->intraFrameInterval     = pDynPrm->intraFrameInterval;
                            pLinkDynPrm->targetBitRate          = pDynPrm->targetBitRate;
                            pLinkDynPrm->interFrameInterval     = 1;
                            pLinkDynPrm->mvAccuracy             = IVIDENC2_MOTIONVECTOR_QUARTERPEL;
                            pLinkDynPrm->inputFrameRate         = pDynPrm->inputFrameRate;
                            pLinkDynPrm->rcAlg                  = pDynPrm->rcAlg;
                            pLinkDynPrm->qpMin                  = pDynPrm->qpMin;
                            pLinkDynPrm->qpMax                  = pDynPrm->qpMax;
                            pLinkDynPrm->qpInit                 = pDynPrm->qpInit;
                            pLinkDynPrm->vbrDuration            = pDynPrm->vbrDuration;
                            pLinkDynPrm->vbrSensitivity         = pDynPrm->vbrSensitivity;
    
                            encPrm.numBufPerCh[i]                   = 4;//3;
                            gVencModuleContext.encFormat[i] = pLinkChPrm->format;
                    }
            }
    
    
        encPrm.chCreateParams[0].defaultDynamicParams.inputFrameRate = 30;
        //encPrm.chCreateParams[1].defaultDynamicParams.inputFrameRate = 30;
            encPrm.vsEnable                                              = 0;
            encPrm.isVaUseCase                                           = 0;
        encPrm.inQueParams.prevLinkId                                = ipcInVideoId;
        encPrm.inQueParams.prevLinkQueId                             = 0;
    
    #ifdef DIR_DEC
        encPrm.outQueParams.nextLink                                 = gDecId;
    #else
        encPrm.outQueParams.nextLink                                 = gVencModuleContext.ipcBitsOutRTOSId; //ipcBitsOutVideoId;
    #endif
    
       /* IPC Bits Out VIDEO Link params */
        ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkId =
        gVencModuleContext.encId;
        ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
        ipcBitsOutVideoPrm.baseCreateParams.numOutQue = 1;
        ipcBitsOutVideoPrm.baseCreateParams.outQueParams[0].nextLink =
        gVencModuleContext.ipcBitsInHLOSId;
        MultiCh_ipcBitsInitCreateParams_BitsOutRTOS(&ipcBitsOutVideoPrm, TRUE);
    
        /* IPC Bits In HOST Link params */
        ipcBitsInHostPrm0.baseCreateParams.inQueParams.prevLinkId =
        gVencModuleContext.ipcBitsOutRTOSId;
        ipcBitsInHostPrm0.baseCreateParams.inQueParams.prevLinkQueId = 0;
        MultiCh_ipcBitsInitCreateParams_BitsInHLOS(&ipcBitsInHostPrm0);
    
        /* Links Creation */
        /* Camera Link */
        //System_linkCreate(gVcamModuleContext.cameraId, &cameraPrm,
         //                 sizeof(cameraPrm));
        
        System_linkCreate( gVcapModuleContext.captureId, &capturePrm,  sizeof(capturePrm));
        OSA_printf("RAJESHKANNAN : Checking Capture link created successfully......\n");
    
        //System_linkControl(gVcapModuleContext.captureId,CAPTURE_LINK_CMD_DETECT_VIDEO, NULL, 0, TRUE);
    
        OSA_printf("AV Deinterlacer Create \n");
            System_linkCreate(gDeiId,&deiPrm,sizeof(DeiLink_CreateParams));
        OSA_printf("AV Deinterlacer Create done successfully\n");
    
    
        System_linkCreate(AV_nsfId, &AV_nsfPrm, sizeof(AV_nsfPrm)); //RAJESH
    
        /*dup link*/
        System_linkCreate(dupId[HDMIDIS_DUP_IDX], &dupPrm[HDMIDIS_DUP_IDX], sizeof(dupPrm[HDMIDIS_DUP_IDX]));
    
    //RAJESHKANNAN ADDED For Testing
        /* IPC Links */
        System_linkCreate(ipcOutVpssId, &ipcOutVpssPrm, sizeof(ipcOutVpssPrm));
        System_linkCreate(ipcInVideoId, &ipcInVideoPrm, sizeof(ipcInVideoPrm));
    
        /* Video Encoder Link */
        System_linkCreate(gVencModuleContext.encId, &encPrm, sizeof(encPrm));
    
    /* IPC Bits Links */
        System_linkCreate(gVencModuleContext.ipcBitsOutRTOSId, &ipcBitsOutVideoPrm,
                          sizeof(ipcBitsOutVideoPrm));
        System_linkCreate(gVencModuleContext.ipcBitsInHLOSId, &ipcBitsInHostPrm0,
                          sizeof(ipcBitsInHostPrm0));
    
        /* display link */
        System_linkCreate(gVdisModuleContext.displayId[VDIS_DEV_HDMI], &displayPrm,
                          sizeof(displayPrm));
    
        OSA_printf("RAJESH KANNAN : USECASE SETUP DONE\n");
    }
    
    /* ===================================================================
     *  @func     MultiCh_deleteStreamCaptureDisplay
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Void MultiCh_deleteStreamCaptureDisplay()
    {
        UInt32 ipcOutVpssId;
        UInt32 ipcInVideoId;
        UInt32 ipcFramesOutVpssId;
    	UInt32 dupId[NUM_DUP_LINK];
        ipcOutVpssId = SYSTEM_VPSS_LINK_ID_IPC_OUT_M3_0;
        ipcInVideoId = SYSTEM_VIDEO_LINK_ID_IPC_IN_M3_0;
        ipcFramesOutVpssId = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_OUT_0;
    
        /* Links Deletion in reverse order */
    
      /* display link */
        System_linkDelete(gVdisModuleContext.displayId[VDIS_DEV_HDMI]);
    
        /* IPC Bits Links */
        System_linkDelete(gVencModuleContext.ipcBitsOutRTOSId);
        System_linkDelete(gVencModuleContext.ipcBitsInHLOSId);
    
        /* Video Encoder Link */
        System_linkDelete(gVencModuleContext.encId);
    
      /* IPC Links */
        System_linkDelete(ipcOutVpssId);
        System_linkDelete(ipcInVideoId);
    
        /* dup Link IDs*/
        dupId[HDMIDIS_DUP_IDX] = SYSTEM_VPSS_LINK_ID_DUP_0;
    
    	/* Dup links */
    	System_linkDelete(dupId[HDMIDIS_DUP_IDX]);
    
    
        System_linkDelete( AV_nsfId ) ; //RAJESHKANNAN JUN_2
    
        System_linkDelete(gDeiId);
        OSA_printf("RAJESHKANNAN : DEI delete done\n");
    
        /* Camera Link */
    //    System_linkDelete(gVcamModuleContext.cameraId);
        System_linkDelete(gVcapModuleContext.captureId);
        /* Print the HWI, SWI and all tasks load */
        /* Reset the accumulated timer ticks */
        MultiCh_prfLoadCalcEnable(FALSE, TRUE, FALSE);
        
        OSA_printf("USECASE TEARDOWN DONE\n");
    }
    

  • Hi Anand,

    In deinterlacer Whatever the input scanformat( in my case INTERLACED) is coming it's taking either only odd scanlines or even scan lines whenever the NEWDATA arrives..,

    Here also Field Merge not happened ???

    Is it a way to implement the merge the fields and convert to progressive ???

    Give me some suggestion

    I attached the Image kindly reply..,

    Regards,

    Rajesh Kannan.S

  • Hi,

    Can you pl. undo the changes done for merging the two fields in the capture link?But keep the standard as 480I in the use case.

    The Deinterlacer generates a full frame out of every field,so that for 60 fields per sec input it will output 60 frames per sec.

    regards,

    Anand 

  • Hi Anand,

    Thanks for your reply..,

    I'll try and let you know the results ..,

    But my doubt is in IPNC RDK 3.5 is able to do the conversion ( fields to frames ) whatever I mentioned the DEI parameters in the Usecase file

    Or we can add any other parameters in DEI side ???

    I mentioned the parameters enableDeiForceBypass and setVipScYuv422Format is it correct ???

    Can you explain me the parameters what it will do ???

    Regards,

    Rajesh Kannan.S
  • Hi Anand,

    I undo the changes in Capture side and enabled the SYS_STD as 480I in usecase

    In Encoding side I'm seeing the scanformat as progressive but still I'm getting the same blank white screen (Jul 8, 2015 10:07 AM post)

    Kindly suggest ???

    Regards,

    Rajesh Kannan.S
  • Hi,

    What is the linkId you are using for DEI?

    Can you check if the DEI process call is really called or frame drop is happening in the DEI link?

    regards,

    Anand

  • Hi Anand,

    I'm using   gDeiId = SYSTEM_LINK_ID_DEI_0 ;

    I enabled the logs at the time of NEW_DATA is Entering to Deinterlacer

    After processing it's returned the error value ( -1) alternatively

    See the below mentioned log

    [m3vpss ]  10651: ###DEI###    : Submitting 1 frames !!!

    [m3vpss ] RAJESHKANNAN : No.of frames in loop.....

    [m3vpss ] RAJESHKANNAN : Checking Frames = 1

    [m3vpss ] RAJESHKANNAN : DeiLink_drvGetProcessedData Fn entered

    [m3vpss ]  10653: RAJESHKANNAN : DEI    : Completed 1 frames !!!

    [m3vpss ] RAJESHKANNAN : ###Checking status value### = 0

    [m3vpss ] RAJESHKANNAN : Checking after submitted data......

    [m3vpss ] RAJESHKANNAN : Checking Ready to submit data......

    [m3vpss ] RAJESHKANNAN Fn(DeiLink_drvSubmitData) Entered......

    [m3vpss ] RAJESHKANNAN : Checking after checking (que_get) status value = 0

    [m3vpss ] RAJESHKANNAN :  DeiLink_drvMakeFrameLists Fn ready to call.....

    [m3vpss ] RAJESHKANNAN : FN(DeiLink_drvMakeFrameLists) Entered......

    [m3vpss ] RAJESHKANNAN : Checking  ###pObj->inQueInfo.numCh = 1

    [m3vpss ] RAJESHKANNAN : Exited from DeiLink_drvMakeFrameLists Fn Successfully......

    [m3vpss ]  10654: ###DEI###    : Submitting 0 frames !!!

    [m3vpss ] RAJESHKANNAN : !!! ERROR !!! NO MORE FRAMES TO PROCESS !!!

    [m3vpss ] RAJESHKANNAN : ###Checking status value### = -1

    [m3vpss ] RAJESHKANNAN : Checking after submitted data......

    [m3vpss ] RAJESHKANNAN : Checking status value in submitted data = -1

     

    Regards,

    Rajesh Kannan.S

  • Hi Anand,

    I'm using     gDeiId = SYSTEM_LINK_ID_DEI_0 ;

    [m3vpss ] RAJESHKANNAN : Checking Fn(DeiLink_drvProcessData) Entered.....

    [m3vpss ]  10618: RAJESHKANNAN : DEI    : Received 1 IN frames !!!

    [m3vpss ] RAJESHKANNAN Checking pFrame->fid = 0

    [m3vpss ] RAJESHKANNAN : Checking Ready to submit data......

    [m3vpss ] RAJESHKANNAN Fn(DeiLink_drvSubmitData) Entered......

    [m3vpss ] RAJESHKANNAN : Checking after checking (que_get) status value = 0

    [m3vpss ] RAJESHKANNAN :  DeiLink_drvMakeFrameLists Fn ready to call.....

    [m3vpss ] RAJESHKANNAN : FN(DeiLink_drvMakeFrameLists) Entered......

    [m3vpss ] RAJESHKANNAN : Checking  ###pObj->inQueInfo.numCh = 1

    [m3vpss ] RAJESHKANNAN : ###else outId

    [m3vpss ] RAJESHKANNAN : Checking BlankOut ...

    [m3vpss ] RAJESHKANNAN : Exited from DeiLink_drvMakeFrameLists Fn Successfully......

    [m3vpss ]  10619: ###DEI###    : Submitting 1 frames !!!

    [m3vpss ] RAJESHKANNAN : No.of frames in loop.....

    [m3vpss ] RAJESHKANNAN : Checking Frames = 1

    [m3vpss ] RAJESHKANNAN : DeiLink_drvGetProcessedData Fn entered

    [m3vpss ]  10621: RAJESHKANNAN : DEI    : Completed 1 frames !!!

    [m3vpss ] RAJESHKANNAN : ###Checking status value### = 0

    [m3vpss ] RAJESHKANNAN : Checking after submitted data......

    [m3vpss ] RAJESHKANNAN : Checking Ready to submit data......

    [m3vpss ] RAJESHKANNAN Fn(DeiLink_drvSubmitData) Entered......

    [m3vpss ] RAJESHKANNAN : Checking after checking (que_get) status value = 0

    [m3vpss ] RAJESHKANNAN :  DeiLink_drvMakeFrameLists Fn ready to call.....

    [m3vpss ] RAJESHKANNAN : FN(DeiLink_drvMakeFrameLists) Entered......

    [m3vpss ] RAJESHKANNAN : Checking  ###pObj->inQueInfo.numCh = 1

    [m3vpss ] RAJESHKANNAN : Exited from DeiLink_drvMakeFrameLists Fn Successfully......

    [m3vpss ]  10622: ###DEI###    : Submitting 0 frames !!!

    [m3vpss ] RAJESHKANNAN : !!! ERROR !!! NO MORE FRAMES TO PROCESS !!!

    [m3vpss ] RAJESHKANNAN : ###Checking status value### = -1

    [m3vpss ] RAJESHKANNAN : Checking after submitted data......

    [m3vpss ] RAJESHKANNAN : Checking status value in submitted data = -1

    After NEW_DATA Entered to DEI it's return ERROR Value..,

    Next Link unable to get the new data !!!

    Regards,

    Rajesh Kannan.S

  • Hi,

    Can you pl. check why there is 0 frames submitted?

    Pl. debug further and corner out the issue.

    regards,

    Anand

  • Hi Anand,

    In Fn DeiLink_drvSubmitData() Only the particular field ( either odd or even ) is entering to
    if (pReqObj->inFrameList.numFrames) after submission ..,

    Here It has to merge the fields and make at as a frames correct ? Or before We can merge ???

    The alternative field is just skipping ???

    Kindly suggest ???

    Regards,

    Rajesh Kannan.S
  • Hi,

    The DEI will output a frame for every input field.
    If the input is 60 fields per second then the output will be 60 frames per second.

    Can you check the flow in the DEI link and make sure each input field is entering the DEI process call?

    regards,
    Anand
  • Hi Anand,

    I enabled the debug logs it looks like only one field is entered to DEI ...,

    Not all the fields entering to deinterlacer !!! DEI it has to take all the fields correct ??? We are not skipping any of the fields ???

    Kindly suggest !!! For your reference ...,

    [m3vpss ] RAJESHKANNAN : Checking Fn(DeiLink_drvProcessData) Entered.....
    [m3vpss ] 10648: RAJESHKANNAN : DEI : Received 1 IN frames !!!
    [m3vpss ] RAJESHKANNAN Checking pFrame->fid = 0
    [m3vpss ] RAJESHKANNAN : Checking Ready to submit data......
    [m3vpss ] RAJESHKANNAN Fn(DeiLink_drvSubmitData) Entered......
    [m3vpss ] RAJESHKANNAN : Checking after checking (que_get) status value = 0
    [m3vpss ] RAJESHKANNAN : DeiLink_drvMakeFrameLists Fn ready to call.....
    [m3vpss ] RAJESHKANNAN : FN(DeiLink_drvMakeFrameLists) Entered......
    [m3vpss ] RAJESHKANNAN : Checking ###pObj->inQueInfo.numCh = 1
    [m3vpss ] RAJESHKANNAN : ###else outId
    [m3vpss ] RAJESHKANNAN : Checking BlankOut ...
    [m3vpss ] RAJESHKANNAN : Exited from DeiLink_drvMakeFrameLists Fn Successfully......
    [m3vpss ] 10649: ###DEI### : Submitting 1 frames !!!
    [m3vpss ] RAJESHKANNAN : No.of frames in loop.....
    [m3vpss ] RAJESHKANNAN : Checking Frames = 1
    [m3vpss ] RAJESHKANNAN : DeiLink_drvGetProcessedData Fn entered
    [m3vpss ] 10651: RAJESHKANNAN : DEI : Completed 1 frames !!!
    [m3vpss ] RAJESHKANNAN : ###Checking status value### = 0
    [m3vpss ] RAJESHKANNAN : Checking after submitted data......
    [m3vpss ] RAJESHKANNAN : Checking Ready to submit data......
    [m3vpss ] RAJESHKANNAN Fn(DeiLink_drvSubmitData) Entered......
    [m3vpss ] RAJESHKANNAN : Checking after checking (que_get) status value = 0
    [m3vpss ] RAJESHKANNAN : DeiLink_drvMakeFrameLists Fn ready to call.....
    [m3vpss ] RAJESHKANNAN : FN(DeiLink_drvMakeFrameLists) Entered......
    [m3vpss ] RAJESHKANNAN : Checking ###pObj->inQueInfo.numCh = 1
    [m3vpss ] RAJESHKANNAN : Exited from DeiLink_drvMakeFrameLists Fn Successfully......
    [m3vpss ] 10652: ###DEI### : Submitting 0 frames !!!
    [m3vpss ] RAJESHKANNAN : !!! ERROR !!! NO MORE FRAMES TO PROCESS !!!
    [m3vpss ] RAJESHKANNAN : ###Checking status value### = -1
    [m3vpss ] RAJESHKANNAN : Checking after submitted data......
    [m3vpss ] RAJESHKANNAN : Checking status value in submitted data = -1

    Regards,

    Rajesh Kannan.S
  • Hi,

    What do '###else outId' and 'Checking BlankOut ...' refer to in the log?
    Can you share your DEI link code?

    regards,
    Anand
  • Hi Anand,

    Find the attached DeiLink_drv file for your reference ..,

    deiLink_drv.c

    Regards,

    Rajesh Kannan.S

  • Hi,

    The log looks normal and DEI is generating the output frame.
    You could also check with the simple chain 'Capture->DEI->Display'.
    Can you pl. enable the 'DEI_LINK_OUT_QUE_DEI_SC' instead of 'DEI_LINK_OUT_QUE_VIP_SC' and check?
    This path has DEI and Scaler only.

    regards,
    Anand
  • Hi Anand,

    I tried Capture->DEI->Display usecase but in display side It's expecting YUV420_SP format only in HDMI
    That is the reason I added Noise filter to change the data format..,

    I enabled the below mentioned macros for main and substreamer. Are you telling to change sub_streamer value to DEI_LINK_OUT_QUE_DEI_SC ???

    #define DEI_OUT_MAIN_STRAMER (DEI_LINK_OUT_QUE_DEI_SC)
    #define DEI_OUT_SUB_STRAMER (DEI_LINK_OUT_QUE_VIP_SC)

    Regards,

    Rajesh Kannan.S
  • Hi,

    HDMI Display should work for YUV422I format.Pl. change the displayId to 'DISPLAY_LINK_DISPLAY_BP0'.
    Pl. enable DEI_LINK_OUT_QUE_DEI_SC output queue for DEI.

    regards,
    Anand
  • Hi Anand,

    After changed the output queue DEI_LINK_OUT_QUE_DEI_SC and display id to DISPLAY_LINK_DISPLAY_SD

    I think it's merged Kindly check and let me know

    I'm getting the following Image it's showing green colour

    In display side I'm getting the scan format SYSTEM_DF_YUV422I_UYVY value is 0 !!!

    Kindly suggest !!!

    Regards,

    Rajesh Kannan.S

  • Hi Anand,

    I forgot to tell u one thing If I changed the display id to DISPLAY_LINK_DISPLAY_BP0 in HDMI, unable to see the the data in display side..,

    If I changed to DISPLAY_LINK_DISPLAY_SD I can able to see the data in display side ..,

    Regards,

    Rajesh Kannan.S
  • Hi,

    The DEI output frames are in YUV422I_YUYV format and this is supported by 'DISPLAY_LINK_DISPLAY_BP0' display path.
    But the SD display may be displaying it as YUV422I_UYVY format hence you see that the luma and chroma data are swapped.
    Pl. check if the HDMI display link is skipping the incoming frames in the 'DisplayLink_drvProcessData()' fn.

    regards,
    Anand
  • Hi Anand,

    In display side .., Is properly entered and return successfully...,

    There is no frame skipping in HDMI display side !!!!

    Regards,

    Rajesh Kannan.S