OpenCV中文网站

 找回密码
 立即注册
搜索
热搜: 安装 配置
查看: 8336|回复: 4

在ccs下调用emcv,编译,头文件出错

[复制链接]
发表于 2010-1-29 12:11:12 | 显示全部楼层 |阅读模式
我用的是DM6446,videnc_copy.c是算法部分的主程序,运行在DSP端。外设管理是ARM端负责,不在这个程序里面。
下面是编译结果:
  1. [videnc_copy.c] "C:\CCStudio_v3.3\C6000\cgtools\bin\cl6x" -g -fr"C:/CCStudio_v3.3/MyProjects/canny_emcv/Debug" -d"_DEBUG" -mv6400 -@"Debug.lkf" "videnc_copy.c"
  2. "gt.h", line 75: error: expected a type specifier
  3. "gt.h", line 75: error: function returning function is not allowed
  4. "gt.h", line 84: error: identifier "GT_TimeFxn" is undefined
  5. "gt.h", line 108: error: identifier "UInt8" is undefined
  6. "gt.h", line 192: error: function returning function is not allowed
  7. "gt.h", line 256: error: identifier "UInt8" is undefined
  8. "videnc_copy.c", line 229: error: identifier "UInt8" is undefined
  9. "videnc_copy.c", line 229: error: expected a ")"
  10. "videnc_copy.c", line 229: error: expected a ")"
  11. "videnc_copy.c", line 236: error: identifier "UInt8" is undefined
  12. "videnc_copy.c", line 236: error: expected a ")"
  13. "videnc_copy.c", line 236: error: expected a ")"
  14. "videnc_copy.c", line 250: error: identifier "UInt8" is undefined
  15. "videnc_copy.c", line 250: error: expected a ")"
  16. "videnc_copy.c", line 250: error: expected a ")"
  17. "videnc_copy.c", line 289: error: identifier "UInt8" is undefined
  18. "videnc_copy.c", line 289: error: expected a ")"
  19. "videnc_copy.c", line 289: error: expected a ")"
  20. "videnc_copy.c", line 331: error: identifier "UInt8" is undefined
  21. "videnc_copy.c", line 331: error: expected a ")"
  22. "videnc_copy.c", line 331: error: expected a ")"
  23. "videnc_copy.c", line 365: error: identifier "UInt8" is undefined
  24. "videnc_copy.c", line 365: error: expected a ")"
  25. "videnc_copy.c", line 365: error: expected a ")"
  26. "videnc_copy.c", line 372: error: expected a ")"
  27. "videnc_copy.c", line 372: error: expected a ")"
  28. "videnc_copy.c", line 444: error: expected a ")"
  29. "videnc_copy.c", line 444: error: expected a ")"
  30. "videnc_copy.c", line 474: error: identifier "UInt8" is undefined
  31. "videnc_copy.c", line 474: error: expected a ")"
  32. "videnc_copy.c", line 474: error: expected a ")"
  33. "videnc_copy.c", line 481: error: expected a ")"
  34. "videnc_copy.c", line 481: error: expected a ")"
  35. 33 errors detected in the compilation of "videnc_copy.c".
  36. >> Compilation failure
  37. Compile Complete,
  38.   33 Errors, 0 Warnings, 0 Remarks.
复制代码

将videnc_copy.c改成videnc_copy.cpp后,编译
  1. [videnc_copy.cpp] "C:\CCStudio_v3.3\C6000\cgtools\bin\cl6x" -g -fr"C:/CCStudio_v3.3/MyProjects/canny_emcv/Debug" -d"_DEBUG" -mv6400 -@"Debug.lkf" "videnc_copy.cpp"
  2. "gt.h", line 75: warning: omission of explicit type is nonstandard ("int" assumed)
  3. "gt.h", line 75: error: type "UInt32" may not be initialized
  4. "gt.h", line 75: error: identifier "GT_TimeFxn" is undefined
  5. "gt.h", line 75: error: expected a ";"
  6. "gt.h", line 84: error: "GT_TimeFxn" is not a type name
  7. "gt.h", line 108: error: identifier "UInt8" is undefined
  8. "gt.h", line 256: error: identifier "UInt8" is undefined
  9. "videnc_copy.cpp", line 63: error: a value of type "void (*)(IALG_Handle)" cannot be used to initialize an entity of type "void (*)(IALG_Handle) C"
  10. "videnc_copy.cpp", line 63: error: a value of type "Int (*)(const IALG_Params *, IALG_Fxns **, IALG_MemRec *)" cannot be used to initialize an entity of type "Int (*)(const IALG_Params *, IALG_Fxns **, IALG_MemRec *) C"
  11. "videnc_copy.cpp", line 63: error: a value of type "void (*)(IALG_Handle)" cannot be used to initialize an entity of type "void (*)(IALG_Handle) C"
  12. "videnc_copy.cpp", line 63: error: a value of type "Int (*)(IALG_Handle, IALG_MemRec *)" cannot be used to initialize an entity of type "Int (*)(IALG_Handle, IALG_MemRec *) C"
  13. "videnc_copy.cpp", line 63: error: a value of type "Int (*)(IALG_Handle, const IALG_MemRec *, IALG_Handle, const IALG_Params *)" cannot be used to initialize an entity of type "Int (*)(IALG_Handle, const IALG_MemRec *, IALG_Handle, const IALG_Params *) C"
  14. "videnc_copy.cpp", line 79: error: a value of type "XDAS_Int32 (*)(IVIDENC_Handle, XDM_BufDesc *, XDM_BufDesc *, IVIDENC_InArgs *, IVIDENC_OutArgs *)" cannot be used to initialize an entity of type "XDAS_Int32 (*)(IVIDENC_Handle, XDM_BufDesc *, XDM_BufDesc *, IVIDENC_InArgs *, IVIDENC_OutArgs *) C"
  15. "videnc_copy.cpp", line 80: error: a value of type "XDAS_Int32 (*)(IVIDENC_Handle, IVIDENC_Cmd, IVIDENC_DynamicParams *, IVIDENC_Status *)" cannot be used to initialize an entity of type "XDAS_Int32 (*)(IVIDENC_Handle, IVIDENC_Cmd, IVIDENC_DynamicParams *, IVIDENC_Status *) C"
  16. "videnc_copy.cpp", line 229: error: identifier "UInt8" is undefined
  17. "videnc_copy.cpp", line 229: error: expected a ")"
  18. "videnc_copy.cpp", line 229: error: expected a ")"
  19. "videnc_copy.cpp", line 236: error: identifier "UInt8" is undefined
  20. "videnc_copy.cpp", line 236: error: expected a ")"
  21. "videnc_copy.cpp", line 236: error: expected a ")"
  22. "videnc_copy.cpp", line 250: error: identifier "UInt8" is undefined
  23. "videnc_copy.cpp", line 250: error: expected a ")"
  24. "videnc_copy.cpp", line 250: error: expected a ")"
  25. "videnc_copy.cpp", line 289: error: identifier "UInt8" is undefined
  26. "videnc_copy.cpp", line 289: error: expected a ")"
  27. "videnc_copy.cpp", line 289: error: expected a ")"
  28. "videnc_copy.cpp", line 331: error: identifier "UInt8" is undefined
  29. "videnc_copy.cpp", line 331: error: expected a ")"
  30. "videnc_copy.cpp", line 331: error: expected a ")"
  31. "videnc_copy.cpp", line 338: error: a value of type "void *" cannot be assigned to an entity of type "XDAS_UInt8 *"
  32. "videnc_copy.cpp", line 339: error: a value of type "void *" cannot be assigned to an entity of type "XDAS_UInt8 *"
  33. "videnc_copy.cpp", line 340: error: a value of type "void *" cannot be assigned to an entity of type "XDAS_UInt8 *"
  34. "videnc_copy.cpp", line 341: error: a value of type "void *" cannot be assigned to an entity of type "XDAS_UInt8 *"
  35. "videnc_copy.cpp", line 365: error: identifier "UInt8" is undefined
  36. "videnc_copy.cpp", line 365: error: expected a ")"
  37. "videnc_copy.cpp", line 365: error: expected a ")"
  38. "videnc_copy.cpp", line 372: error: expected a ")"
  39. "videnc_copy.cpp", line 372: error: expected a ")"
  40. "videnc_copy.cpp", line 444: error: expected a ")"
  41. "videnc_copy.cpp", line 444: error: expected a ")"
  42. "videnc_copy.cpp", line 474: error: identifier "UInt8" is undefined
  43. "videnc_copy.cpp", line 474: error: expected a ")"
  44. "videnc_copy.cpp", line 474: error: expected a ")"
  45. "videnc_copy.cpp", line 481: error: expected a ")"
  46. "videnc_copy.cpp", line 481: error: expected a ")"
  47. 44 errors detected in the compilation of "videnc_copy.cpp".
  48. >> Compilation failure
  49. Compile Complete,
  50.   44 Errors, 1 Warnings, 0 Remarks.
复制代码

除了在编译videnc_copy.c时出现的错误,还多了一些这种
a value of type "void (*)(IALG_Handle)" cannot be used to initialize an entity of type "void (*)(IALG_Handle) C"
错误,上网搜过,没有什么解决方案。
gt.h是我从Linux里拷过来的,路径是
/home/davinci/dvevm_1_20/codec_engine_1_10_01/packages/ti/sdo/ce/trace/gt.h
我看到下面这个帖子说要在Windows下安装dvsdk,然后将路径加到CCS里
<!-- l --><a class="postlink-local" href="http://www.opencv.org.cn/forum/viewtopic.php?f=9&t=7937&p=35292&hilit=%E5%AD%A6%E7%94%A8emcv#p35292">viewtopic.php?f=9&t=7937&p=35292&hilit=%E5%AD%A6%E7%94%A8emcv#p35292</a><!-- l -->
我试过了,在Linux下的dvsdk的安装文件(bin文件),没法安装在Windows,提示文件损坏或与2Windows不兼容。我不知道是不是因为我没有安装dvsdk,所以导致从dvsdk里拷过来的头文件gt.h在编译时出错。
请各位老师同学指点一下。
下面是videnc_copy.c的代码
  1. /*
  2. *  Copyright 2007
  3. *  Texas Instruments Incorporated
  4. *
  5. *  All rights reserved.  Property of Texas Instruments Incorporated
  6. *  Restricted rights to use, duplicate or disclose this code are
  7. *  granted through contract.
  8. *
  9. */
  10. /*
  11. *  ======== videnc_copy.c ========
  12. *  Video Encoder &quot;copy&quot; algorithm.
  13. *
  14. *  This file contains an implementation of the IALG interface
  15. *  required by XDAS.
  16. */
  17. //#include <xdc/std.h>
  18. #include <std.h>
  19. #include <string.h>
  20. //#include <ti/xdais/dm/ividenc.h>
  21. #include &quot;ividenc.h&quot;
  22. //#include <ti/sdo/ce/trace/gt.h>
  23. #include &quot;gt.h&quot;
  24. #include &quot;videnc_copy_ti.h&quot;
  25. #include &quot;videnc_copy_ti_priv.h&quot;
  26. /*emcv lib */
  27. //#include &quot;cv.hpp&quot;
  28. /* buffer definitions */
  29. #define MININBUFS       1
  30. #define MINOUTBUFS      1
  31. #define MININBUFSIZE    1
  32. #define MINOUTBUFSIZE   1
  33. //extern void vidprocess(XDAS_Int8* in,XDAS_Int8* out,XDAS_UInt32 minSamples);
  34. extern IALG_Fxns VIDENCCOPY_TI_IALG;
  35. #define IALGFXNS  \
  36.     &VIDENCCOPY_TI_IALG,        /* module ID */                         \
  37.     VIDENCCOPY_TI_activate, /* activate*/                         \
  38.     VIDENCCOPY_TI_alloc,     /* alloc8*/                           \
  39.     NULL,                       /* control (NULL => no control ops) */  \
  40.     VIDENCCOPY_TI_deactivate,/* deactivate*/                      \
  41.     VIDENCCOPY_TI_free,    /* free */                              \
  42.     VIDENCCOPY_TI_initObj,   /* init*/                             \
  43.     NULL,                       /* moved */                             \
  44.     NULL                        /* numAlloc (NULL => IALG_MAXMEMRECS) */
  45. /*
  46. *  ======== VIDENCCOPY_TI_IVIDENC ========
  47. *  This structure defines TI's implementation of the IVIDENC interface
  48. *  for the VIDENCCOPY_TI module.
  49. */
  50. IVIDENC_Fxns VIDENCCOPY_TI_VIDENCCOPY = {    /* module_vendor_interface */
  51.    {IALGFXNS},
  52.      
  53. // {
  54. //   &VIDENCCOPY_TI_IALG,      /* module ID */                         \
  55. //   VIDENCCOPY_TI_activate,                        \
  56. //   VIDENCCOPY_TI_alloc,                                  \
  57. //    NULL,                      /* control (NULL => no control ops) */  \
  58. //   VIDENCCOPY_TI_deactivate,                           \
  59. //   VIDENCCOPY_TI_free,                                     \
  60. //   VIDENCCOPY_TI_initObj,                                   \
  61. //   NULL,                       /* moved */                             \
  62. //   NULL                       /* numAlloc (NULL => IALG_MAXMEMRECS) */
  63. //  },*/
  64. /*    (XDAS_Int32 *) VIDENCCOPY_TI_process(IVIDENC_Handle h, XDM_BufDesc *inBufs, XDM_BufDesc *outBufs, IVIDENC_InArgs *inArgs, IVIDENC_OutArgs *outArgs), (void *)(int *)
  65.     (XDAS_Int32 *) VIDENCCOPY_TI_control(IVIDENC_Handle handle, IVIDENC_Cmd id, IVIDENC_DynamicParams *params, IVIDENC_Status *status),*/
  66.     VIDENCCOPY_TI_process,
  67.     VIDENCCOPY_TI_control
  68. };
  69. typedef struct RECT
  70. {
  71.         XDAS_UInt16 top;
  72.         XDAS_UInt16 bottom;
  73.         XDAS_UInt16 left;
  74.         XDAS_UInt16 right;
  75. }Rect;
  76. XDAS_Int16 width;
  77. XDAS_Int16 height;
  78. XDAS_UInt8* pBkImg = NULL;
  79. XDAS_UInt8* pFrImg = NULL;
  80. XDAS_UInt8* pFrameImg = NULL;
  81. XDAS_UInt8* pFrameTmp = NULL;
  82. XDAS_UInt8 rectCount=0;
  83. Rect rect&#91;20&#93;;        //max numble of rects is 20
  84. /*
  85. *  ======== VIDENC_TI_IALG ========
  86. *  This structure defines TI's implementation of the IALG interface
  87. *  for the VIDENCCOPY_TI module.
  88. */
  89. #ifdef _TI_
  90. /* satisfy xDAIS symbol requirement without any overhead */
  91. asm(&quot;_VIDENCCOPY_TI_IALG .set _VIDENCCOPY_TI_VIDENCCOPY&quot;);
  92. #else
  93. /*
  94. *  We duplicate the structure here to allow this code to be compiled and
  95. *  run non-DSP platforms at the expense of unnecessary data space
  96. *  consumed by the definition below.
  97. */
  98. IALG_Fxns VIDENCCOPY_TI_IALG = {      /* module_vendor_interface */
  99.    IALGFXNS
  100. };
  101. #endif
  102. /* tracing information */
  103. #define GTNAME &quot;codecs.videnc_copy&quot;
  104. static GT_Mask curTrace = {NULL,NULL};
  105. #ifdef USE_ACPY3
  106. /* Implementation of IDMA3 interface functions & IDMA3_Fxns vtable */
  107. #include <ti/bios/include/std.h>
  108. #include <ti/xdais/idma3.h>
  109. #include <ti/sdo/fc/acpy3/acpy3.h>
  110. #define NUM_LOGICAL_CH 1
  111. /*
  112. *  ======== VIDENCCOPY_TI_dmaChangeChannels ========
  113. *  Update instance object with new logical channel.
  114. */
  115. Void VIDENCCOPY_TI_dmaChangeChannels(IALG_Handle handle,
  116.     IDMA3_ChannelRec dmaTab&#91;&#93;)
  117. {
  118.     VIDENCCOPY_TI_Obj *videncObj = (Void *)handle;
  119.      //  VIDENCCOPY_TI_Obj *videncObj = (VIDENCCOPY_TI_Obj *)handle;
  120.     GT_2trace(curTrace, GT_ENTER,
  121.         &quot;VIDENCCOPY_TI_dmaChangeChannels(0x%x, 0x%x)\n&quot;, handle, dmaTab);
  122.     videncObj->dmaHandle1D1D8B = dmaTab&#91;0&#93;.handle;
  123. }
  124. /*
  125. *  ======== VIDENCCOPY_TI_dmaGetChannelCnt ========
  126. *  Return max number of logical channels requested.
  127. */
  128. Uns VIDENCCOPY_TI_dmaGetChannelCnt(Void)
  129. {
  130.     GT_0trace(curTrace, GT_ENTER, &quot;VIDENCCOPY_TI_dmaGetChannelCnt()\n&quot;);
  131.     return (NUM_LOGICAL_CH);
  132. }
  133. /*
  134. *  ======== VIDENCCOPY_TI_dmaGetChannels ========
  135. *  Declare DMA resource requirement/holdings.
  136. */
  137. Uns VIDENCCOPY_TI_dmaGetChannels(IALG_Handle handle, IDMA3_ChannelRec dmaTab&#91;&#93;)
  138. {
  139.     VIDENCCOPY_TI_Obj *videncObj = (Void *)handle;
  140.     //  VIDENCCOPY_TI_Obj *videncObj = (VIDENCCOPY_TI_Obj *)handle;
  141.     int i;
  142.     GT_2trace(curTrace, GT_ENTER,
  143.         &quot;VIDENCCOPY_TI_dmaGetChannels(0x%x, 0x%x)\n&quot;, handle, dmaTab);
  144.     /* Initial values on logical channels */
  145.     dmaTab&#91;0&#93;.handle = videncObj->dmaHandle1D1D8B;
  146.     dmaTab&#91;0&#93;.numTransfers = 1;
  147.     dmaTab&#91;0&#93;.numWaits = 1;
  148.     /*
  149.      * Request logical DMA channels for use with ACPY3
  150.      * AND with environment size obtained from ACPY3 implementation
  151.      * AND with low priority.
  152.      */
  153.     for (i=0; i<NUM_LOGICAL_CH; i++) {
  154.         dmaTab&#91;i&#93;.priority = IDMA3_PRIORITY_LOW;
  155.         dmaTab&#91;i&#93;.persistent = FALSE;
  156.         dmaTab&#91;i&#93;.protocol = &ACPY3_PROTOCOL;
  157.     }
  158.     return (NUM_LOGICAL_CH);
  159. }
  160. /*
  161. *  ======== VIDENCCOPY_TI_dmaInit ========
  162. *  Initialize instance object with granted logical channel.
  163. */
  164. Int VIDENCCOPY_TI_dmaInit(IALG_Handle handle, IDMA3_ChannelRec dmaTab&#91;&#93;)
  165. {
  166.     VIDENCCOPY_TI_Obj *videncObj = (Void *)handle;
  167.    //   VIDENCCOPY_TI_Obj *videncObj = (VIDENCCOPY_TI_Obj *)handle;
  168.     GT_2trace(curTrace, GT_ENTER, &quot;VIDENCCOPY_TI_dmaInit(0x%x, 0x%x)\n&quot;,
  169.         handle, dmaTab);
  170.     videncObj->dmaHandle1D1D8B = dmaTab&#91;0&#93;.handle;
  171.     return (IALG_EOK);
  172. }
  173. /*
  174. *  ======== VIDENCCOPY_TI_IDMA3 ========
  175. *  This structure defines TI's implementation of the IDMA3 interface
  176. *  for the VIDENCCOPY_TI module.
  177. */
  178. IDMA3_Fxns VIDENCCOPY_TI_IDMA3 = {      /* module_vendor_interface */
  179.     &VIDENCCOPY_TI_IALG,              /* IALG functions */
  180.     VIDENCCOPY_TI_dmaChangeChannels,  /* ChangeChannels */
  181.     VIDENCCOPY_TI_dmaGetChannelCnt,   /* GetChannelCnt */
  182.     VIDENCCOPY_TI_dmaGetChannels,     /* GetChannels */
  183.     VIDENCCOPY_TI_dmaInit             /* initialize logical channels */
  184. };
  185. #endif
  186. /*
  187. *  ======== VIDENCCOPY_TI_activate ========
  188. */
  189. Void VIDENCCOPY_TI_activate(IALG_Handle handle)
  190. {
  191.     GT_1trace(curTrace, GT_ENTER, &quot;VIDENCCOPY_TI_activate(0x%x)\n&quot;, handle);
  192. }
  193. /*
  194. *  ======== VIDENCCOPY_TI_deactivate ========
  195. */
  196. Void VIDENCCOPY_TI_deactivate(IALG_Handle handle)
  197. {
  198.     GT_1trace(curTrace, GT_ENTER, &quot;VIDENCCOPY_TI_deactivate(0x%x)\n&quot;, handle);
  199. }
  200. /*
  201. *  ======== VIDENCCOPY_TI_alloc ========
  202. */
  203. Int VIDENCCOPY_TI_alloc(const IALG_Params *algParams,
  204.     IALG_Fxns **pf, IALG_MemRec memTab&#91;&#93;)
  205. {
  206.         IVIDENC_Params* params=(IVIDENC_Params*)algParams;
  207.   if (curTrace.modName == NULL) {   /* initialize GT (tracing) */
  208.         GT_create(&curTrace, GTNAME);
  209.     }
  210.     GT_3trace(curTrace, GT_ENTER, &quot;VIDENCCOPY_TI_alloc(0x%x, 0x%x, 0x%x)\n&quot;,
  211.         algParams, pf, memTab);
  212.     /* Request memory for my object */
  213.     memTab&#91;0&#93;.size = sizeof(VIDENCCOPY_TI_Obj);
  214.     memTab&#91;0&#93;.alignment = 0;
  215.     memTab&#91;0&#93;.space = IALG_EXTERNAL;
  216.     memTab&#91;0&#93;.attrs = IALG_PERSIST;
  217.         if(params != NULL){
  218.                 memTab&#91;1&#93;.size = params->maxWidth*params->maxHeight;
  219.                 memTab&#91;1&#93;.alignment = 0;
  220.                 memTab&#91;1&#93;.space = IALG_EXTERNAL;
  221.                 memTab&#91;1&#93;.attrs = IALG_PERSIST;
  222.        
  223.                 memTab&#91;2&#93;.size = params->maxWidth*params->maxHeight;
  224.                 memTab&#91;2&#93;.alignment = 0;
  225.                 memTab&#91;2&#93;.space = IALG_EXTERNAL;
  226.                 memTab&#91;2&#93;.attrs = IALG_PERSIST;
  227.        
  228.                 memTab&#91;3&#93;.size = params->maxWidth*params->maxHeight;
  229.                 memTab&#91;3&#93;.alignment = 0;
  230.                 memTab&#91;3&#93;.space = IALG_EXTERNAL;
  231.                 memTab&#91;3&#93;.attrs = IALG_PERSIST;
  232.                
  233.                 memTab&#91;4&#93;.size = params->maxWidth*params->maxHeight;
  234.                 memTab&#91;4&#93;.alignment = 0;
  235.                 memTab&#91;4&#93;.space = IALG_EXTERNAL;
  236.                 memTab&#91;4&#93;.attrs = IALG_PERSIST;
  237.         }
  238.     return (5);
  239. //   return (1);
  240. }
  241. /*
  242. *  ======== VIDENCCOPY_TI_free ========
  243. */
  244. Int VIDENCCOPY_TI_free(IALG_Handle handle, IALG_MemRec memTab&#91;&#93;)
  245. {
  246.     GT_2trace(curTrace, GT_ENTER, &quot;VIDENCCOPY_TI_free(0x%lx, 0x%lx)\n&quot;,
  247.         handle, memTab);
  248.     VIDENCCOPY_TI_alloc(NULL, NULL, memTab);
  249.    
  250.     memTab&#91;1&#93;.size = width*height;
  251.         memTab&#91;1&#93;.alignment = 0;
  252.         memTab&#91;1&#93;.space = IALG_EXTERNAL;
  253.         memTab&#91;1&#93;.attrs = IALG_PERSIST;
  254.         memTab&#91;1&#93;.base = pBkImg;
  255.        
  256.         memTab&#91;2&#93;.size = width*height;
  257.         memTab&#91;2&#93;.alignment = 0;
  258.         memTab&#91;2&#93;.space = IALG_EXTERNAL;
  259.         memTab&#91;2&#93;.attrs = IALG_PERSIST;
  260.         memTab&#91;2&#93;.base = pFrImg;
  261.        
  262.         memTab&#91;3&#93;.size = width*height;
  263.         memTab&#91;3&#93;.alignment = 0;
  264.         memTab&#91;3&#93;.space = IALG_EXTERNAL;
  265.         memTab&#91;3&#93;.attrs = IALG_PERSIST;
  266.         memTab&#91;3&#93;.base = pFrameImg;
  267.        
  268.         memTab&#91;4&#93;.size = width*height;
  269.         memTab&#91;4&#93;.alignment = 0;
  270.         memTab&#91;4&#93;.space = IALG_EXTERNAL;
  271.         memTab&#91;4&#93;.attrs = IALG_PERSIST;
  272.         memTab&#91;4&#93;.base = pFrameTmp;
  273.        
  274.     return (5);
  275.     //return (1);
  276. }
  277. /*
  278. *  ======== VIDENCCOPY_TI_initObj ========
  279. */
  280. Int VIDENCCOPY_TI_initObj(IALG_Handle handle,
  281.     const IALG_MemRec memTab&#91;&#93;, IALG_Handle p,
  282.     const IALG_Params *algParams)
  283. {
  284.         IVIDENC_Params* videnc_params=(IVIDENC_Params*)algParams;
  285.        
  286.     GT_4trace(curTrace, GT_ENTER,
  287.         &quot;VIDENCCOPY_TI_initObj(0x%x, 0x%x, 0x%x, 0x%x)\n&quot;, handle, memTab,
  288.         p, algParams);
  289.         width=videnc_params->maxWidth;
  290.         height=videnc_params->maxHeight;
  291.        
  292.         pBkImg = memTab&#91;1&#93;.base;
  293.         pFrImg = memTab&#91;2&#93;.base;
  294.         pFrameImg = memTab&#91;3&#93;.base;
  295.         pFrameTmp = memTab&#91;4&#93;.base;
  296.        
  297.     return (IALG_EOK);
  298. }
  299. /*
  300. *  ======== VIDENCCOPY_TI_process ========
  301. */
  302. XDAS_Int32 VIDENCCOPY_TI_process(IVIDENC_Handle h, XDM_BufDesc *inBufs,
  303.     XDM_BufDesc *outBufs, IVIDENC_InArgs *inArgs, IVIDENC_OutArgs *outArgs)
  304. {
  305.     XDAS_Int32 curBuf;
  306.     XDAS_UInt32 minSamples;
  307. #ifdef USE_ACPY3
  308.     const Uint32 maxTransferChunkSize       = 0xffff;
  309.     Uint32       thisTransferChunkSize      = 0x0;
  310.     Uint32       remainingTransferChunkSize;
  311.     Uint32       thisTransferSrcAddr, thisTransferDstAddr;
  312.     ACPY3_Params params;
  313.     VIDENCCOPY_TI_Obj *videncObj = (VIDENCCOPY_TI_Obj *)h;
  314. #endif
  315.     GT_5trace(curTrace, GT_ENTER, &quot;VIDENCCOPY_TI_process(0x%x, 0x%x, 0x%x, &quot;
  316.         &quot;0x%x, 0x%x)\n&quot;, h, inBufs, outBufs, inArgs, outArgs);
  317.     /* validate arguments - this codec only supports &quot;base&quot; xDM. */
  318.     if ((inArgs->size != sizeof(*inArgs)) ||
  319.         (outArgs->size != sizeof(*outArgs))) {
  320.         GT_2trace(curTrace, GT_ENTER,
  321.             &quot;VIDENCCOPY_TI_process, unsupported size &quot;
  322.             &quot;(0x%x, 0x%x)\n&quot;, inArgs->size, outArgs->size);
  323.         return (IVIDENC_EFAIL);
  324.     }
  325. #ifdef USE_ACPY3
  326.     /*
  327.      * Activate Channel  scratch DMA channels.
  328.      */
  329.     ACPY3_activate(videncObj->dmaHandle1D1D8B);
  330. #endif
  331.     /* outArgs->bytesGenerated reports the total number of bytes generated */
  332.     outArgs->bytesGenerated = 0;
  333.     /*
  334.      * A couple constraints for this simple &quot;copy&quot; codec:
  335.      *    - Video encoding presumes a single input buffer, so only one input
  336.      *      buffer will be encoded, regardless of inBufs->numBufs.
  337.      *    - Given a different size of an input and output buffers, only
  338.      *      encode (i.e., copy) the lesser of the sizes.
  339.      */
  340.     for (curBuf = 0; (curBuf < inBufs->numBufs) &&
  341.         (curBuf < outBufs->numBufs); curBuf++) {
  342.         /* there's an available in and out buffer, how many samples? */
  343.         minSamples = inBufs->bufSizes&#91;curBuf&#93; < outBufs->bufSizes&#91;curBuf&#93; ?
  344.             inBufs->bufSizes&#91;curBuf&#93; : outBufs->bufSizes&#91;curBuf&#93;;
  345. #ifdef USE_ACPY3
  346.         thisTransferSrcAddr        = (Uint32)inBufs->bufs&#91;curBuf&#93;;
  347.         thisTransferDstAddr        = (Uint32)outBufs->bufs&#91;curBuf&#93;;
  348.         remainingTransferChunkSize = minSamples;
  349.         while (remainingTransferChunkSize > 0) {
  350.             if (remainingTransferChunkSize > maxTransferChunkSize) {
  351.                thisTransferChunkSize = maxTransferChunkSize;
  352.             }
  353.             else {
  354.                thisTransferChunkSize = remainingTransferChunkSize;
  355.             }
  356.             /* Configure the logical channel */
  357.             params.transferType = ACPY3_1D1D;
  358.             params.srcAddr      = (void *)thisTransferSrcAddr;
  359.             params.dstAddr      = (void *)thisTransferDstAddr;
  360.             params.elementSize  = thisTransferChunkSize;
  361.             params.numElements  = 1;
  362.             params.waitId       = 0;
  363.             params.numFrames    = 1;
  364.             remainingTransferChunkSize -= thisTransferChunkSize;
  365.             thisTransferSrcAddr += thisTransferChunkSize;
  366.             thisTransferDstAddr += thisTransferChunkSize;
  367.             /* Configure logical dma channel */
  368.             ACPY3_configure(videncObj->dmaHandle1D1D8B, &params, 0);
  369.             /* Use DMA to copy data */
  370.             ACPY3_start(videncObj->dmaHandle1D1D8B);
  371.             /* wait for transfer to finish  */
  372.             ACPY3_wait(videncObj->dmaHandle1D1D8B);
  373.         }
  374.        GT_1trace(curTrace, GT_2CLASS, &quot;VIDENCCOPY_TI_process> &quot;
  375.                &quot;ACPY3 Processed %d bytes.\n&quot;, minSamples);
  376. #else
  377.         GT_3trace(curTrace, GT_2CLASS, &quot;VIDENCCOPY_TI_process> &quot;
  378.                &quot;memcpy (0x%x, 0x%x, %d)\n&quot;,
  379.                outBufs->bufs&#91;curBuf&#93;, inBufs->bufs&#91;curBuf&#93;, minSamples);
  380.         /* process the data: read input, produce output */
  381.         //memcpy(outBufs->bufs&#91;curBuf&#93;, inBufs->bufs&#91;curBuf&#93;, minSamples);
  382.          // vidprocess(inBufs->bufs&#91;curBuf&#93;,outBufs->bufs&#91;curBuf&#93;,minSamples);
  383.         //yuvtorgb((XDAS_UInt8*)inBufs->bufs&#91;curBuf&#93;,(XDAS_UInt8*)outBufs->bufs&#91;curBuf&#93;);
  384. #endif
  385.         outArgs->bytesGenerated += minSamples;
  386.     }
  387.     /* Fill out the rest of the outArgs struct */
  388.     outArgs->extendedError = 0;
  389.     outArgs->encodedFrameType = 0;    /* TODO */
  390.     outArgs->inputFrameSkip = IVIDEO_FRAME_ENCODED;
  391.     outArgs->reconBufs.numBufs = 0;   /* important: indicate no reconBufs */
  392.     return (IVIDENC_EOK);
  393. }
  394. /*
  395. *  ======== VIDENCCOPY_TI_control ========
  396. */
  397. XDAS_Int32 VIDENCCOPY_TI_control(IVIDENC_Handle handle, IVIDENC_Cmd id,
  398.     IVIDENC_DynamicParams *params, IVIDENC_Status *status)
  399. {
  400.     XDAS_Int32 retVal;
  401.    GT_4trace(curTrace, GT_ENTER, &quot;VIDENCCOPY_TI_control(0x%x, 0x%x, 0x%x, &quot;
  402.         &quot;0x%x)\n&quot;, handle, id, params, status);
  403.     /* validate arguments - this codec only supports &quot;base&quot; xDM. */
  404.     if ((params->size != sizeof(*params)) ||
  405.         (status->size != sizeof(*status))) {
  406.         GT_2trace(curTrace, GT_ENTER,
  407.             &quot;VIDENCCOPY_TI_control, unsupported size &quot;
  408.             &quot;(0x%x, 0x%x)\n&quot;, params->size, status->size);
  409.         return (IVIDENC_EFAIL);
  410.     }
  411.     switch (id) {
  412.         case XDM_GETSTATUS:
  413.             status->extendedError = 0;
  414.             status->bufInfo.minNumInBufs = MININBUFS;
  415.             status->bufInfo.minNumOutBufs = MINOUTBUFS;
  416.             status->bufInfo.minInBufSize&#91;0&#93; = MININBUFSIZE;
  417.             status->bufInfo.minOutBufSize&#91;0&#93; = MINOUTBUFSIZE;
  418.             retVal = IVIDENC_EOK;
  419.             break;
  420.         default:
  421.             /* unsupported cmd */
  422.             retVal = IVIDENC_EFAIL;
  423.             break;
  424.     }
  425.     return (retVal);
  426. }
  427. /*
  428. *  @(#) codec_engine_1_10_01; 1,0,0,197; 4-20-2007 13:16:15; /db/atree/library/trees/ce-e10x/src/
  429. */
复制代码
回复

使用道具 举报

发表于 2010-1-29 12:44:56 | 显示全部楼层

在ccs下调用emcv,编译,头文件出错

从出错来看,看不出错误跟emcv有什么关系啊。
你编译环境没有配置好吧。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-1-29 14:56:30 | 显示全部楼层

在ccs下调用emcv,编译,头文件出错

从出错来看,看不出错误跟emcv有什么关系啊。
你编译环境没有配置好吧。
于老师,能不能说的详细一点,ccs3.3一般都配置那些东西?针对emcv需要哪些特殊配置?
回复 支持 反对

使用道具 举报

发表于 2010-7-20 14:07:17 | 显示全部楼层

在ccs下调用emcv,编译,头文件出错

在Linux下的dvsdk的安装文件(bin文件),没法安装在Windows

这个可以先在Linux上安装好,在把安装好的文件拷贝到Windows上来,最后拷贝到你的CCS安装目录下

然后再在dvsdk下进行程序编译

希望编译通过
回复 支持 反对

使用道具 举报

发表于 2011-5-10 15:12:26 | 显示全部楼层

在ccs下调用emcv,编译,头文件出错

楼上的方法,谁试过?灵吗?谢谢!!!!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|OpenCV中文网站

GMT+8, 2024-4-29 04:22 , Processed in 0.010363 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表