asasdasd
工具链是指的Linux下对程序的编译环境。在这里通过codec_engine_1_02\examples\codecs 下的videnc_copy工程封装CCS下调试好的程序并生成videnc_copy.a64P,再通过codec_engine_1_02\examples\servers\video_copy工程把videnc_copy.a64P封装成all.x64P。最后通过encodedecode工程调用all.x64P。
步骤如下:
1、把ccs下编写好的文件复制到Linux codec_engine_1_02\examples\codecs 下的videnc_copy工程中。
2、修改该工程中的package.bld文件,修改var SRCS = ["videnc_copy","blob","cornerdetection","him","imc","morph","objectrecognition"]; 中括号里只选择工程下的C文件。修改该文件中的
for (var i = 0; i <1 /*Build.targets.length*/; i++) { 选择DSP端只用cgtool来编译。
3、修改codec_engine_1_02\examples下的user.bld,把linux86注掉,选择用C64P,跟第二步中对应。
<!--[if !supportLists]--><!--[endif]--><!--[endif]-->
修改server/all.tcf
var mem_ext = [
{
comment: "DDRALGHEAP: off-chip memory for dynamic algmem allocation",
name: "DDRALGHEAP",
base: 0x88000000, // 128MB
len: 0x07A00000, // 122MB
space: "code/data"
},
{
comment: "DDR: off-chip memory for application code and data",
name: "DDR",
base: 0x8FA00000, // 250MB
len: 0x00400000, // 4MB
space: "code/data"
},
{
comment: "DSPLINK: off-chip memory reserved for DSPLINK code and data",
name: "DSPLINKMEM",
base: 0x8FE00000, // 254MB
len: 0x00100000, // 1MB
space: "code/data"
},
{
comment: "RESET_VECTOR: off-chip memory for the reset vector table",
name: "RESET_VECTOR",
base: 0x8FF00000,
len: 0x00000080,
space: "code/data"
},
];
修改为:
var mem_ext = [
{
comment: "DDRALGHEAP: off-chip memory for dynamic algmem allocation",
name: "DDRALGHEAP",
base: 0x88000000, // 128MB
len: 0x07400000, // 122MB
space: "code/data"
},
{
comment: "DDR: off-chip memory for application code and data",
name: "DDR",
base: 0x8F400000, // 250MB
len: 0x00A00000, // 4MB
space: "code/data"
},
{
comment: "DSPLINK: off-chip memory reserved for DSPLINK code and data",
name: "DSPLINKMEM",
base: 0x8FE00000, // 254MB
len: 0x00100000, // 1MB
space: "code/data"
},
{
comment: "RESET_VECTOR: off-chip memory for the reset vector table",
name: "RESET_VECTOR",
base: 0x8FF00000,
len: 0x00000080,
space: "code/data"
},
];
5、修改loadmodules.sh:void ObjectRecognition(unsigned char* inbuf, int* flag,unsigned char* outbuf, int* kind, float *inIM)。其中输入输出参数是由
XDAS_Int32 VIDENCCOPY_TI_process(IVIDENC_Handle h, XDM_BufDesc *inBufs,XDM_BufDesc *outBufs, IVIDENC_InArgs *inArgs, IVIDENC_OutArgs *outArgs)决定。由于输入输出参数由IVIDENC_InArgs,IVIDENC_OutArgs结构体来决定,所以为了增加输出输入参数,应该修改这两个结构体。为此修改xdais_5_00\packages\ti\xdais\dm中的ividdec.h文件。添加kind和IM[25]。
typedef struct IVIDENC_OutArgs {
XDAS_Int32 size; XDAS_Int32 extendedError;
XDAS_Int32 bytesGenerated;
XDAS_Int32 encodedFrameType;
XDAS_Int32 inputFrameSkip;
XDAS_Int32 kind; /*what's kind of the target*/
float IM[25]; /*return value*/
IVIDEO_BufDesc reconBufs; /**< Reconstruction Frames. */
} IVIDENC_OutArgs;
为了区分输入帧存的性质(从jpeg读取的数据还是ccd采集的数据)增加一个flag作为标志。
typedef struct IVIDENC_InArgs {
XDAS_Int32 size;
XDAS_Int32 flag;//is picture saved on U or captured from CCD
} IVIDENC_InArgs;static String decoderName = "viddec_copy";
static String encoderName = "videnc_copy";
static String engineName = "video_copy";
hDecode = VIDDEC_create(hEngine, decoderName, ¶ms);
hEncode = VIDENC_create(hEngine, encoderName, ¶ms);
在工程里用到的是hEncode。
修改status = VIDENC_process(hEncode, &inBufDesc,&outBufDesc,&inArgs, &outArgs);<!--[endif]-->的输入输出参数,使之符合封装算法是的函数参数。
发表于 @ 2009年05月22日 23:02:00 | 评论( loading... ) | 举报| 收藏