⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mpeg2main.c

📁 TI公司C6000系列DSP(DM642)模拟视频采集与回显源代码
💻 C
字号:
/*
 *  Copyright 2003 by Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
#include <csl.h>
#include <csl_cache.h>
#include <csl_dat.h>
#include <chan.h>
#include <scom.h>
#include <utl.h>
#include "appMain.h"

#define GLOBAL
#include "evm642_mpeg2enc.h"
#undef GLOBAL

extern int intHeap,extHeap; 

/*-------------------------------------------------------*/
/* perform all initializations                           */
/*-------------------------------------------------------*/
void main()
{
    int i;
    CSL_init();                                             
    CACHE_clean(CACHE_L2ALL, 0, 0);
    CACHE_setL2Mode(CACHE_64KCACHE);       
    CACHE_enableCaching(CACHE_EMIFA_CE00);
    CACHE_enableCaching(CACHE_EMIFA_CE01);
  
#define L2ALLOC3 0x0184200C
    *(int *) L2ALLOC3 = (*(int *) L2ALLOC3) | 0x00000007;

#define L2ALLOC2 0x01842008
    *(int *) L2ALLOC2 = (*(int *) L2ALLOC2) | 0x00000007;

#define L2ALLOC1 0x01842004
    *(int *) L2ALLOC1 = (*(int *) L2ALLOC1) | 0x00000007;
	
    CACHE_setPriL2Req(CACHE_L2PRIHIGH);  

    /*-------------------------------------------------------*/
    /*Initialize RF5 modules                                  */
    /*-------------------------------------------------------*/
    CHAN_init();
    ICC_init();
    SCOM_init();
    
    /*-------------------------------------------------------*/
    /*Setup the RF-5 chan module                             */
    /*-------------------------------------------------------*/
    CHAN_setup( intHeap, extHeap, intHeap, 1, NULL, NULL);

    /*-------------------------------------------------------*/
    /*Initialize and start the process task                  */
    /*-------------------------------------------------------*/
 	tskVideoInputInit();
 	tskVideoOutputInit();
    
    /*-------------------------------------------------------*/
    /*Initialize and start the Input task                    */
    /*-------------------------------------------------------*/
    tskVideoInputStart();
    tskVideoOutputStart();

    /*-------------------------------------------------------*/
    /*Initialize and start the process task                             */
    /*-------------------------------------------------------*/
    tskProcessInit();
    tskProcessStart();
     
    /*-------------------------------------------------------*/
    /* create all SCOM and message objects                   */
    /*-------------------------------------------------------*/
    for(i = 0; i<NUM_SCOM_OBJS_IN; i++) {
	    objSCOMInToProc[i][0] = SCOM_create("INTOPROC", NULL);
	    objSCOMInToProc[i][1] = SCOM_create("PROCTOIN", NULL);
	    
	}
	
    for(i = 0; i<NUM_SCOM_OBJS_OUT; i++) {
        objSCOMProcToOut[i][0] = SCOM_create("PROCTOOUT", NULL);
        objSCOMProcToOut[i][1] = SCOM_create("OUTTOIN", NULL);
	    
    }   
     
    for(i = 0 ; i < NUM_OF_CAPTURE_FRAMES; i++)
    {
  	
		YUV_buffer_for_capture[i][0] = 
					YUV_buffer_for_capture_all  +
					(i * ((DEMO_WIDTH * DEMO_HEIGHT * 3) /2)) ;
					
		YUV_buffer_for_capture[i][1] = 
					YUV_buffer_for_capture[i][0] +
					(DEMO_WIDTH * DEMO_HEIGHT) ;								
					 
		YUV_buffer_for_capture[i][2] = 
					YUV_buffer_for_capture[i][1] + 
					((DEMO_WIDTH * DEMO_HEIGHT)/4 );
	
   } 
   capfrnum = 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -