[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[321] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2012-11-10 13:05:31
|
Revision: 321 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=321&view=rev Author: nickols_k Date: 2012-11-10 13:05:23 +0000 (Sat, 10 Nov 2012) Log Message: ----------- replace #define with inline functions Modified Paths: -------------- mplayerxp/libvo/osd_template.c mplayerxp/postproc/dsp_accel.h mplayerxp/pvector/pvector.h mplayerxp/pvector/pvector_f32_x86.h mplayerxp/pvector/pvector_int_x86.h Modified: mplayerxp/libvo/osd_template.c =================================================================== --- mplayerxp/libvo/osd_template.c 2012-11-10 12:52:42 UTC (rev 320) +++ mplayerxp/libvo/osd_template.c 2012-11-10 13:05:23 UTC (rev 321) @@ -64,11 +64,11 @@ _ivec_prefetch(&src[x]); _ivec_prefetch(&srca[x]); /* MOVNTDQ: #GP(0) - If memory operand is not aligned on a 16-byte boundary */ - if(!IVEC_ALIGNED(dstbase)) + if(!_ivec_aligned(dstbase)) for(;x<w;x++){ unsigned char *dst=&dstbase[x]; if(srca[x]) *dst=((dstbase[x]*srca[x])>>8)+src[x]; - if(IVEC_ALIGNED(dst)) break; /* align on sizeof(MMREG) boundary */ + if(_ivec_aligned(dst)) break; /* align on sizeof(MMREG) boundary */ } if((w-x)>=__IVEC_SIZE) for(;x<w;x+=__IVEC_SIZE){ @@ -77,11 +77,11 @@ _ivec_prefetch(&src[x+__IVEC_SIZE*4]); _ivec_prefetch(&srca[x+__IVEC_SIZE*4]); vdest = _ivec_loada(&dstbase[x]); - if(IVEC_ALIGNED(&src[x])) + if(_ivec_aligned(&src[x])) vsrc = _ivec_loada(&src[x]); else vsrc = _ivec_loadu(&src[x]); - if(IVEC_ALIGNED(&srca[x])) + if(_ivec_aligned(&srca[x])) vsrca = _ivec_loada(&srca[x]); else vsrca = _ivec_loadu(&srca[x]); Modified: mplayerxp/postproc/dsp_accel.h =================================================================== --- mplayerxp/postproc/dsp_accel.h 2012-11-10 12:52:42 UTC (rev 320) +++ mplayerxp/postproc/dsp_accel.h 2012-11-10 13:05:23 UTC (rev 321) @@ -10,15 +10,15 @@ i = 0; #ifdef HAVE_INT_PVECTOR len_mm=len&(~(__IVEC_SIZE-1)); - if(!IVEC_ALIGNED(out_data)) + if(!_ivec_aligned(out_data)) for(;i<len;i++) { ((uint16_t*)out_data)[i]=((uint16_t)((const uint8_t*)in_data)[i])<<8; - if(IVEC_ALIGNED(out_data)) break; + if(_ivec_aligned(out_data)) break; } if((len_mm-i)>=__IVEC_SIZE) for(;i<len_mm;i+=__IVEC_SIZE){ __ivec ind,itmp[2]; - if(IVEC_ALIGNED(in_data)) + if(_ivec_aligned(in_data)) ind = _ivec_loada(&((const uint8_t *)in_data)[i]); else ind = _ivec_loadu(&((const uint8_t *)in_data)[i]); @@ -47,15 +47,15 @@ i = 0; #ifdef HAVE_INT_PVECTOR len_mm=len&(~(__IVEC_SIZE-1)); - if(!IVEC_ALIGNED(out_data)) + if(!_ivec_aligned(out_data)) for(;i<len;i++) { ((uint8_t*)out_data)[i]=(uint8_t)((((const uint16_t*)in_data)[i])>>8); - if(IVEC_ALIGNED(out_data)) break; + if(_ivec_aligned(out_data)) break; } if((len_mm-i)>=__IVEC_SIZE) for(;i<len_mm;i+=__IVEC_SIZE){ __ivec outd,itmp[2]; - if(IVEC_ALIGNED(in_data)) { + if(_ivec_aligned(in_data)) { itmp[0] = _ivec_loada(&((const uint16_t*)in_data)[i]); itmp[1] = _ivec_loada(&((const uint16_t*)in_data)[i+__IVEC_SIZE/2]); } @@ -85,16 +85,16 @@ i=0; #ifdef HAVE_INT_PVECTOR len_mm=len&(~(__IVEC_SIZE-1)); - if(!IVEC_ALIGNED(out_data)) + if(!_ivec_aligned(out_data)) for(;i<len;i++){ ((uint32_t*)out_data)[i]=((uint32_t)((const uint16_t*)in_data)[i])<<16; - if(IVEC_ALIGNED(out_data)) break; + if(_ivec_aligned(out_data)) break; } if((len_mm-i)>=__IVEC_SIZE) for(;i<len_mm;i+=__IVEC_SIZE) { __ivec ind,tmp[2]; - if(IVEC_ALIGNED(in_data)) + if(_ivec_aligned(in_data)) ind = _ivec_loada(&((const uint8_t *)in_data)[i]); else ind = _ivec_loadu(&((const uint8_t *)in_data)[i]); @@ -123,16 +123,16 @@ i=0; #ifdef HAVE_INT_PVECTOR len_mm=len&(~(__IVEC_SIZE-1)); - if(!IVEC_ALIGNED(out_data)) + if(!_ivec_aligned(out_data)) for(;i<len;i++){ ((uint16_t*)out_data)[i]=(uint16_t)((((const uint32_t*)in_data)[i])>>16); - if(IVEC_ALIGNED(out_data)) break; + if(_ivec_aligned(out_data)) break; } if((len_mm-i)>=__IVEC_SIZE) for(;i<len_mm;i+=__IVEC_SIZE) { __ivec ind[2],tmp; - if(IVEC_ALIGNED(in_data)) { + if(_ivec_aligned(in_data)) { ind[0]=_ivec_loada(&((const uint8_t *)in_data)[i*2]); ind[1]=_ivec_loada(&((const uint8_t *)in_data)[i*2+__IVEC_SIZE]); } else { @@ -326,19 +326,19 @@ So CLAMP volume on 0.0002% here. */ plus1 = _f32vec_broadcast(+0.999998); minus1= _f32vec_broadcast(-0.999998); - if(!F32VEC_ALIGNED(out)) + if(!_f32vec_aligned(out)) for(;i<len;i++) { ftmp=((const float*)in)[i]; SATURATE(ftmp,-0.999998,+0.999998); ((int32_t*)out)[i]=(int32_t)lrintf((INT_MAX-1)*ftmp); - if(F32VEC_ALIGNED(out)) break; + if(_f32vec_aligned(out)) break; } _ivec_empty(); len_mm=len&(~(__F32VEC_SIZE-1)); if((len_mm-i)>=__F32VEC_SIZE/sizeof(float)) for(;i<len_mm;i+=__F32VEC_SIZE/sizeof(float)) { __f32vec tmp; - if(F32VEC_ALIGNED(in)) + if(_f32vec_aligned(in)) tmp = _f32vec_loada(&((const float*)in)[i]); else tmp = _f32vec_loadu(&((const float*)in)[i]); @@ -366,16 +366,16 @@ #endif register unsigned i=0; #ifdef HAVE_F32_PVECTOR - if(!F32VEC_ALIGNED(out)) + if(!_f32vec_aligned(out)) for(;i<len;i++) { ((float*)out)[i]=(1.0/INT_MAX)*((float)((const int32_t*)in)[i]); - if(F32VEC_ALIGNED(out)) break; + if(_f32vec_aligned(out)) break; } _ivec_empty(); if((len-i)>=__F32VEC_SIZE) for(;i<len;i+=__F32VEC_SIZE/sizeof(float)) { __f32vec tmp; - if(F32VEC_ALIGNED(in)) + if(_f32vec_aligned(in)) tmp = _f32vec_from_s32a(&((const int32_t*)in)[i]); else tmp = _f32vec_from_s32u(&((const int32_t*)in)[i]); Modified: mplayerxp/pvector/pvector.h =================================================================== --- mplayerxp/pvector/pvector.h 2012-11-10 12:52:42 UTC (rev 320) +++ mplayerxp/pvector/pvector.h 2012-11-10 13:05:23 UTC (rev 321) @@ -47,11 +47,6 @@ #undef HAVE_F32_PVECTOR #endif -#undef IVEC_ALIGNED -#define IVEC_ALIGNED(p) ((((long)((any_t*)(p)))&(__IVEC_SIZE-1))==0) -#undef F32VEC_ALIGNED -#define F32VEC_ALIGNED(p) ((((long)((any_t*)(p)))&(__F32VEC_SIZE-1))==0) - /* ABBREVIATION: s8 - signed int8_t Modified: mplayerxp/pvector/pvector_f32_x86.h =================================================================== --- mplayerxp/pvector/pvector_f32_x86.h 2012-11-10 12:52:42 UTC (rev 320) +++ mplayerxp/pvector/pvector_f32_x86.h 2012-11-10 13:05:23 UTC (rev 321) @@ -34,6 +34,11 @@ #define __f32vec __m64 #endif +extern __inline int __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(f32vec_aligned)(const any_t* p) { return (((long)p)&(__F32VEC_SIZE-1))==0; } +#undef _f32vec_aligned +#define _f32vec_aligned PVECTOR_RENAME(f32vec_aligned) + extern __inline __f32vec __attribute__((__gnu_inline__, __always_inline__)) PVECTOR_RENAME(f32_loadu)(float const *__P) { Modified: mplayerxp/pvector/pvector_int_x86.h =================================================================== --- mplayerxp/pvector/pvector_int_x86.h 2012-11-10 12:52:42 UTC (rev 320) +++ mplayerxp/pvector/pvector_int_x86.h 2012-11-10 13:05:23 UTC (rev 321) @@ -34,6 +34,11 @@ #define __ivec __m64 #endif +static __inline int __attribute__((__gnu_inline__, __always_inline__)) +PVECTOR_RENAME(ivec_aligned)(const any_t* p) { return (((long)p)&(__IVEC_SIZE-1))==0; } +#undef _ivec_aligned +#define _ivec_aligned PVECTOR_RENAME(ivec_aligned) + extern __inline void __attribute__((__gnu_inline__, __always_inline__)) PVECTOR_RENAME(empty)(void) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |