Dear Experts,
I wish some expert would answer my question this time. I have wanted for long time. but still no answer at all. I try to express my question clearly.
I have jm decoder to port into DSP side. Since the malloc() and calloc() are not supported on DSP, also i tried MEM_alloc() and so on. They are not functionally. I do not know why too many SPRU guide just gives misleading for that ? (I may not be correct, but the guide needs give more about environment and examples.) So I have to try like the following:
I suppose to put configuration and memory initialization on app side (ARM) in order to avoid too many melloc() inside DSP side:
but, it is unsuccessful, Here is example: I have structure and configuration file like the following:
typedef struct VIDDECCOPY_TI_Obj {
IALG_Obj alg; /* MUST be first field of all XDAS algs */
int intra_profile_deblocking; //!< Loop filter usage determined by flags and parameters in bitstream
int iDecFrmNum;
int conceal_mode;
int ref_poc_gap;
int poc_gap;
unsigned int maxHeight;
unsigned int maxWidth;
DecoderParams *p_Dec;
InputParameters *inParams;
} VIDDECCOPY_TI_Obj;
XDAS_Void Configure(InputParameters *p_Inp)
{
memset(p_Inp, 0, sizeof(InputParameters));
p_Inp->FileFormat = PAR_OF_ANNEXB;
p_Inp->ref_offset=0;
p_Inp->poc_scale=2;
p_Inp->silent = FALSE;
p_Inp->intra_profile_deblocking = 0;
p_Inp->iDecFrmNum = 3;//dave
p_Inp->write_uv=1;
// picture error concealment
p_Inp->conceal_mode = 0;
p_Inp->ref_poc_gap = 2;
}
So, I did like this: put the followings inside "Void encode_decode(VIDDEC_Handle dec, FILE *in, FILE *out)", (this function is located inside ./apps/video_copy.c)
VIDDECCOPY_TI_Obj *jmdec = (Void *) dec;
Configure(jmdec->inParams);
and then keep others the same as the original codec engine, I just do memcpy like the example from codec engine, which means it never related "jmdec" defined above.
But, the result is not correct from memcpy().
My question:
1.
If it is not allowed to set up any value for the codec handler (like "dec" above), how can I use the handler to pass some associated values into DSP side?
2.
&decInArgs, &decOutArgs are for this purpose? how to do so?
3.
The main question is that, how can I make those "malloc()" inside jm code work in Code engine DSP side. example is appreciated.
Best regards
David