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

📄 diff_ti_ialg.c

📁 本程序可以完成视频图像的运动目标的检测!它是在CCS上调试通过后
💻 C
字号:
/*
 *  Copyright 2002 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.
 *  
 */
/*
 *  ======== diff_ti_ialg.c ========
 *  Implementation of the DIFF_TI.h interface; TI's implementation 
 *  of the IDIFF interface. 
 */
#pragma CODE_SECTION(DIFF_TI_alloc, ".text:algAlloc")
#pragma CODE_SECTION(DIFF_TI_free, ".text:algFree")
#pragma CODE_SECTION(DIFF_TI_initObj, ".text:algInit")
#pragma CODE_SECTION(DIFF_TI_numAlloc, ".text:algNumAlloc")
 
#include <std.h>

#include "idiff.h"
#include "diff_ti.h"
#include "diff_ti_priv.h"

#define OBJECT  0
#define NUMBUFS 1


/*
 *  ======== DIFF_TI_alloc ========
 *  Return a table of memory descriptors that describe the memory needed 
 *  to construct a DIFF_TI_Obj structure.
 */
Int DIFF_TI_alloc(const IALG_Params *diffParams, IALG_Fxns **fxns, 
                    IALG_MemRec memTab[])
{
    const IDIFF_Params *params = (Void *)diffParams;
    
    if (params == NULL) 
    {
        params = &IDIFF_PARAMS;       /* set default parameters */
    }

    /* Request memory for DIFF object */
    memTab[OBJECT].size       = sizeof(DIFF_TI_Obj);
    memTab[OBJECT].alignment  = 4;
    memTab[OBJECT].space      = IALG_EXTERNAL;
    memTab[OBJECT].attrs      = IALG_PERSIST;
           
    return (NUMBUFS);
}

/*
 *  ======== DIFF_TI_free ========
 *  Return a table of memory pointers that should be freed.  Note
 *  that this should include *all* memory requested in the 
 *  DIFF_TI_alloc operation above.
 */
Int DIFF_TI_free(IALG_Handle handle, IALG_MemRec memTab[])
{
    DIFF_TI_Obj *diff = (Void *)handle;
    
    DIFF_TI_alloc(NULL, NULL, memTab);
      
    memTab[OBJECT].base = diff;
     
    return (NUMBUFS);
}

/*  ======== DIFF_TI_initObj ========
 *  Initialize the memory allocated for our instance.
 */
Int DIFF_TI_initObj(IALG_Handle handle, const IALG_MemRec memTab[], 
                      IALG_Handle p, const IALG_Params *diffParams)
{
//    DIFF_TI_Obj *diff = (Void *)handle;
    const IDIFF_Params *params = (Void *)diffParams;

    if (params == NULL) 
    {
        params = &IDIFF_PARAMS;  /* set default parameters */
    }
	
    return (IALG_EOK);
}

/*  ======== DIFF_TI_numAlloc ========
 *  Returns the number of records needed for the MEM tab by the client.
 */
Int DIFF_TI_numAlloc()
{
    return(NUMBUFS);
}


⌨️ 快捷键说明

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