1. Add parentheses in int
Cv_inline int cvround (double value)
{
Return (INT) (floor (Value + 0.5 ));
}
Cv_inline int cvfloor (double value)
{
Return (INT) (floor (value ));
}
Cv_inline int cvceil (double value)
{
Return (INT) (Ceil (value ));
}
It may be a problem with the compiler, (INT)
2. Remove 32
Cv_inline void * cvalignptr (const void * PTR, int align )//
{
Assert (Align & (align-1) = 0 );
Return (void *) (size_t) PTR + align-1 )&~ (Size_t) (align-1 ));
}
3. Size assignment
Cv_inline cvsize cvgetmatsize (const cvmat * mat)
{
// Cvsize size = {mat-> width, mat-> height };
Cvsize size;
Size. width = mat-> Cols;
Size. Height = mat-> rows;
Return size;
}
4. Remove repeated declarations
/Opt/dm3730/dvsdk/codec-engine_2_26_02_11/examples/Ti/SDO/CE/examples/codecs/videnc_copy/EMCV/cxcore/cxmisc. h: 724: Error: redefinition of typedef 'cvfunc2dnc _ 1a1p'
# If 0
Typedef cvstatus (cv_stdcall * cvfunc2dnc_1a1p) (void * arr, int step, cvsize size,
Int CN, int COI, void * PARAM );
# Endif
Typedef cvstatus (cv_stdcall * cvfunc2dnc_1a1p) (void * arr, int step, cvsize size,
Int CN, int COI, void * PARAM );
# If 0
Typedef cvstatus (cv_stdcall * cvfunc2dnc_2a1p) (void * arr0, int step0,
Void * arr1, int Step1,
Cvsize size, int CN,
Int COI, void * PARAM );
# Endif
Typedef cvstatus (cv_stdcall * cvfunc2dnc_2a1p) (void * arr0, int step0,
Void * arr1, int Step1,
Cvsize size, int CN,
Int COI, void * PARAM );
5. Remove the assembler functions of some DSP Libraries
EMCV/cV/cvmorph. cpp: 48: Error: Expected ',' or '... 'before' in _ data'
EMCV/cV/cvmorph. cpp: In function 'void icverode_8uc1 (const unsigned char *)':
EMCV/cV/cvmorph. cpp: 60: Error: 'mask' was not declared in this scope
EMCV/cV/cvmorph. cpp: 74: Error: 'cols' was not declared in this scope
EMCV/cV/cvmorph. cpp: 77: Error: 'In _ data' was not declared in this scope
EMCV/cV/cvmorph. cpp: 77: Error: '_ mem4_const' was not declared in this scope
EMCV/cV/cvmorph. cpp: 78: Error: 'step' was not declared in this scope
EMCV/cV/cvmorph. cpp: 86: Error: '_ minu4' was not declared in this scope
EMCV/cV/cvmorph. cpp: 95: Error: 'Out _ data' was not declared in this scope
EMCV/cV/cvmorph. cpp: at global scope:
EMCV/cV/cvmorph. cpp: 102: Error: Expected ',' or '... 'before' in _ data'
EMCV/cV/cvmorph. cpp: In function 'void icvdilate_8uc1 (const unsigned char *)':
EMCV/cV/cvmorph. cpp: 114: Error: 'mask' was not declared in this scope
EMCV/cV/cvmorph. cpp: 128: Error: 'cols' was not declared in this scope
EMCV/cV/cvmorph. cpp: 131: Error: 'In _ data' was not declared in this scope
EMCV/cV/cvmorph. cpp: 131: Error: '_ mem4_const' was not declared in this scope
EMCV/cV/cvmorph. cpp: 132: Error: 'step' was not declared in this scope
EMCV/cV/cvmorph. cpp: 140: Error: '_ maxu4' was not declared in this scope
EMCV/cV/cvmorph. cpp: 149: Error: 'Out _ data' was not declared in this scope
EMCV/cV/cvmorph. cpp: In function 'void icvmorphop (const void *, void *, iplconvkernel *, Int, INT )':
EMCV/cV/cvmorph. cpp: 53: Error: Too extends arguments to function 'void icverode_8uc1 (const unsigned char *)'
EMCV/cV/cvmorph. cpp: 247: Error: At this point in file
EMCV/cV/cvmorph. cpp: 107: Error: Too extends arguments to function 'void icvdilate_8uc1 (const unsigned char *)'
EMCV/cV/cvmorph. cpp: 266: Error: At this point in file
Void icverode_8uc1
(
Const unsigned char * restrict in_data,
Unsigned char * restrict out_data,
Const char * restrict mask,
Int cols,
Int step
)
Remove restrict. Isn't this a standard C library? Why not? I am using ARM-Arago-Linux-gnueabi-Compilation
P0 = (_ mem4_const (& in_data [I]);
P3 = (_ mem4_const (& in_data [I + step]);
P6 = (_ mem4_const (& in_data [I + step * 2]);
P1 = P0> 8; P2 = P0> 16;
P4 = P3> 8; P5 = P3> 16;
P7 = P6> 8; P8 = P6> 16;
Result = P4 & 0 xFFFF;
Result = M0? _ Minu4 (result, P0): result;
Result = m1? _ Minu4 (result, P1): result;
Result = m2? _ Minu4 (result, P2): result;
Result = m3? _ Minu4 (result, P3): result;
Result = M5? _ Minu4 (result, P5): result;
Result = M6? _ Minu4 (result, p6): result;
Result = M7? _ Minu4 (result, P7): result;
Result = M8? _ Minu4 (result, P8): result;
Modify the above and use C. I don't know if the logic is correct and need to be verified.
For (I = 0; I <Cols-2; I + = 2)
{
P0 = (in_data [I]);
P3 = (in_data [I + step]);
P6 = (in_data [I + step * 2]);
P1 = P0> 8; P2 = P0> 16;
P4 = P3> 8; P5 = P3> 16;
P7 = P6> 8; P8 = P6> 16;
Result = P4 & 0 xFFFF;
Result = M0? Min (result, P0): result;
Result = m1? Min (result, P1): result;
Result = m2? Min (result, P2): result;
Result = m3? Min (result, P3): result;
Result = M5? Min (result, P5): result;
Result = M6? Min (result, p6): result;
Result = M7? Min (result, P7): result;
Result = M8? Min (result, P8): result;
Also:
For (I = 0; I <Cols-2; I + = 2)
{
P0 = (in_data [I]);
P3 = (in_data [I + step]);
P6 = (in_data [I + step * 2]);
P1 = P0> 8; P2 = P0> 16;
P4 = P3> 8; P5 = P3> 16;
P7 = P6> 8; P8 = P6> 16;
Result = P4 & 0 xFFFF;
Result = M0? Max (result, P0): result;
Result = m1? Max (result, P1): result;
Result = m2? Max (result, P2): result;
Result = m3? Max (result, P3): result;
Result = M5? Max (result, P5): result;
Result = M6? Max (result, p6): result;
Result = M7? Max (result, P7): result;
Result = M8? Max (result, P8): result;
Out_data [I] = (Result & 0xff );
Out_data [I + 1] = (result> 8 & 0xff );
After the above, CV-related files can be compiled in codec Engine