From dd68318ceee3de05ca705652133e1eb22a17780e Mon Sep 17 00:00:00 2001 From: Ramiro Polla Date: Sun, 16 Aug 2009 21:11:28 +0000 Subject: Cosmetics: - Place curly brackets in the same line as while/for/if/switch/else/do; - Place curly brackets at column 0 in the next line starting a function. Originally committed as revision 29523 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale --- libswscale/rgb2rgb_template.c | 235 ++++++++++++++++-------------------------- 1 file changed, 90 insertions(+), 145 deletions(-) (limited to 'libswscale/rgb2rgb_template.c') diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c index 475a810f0b..8b5a504da6 100644 --- a/libswscale/rgb2rgb_template.c +++ b/libswscale/rgb2rgb_template.c @@ -84,8 +84,7 @@ static inline void RENAME(rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long s __asm__ volatile(PREFETCH" %0"::"m"(*s):"memory"); mm_end = end - 23; __asm__ volatile("movq %0, %%mm7"::"m"(mask32a):"memory"); - while (s < mm_end) - { + while (s < mm_end) { __asm__ volatile( PREFETCH" 32%1 \n\t" "movd %1, %%mm0 \n\t" @@ -113,8 +112,7 @@ static inline void RENAME(rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long s __asm__ volatile(SFENCE:::"memory"); __asm__ volatile(EMMS:::"memory"); #endif - while (s < end) - { + while (s < end) { #if HAVE_BIGENDIAN /* RGB24 (= R,G,B) -> RGB32 (= A,B,G,R) */ *dest++ = 255; @@ -143,8 +141,7 @@ static inline void RENAME(rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long s #if HAVE_MMX __asm__ volatile(PREFETCH" %0"::"m"(*s):"memory"); mm_end = end - 31; - while (s < mm_end) - { + while (s < mm_end) { __asm__ volatile( PREFETCH" 32%1 \n\t" "movq %1, %%mm0 \n\t" @@ -199,8 +196,7 @@ static inline void RENAME(rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long s __asm__ volatile(SFENCE:::"memory"); __asm__ volatile(EMMS:::"memory"); #endif - while (s < end) - { + while (s < end) { #if HAVE_BIGENDIAN /* RGB32 (= A,B,G,R) -> RGB24 (= R,G,B) */ s++; @@ -234,8 +230,7 @@ static inline void RENAME(rgb15to16)(const uint8_t *src, uint8_t *dst, long src_ __asm__ volatile(PREFETCH" %0"::"m"(*s)); __asm__ volatile("movq %0, %%mm4"::"m"(mask15s)); mm_end = end - 15; - while (s>1)&0x7FE07FE0) | (x&0x001F001F); s+=4; d+=4; } - if (s < end) - { + if (s < end) { register uint16_t x= *((const uint16_t*)s); *((uint16_t *)d) = ((x>>1)&0x7FE0) | (x&0x001F); } @@ -378,8 +368,7 @@ static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, long src_ "movq %0, %%mm7 \n\t" "movq %1, %%mm6 \n\t" ::"m"(red_16mask),"m"(green_16mask)); - while (s < mm_end) - { + while (s < mm_end) { __asm__ volatile( PREFETCH" 32%1 \n\t" "movd %1, %%mm0 \n\t" @@ -417,8 +406,7 @@ static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, long src_ __asm__ volatile(SFENCE:::"memory"); __asm__ volatile(EMMS:::"memory"); #endif - while (s < end) - { + while (s < end) { register int rgb = *(const uint32_t*)s; s += 4; *d++ = ((rgb&0xFF)>>3) + ((rgb&0xFC00)>>5) + ((rgb&0xF80000)>>8); } @@ -440,8 +428,7 @@ static inline void RENAME(rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long s "movq %1, %%mm6 \n\t" ::"m"(red_16mask),"m"(green_16mask)); mm_end = end - 15; - while (s < mm_end) - { + while (s < mm_end) { __asm__ volatile( PREFETCH" 32%1 \n\t" "movd %1, %%mm0 \n\t" @@ -478,8 +465,7 @@ static inline void RENAME(rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long s __asm__ volatile(SFENCE:::"memory"); __asm__ volatile(EMMS:::"memory"); #endif - while (s < end) - { + while (s < end) { register int rgb = *(const uint32_t*)s; s += 4; *d++ = ((rgb&0xF8)<<8) + ((rgb&0xFC00)>>5) + ((rgb&0xF80000)>>19); } @@ -537,8 +523,7 @@ static inline void RENAME(rgb32to15)(const uint8_t *src, uint8_t *dst, long src_ "movq %0, %%mm7 \n\t" "movq %1, %%mm6 \n\t" ::"m"(red_15mask),"m"(green_15mask)); - while (s < mm_end) - { + while (s < mm_end) { __asm__ volatile( PREFETCH" 32%1 \n\t" "movd %1, %%mm0 \n\t" @@ -576,8 +561,7 @@ static inline void RENAME(rgb32to15)(const uint8_t *src, uint8_t *dst, long src_ __asm__ volatile(SFENCE:::"memory"); __asm__ volatile(EMMS:::"memory"); #endif - while (s < end) - { + while (s < end) { register int rgb = *(const uint32_t*)s; s += 4; *d++ = ((rgb&0xFF)>>3) + ((rgb&0xF800)>>6) + ((rgb&0xF80000)>>9); } @@ -599,8 +583,7 @@ static inline void RENAME(rgb32tobgr15)(const uint8_t *src, uint8_t *dst, long s "movq %1, %%mm6 \n\t" ::"m"(red_15mask),"m"(green_15mask)); mm_end = end - 15; - while (s < mm_end) - { + while (s < mm_end) { __asm__ volatile( PREFETCH" 32%1 \n\t" "movd %1, %%mm0 \n\t" @@ -637,8 +620,7 @@ static inline void RENAME(rgb32tobgr15)(const uint8_t *src, uint8_t *dst, long s __asm__ volatile(SFENCE:::"memory"); __asm__ volatile(EMMS:::"memory"); #endif - while (s < end) - { + while (s < end) { register int rgb = *(const uint32_t*)s; s += 4; *d++ = ((rgb&0xF8)<<7) + ((rgb&0xF800)>>6) + ((rgb&0xF80000)>>19); } @@ -660,8 +642,7 @@ static inline void RENAME(rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long s "movq %1, %%mm6 \n\t" ::"m"(red_16mask),"m"(green_16mask)); mm_end = end - 11; - while (s < mm_end) - { + while (s < mm_end) { __asm__ volatile( PREFETCH" 32%1 \n\t" "movd %1, %%mm0 \n\t" @@ -698,8 +679,7 @@ static inline void RENAME(rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long s __asm__ volatile(SFENCE:::"memory"); __asm__ volatile(EMMS:::"memory"); #endif - while (s < end) - { + while (s < end) { const int b = *s++; const int g = *s++; const int r = *s++; @@ -723,8 +703,7 @@ static inline void RENAME(rgb24to16)(const uint8_t *src, uint8_t *dst, long src_ "movq %1, %%mm6 \n\t" ::"m"(red_16mask),"m"(green_16mask)); mm_end = end - 15; - while (s < mm_end) - { + while (s < mm_end) { __asm__ volatile( PREFETCH" 32%1 \n\t" "movd %1, %%mm0 \n\t" @@ -761,8 +740,7 @@ static inline void RENAME(rgb24to16)(const uint8_t *src, uint8_t *dst, long src_ __asm__ volatile(SFENCE:::"memory"); __asm__ volatile(EMMS:::"memory"); #endif - while (s < end) - { + while (s < end) { const int r = *s++; const int g = *s++; const int b = *s++; @@ -786,8 +764,7 @@ static inline void RENAME(rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long s "movq %1, %%mm6 \n\t" ::"m"(red_15mask),"m"(green_15mask)); mm_end = end - 11; - while (s < mm_end) - { + while (s < mm_end) { __asm__ volatile( PREFETCH" 32%1 \n\t" "movd %1, %%mm0 \n\t" @@ -824,8 +801,7 @@ static inline void RENAME(rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long s __asm__ volatile(SFENCE:::"memory"); __asm__ volatile(EMMS:::"memory"); #endif - while (s < end) - { + while (s < end) { const int b = *s++; const int g = *s++; const int r = *s++; @@ -849,8 +825,7 @@ static inline void RENAME(rgb24to15)(const uint8_t *src, uint8_t *dst, long src_ "movq %1, %%mm6 \n\t" ::"m"(red_15mask),"m"(green_15mask)); mm_end = end - 15; - while (s < mm_end) - { + while (s < mm_end) { __asm__ volatile( PREFETCH" 32%1 \n\t" "movd %1, %%mm0 \n\t" @@ -887,8 +862,7 @@ static inline void RENAME(rgb24to15)(const uint8_t *src, uint8_t *dst, long src_ __asm__ volatile(SFENCE:::"memory"); __asm__ volatile(EMMS:::"memory"); #endif - while (s < end) - { + while (s < end) { const int r = *s++; const int g = *s++; const int b = *s++; @@ -929,8 +903,7 @@ static inline void RENAME(rgb15tobgr24)(const uint8_t *src, uint8_t *dst, long s #if HAVE_MMX __asm__ volatile(PREFETCH" %0"::"m"(*s):"memory"); mm_end = end - 7; - while (s < mm_end) - { + while (s < mm_end) { __asm__ volatile( PREFETCH" 32%1 \n\t" "movq %1, %%mm0 \n\t" @@ -1049,8 +1022,7 @@ static inline void RENAME(rgb15tobgr24)(const uint8_t *src, uint8_t *dst, long s __asm__ volatile(SFENCE:::"memory"); __asm__ volatile(EMMS:::"memory"); #endif - while (s < end) - { + while (s < end) { register uint16_t bgr; bgr = *s++; *d++ = (bgr&0x1F)<<3; @@ -1071,8 +1043,7 @@ static inline void RENAME(rgb16tobgr24)(const uint8_t *src, uint8_t *dst, long s #if HAVE_MMX __asm__ volatile(PREFETCH" %0"::"m"(*s):"memory"); mm_end = end - 7; - while (s < mm_end) - { + while (s < mm_end) { __asm__ volatile( PREFETCH" 32%1 \n\t" "movq %1, %%mm0 \n\t" @@ -1190,8 +1161,7 @@ static inline void RENAME(rgb16tobgr24)(const uint8_t *src, uint8_t *dst, long s __asm__ volatile(SFENCE:::"memory"); __asm__ volatile(EMMS:::"memory"); #endif - while (s < end) - { + while (s < end) { register uint16_t bgr; bgr = *s++; *d++ = (bgr&0x1F)<<3; @@ -1233,8 +1203,7 @@ static inline void RENAME(rgb15to32)(const uint8_t *src, uint8_t *dst, long src_ __asm__ volatile("pxor %%mm7,%%mm7 \n\t":::"memory"); __asm__ volatile("pcmpeqd %%mm6,%%mm6 \n\t":::"memory"); mm_end = end - 3; - while (s < mm_end) - { + while (s < mm_end) { __asm__ volatile( PREFETCH" 32%1 \n\t" "movq %1, %%mm0 \n\t" @@ -1256,8 +1225,7 @@ static inline void RENAME(rgb15to32)(const uint8_t *src, uint8_t *dst, long src_ __asm__ volatile(SFENCE:::"memory"); __asm__ volatile(EMMS:::"memory"); #endif - while (s < end) - { + while (s < end) { register uint16_t bgr; bgr = *s++; #if HAVE_BIGENDIAN @@ -1288,8 +1256,7 @@ static inline void RENAME(rgb16to32)(const uint8_t *src, uint8_t *dst, long src_ __asm__ volatile("pxor %%mm7,%%mm7 \n\t":::"memory"); __asm__ volatile("pcmpeqd %%mm6,%%mm6 \n\t":::"memory"); mm_end = end - 3; - while (s < mm_end) - { + while (s < mm_end) { __asm__ volatile( PREFETCH" 32%1 \n\t" "movq %1, %%mm0 \n\t" @@ -1311,8 +1278,7 @@ static inline void RENAME(rgb16to32)(const uint8_t *src, uint8_t *dst, long src_ __asm__ volatile(SFENCE:::"memory"); __asm__ volatile(EMMS:::"memory"); #endif - while (s < end) - { + while (s < end) { register uint16_t bgr; bgr = *s++; #if HAVE_BIGENDIAN @@ -1453,8 +1419,7 @@ static inline void RENAME(rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long s src-= src_size; dst-= src_size; #endif - for (i=0; i>1; - for (y=0; y>1; - for (y=0; y>1; - for (y=0; y>2; dst[2*x+2]= ( src[x] + 3*src[x+1])>>2; } @@ -1890,7 +1848,7 @@ static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, long srcWi dst+= dstStride; - for (y=1; y>2; dst[dstStride]= ( src[0] + 3*src[srcStride])>>2; - for (x=mmxSize-1; x>2; dst[2*x+dstStride+2]= ( src[x+0] + 3*src[x+srcStride+1])>>2; dst[2*x+dstStride+1]= ( src[x+1] + 3*src[x+srcStride ])>>2; @@ -1958,13 +1916,13 @@ static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, long srcWi #if 1 dst[0]= src[0]; - for (x=0; x>2; dst[2*x+2]= ( src[x] + 3*src[x+1])>>2; } dst[2*srcWidth-1]= src[srcWidth-1]; #else - for (x=0; x>1; - for (y=0; y>1; #if HAVE_MMX - for (y=0; y>1); uint8_t* d=dst1+dstStride1*y; x=0; #if HAVE_MMX - for (;x>1); uint8_t* d=dst2+dstStride2*y; x=0; #if HAVE_MMX - for (;x>2); const uint8_t* vp=src3+srcStride3*(y>>2); uint8_t* d=dst+dstStride*y; x=0; #if HAVE_MMX - for (;x>1; dst1[count]= (src0[4*count+2]+src1[4*count+2])>>1; count++; @@ -2830,7 +2774,7 @@ static void RENAME(extract_odd2)(const uint8_t *src, uint8_t *dst0, uint8_t *dst src += 4*count; count= - count; #if HAVE_MMX - if(count <= -8){ + if(count <= -8) { count += 7; __asm__ volatile( "pcmpeqw %%mm7, %%mm7 \n\t" @@ -2865,7 +2809,7 @@ static void RENAME(extract_odd2)(const uint8_t *src, uint8_t *dst0, uint8_t *dst } #endif src++; - while(count<0){ + while(count<0) { dst0[count]= src[4*count+0]; dst1[count]= src[4*count+2]; count++; @@ -2880,7 +2824,7 @@ static void RENAME(extract_odd2avg)(const uint8_t *src0, const uint8_t *src1, ui src1 += 4*count; count= - count; #ifdef PAVGB - if(count <= -8){ + if(count <= -8) { count += 7; __asm__ volatile( "pcmpeqw %%mm7, %%mm7 \n\t" @@ -2920,7 +2864,7 @@ static void RENAME(extract_odd2avg)(const uint8_t *src0, const uint8_t *src1, ui #endif src0++; src1++; - while(count<0){ + while(count<0) { dst0[count]= (src0[4*count+0]+src1[4*count+0])>>1; dst1[count]= (src0[4*count+2]+src1[4*count+2])>>1; count++; @@ -2934,9 +2878,9 @@ static void RENAME(yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, co long y; const long chromWidth= -((-width)>>1); - for (y=0; y>1); - for (y=0; y>1); - for (y=0; y>1); - for (y=0; y