diff --git a/postproc/rgb2rgb_template.c b/postproc/rgb2rgb_template.c index b6c26a11ee..464ad4c269 100644 --- a/postproc/rgb2rgb_template.c +++ b/postproc/rgb2rgb_template.c @@ -63,13 +63,13 @@ static inline void RENAME(rgb24to32)(const uint8_t *src,uint8_t *dst,unsigned sr const uint8_t *s = src; const uint8_t *end; #ifdef HAVE_MMX - uint8_t *mm_end; + const uint8_t *mm_end; #endif end = s + src_size; #ifdef HAVE_MMX __asm __volatile(PREFETCH" %0"::"m"(*s):"memory"); + mm_end = end - 23; __asm __volatile("movq %0, %%mm7"::"m"(mask32):"memory"); - mm_end = (uint8_t*)((((unsigned long)end)/24)*24); while(s < mm_end) { __asm __volatile( @@ -114,12 +114,12 @@ static inline void RENAME(rgb32to24)(const uint8_t *src,uint8_t *dst,unsigned sr const uint8_t *s = src; const uint8_t *end; #ifdef HAVE_MMX - uint8_t *mm_end; + const uint8_t *mm_end; #endif end = s + src_size; #ifdef HAVE_MMX __asm __volatile(PREFETCH" %0"::"m"(*s):"memory"); - mm_end = (uint8_t*)((((unsigned long)end)/32)*32); + mm_end = end - 31; while(s < mm_end) { __asm __volatile( @@ -196,12 +196,12 @@ static inline void RENAME(rgb15to16)(const uint8_t *src,uint8_t *dst,unsigned sr register const uint8_t* s=src; register uint8_t* d=dst; register const uint8_t *end; - uint8_t *mm_end; + const uint8_t *mm_end; end = s + src_size; #ifdef HAVE_MMX __asm __volatile(PREFETCH" %0"::"m"(*s)); __asm __volatile("movq %0, %%mm4"::"m"(mask15s)); - mm_end = (uint8_t*)((((unsigned long)end)/16)*16); + mm_end = end - 15; while(s