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.

DM816x RDK Support for Resolutions greater than 1080P

Hello TI:

We are using the DM816x and we would like to transcode video received from IP cameras with resolutions greater than 1080P, such as 5 MP (2592x1944).

Does the DM816x RDK including the McFW (scalar, merge, dup, tiler, ipc), drivers, decoder, and encoder (and other drivers/components) readily support resolutions greater than 1080P?

Which DM816x RDK release specifically introduced expanded (>1080P) resolutions and does a use-case exist?

[The H264_Encoder_HDVICP2_UserGuide.pdf indicates that H.264 encoder on the HDVICP2 supports encoding resolutions up to 4096x4096]

Details:

Our McFW processing pipeline duplicates the decoder output and sends the decoded image to SCLR1 and then runs our DSP algorithm. The decoded image is also sent to SCLR0 and three encodes are performed at three different resolutions.

  1. H.264 (Hi: up to source resolution & frame rate, or scaled with lower frame rate)
  2. H.264 (Low: scaled resolution, lower frame rate)
  3. MJPEG (scaled resolution, 1 to 5 fps)

 Upscaling is not required.   We do not need HDMI or other display support higher than 1080P.

Resolutions:

We would like to support encoding the "source" resolution (i.e., the resolution from the source camera's RTSP stream), and quarter resolutions derived from the "source" resolution.

For instance, if the "source" resolution is 2592x1944 we would like to set-up our encoders to encode any of the following resolutions.

5MP

  • 2592x1944
  • 1296x972
  • 648x486
  • 324x243

 3MP

  • 2048x1536
  • 1024x768
  • 512x384
  • 256x192

 Regards,

 --B

  • Bandeg said:
    Does the DM816x RDK including the McFW (scalar, merge, dup, tiler, ipc), drivers, decoder, and encoder (and other drivers/components) readily support resolutions greater than 1080P?

    Specific to your usecase all components expect scaler support resolution greater than 1080P.i.e Decoder,encoder,merge,dup,tiler etc.

    For scaling greater than 1080P resolution DVRRDK has a MpSclr link which can take input greater than 1080P. The MpSclr will split the input image into slices of 1080P or lesser and output a image of 1080P resolution.

    The MpSclr link has some limitations:

    1. Input only 420SP and output only 422I - This is not an issue for your usecase.

    2. Output resolution of MpSclr is always 1920x1080 irrespective of input resolution.This means for your usecase you will have to do multi stage scaling. i.e Connect  a scaler to output of MpScaler to scale from 1920x1080 to desired resolution.

    The multich_vdec_vdis.c usecase (Decode Display usecase) demonstrates MpSclr useage. MpSclr Link is available in the latest DVRRDK 4.1 release.

    Some changes would be required to this usecase to realize your data flow.

    /*******************************************************************************
     *                                                                             *
     * Copyright (c) 2009 Texas Instruments Incorporated - http://www.ti.com/      *
     *                        ALL RIGHTS RESERVED                                  *
     *                                                                             *
     ******************************************************************************/
    /*  ========================= TI_816X_BUILD case ==============================
                              |
                            IPC_BITS_OUT_A8 (BitStream)
                              |
                            IPC_BITS_IN (Video)
                              |
                            DEC (YUV420SP)
                              |
                            IPC_OUT (Video)
                              |
                            IPC_IN (Vpss)
                              |   (32 D1 + 10 720P + 6 1080P)
                            MP_SCLR (Vpss)
                              |
                             DUP
                   (48CH)    | |    (48CH)
             +---------------+ +-------------+
             |                               |
             |                               |
          SW Mosaic                       SW Mosaic
         (SC5 SC1 YUV422I)                (SC4 SC2 YUV422I)
            |  |                             |  |
            |  |                             |  |
           (DDR)(422I)                      (DDR)(422I)
              |                               |
      GRPX0   |                      GRPX1    |
         |    |                          |    |
         On-Chip HDMI                    Off-Chip HDMI
           1080p60                        1080p60
    */
    
    /* ========================= TI_814X_BUILD case ==============================
                              |
                            IPC_BITS_OUT_A8 (BitStream)
                              |
                            IPC_BITS_IN (Video)
                              |
                            DEC (YUV420SP)
                              |
                            IPC_OUT (Video)
                              |
                            IPC_IN (Vpss)
                              |   (16 channels)
                            MP_SCLR (Vpss)
                              |
                             DUP
                   (16CH)    | |    (16CH)
             +---------------+ +-------------+
             |                               |
             |                               |
          SW Mosaic                       SW Mosaic
         (SC5 YUV422I)                (SC5 YUV422I)
            |  |                             |  |
            |  |                             |  |
           (DDR)(422I)                      (DDR)(422I)
              |                               |
      GRPX0   |----Tied---|                   |
         |    |           |                   |
         On-Chip HDMI  Off-Chip HDMI         SDTV
           1080p60       1080p60
    */
    
    #include "mcfw/src_linux/mcfw_api/usecases/multich_common.h"
    #include "mcfw/src_linux/mcfw_api/usecases/multich_ipcbits.h"
    #include "mcfw/interfaces/link_api/system_tiler.h"
    #include "mcfw/interfaces/link_api/avsync_hlos.h"
    
    /* =============================================================================
     * Externs
     * =============================================================================
     */
    
    
    /* =============================================================================
     * Use case code
     * =============================================================================
     */
    
    
    
    #define MAX_DEC_OUT_FRAMES_PER_CH                           (5)
    #define MULTICH_VDEC_VDIS_IPCFRAMEEXPORT_NUM_CHANNELS       (16)
    #define MULTICH_VDEC_VDIS_IPCFRAMEEXPORT_FRAME_WIDTH        (720)
    #define MULTICH_VDEC_VDIS_IPCFRAMEEXPORT_FRAME_HEIGHT       (480)
    #define MULTICH_NUM_SWMS_MAX_BUFFERS                        (7)
    
    #define     MAX_BUFFERING_QUEUE_LEN_PER_CH           (50)
    
    #define     BIT_BUF_LENGTH_LIMIT_FACTOR_CIF           (10)
    #define     BIT_BUF_LENGTH_LIMIT_FACTOR_SD            (6)
    #define     BIT_BUF_LENGTH_LIMIT_FACTOR_HD            (5)
    #define     BIT_BUF_LENGTH_LIMIT_FACTOR_720P          (4)
    #define     BIT_BUF_LENGTH_LIMIT_FACTOR_HMP           (4)
    
    #define     VDEC_VDIS_TILER_ENABLE                    (TRUE)
    
    #if defined(TI_814X_BUILD) || defined(TI_8107_BUILD)
    static SystemVideo_Ivahd2ChMap_Tbl systemVid_encDecIvaChMapTbl =
    {
        .isPopulated = 1,
        .ivaMap[0] =
        {
            .EncNumCh  = 0,
            .EncChList = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0},
    
            .DecNumCh  = 16,
            .DecChList = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
        },
    };
    #define NUM_STATIC_CHANNELS   (6)
    #else
    /*
    Max channels per IVA-HD MUST be < 16,
    i.e total number of channels for decode can be 48.
    
    Example CH allocation for SD+HD,
    
    32CH SD    :  0 to 31
     6CH 1080P : 32 to 38
    10CH 720P  : 39 to 48
    
    */
    static SystemVideo_Ivahd2ChMap_Tbl systemVid_encDecIvaChMapTbl =
    {
        .isPopulated = 1,
        .ivaMap[0] =
        {
            .EncNumCh  = 0,
            .EncChList = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0},
    
            .DecNumCh  = 17,
            .DecChList = {   0,  3,  6,  9, 12, 15, 18, 21,
                            24, 27, 30, 33, 36, 39, 42, 45,
                            48
                         },
        },
        .ivaMap[1] =
        {
            .EncNumCh  = 0,
            .EncChList = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0},
    
            .DecNumCh  = 17,
            .DecChList = {   1,  4,  7, 10, 13, 16, 19, 22,
                            25, 28, 31, 34, 37, 40, 43, 46,
                            49
                         },
        },
        .ivaMap[2] =
        {
            .EncNumCh  = 0,
            .EncChList = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0},
    
            .DecNumCh  = 16,
            .DecChList = {   2,  5,  8, 11, 14, 17, 20, 23,
                            26, 29, 32, 35, 38, 41, 44, 47
                         },
        },
    };
    #define NUM_STATIC_CHANNELS   (8)
    #endif
    
    #define     MULTICH_VDEC_VDIS_USECASE_MAX_NUM_LINKS       (64)
    
    typedef struct {
        UInt32 dupId;
        UInt32 ipcOutVideoId;
        UInt32 ipcInVpssId;
        UInt32 mergeId;
        Bool   enableVideoFrameExport;
        AvsyncLink_LinkSynchConfigParams   avsyncCfg[VDIS_DEV_MAX];
        UInt32 mpSclrId;
        UInt32 decSnapshotDup;
        UInt32 ipcFramesOutVpssId;
        IpcFramesOutLinkRTOS_CreateParams ipcFramesOutVpssPrm;
        UInt32 ipcFramesInVideoId;
        IpcFramesInLinkRTOS_CreateParams ipcFramesInVideoPrm;
        UInt32 encId;
        EncLink_CreateParams encPrm;
        UInt32 ipcBitsOutVideoId;
        IpcBitsOutLinkRTOS_CreateParams ipcBitsOutVideoPrm;
        UInt32 ipcBitsInHostId;
        IpcBitsInLinkHLOS_CreateParams ipcBitsInHostPrm;
        UInt32 createdLinkCount;
        UInt32 createdLinks[MULTICH_VDEC_VDIS_USECASE_MAX_NUM_LINKS];
        Bool tilerEnable;
    } MultiCh_VdecVdisObj;
    
    MultiCh_VdecVdisObj gMultiCh_VdecVdisObj;
    
    static Void multich_vdecvdis_register_created_link(MultiCh_VdecVdisObj *pContext,
                                                       UInt32 linkID)
    {
        OSA_assert(pContext->createdLinkCount < OSA_ARRAYSIZE(pContext->createdLinks));
        pContext->createdLinks[pContext->createdLinkCount] = linkID;
        pContext->createdLinkCount++;
    }
    
    #define MULTICH_VDECVDIS_CREATE_LINK(linkID,createPrm,createPrmSize)            \
        do                                                                          \
        {                                                                           \
            System_linkCreate(linkID,createPrm,createPrmSize);                      \
            multich_vdecvdis_register_created_link(&gMultiCh_VdecVdisObj,           \
                                                    linkID);                        \
        } while (0)
    
    static Void MultiCh_setIpcFramesOutInQueInfo(System_LinkQueInfo *inQueInfo)
    {
        Int i;
    
        inQueInfo->numCh = MULTICH_VDEC_VDIS_IPCFRAMEEXPORT_NUM_CHANNELS;
        for (i = 0; i < inQueInfo->numCh; i++)
        {
            inQueInfo->chInfo[i].bufType = SYSTEM_BUF_TYPE_VIDFRAME;
            inQueInfo->chInfo[i].dataFormat = SYSTEM_DF_YUV422I_YUYV;
            inQueInfo->chInfo[i].memType    = SYSTEM_MT_NONTILEDMEM;
            inQueInfo->chInfo[i].scanFormat = SYSTEM_SF_PROGRESSIVE;
            inQueInfo->chInfo[i].startX     = 0;
            inQueInfo->chInfo[i].startY     = 0;
            inQueInfo->chInfo[i].width      =
                       MULTICH_VDEC_VDIS_IPCFRAMEEXPORT_FRAME_WIDTH;
            inQueInfo->chInfo[i].height     =
                       MULTICH_VDEC_VDIS_IPCFRAMEEXPORT_FRAME_HEIGHT;
            inQueInfo->chInfo[i].pitch[0]   =
                       MULTICH_VDEC_VDIS_IPCFRAMEEXPORT_FRAME_WIDTH * 2;
            inQueInfo->chInfo[i].pitch[1]   = 0;
            inQueInfo->chInfo[i].pitch[2]   = 0;
        }
    }
    
    static
    Void mulich_vdec_vdis_set_avsync_vidque_prm(Avsync_SynchConfigParams *queCfg,
                                                Int chnum,
                                                UInt32 avsStartChNum,
                                                UInt32 avsEndChNum,
                                                VDIS_DEV vdDevId)
    {
        queCfg->chNum = chnum;
        queCfg->audioPresent = FALSE;
        if ((queCfg->chNum >= avsStartChNum)
            &&
            (queCfg->chNum <= avsEndChNum)
            &&
            (gVsysModuleContext.vsysConfig.enableAVsync))
        {
            queCfg->avsyncEnable = TRUE;
        }
        else
        {
            queCfg->avsyncEnable = FALSE;
        }
    
        queCfg->clkAdjustPolicy.refClkType = AVSYNC_REFCLKADJUST_NONE;
        queCfg->clkAdjustPolicy.clkAdjustLead = AVSYNC_VIDEO_TIMEBASESHIFT_MAX_LEAD_MS;
        queCfg->clkAdjustPolicy.clkAdjustLag  = AVSYNC_VIDEO_TIMEBASESHIFT_MAX_LAG_MS;
        queCfg->vidSynchPolicy.maxReplayLead  = AVSYNC_VIDEO_FUTURE_FRAME_DROP_THRESHOLD_MS;
        queCfg->vidSynchPolicy.playMaxLag  = 180;
        queCfg->vidSynchPolicy.playMaxLead = 0;
        queCfg->vidSynchPolicy.doMarginScaling = FALSE;
        queCfg->playTimerStartTimeout = 0;
        queCfg->playStartMode = AVSYNC_PLAYBACK_START_MODE_WAITSYNCH;
        queCfg->ptsInitMode   = AVSYNC_PTS_INIT_MODE_APP;
    }
    
    static
    Void mulich_vdec_vdis_set_avsync_prm(AvsyncLink_LinkSynchConfigParams *avsyncPrm,
                                         UInt32 swMsIdx,
                                         VDIS_DEV vdDevId)
    {
        Int i;
        Int32 status;
    
        Vdis_getAvsyncConfig(vdDevId,avsyncPrm);
        avsyncPrm->displayLinkID        = Vdis_getDisplayId(vdDevId);
        avsyncPrm->videoSynchLinkID = gVdisModuleContext.swMsId[swMsIdx];
        avsyncPrm->numCh            = gVdecModuleContext.vdecConfig.numChn;
        avsyncPrm->syncMasterChnum =  AVSYNC_INVALID_CHNUM;
        for (i = 0; i < avsyncPrm->numCh;i++)
        {
            mulich_vdec_vdis_set_avsync_vidque_prm(&avsyncPrm->queCfg[i],
                                                   i,
                                                   0,
                                                   (0 + gVdecModuleContext.vdecConfig.numChn),
                                                   vdDevId);
        }
        if (0 == swMsIdx)
        {
            Vdis_setAvsyncConfig(VDIS_DEV_HDMI,avsyncPrm);
        }
        else
        {
            Vdis_setAvsyncConfig(VDIS_DEV_SD,avsyncPrm);
        }
    
        status = Avsync_configSyncConfigInfo(avsyncPrm);
        OSA_assert(status == 0);
    }
    
    static Void mulich_vdec_vdis_set_mjpeg_enc_ch_params (EncLink_CreateParams *encPrm, Int32 startChNum, Int32 endChNum)
    {
        Int32 i;
    
        EncLink_ChCreateParams *pLinkChPrm;
        EncLink_ChDynamicParams *pLinkDynPrm;
        VENC_CHN_DYNAMIC_PARAM_S *pDynPrm;
        VENC_CHN_PARAMS_S *pChPrm;
    
        for (i=startChNum; i<endChNum; i++)
        {
            pLinkChPrm  = &encPrm->chCreateParams[i];
            pLinkDynPrm = &pLinkChPrm->defaultDynamicParams;
    
            pChPrm      = &gVencModuleContext.vencConfig.encChannelParams[i];
            pDynPrm     = &pChPrm->dynamicParam;
    
            pLinkChPrm->format                 = IVIDEO_MJPEG;
            pLinkChPrm->profile                = 0;
            pLinkChPrm->dataLayout             = VCODEC_FIELD_SEPARATED;
            pLinkChPrm->fieldMergeEncodeEnable = FALSE;
            pLinkChPrm->enableAnalyticinfo     = 0;
            pLinkChPrm->enableWaterMarking     = 0;
            pLinkChPrm->maxBitRate             = 0;
            pLinkChPrm->encodingPreset         = 0;
            pLinkChPrm->rateControlPreset      = 0;
            pLinkChPrm->enableSVCExtensionFlag = 0;
            pLinkChPrm->numTemporalLayer       = 0;
    
            pLinkDynPrm->intraFrameInterval    = 0;
            pLinkDynPrm->targetBitRate         = 100*1000;
            pLinkDynPrm->interFrameInterval    = 0;
            pLinkDynPrm->mvAccuracy            = 0;
            pLinkDynPrm->inputFrameRate        = pDynPrm->inputFrameRate;
            pLinkDynPrm->qpMin                 = 0;
            pLinkDynPrm->qpMax                 = 0;
            pLinkDynPrm->qpInit                = -1;
            pLinkDynPrm->vbrDuration           = 0;
            pLinkDynPrm->vbrSensitivity        = 0;
        }
    }
    
    Void MultiCh_createVdecVdis()
    {
        IpcBitsOutLinkHLOS_CreateParams   ipcBitsOutHostPrm;
        IpcBitsInLinkRTOS_CreateParams    ipcBitsInVideoPrm;
        DecLink_CreateParams        decPrm;
        IpcLink_CreateParams        ipcOutVideoPrm;
        IpcLink_CreateParams        ipcInVpssPrm;
        DupLink_CreateParams        dupPrm,dupSnapshotPrm;
        static SwMsLink_CreateParams       swMsPrm[VDIS_DEV_MAX];
        DisplayLink_CreateParams    displayPrm[VDIS_DEV_MAX];
        IpcFramesOutLinkHLOS_CreateParams  ipcFramesOutHostPrm;
        IpcFramesInLinkRTOS_CreateParams   ipcFramesInVpssFromHostPrm;
        MergeLink_CreateParams             mergePrm;
        MpSclrLink_CreateParams            mpSclrPrm;
    
        UInt32 i;
        UInt32 enableGrpx;
        Bool enableVideoFrameExport;
    
        MULTICH_INIT_STRUCT(IpcLink_CreateParams,ipcInVpssPrm);
        MULTICH_INIT_STRUCT(IpcLink_CreateParams,ipcOutVideoPrm);
        MULTICH_INIT_STRUCT(IpcBitsOutLinkHLOS_CreateParams,ipcBitsOutHostPrm);
        MULTICH_INIT_STRUCT(IpcBitsInLinkRTOS_CreateParams,ipcBitsInVideoPrm);
        MULTICH_INIT_STRUCT(DecLink_CreateParams, decPrm);
        MULTICH_INIT_STRUCT(IpcFramesOutLinkHLOS_CreateParams ,ipcFramesOutHostPrm);
        MULTICH_INIT_STRUCT(IpcFramesInLinkRTOS_CreateParams  ,ipcFramesInVpssFromHostPrm);
        for (i = 0; i < VDIS_DEV_MAX;i++)
        {
            MULTICH_INIT_STRUCT(DisplayLink_CreateParams,displayPrm[i]);
            MULTICH_INIT_STRUCT(SwMsLink_CreateParams ,swMsPrm[i]);
        }
    
        MULTICH_INIT_STRUCT(MpSclrLink_CreateParams, mpSclrPrm);
    
        gMultiCh_VdecVdisObj.createdLinkCount = 0;
        MultiCh_detectBoard();
    
        System_linkControl(
            SYSTEM_LINK_ID_M3VPSS,
            SYSTEM_M3VPSS_CMD_RESET_VIDEO_DEVICES,
            NULL,
            0,
            TRUE
            );
    
        System_linkControl(
            SYSTEM_LINK_ID_M3VIDEO,
            SYSTEM_COMMON_CMD_SET_CH2IVAHD_MAP_TBL,
            &systemVid_encDecIvaChMapTbl,
            sizeof(SystemVideo_Ivahd2ChMap_Tbl),
            TRUE
        );
    #if defined(TI_814X_BUILD) || defined(TI_8107_BUILD)
        enableGrpx   = FALSE;
    #else
        enableGrpx   = TRUE;
    #endif
    
        gMultiCh_VdecVdisObj.tilerEnable = VDEC_VDIS_TILER_ENABLE;
    
    
        if (gMultiCh_VdecVdisObj.tilerEnable == FALSE)
        {
            /* Disable tiler allocator for this usecase
             * for that tiler memory can be reused for
             * non-tiled allocation
             */
            SystemTiler_disableAllocator();
        }
        else
        {
            SystemTiler_BucketGeometry_t bucketRes;
    
            bucketRes.bucketWidth  = SYSTEM_TILER_ALLOCATOR_BUCKET_WIDTH_DEFAULT;
            bucketRes.bucketHeight = SYSTEM_TILER_ALLOCATOR_BUCKET_HEIGHT_DEFAULT;
            bucketRes.minResolution = SYSTEM_TILER_RESOLUTION_CIF;
            bucketRes.setSingleBucketGeometry = FALSE;
            SystemTiler_setBucketGeometry(&bucketRes);
        }
    
        enableVideoFrameExport = FALSE;
    
        gVdecModuleContext.ipcBitsOutHLOSId = SYSTEM_HOST_LINK_ID_IPC_BITS_OUT_0;
        gVdecModuleContext.ipcBitsInRTOSId  = SYSTEM_VIDEO_LINK_ID_IPC_BITS_IN_0;
        gVdecModuleContext.decId            = SYSTEM_LINK_ID_VDEC_0;
    
        gMultiCh_VdecVdisObj.ipcOutVideoId  = SYSTEM_VIDEO_LINK_ID_IPC_OUT_M3_0;
        gMultiCh_VdecVdisObj.ipcInVpssId    = SYSTEM_VPSS_LINK_ID_IPC_IN_M3_0;
        gMultiCh_VdecVdisObj.dupId          = SYSTEM_VPSS_LINK_ID_DUP_0;
        gMultiCh_VdecVdisObj.mpSclrId       = SYSTEM_LINK_ID_MP_SCLR_INST_0;
        gVdisModuleContext.mpSclrId         = SYSTEM_LINK_ID_MP_SCLR_INST_0;
        gVdisModuleContext.swMsId[0]        = SYSTEM_LINK_ID_SW_MS_MULTI_INST_0;
    
        gVdisModuleContext.displayId[0]     = SYSTEM_LINK_ID_DISPLAY_0; // ON AND OFF CHIP HDMI
    
        if (gVsysModuleContext.vsysConfig.numDisplays > 1)
        {
            gVdisModuleContext.swMsId[1]        = SYSTEM_LINK_ID_SW_MS_MULTI_INST_1;
    #if defined(TI_814X_BUILD) || defined(TI_8107_BUILD)
            gVdisModuleContext.displayId[1]     = SYSTEM_LINK_ID_DISPLAY_2; // SDTV
    #else
            gVdisModuleContext.displayId[1]     = SYSTEM_LINK_ID_DISPLAY_1; // OFF CHIP HDMI
    #endif
        }
    
        if (enableVideoFrameExport)
        {
            gMultiCh_VdecVdisObj.mergeId                 = SYSTEM_VPSS_LINK_ID_MERGE_0;
            gVdisModuleContext.ipcFramesOutHostId        = SYSTEM_HOST_LINK_ID_IPC_FRAMES_OUT_0;
            gVdisModuleContext.ipcFramesInVpssFromHostId = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_IN_0;
        }
    
        if(enableGrpx)
        {
            // GRPX is enabled in Vdis_start() based on the link ID set here
            gVdisModuleContext.grpxId[0]    = SYSTEM_LINK_ID_GRPX_0;
    #if defined(TI_814X_BUILD) || defined(TI_8107_BUILD)
            gVdisModuleContext.grpxId[1]    = SYSTEM_LINK_ID_INVALID;
    #else
            gVdisModuleContext.grpxId[1]    = SYSTEM_LINK_ID_GRPX_1;
    #endif
        }
    
        gMultiCh_VdecVdisObj.decSnapshotDup     =  SYSTEM_VPSS_LINK_ID_DUP_1;
        gMultiCh_VdecVdisObj.ipcFramesOutVpssId = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_OUT_1;
        gMultiCh_VdecVdisObj.ipcFramesInVideoId = SYSTEM_VIDEO_LINK_ID_IPC_FRAMES_IN_0;
        gMultiCh_VdecVdisObj.encId              = SYSTEM_LINK_ID_VENC_0;
        gMultiCh_VdecVdisObj.ipcBitsOutVideoId      = SYSTEM_VIDEO_LINK_ID_IPC_BITS_OUT_0;
        gMultiCh_VdecVdisObj.ipcBitsInHostId       = SYSTEM_HOST_LINK_ID_IPC_BITS_IN_0;
    
    
        ipcBitsOutHostPrm.baseCreateParams.outQueParams[0].nextLink= gVdecModuleContext.ipcBitsInRTOSId;
        ipcBitsOutHostPrm.baseCreateParams.notifyNextLink       = FALSE;
        ipcBitsOutHostPrm.baseCreateParams.notifyPrevLink       = FALSE;
        ipcBitsOutHostPrm.baseCreateParams.noNotifyMode         = TRUE;
        ipcBitsOutHostPrm.baseCreateParams.numOutQue            = 1;
        ipcBitsOutHostPrm.inQueInfo.numCh                       = gVdecModuleContext.vdecConfig.numChn;
    
        for (i=0; i<ipcBitsOutHostPrm.inQueInfo.numCh; i++)
        {
            ipcBitsOutHostPrm.inQueInfo.chInfo[i].width =
                gVdecModuleContext.vdecConfig.decChannelParams[i].maxVideoWidth;
    
            ipcBitsOutHostPrm.inQueInfo.chInfo[i].height =
                gVdecModuleContext.vdecConfig.decChannelParams[i].maxVideoHeight;
    
            ipcBitsOutHostPrm.inQueInfo.chInfo[i].scanFormat =
                SYSTEM_SF_PROGRESSIVE;
    
            ipcBitsOutHostPrm.inQueInfo.chInfo[i].bufType        = 0; // NOT USED
            ipcBitsOutHostPrm.inQueInfo.chInfo[i].codingformat   = 0; // NOT USED
            ipcBitsOutHostPrm.inQueInfo.chInfo[i].dataFormat     = 0; // NOT USED
            ipcBitsOutHostPrm.inQueInfo.chInfo[i].memType        = 0; // NOT USED
            ipcBitsOutHostPrm.inQueInfo.chInfo[i].startX         = 0; // NOT USED
            ipcBitsOutHostPrm.inQueInfo.chInfo[i].startY         = 0; // NOT USED
            ipcBitsOutHostPrm.inQueInfo.chInfo[i].pitch[0]       = 0; // NOT USED
            ipcBitsOutHostPrm.inQueInfo.chInfo[i].pitch[1]       = 0; // NOT USED
            ipcBitsOutHostPrm.inQueInfo.chInfo[i].pitch[2]       = 0; // NOT USED
    
            ipcBitsOutHostPrm.maxQueueDepth[i] = MAX_BUFFERING_QUEUE_LEN_PER_CH;
            ipcBitsOutHostPrm.chMaxReqBufSize[i] = 
                    (ipcBitsOutHostPrm.inQueInfo.chInfo[i].width * ipcBitsOutHostPrm.inQueInfo.chInfo[i].height); 
            ipcBitsOutHostPrm.totalBitStreamBufferSize [i] = 
                    (ipcBitsOutHostPrm.chMaxReqBufSize[i] * BIT_BUF_LENGTH_LIMIT_FACTOR_HD);
    
        }
    
        ipcBitsInVideoPrm.baseCreateParams.inQueParams.prevLinkId    = gVdecModuleContext.ipcBitsOutHLOSId;
        ipcBitsInVideoPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
        ipcBitsInVideoPrm.baseCreateParams.outQueParams[0].nextLink  = gVdecModuleContext.decId;
        ipcBitsInVideoPrm.baseCreateParams.noNotifyMode              = TRUE;
        ipcBitsInVideoPrm.baseCreateParams.notifyNextLink            = TRUE;
        ipcBitsInVideoPrm.baseCreateParams.notifyPrevLink            = FALSE;
        ipcBitsInVideoPrm.baseCreateParams.numOutQue                 = 1;
    
        for (i=0; i<ipcBitsOutHostPrm.inQueInfo.numCh; i++)
        {
            if(gVdecModuleContext.vdecConfig.decChannelParams[i].isCodec == VDEC_CHN_H264)
                decPrm.chCreateParams[i].format                 = IVIDEO_H264HP;
            else if(gVdecModuleContext.vdecConfig.decChannelParams[i].isCodec == VDEC_CHN_MPEG4)
                decPrm.chCreateParams[i].format                 = IVIDEO_MPEG4ASP;
            else if(gVdecModuleContext.vdecConfig.decChannelParams[i].isCodec == VDEC_CHN_MJPEG)
                decPrm.chCreateParams[i].format                 = IVIDEO_MJPEG;
            else if(gVdecModuleContext.vdecConfig.decChannelParams[i].isCodec == VDEC_CHN_MPEG2)
                decPrm.chCreateParams[i].format                 = IVIDEO_MPEG2HP;
    
            decPrm.chCreateParams[i].numBufPerCh
                             = gVdecModuleContext.vdecConfig.decChannelParams[i].numBufPerCh;
            decPrm.chCreateParams[i].profile                = IH264VDEC_PROFILE_ANY;
            decPrm.chCreateParams[i].displayDelay
                             = gVdecModuleContext.vdecConfig.decChannelParams[i].displayDelay;
            decPrm.chCreateParams[i].dpbBufSizeInFrames = IH264VDEC_DPB_NUMFRAMES_AUTO;
            if (gVdecModuleContext.vdecConfig.decChannelParams[i].fieldPicture)
            {
                OSA_printf("MULTICH_VDEC_VDIS:INFO ChId[%d] configured for field picture\n",i);
                decPrm.chCreateParams[i].processCallLevel   = VDEC_FIELDLEVELPROCESSCALL;
            }
            else
            {
                decPrm.chCreateParams[i].processCallLevel   = VDEC_FRAMELEVELPROCESSCALL;
            }
            decPrm.chCreateParams[i].targetMaxWidth  =
                ipcBitsOutHostPrm.inQueInfo.chInfo[i].width;
    
            decPrm.chCreateParams[i].targetMaxHeight =
                ipcBitsOutHostPrm.inQueInfo.chInfo[i].height;
    
            decPrm.chCreateParams[i].defaultDynamicParams.targetFrameRate =
                gVdecModuleContext.vdecConfig.decChannelParams[i].dynamicParam.frameRate;
    
            decPrm.chCreateParams[i].defaultDynamicParams.targetBitRate =
                gVdecModuleContext.vdecConfig.decChannelParams[i].dynamicParam.targetBitRate;
            if (FALSE == gMultiCh_VdecVdisObj.tilerEnable)
            {
            	decPrm.chCreateParams[i].tilerEnable = FALSE;
            }
            else
            {
            	decPrm.chCreateParams[i].tilerEnable = gVdecModuleContext.vdecConfig.decChannelParams[i].tilerEnable;
            }
            decPrm.chCreateParams[i].enableWaterMarking = 
                gVdecModuleContext.vdecConfig.decChannelParams[i].enableWaterMarking;
        }
    
        decPrm.inQueParams.prevLinkId       = gVdecModuleContext.ipcBitsInRTOSId;
        decPrm.inQueParams.prevLinkQueId    = 0;
        decPrm.outQueParams.nextLink        = gMultiCh_VdecVdisObj.ipcOutVideoId;
    
        ipcOutVideoPrm.inQueParams.prevLinkId    = gVdecModuleContext.decId;
        ipcOutVideoPrm.inQueParams.prevLinkQueId = 0;
        ipcOutVideoPrm.outQueParams[0].nextLink     = gMultiCh_VdecVdisObj.ipcInVpssId;
        ipcOutVideoPrm.notifyNextLink            = FALSE;
        ipcOutVideoPrm.notifyPrevLink            = TRUE;
        ipcOutVideoPrm.noNotifyMode              = TRUE;
        ipcOutVideoPrm.numOutQue                 = 1;
    
        ipcInVpssPrm.inQueParams.prevLinkId    = gMultiCh_VdecVdisObj.ipcOutVideoId;
        ipcInVpssPrm.inQueParams.prevLinkQueId = 0;
        ipcInVpssPrm.notifyNextLink            = TRUE;
        ipcInVpssPrm.notifyPrevLink            = FALSE;
        ipcInVpssPrm.noNotifyMode              = TRUE;
        ipcInVpssPrm.numOutQue                 = 1;
    
        dupSnapshotPrm.inQueParams.prevLinkId = gMultiCh_VdecVdisObj.ipcInVpssId;
        dupSnapshotPrm.inQueParams.prevLinkQueId = 0;
        dupSnapshotPrm.notifyNextLink = TRUE;
        dupSnapshotPrm.numOutQue = 2;
    
    
        if (enableVideoFrameExport)
        {
            ipcFramesOutHostPrm.baseCreateParams.noNotifyMode = TRUE;
            ipcFramesOutHostPrm.baseCreateParams.notifyNextLink = FALSE;
            ipcFramesOutHostPrm.baseCreateParams.notifyPrevLink = FALSE;
            ipcFramesOutHostPrm.baseCreateParams.inQueParams.prevLinkId = SYSTEM_LINK_ID_INVALID;
            ipcFramesOutHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
            ipcFramesOutHostPrm.baseCreateParams.numOutQue = 1;
            ipcFramesOutHostPrm.baseCreateParams.outQueParams[0].nextLink = gVdisModuleContext.ipcFramesInVpssFromHostId;
            MultiCh_setIpcFramesOutInQueInfo(&ipcFramesOutHostPrm.inQueInfo);
    
            ipcFramesInVpssFromHostPrm.baseCreateParams.noNotifyMode = TRUE;
            ipcFramesInVpssFromHostPrm.baseCreateParams.notifyNextLink = TRUE;
            ipcFramesInVpssFromHostPrm.baseCreateParams.notifyPrevLink = FALSE;
            ipcFramesInVpssFromHostPrm.baseCreateParams.inQueParams.prevLinkId = gVdisModuleContext.ipcFramesOutHostId;
            ipcFramesInVpssFromHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
            ipcFramesInVpssFromHostPrm.baseCreateParams.numOutQue = 1;
            ipcFramesInVpssFromHostPrm.baseCreateParams.outQueParams[0].nextLink = gMultiCh_VdecVdisObj.mergeId;
    
    
            ipcInVpssPrm.outQueParams[0].nextLink     = gMultiCh_VdecVdisObj.mergeId;
    
            mergePrm.numInQue                     = 2;
            mergePrm.inQueParams[0].prevLinkId    = gMultiCh_VdecVdisObj.decSnapshotDup;
            mergePrm.inQueParams[0].prevLinkQueId = 0;
            dupSnapshotPrm.outQueParams[0].nextLink = gMultiCh_VdecVdisObj.mergeId;
            mergePrm.inQueParams[1].prevLinkId    = gVdisModuleContext.ipcFramesInVpssFromHostId;
            mergePrm.inQueParams[1].prevLinkQueId = 0;
    
            mergePrm.outQueParams.nextLink        = gMultiCh_VdecVdisObj.mpSclrId;
            mergePrm.notifyNextLink               = TRUE;
            mpSclrPrm.inQueParams.prevLinkId      = gMultiCh_VdecVdisObj.mergeId;
        }
        else
        {
            ipcInVpssPrm.outQueParams[0].nextLink   = gMultiCh_VdecVdisObj.decSnapshotDup;
            mpSclrPrm.inQueParams.prevLinkId        = gMultiCh_VdecVdisObj.decSnapshotDup;
            mpSclrPrm.inQueParams.prevLinkQueId     = 0;
            dupSnapshotPrm.outQueParams[0].nextLink = gMultiCh_VdecVdisObj.mpSclrId;
        }
    #if defined(TI_814X_BUILD) || defined(TI_8107_BUILD)
        mpSclrPrm.pathId = MP_SCLR_LINK_SEC0_SC3_VIP0;
    #else
        mpSclrPrm.pathId = MP_SCLR_LINK_SEC1_SC4_VIP1;
    #endif
    
        mpSclrPrm.numCh = 4;
        mpSclrPrm.enableLineSkip = FALSE;
    
        mpSclrPrm.outQueParams.nextLink       = gMultiCh_VdecVdisObj.dupId;
        dupPrm.inQueParams.prevLinkId         = gMultiCh_VdecVdisObj.mpSclrId;
    
        dupPrm.inQueParams.prevLinkQueId      = 0;
        dupPrm.numOutQue                      = gVsysModuleContext.vsysConfig.numDisplays;
        dupPrm.outQueParams[0].nextLink       = gVdisModuleContext.swMsId[0];
        dupPrm.outQueParams[1].nextLink       = gVdisModuleContext.swMsId[1];
        dupPrm.notifyNextLink                 = TRUE;
    #if defined(TI_814X_BUILD) || defined(TI_8107_BUILD)
    
        swMsPrm[0].numSwMsInst = 1;
        swMsPrm[0].swMsInstId[0]        = SYSTEM_SW_MS_SC_INST_DEIHQ_SC_NO_DEI;
    
        swMsPrm[0].swMsInstStartWin[0]  = 0;
        swMsPrm[0].swMsInstStartWin[1]  = 10;
    
        swMsPrm[1].numSwMsInst = 1;
        swMsPrm[1].swMsInstId[0]        = SYSTEM_SW_MS_SC_INST_DEI_SC_NO_DEI;
    
        swMsPrm[1].swMsInstStartWin[0]  = 0;
        swMsPrm[1].swMsInstStartWin[1]  = 10;
    
        swMsPrm[0].enableProcessTieWithDisplay = TRUE;
        swMsPrm[1].enableProcessTieWithDisplay = FALSE;
    
        /* We do not require dual output, this free up SC3 scalar */
        swMsPrm[0].includeVipScInDrvPath = FALSE;
        swMsPrm[1].includeVipScInDrvPath = FALSE;
    #else
        swMsPrm[0].swMsInstId[0]        = SYSTEM_SW_MS_SC_INST_DEI_SC_NO_DEI;
        swMsPrm[0].swMsInstId[1]        = SYSTEM_SW_MS_SC_INST_VIP1_SC;
    
        swMsPrm[1].swMsInstId[0]        = SYSTEM_SW_MS_SC_INST_DEIHQ_SC_NO_DEI;
        swMsPrm[1].swMsInstId[1]        = SYSTEM_SW_MS_SC_INST_VIP0_SC;
    
        swMsPrm[0].numSwMsInst          = 2;
    
        swMsPrm[0].swMsInstStartWin[0]  = 0;
        swMsPrm[0].swMsInstStartWin[1]  = 16;
    
        swMsPrm[1].numSwMsInst          = swMsPrm[0].numSwMsInst;
        swMsPrm[1].swMsInstStartWin[0]  = swMsPrm[0].swMsInstStartWin[0];
        swMsPrm[1].swMsInstStartWin[1]  = swMsPrm[0].swMsInstStartWin[1];
    
        swMsPrm[0].enableProcessTieWithDisplay = TRUE;
        swMsPrm[1].enableProcessTieWithDisplay = TRUE;
    
    #endif
        for(i=0; i<gVsysModuleContext.vsysConfig.numDisplays; i++)
        {
            VDIS_DEV vdDevId = VDIS_DEV_HDMI;
    
            swMsPrm[i].inQueParams.prevLinkId     = gMultiCh_VdecVdisObj.dupId;
            swMsPrm[i].inQueParams.prevLinkQueId  = i;
            swMsPrm[i].outQueParams.nextLink      = gVdisModuleContext.displayId[i];
            swMsPrm[i].numOutBuf                 = MULTICH_NUM_SWMS_MAX_BUFFERS;
    
            /* Disable inQue drop at SwMs as input may arrive very fast in VDEC->VDIS use case */
            swMsPrm[i].maxInputQueLen             = SYSTEM_SW_MS_INVALID_INPUT_QUE_LEN;
            if (i == 0)
            {
                vdDevId = VDIS_DEV_HDMI;
                swMsPrm[i].maxOutRes              = VSYS_STD_1080P_60;
                swMsPrm[i].initOutRes             = gVdisModuleContext.vdisConfig.deviceParams[VDIS_DEV_HDMI].resolution;
            }
            else if (i == 1)
            {
    #if defined(TI_814X_BUILD) || defined(TI_8107_BUILD)
                vdDevId = VDIS_DEV_SD;
                swMsPrm[i].maxOutRes              = VSYS_STD_PAL;
                swMsPrm[i].outQueParams.nextLink  = SYSTEM_LINK_ID_DISPLAY_2;
                swMsPrm[i].initOutRes             = gVdisModuleContext.vdisConfig.deviceParams[VDIS_DEV_SD].resolution;
    
    #else
                vdDevId = VDIS_DEV_DVO2;
                swMsPrm[i].maxOutRes              = VSYS_STD_1080P_60;
                swMsPrm[i].initOutRes             = gVdisModuleContext.vdisConfig.deviceParams[VDIS_DEV_DVO2].resolution;
    #endif
            }
            /* low cost line skip mode of scaling can be used, when tiler is off */
            if(gMultiCh_VdecVdisObj.tilerEnable)
                swMsPrm[i].lineSkipMode           = FALSE;
            else
                swMsPrm[i].lineSkipMode           = TRUE;
    
            swMsPrm[i].enableLayoutGridDraw = gVdisModuleContext.vdisConfig.enableLayoutGridDraw;
    
            MultiCh_swMsGetDefaultLayoutPrm(vdDevId, &swMsPrm[i], FALSE);    /* both from 0-16 chnl */
    
            displayPrm[i].inQueParams[0].prevLinkId    = gVdisModuleContext.swMsId[i];
            displayPrm[i].inQueParams[0].prevLinkQueId = 0;
            displayPrm[i].displayRes                = swMsPrm[i].initOutRes;
            if (i == 1)
    #if defined(TI_814X_BUILD) || defined(TI_8107_BUILD)
                            displayPrm[i].displayRes            = gVdisModuleContext.vdisConfig.deviceParams[VDIS_DEV_SD].resolution;
    #else
                            displayPrm[i].displayRes            = gVdisModuleContext.vdisConfig.deviceParams[VDIS_DEV_DVO2].resolution;
    #endif
            mulich_vdec_vdis_set_avsync_prm(&gMultiCh_VdecVdisObj.avsyncCfg[i],i,vdDevId);
        }
    
        dupSnapshotPrm.outQueParams[1].nextLink = gMultiCh_VdecVdisObj.ipcFramesOutVpssId;
        IpcFramesOutLinkRTOS_CreateParams_Init(&gMultiCh_VdecVdisObj.ipcFramesOutVpssPrm);
        gMultiCh_VdecVdisObj.ipcFramesOutVpssPrm.baseCreateParams.inQueParams.prevLinkId = gMultiCh_VdecVdisObj.decSnapshotDup;
        gMultiCh_VdecVdisObj.ipcFramesOutVpssPrm.baseCreateParams.inQueParams.prevLinkQueId = 1;
        gMultiCh_VdecVdisObj.ipcFramesOutVpssPrm.baseCreateParams.inputFrameRate  = 30;
        gMultiCh_VdecVdisObj.ipcFramesOutVpssPrm.baseCreateParams.outputFrameRate = 1;
        gMultiCh_VdecVdisObj.ipcFramesOutVpssPrm.baseCreateParams.noNotifyMode    = TRUE;
        gMultiCh_VdecVdisObj.ipcFramesOutVpssPrm.baseCreateParams.notifyNextLink  = FALSE;
        gMultiCh_VdecVdisObj.ipcFramesOutVpssPrm.baseCreateParams.notifyPrevLink  = TRUE;
        gMultiCh_VdecVdisObj.ipcFramesOutVpssPrm.baseCreateParams.outQueParams[0].nextLink = gMultiCh_VdecVdisObj.ipcFramesInVideoId;
    
        IpcFramesInLinkRTOS_CreateParams_Init(&gMultiCh_VdecVdisObj.ipcFramesInVideoPrm);
        gMultiCh_VdecVdisObj.ipcFramesInVideoPrm.baseCreateParams.inQueParams.prevLinkId = gMultiCh_VdecVdisObj.ipcFramesOutVpssId;
        gMultiCh_VdecVdisObj.ipcFramesInVideoPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
        gMultiCh_VdecVdisObj.ipcFramesInVideoPrm.baseCreateParams.noNotifyMode = TRUE;
        gMultiCh_VdecVdisObj.ipcFramesInVideoPrm.baseCreateParams.notifyPrevLink = FALSE;
        gMultiCh_VdecVdisObj.ipcFramesInVideoPrm.baseCreateParams.notifyNextLink = TRUE;
        gMultiCh_VdecVdisObj.ipcFramesInVideoPrm.baseCreateParams.outQueParams[0].nextLink = gMultiCh_VdecVdisObj.encId;
    
        EncLink_CreateParams_Init(&gMultiCh_VdecVdisObj.encPrm);
        gMultiCh_VdecVdisObj.encPrm.numBufPerCh[0] = 4;
        gMultiCh_VdecVdisObj.encPrm.inQueParams.prevLinkId    = gMultiCh_VdecVdisObj.ipcFramesInVideoId;
        gMultiCh_VdecVdisObj.encPrm.inQueParams.prevLinkQueId = 0;
        gMultiCh_VdecVdisObj.encPrm.outQueParams.nextLink     = gMultiCh_VdecVdisObj.ipcBitsOutVideoId;
        mulich_vdec_vdis_set_mjpeg_enc_ch_params(&gMultiCh_VdecVdisObj.encPrm, 0, ipcBitsOutHostPrm.inQueInfo.numCh);
    
        IpcBitsOutLinkRTOS_CreateParams_Init(&gMultiCh_VdecVdisObj.ipcBitsOutVideoPrm);
        gMultiCh_VdecVdisObj.ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkId    = gMultiCh_VdecVdisObj.encId;
        gMultiCh_VdecVdisObj.ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
        gMultiCh_VdecVdisObj.ipcBitsOutVideoPrm.baseCreateParams.numOutQue                 = 1;
        gMultiCh_VdecVdisObj.ipcBitsOutVideoPrm.baseCreateParams.outQueParams[0].nextLink  = gMultiCh_VdecVdisObj.ipcBitsInHostId;
        gMultiCh_VdecVdisObj.ipcBitsOutVideoPrm.baseCreateParams.notifyPrevLink = TRUE;
        gMultiCh_VdecVdisObj.ipcBitsOutVideoPrm.baseCreateParams.notifyNextLink = TRUE;
        gMultiCh_VdecVdisObj.ipcBitsOutVideoPrm.baseCreateParams.noNotifyMode   = FALSE;
    
    
        IpcBitsInLinkHLOS_CreateParams_Init(&gMultiCh_VdecVdisObj.ipcBitsInHostPrm);
        gMultiCh_VdecVdisObj.ipcBitsInHostPrm.baseCreateParams.inQueParams.prevLinkId = gMultiCh_VdecVdisObj.ipcBitsOutVideoId;
        gMultiCh_VdecVdisObj.ipcBitsInHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
        gMultiCh_VdecVdisObj.ipcBitsInHostPrm.baseCreateParams.numOutQue = 0;
        gMultiCh_VdecVdisObj.ipcBitsInHostPrm.baseCreateParams.outQueParams[0].nextLink = SYSTEM_LINK_ID_INVALID;
        gMultiCh_VdecVdisObj.ipcBitsInHostPrm.baseCreateParams.notifyPrevLink = TRUE;
        gMultiCh_VdecVdisObj.ipcBitsInHostPrm.baseCreateParams.notifyNextLink = FALSE;
        gMultiCh_VdecVdisObj.ipcBitsInHostPrm.baseCreateParams.noNotifyMode   = FALSE;
        gMultiCh_VdecVdisObj.ipcBitsInHostPrm.cbFxn = gVencModuleContext.callbackFxn.newDataAvailableCb; // register the encode callback function for snapshot
        gMultiCh_VdecVdisObj.ipcBitsInHostPrm.cbCtx = gVencModuleContext.callbackArg;                    // register the encode callback context for snapshot
    
    
    
        MULTICH_VDECVDIS_CREATE_LINK(gVdecModuleContext.ipcBitsOutHLOSId,&ipcBitsOutHostPrm,sizeof(ipcBitsOutHostPrm));
        MULTICH_VDECVDIS_CREATE_LINK(gVdecModuleContext.ipcBitsInRTOSId,&ipcBitsInVideoPrm,sizeof(ipcBitsInVideoPrm));
        MULTICH_VDECVDIS_CREATE_LINK(gVdecModuleContext.decId, &decPrm, sizeof(decPrm));
    
        MULTICH_VDECVDIS_CREATE_LINK(gMultiCh_VdecVdisObj.ipcOutVideoId, &ipcOutVideoPrm, sizeof(ipcOutVideoPrm));
        MULTICH_VDECVDIS_CREATE_LINK(gMultiCh_VdecVdisObj.ipcInVpssId  , &ipcInVpssPrm, sizeof(ipcInVpssPrm));
    
        MULTICH_VDECVDIS_CREATE_LINK(gMultiCh_VdecVdisObj.decSnapshotDup,&dupSnapshotPrm,sizeof(dupSnapshotPrm));
        if (enableVideoFrameExport)
        {
            MULTICH_VDECVDIS_CREATE_LINK(gVdisModuleContext.ipcFramesOutHostId     , &ipcFramesOutHostPrm    , sizeof(ipcFramesOutHostPrm));
            MULTICH_VDECVDIS_CREATE_LINK(gVdisModuleContext.ipcFramesInVpssFromHostId     , &ipcFramesInVpssFromHostPrm    , sizeof(ipcFramesInVpssFromHostPrm));
            MULTICH_VDECVDIS_CREATE_LINK(gMultiCh_VdecVdisObj.mergeId,&mergePrm,sizeof(mergePrm));
        }
    
        MULTICH_VDECVDIS_CREATE_LINK(gMultiCh_VdecVdisObj.mpSclrId, &mpSclrPrm, sizeof(mpSclrPrm));
        MULTICH_VDECVDIS_CREATE_LINK(gMultiCh_VdecVdisObj.dupId     , &dupPrm    , sizeof(dupPrm));
    
        for(i=0; i<gVsysModuleContext.vsysConfig.numDisplays; i++)
            MULTICH_VDECVDIS_CREATE_LINK(gVdisModuleContext.swMsId[i]  , &swMsPrm[i], sizeof(swMsPrm[i]));
    
        for(i=0; i<gVsysModuleContext.vsysConfig.numDisplays; i++)
            MULTICH_VDECVDIS_CREATE_LINK(gVdisModuleContext.displayId[i], &displayPrm[i], sizeof(displayPrm[i]));
    
        MULTICH_VDECVDIS_CREATE_LINK(gMultiCh_VdecVdisObj.ipcFramesOutVpssId, &gMultiCh_VdecVdisObj.ipcFramesOutVpssPrm, sizeof(gMultiCh_VdecVdisObj.ipcFramesOutVpssPrm));
        MULTICH_VDECVDIS_CREATE_LINK(gMultiCh_VdecVdisObj.ipcFramesInVideoId, &gMultiCh_VdecVdisObj.ipcFramesInVideoPrm, sizeof(gMultiCh_VdecVdisObj.ipcFramesInVideoPrm));
        MULTICH_VDECVDIS_CREATE_LINK(gMultiCh_VdecVdisObj.encId, &gMultiCh_VdecVdisObj.encPrm, sizeof(gMultiCh_VdecVdisObj.encPrm));
        MULTICH_VDECVDIS_CREATE_LINK(gMultiCh_VdecVdisObj.ipcBitsOutVideoId, &gMultiCh_VdecVdisObj.ipcBitsOutVideoPrm, sizeof(gMultiCh_VdecVdisObj.ipcBitsOutVideoPrm));
        MULTICH_VDECVDIS_CREATE_LINK(gMultiCh_VdecVdisObj.ipcBitsInHostId, &gMultiCh_VdecVdisObj.ipcBitsInHostPrm, sizeof(gMultiCh_VdecVdisObj.ipcBitsInHostPrm));
    
        MultiCh_memPrintHeapStatus();
        gMultiCh_VdecVdisObj.enableVideoFrameExport = enableVideoFrameExport;
        {
            MultiCh_setDec2DispMap(VDIS_DEV_HDMI,gVdecModuleContext.vdecConfig.numChn,0,0);
            #if defined(TI_814X_BUILD) || defined(TI_8107_BUILD)
            MultiCh_setDec2DispMap(VDIS_DEV_SD,gVdecModuleContext.vdecConfig.numChn,0,0);
            #else
            MultiCh_setDec2DispMap(VDIS_DEV_HDCOMP,gVdecModuleContext.vdecConfig.numChn,0,0);
            #endif
       }
    
    }
    
    Void MultiCh_deleteVdecVdis()
    {
        Int i;
    
        for (i = 0; i < gMultiCh_VdecVdisObj.createdLinkCount; i++)
        {
            System_linkDelete (gMultiCh_VdecVdisObj.createdLinks[i]);
        }
        gMultiCh_VdecVdisObj.createdLinkCount = 0;
    
        /* Print the HWI, SWI and all tasks load */
        /* Reset the accumulated timer ticks */
        MultiCh_prfLoadCalcEnable(FALSE, TRUE, FALSE);
    
    
        if (gMultiCh_VdecVdisObj.tilerEnable == FALSE)
        {
            /* Disable tiler allocator for this usecase
             * for that tiler memory can be reused for
             * non-tiled allocation
             */
            SystemTiler_enableAllocator();
        }
        else
        {
            SystemTiler_BucketGeometry_t bucketRes;
    
            bucketRes.minResolution = SYSTEM_TILER_RESOLUTION_CIF;
            bucketRes.setSingleBucketGeometry = TRUE;
            SystemTiler_setBucketGeometry(&bucketRes);
        }
    
    }
    
    Attached is modified multich_vdec_vdis doing transcode that can be used as reference.

    You can also refer this post where another customer has implemented transcode usecase:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/309305/1083568.aspx#1083568

    If possible pls share representative bitstream for 2592x1944 and 2048x1536 resolution so that we can check  encode/decode performance and fps at our end.

     

     

     

     

     

     

  • Thanks Badri:

    I'll try to follow-up with some bitstreams.

    1. Can the MpSclr be used on either SCLR?

    2. If the 5 MP image is 4x3 aspect ratio, what will happen to the image as it is scaled into 1080P. (16x9)?  If we need to grab a window from the scaled image, how is that done with the mcfw?

    3. The output is 422I?  Is that typical scalar output?  And does make sense with our use case (see next question).

    4. Does the following use case make sense.  The number of channels when using MP sources is TBD ("N" in the tree below).  

                                               |
                                             IPC_BITS_OUT_A8 (BitStream)
                                                      |
                                               IPC_BITS_IN (Video)
                                                      |
                                                DEC (YUV420SP)
                                                      |
                                                IPC_OUT (Video)
                                                      |
                                                 IPC_IN (Vpss)
                                                      |
                                                      |   (4CH D1 | 4CH 720P | N CH 1080P | N CH 5 MP)
                                                      v
                                        -------------------------
                                                  DUP_LINK
                                        -------------------------
                                           |     |     |     |
                     +---------------------+     |     |     +---------------------+
                     |                           |     |                           |
                     |                           |     +----------+                |
                   MP_SCLR                       |                |                |
                     |                           |             4CH|                |
                     |                           |                |                |
                     |                           |                |                |
                     |                           |                |                |
                     |4CH                        |4CH             V             4CH|
                     |                           +------------->MERGE              |
                     |                                            |                |
                     |                                            |                |
                     |                                            |                |
                     |                                          MP_SCLR            |
                     |                                            |                |
                     v                                            v                |      
                   SCLR1 (Vpss)                                 SCLR0 (Vpss)       |
                     |                                            |                |
                     V                                            |                |
              IPC Frames Out1 (M3)--<<process link>>              |                IPC_OUT (M3)
                     |                      |                     |                |
                     |                      V                     |                |
                     |               IPC Frames In(DSP)           |                v 
                     |                      |                     |                IPC_IN (M3)
                     |                      V                     |                |
                     |                   ALGLINK                  |                |
                     |                                            |                Encode NCH 5MP
                     |                                            |                |
                     |                                            v                |
                     |                                       IPC OUT (M3)          IP BITS OUT (M3)
                     |                                            |                |
                     |                                            v                |
                     |                                       IPC IN  (M3)          IP BITS IN (A8)
                     |                                            |
                     |                                            v
                     |                      Encode ( 4CH Secondary + 4CH MJPEG)
                     V                                            |
                SW Mosaic                                         v
               (SC DEI-HQ)                                   IPC BITS OUT (M3)
                     |                                            |
                     V                                            v
                On-Chip HDMI                               IPC BITS IN  (A8)
                  1080p60

                                                                                         

  • Bandeg said:
    1. Can the MpSclr be used on either SCLR?

    - I don't understand the question.MpSclr can use SC3/SC4/SC5 HDVPSS scalers to do MPScaling.

    Bandeg said:
    2. If the 5 MP image is 4x3 aspect ratio, what will happen to the image as it is scaled into 1080P. (16x9)?  If we need to grab a window from the scaled image, how is that done with the mcfw?

    - The output of MpSclr will always be 1920x1080 so aspect ratio will not be preserved. You will have to do multi stage scaling if you want any output resolution other than 1920x1080.

    - MpSclr has an option to fwd the image original Mega Pixel image without scaling and the next link can scale a window of the original image

    Bandeg said:
    3. The output is 422I?  Is that typical scalar output?  And does make sense with our use case (see next question).

    - Yes it is standard Scaler output format .Before encoding you need to use Nsf link to convert YUV422I to YUV420SP

    Bandeg said:
    4. Does the following use case make sense.  The number of channels when using MP sources is TBD ("N" in the tree below).  

    - Yes data flow looks fine. You don't need 2 MpSclr link instances since output resolution for MpSclr is fixed. There is no reason to have two instances doing MpScaling. The only thing you have to ensure is to select the correct HDVPSS scaler resource to ensure no conflict and equal load distribution across MpScaler/Scaler and SwMs.

    You could use SC1/SC2 (DEI link with DEI in bypass) for SCLR0 and SCLR1 , use SC5 for MpScaler ,use SC4 for SwMs.

    Also as I mentioned if using encoder other than MJPEG you will have to convert to YUV420SP before encoding.