Fix MMX rgb24 to yuv conversion with gcc 4.6
When built with gcc 4.6, the MMX rgb24 to yuv conversion gives
wrong output. The compiler produces this warning:
libswscale/swscale_template.c:1885:5: warning: use of memory input without lvalue in asm operand 4 is deprecated
Changing the memory operand to a register makes it work.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit f344903ca5
)
Conflicts:
libswscale/swscale_template.c
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
This commit is contained in:
committed by
Reinhard Tartler
parent
4f07a3aa2c
commit
8135c35528
@@ -1739,7 +1739,7 @@ static inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, uint8_t *src, long width,
|
||||
static inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, uint8_t *src, long width, int srcFormat)
|
||||
{
|
||||
__asm__ volatile(
|
||||
"movq 24+%4, %%mm6 \n\t"
|
||||
"movq 24(%4), %%mm6 \n\t"
|
||||
"mov %3, %%"REG_a" \n\t"
|
||||
"pxor %%mm7, %%mm7 \n\t"
|
||||
"1: \n\t"
|
||||
@@ -1750,9 +1750,9 @@ static inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, uint8_t *
|
||||
"punpcklbw %%mm7, %%mm1 \n\t"
|
||||
"movq %%mm0, %%mm2 \n\t"
|
||||
"movq %%mm1, %%mm3 \n\t"
|
||||
"pmaddwd %4, %%mm0 \n\t"
|
||||
"pmaddwd 8+%4, %%mm1 \n\t"
|
||||
"pmaddwd 16+%4, %%mm2 \n\t"
|
||||
"pmaddwd (%4), %%mm0 \n\t"
|
||||
"pmaddwd 8(%4), %%mm1 \n\t"
|
||||
"pmaddwd 16(%4), %%mm2 \n\t"
|
||||
"pmaddwd %%mm6, %%mm3 \n\t"
|
||||
"paddd %%mm1, %%mm0 \n\t"
|
||||
"paddd %%mm3, %%mm2 \n\t"
|
||||
@@ -1764,9 +1764,9 @@ static inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, uint8_t *
|
||||
"punpcklbw %%mm7, %%mm3 \n\t"
|
||||
"movq %%mm1, %%mm4 \n\t"
|
||||
"movq %%mm3, %%mm5 \n\t"
|
||||
"pmaddwd %4, %%mm1 \n\t"
|
||||
"pmaddwd 8+%4, %%mm3 \n\t"
|
||||
"pmaddwd 16+%4, %%mm4 \n\t"
|
||||
"pmaddwd (%4), %%mm1 \n\t"
|
||||
"pmaddwd 8(%4), %%mm3 \n\t"
|
||||
"pmaddwd 16(%4), %%mm4 \n\t"
|
||||
"pmaddwd %%mm6, %%mm5 \n\t"
|
||||
"paddd %%mm3, %%mm1 \n\t"
|
||||
"paddd %%mm5, %%mm4 \n\t"
|
||||
@@ -1789,7 +1789,7 @@ static inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, uint8_t *
|
||||
"add $4, %%"REG_a" \n\t"
|
||||
" js 1b \n\t"
|
||||
: "+r" (src)
|
||||
: "r" (dstU+width), "r" (dstV+width), "g" (-width), "m"(ff_bgr24toUV[srcFormat == PIX_FMT_RGB24][0])
|
||||
: "r" (dstU+width), "r" (dstV+width), "g" (-width), "r"(ff_bgr24toUV[srcFormat == PIX_FMT_RGB24])
|
||||
: "%"REG_a
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user