您好,欢迎来到61ic! | [登录] [注册] 忘记密码 | 设为首页 帮助
 . 网站首页 . 业界新闻 . 设计中心 . 移动技术 . TI专栏 . ADI专栏 . FPGA专栏 . 代码工厂 . 官方商城 . 
 . 活动专区 . 新品快递 . 解决方案 . 前沿科技 . TI资源 . ADI资源 . FPGA资源 . 下载中心 . 产品展示 . 
加入收藏
付款方式
联系我们
您现在的位置: 61IC电子在线 >> TI专栏 >> TI DaVinci >> TMS320DM81x SOC >> 正文
  scd-link移植的代码流程           ★★★ 【字体:
scd-link移植的代码流程
作者:木之子    文章来源:木之子    点击数:    更新时间:2014-8-24    

注意scd的最大支持cif(352x288)

图形的流程:

IPC Frames Out-----><Process Link>----->IPC Frames In DSP ----->AlgLink(SCD----->IPCBitsIn(A8)


代码流程:

 if(enableScdAlgLink){
IpcFramesOutLinkRTOS_CreateParams ipcFramesOutVpssPrm;
IpcFramesInLinkRTOS_CreateParams  ipcFramesInDspPrm;
AlgLink_CreateParams                        dspAlgPrm;
IpcBitsOutLinkRTOS_CreateParams      ipcBitsOutDspPrm;
   }


  if(enableScdAlgLink){
gVcapModuleContext.ipcFramesOutVpssId[0] = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_OUT_0;
gVcapModuleContext.ipcFramesInDspId[0] = SYSTEM_DSP_LINK_ID_IPC_FRAMES_IN_0;
gVcapModuleContext.dspAlgId[0] = SYSTEM_LINK_ID_ALG_0;
gVcapModuleContext.ipcBitsOutDSPId = SYSTEM_DSP_LINK_ID_IPC_BITS_OUT_0;
gVcapModuleContext.ipcBitsInHLOSId = SYSTEM_HOST_LINK_ID_IPC_BITS_IN_1;
 }

      if(enableScdAlgLink){
ipcFramesOutVpssPrm.baseCreateParams.inQueParams.prevLinkId    =gVcapModuleContext.nsfId[0];
ipcFramesOutVpssPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcFramesOutVpssPrm.baseCreateParams.inputFrameRate  = 30;
ipcFramesOutVpssPrm.baseCreateParams.outputFrameRate = 30;
ipcFramesOutVpssPrm.baseCreateParams.notifyPrevLink = TRUE;
ipcFramesOutVpssPrm.baseCreateParams.numOutQue = 1;
ipcFramesOutVpssPrm.baseCreateParams.outQueParams[0].nextLink =ipcOutVpssId;
ipcFramesOutVpssPrm.baseCreateParams.notifyNextLink = TRUE;
      
ipcFramesOutVpssPrm.baseCreateParams.processLink = gVcapModuleContext.ipcFramesInDspId[0];
ipcFramesOutVpssPrm.baseCreateParams.notifyProcessLink = TRUE;
ipcFramesOutVpssPrm.baseCreateParams.noNotifyMode = FALSE;


ipcFramesInDspPrm.baseCreateParams.inQueParams.prevLinkId = gVcapModuleContext.ipcFramesOutVpssId[0];
ipcFramesInDspPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcFramesInDspPrm.baseCreateParams.numOutQue   = 1;
ipcFramesInDspPrm.baseCreateParams.outQueParams[0].nextLink = gVcapModuleContext.dspAlgId[0];
ipcFramesInDspPrm.baseCreateParams.notifyPrevLink = TRUE;
ipcFramesInDspPrm.baseCreateParams.notifyNextLink = TRUE;
ipcFramesInDspPrm.baseCreateParams.noNotifyMode   = FALSE;


dspAlgPrm.inQueParams.prevLinkId = gVcapModuleContext.ipcFramesInDspId[0];
dspAlgPrm.inQueParams.prevLinkQueId = 0;
     }


     if (enableScdAlgLink)
     {
        Int32    numBlksInFrame;
        Int32    numHorzBlks, numVertBlks, chIdx;
        Uint32  x, y, i;


         dspAlgPrm.enableSCDAlg              = TRUE;
         dspAlgPrm.outQueParams[ALG_LINK_SCD_OUT_QUE].nextLink     = gVcapModuleContext.ipcBitsOutDSPId;
         dspAlgPrm.scdCreateParams.numBufPerCh            = 3;

 


         dspAlgPrm.scdCreateParams.maxWidth               =352;
         if(Vcap_isPalMode())
            dspAlgPrm.scdCreateParams.maxHeight           = 288;
         else
            dspAlgPrm.scdCreateParams.maxHeight           = 240;


         dspAlgPrm.scdCreateParams.maxStride              = 352;
         dspAlgPrm.scdCreateParams.numValidChForSCD       = 8;//16;///////////////////////////////////////////////////////这里是创建osd的个数


        dspAlgPrm.scdCreateParams.numSecs2WaitB4Init     = 3;
         dspAlgPrm.scdCreateParams.numSecs2WaitB4FrmAlert = 1;
         dspAlgPrm.scdCreateParams.inputFrameRate         = 30;
         dspAlgPrm.scdCreateParams.outputFrameRate        = 2;


         dspAlgPrm.scdCreateParams.numSecs2WaitAfterFrmAlert    = 2;
         dspAlgPrm.scdCreateParams.numSecs2Wait2MarkStableFrame = 5;


         dspAlgPrm.scdCreateParams.enableMotionNotify        = FALSE;
         dspAlgPrm.scdCreateParams.enableTamperNotify        = FALSE;


         /* Should be applied on CIF channels whose ch numbers are 4~7 */
         //dspAlgPrm.scdCreateParams.startChNoForSCD = 16;
         // Configure array to monitor scene changes in all frame blocks, i.e., motion detection.
         // Each block is fixed to be 32x10 in size,
         numHorzBlks     = dspAlgPrm.scdCreateParams.maxWidth / 32;
         if(dspAlgPrm.scdCreateParams.maxHeight == 240)
            numVertBlks    = dspAlgPrm.scdCreateParams.maxHeight / 10;
         else   /* For 288 Block height becomes 12 */
            numVertBlks    = dspAlgPrm.scdCreateParams.maxHeight / 12;


         numBlksInFrame  = numHorzBlks * numVertBlks;


         for(chIdx = 0; chIdx < dspAlgPrm.scdCreateParams.numValidChForSCD; chIdx++)
         {
            AlgLink_ScdChParams * chPrm = &dspAlgPrm.scdCreateParams.chDefaultParams[chIdx];


            chPrm->blkNumBlksInFrame  = numBlksInFrame;
            chPrm->chId               = SCDChannelMonitor[chIdx];
            chPrm->mode               = ALG_LINK_SCD_DETECTMODE_MONITOR_BLOCKS_AND_FRAME;
            chPrm->frmIgnoreLightsON  = FALSE;
            chPrm->frmIgnoreLightsOFF = FALSE;
            chPrm->frmSensitivity     = ALG_LINK_SCD_SENSITIVITY_VERYLOW;//ALG_LINK_SCD_SENSITIVITY_VERYHIGH;
            chPrm->frmEdgeThreshold   = 100;


            i = 0;
            for(y = 0; y < numVertBlks; y++)
            {
              for(x = 0; x < numHorzBlks; x++)
              {
                chPrm->blkConfig[i].sensitivity = ALG_LINK_SCD_SENSITIVITY_LOW;
                chPrm->blkConfig[i].monitored     = 0;
                i++;
              }
            }
         }


         ipcBitsOutDspPrm.baseCreateParams.inQueParams.prevLinkId    = gVcapModuleContext.dspAlgId[0];
         ipcBitsOutDspPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
         ipcBitsOutDspPrm.baseCreateParams.numOutQue                 = 1;
         ipcBitsOutDspPrm.baseCreateParams.outQueParams[0].nextLink  = gVcapModuleContext.ipcBitsInHLOSId;
         MultiCh_ipcBitsInitCreateParams_BitsOutRTOS(&ipcBitsOutDspPrm,
                                                    TRUE);
         ipcBitsOutDspPrm.baseCreateParams.notifyNextLink              = TRUE;
         ipcBitsOutDspPrm.baseCreateParams.noNotifyMode                = FALSE;


         ipcBitsInHostPrm[1].baseCreateParams.inQueParams.prevLinkId = gVcapModuleContext.ipcBitsOutDSPId;
         ipcBitsInHostPrm[1].baseCreateParams.inQueParams.prevLinkQueId = 0;
         ipcBitsInHostPrm[1].baseCreateParams.numOutQue                 = 1;
         ipcBitsInHostPrm[1].baseCreateParams.outQueParams[0].nextLink   = SYSTEM_LINK_ID_INVALID;
         MultiCh_ipcBitsInitCreateParams_BitsInHLOSVcap(&ipcBitsInHostPrm[1]);
         ipcBitsInHostPrm[1].baseCreateParams.notifyPrevLink         = TRUE;
         ipcBitsInHostPrm[1].baseCreateParams.noNotifyMode              = FALSE;
     }
     else
     {
         dspAlgPrm.outQueParams[ALG_LINK_SCD_OUT_QUE].nextLink     = SYSTEM_LINK_ID_INVALID;
     }

 

 

if( enableScdAlgLink)
 {
         System_linkCreate(gVcapModuleContext.ipcFramesOutVpssId[0], &ipcFramesOutVpssPrm, sizeof(ipcFramesOutVpssPrm));
         System_linkCreate(gVcapModuleContext.ipcFramesInDspId[0], &ipcFramesInDspPrm, sizeof(ipcFramesInDspPrm));

         System_linkCreate(gVcapModuleContext.dspAlgId[0] , &dspAlgPrm, sizeof(dspAlgPrm));

         System_linkCreate(gVcapModuleContext.ipcBitsOutDSPId, &ipcBitsOutDspPrm, sizeof(ipcBitsOutDspPrm));

         System_linkCreate(gVcapModuleContext.ipcBitsInHLOSId, &ipcBitsInHostPrm[1], sizeof(ipcBitsInHostPrm[1])); 
  }


有什么不对,下面可以给我留言!!!技术需要交流

文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章: 没有了
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
    YUV422与RGB互相转
    DM8168 PWM驱动与测试程序
    DM8168中程序启动分析及如何…
    DM8168视频格式及HDVPSS研究
    TMS320DM8168下GDB远程调试环…
    DM8168集成图像算法(改正官…
    DM8168电源调试总结
    DM8168 ccs5.4 烧写u-boot到…
    DM8168 nandflash启动出现卡…
    DM8168板第一次有串口输出数…
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    站长:61 湘ICP备13001086号-2