Commit d701bbbf authored by michael's avatar michael

Make horizontal mmx scaling code match C code.


git-svn-id: file:///var/local/repositories/mplayer/trunk/libswscale@27596 b3059339-0415-0410-9bf9-f77b7e298cf2
parent 17f1e9ab
...@@ -2170,7 +2170,6 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW ...@@ -2170,7 +2170,6 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW
"push %%"REG_b" \n\t" "push %%"REG_b" \n\t"
#endif #endif
"pxor %%mm7, %%mm7 \n\t" "pxor %%mm7, %%mm7 \n\t"
"movq "MANGLE(w02)", %%mm6 \n\t"
"push %%"REG_BP" \n\t" // we use 7 regs here ... "push %%"REG_BP" \n\t" // we use 7 regs here ...
"mov %%"REG_a", %%"REG_BP" \n\t" "mov %%"REG_a", %%"REG_BP" \n\t"
ASMALIGN(4) ASMALIGN(4)
...@@ -2185,10 +2184,11 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW ...@@ -2185,10 +2184,11 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW
"punpcklbw %%mm7, %%mm2 \n\t" "punpcklbw %%mm7, %%mm2 \n\t"
"pmaddwd %%mm1, %%mm0 \n\t" "pmaddwd %%mm1, %%mm0 \n\t"
"pmaddwd %%mm2, %%mm3 \n\t" "pmaddwd %%mm2, %%mm3 \n\t"
"psrad $8, %%mm0 \n\t" "movq %%mm0, %%mm4 \n\t"
"psrad $8, %%mm3 \n\t" "punpckldq %%mm3, %%mm0 \n\t"
"packssdw %%mm3, %%mm0 \n\t" "punpckhdq %%mm3, %%mm4 \n\t"
"pmaddwd %%mm6, %%mm0 \n\t" "paddd %%mm4, %%mm0 \n\t"
"psrad $7, %%mm0 \n\t"
"packssdw %%mm0, %%mm0 \n\t" "packssdw %%mm0, %%mm0 \n\t"
"movd %%mm0, (%4, %%"REG_BP") \n\t" "movd %%mm0, (%4, %%"REG_BP") \n\t"
"add $4, %%"REG_BP" \n\t" "add $4, %%"REG_BP" \n\t"
...@@ -2216,7 +2216,6 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW ...@@ -2216,7 +2216,6 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW
"push %%"REG_b" \n\t" "push %%"REG_b" \n\t"
#endif #endif
"pxor %%mm7, %%mm7 \n\t" "pxor %%mm7, %%mm7 \n\t"
"movq "MANGLE(w02)", %%mm6 \n\t"
"push %%"REG_BP" \n\t" // we use 7 regs here ... "push %%"REG_BP" \n\t" // we use 7 regs here ...
"mov %%"REG_a", %%"REG_BP" \n\t" "mov %%"REG_a", %%"REG_BP" \n\t"
ASMALIGN(4) ASMALIGN(4)
...@@ -2242,11 +2241,11 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW ...@@ -2242,11 +2241,11 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW
"pmaddwd %%mm2, %%mm5 \n\t" "pmaddwd %%mm2, %%mm5 \n\t"
"paddd %%mm4, %%mm0 \n\t" "paddd %%mm4, %%mm0 \n\t"
"paddd %%mm5, %%mm3 \n\t" "paddd %%mm5, %%mm3 \n\t"
"movq %%mm0, %%mm4 \n\t"
"psrad $8, %%mm0 \n\t" "punpckldq %%mm3, %%mm0 \n\t"
"psrad $8, %%mm3 \n\t" "punpckhdq %%mm3, %%mm4 \n\t"
"packssdw %%mm3, %%mm0 \n\t" "paddd %%mm4, %%mm0 \n\t"
"pmaddwd %%mm6, %%mm0 \n\t" "psrad $7, %%mm0 \n\t"
"packssdw %%mm0, %%mm0 \n\t" "packssdw %%mm0, %%mm0 \n\t"
"movd %%mm0, (%4, %%"REG_BP") \n\t" "movd %%mm0, (%4, %%"REG_BP") \n\t"
"add $4, %%"REG_BP" \n\t" "add $4, %%"REG_BP" \n\t"
...@@ -2272,7 +2271,6 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW ...@@ -2272,7 +2271,6 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW
dst-= counter/2; dst-= counter/2;
asm volatile( asm volatile(
"pxor %%mm7, %%mm7 \n\t" "pxor %%mm7, %%mm7 \n\t"
"movq "MANGLE(w02)", %%mm6 \n\t"
ASMALIGN(4) ASMALIGN(4)
"1: \n\t" "1: \n\t"
"mov %2, %%"REG_c" \n\t" "mov %2, %%"REG_c" \n\t"
...@@ -2297,10 +2295,11 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW ...@@ -2297,10 +2295,11 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW
"cmp %4, %%"REG_c" \n\t" "cmp %4, %%"REG_c" \n\t"
" jb 2b \n\t" " jb 2b \n\t"
"add %6, %1 \n\t" "add %6, %1 \n\t"
"psrad $8, %%mm4 \n\t" "movq %%mm4, %%mm0 \n\t"
"psrad $8, %%mm5 \n\t" "punpckldq %%mm5, %%mm4 \n\t"
"packssdw %%mm5, %%mm4 \n\t" "punpckhdq %%mm5, %%mm0 \n\t"
"pmaddwd %%mm6, %%mm4 \n\t" "paddd %%mm0, %%mm4 \n\t"
"psrad $7, %%mm4 \n\t"
"packssdw %%mm4, %%mm4 \n\t" "packssdw %%mm4, %%mm4 \n\t"
"mov %3, %%"REG_a" \n\t" "mov %3, %%"REG_a" \n\t"
"movd %%mm4, (%%"REG_a", %0) \n\t" "movd %%mm4, (%%"REG_a", %0) \n\t"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment