Revision bf2bdde6

View differences:

libswscale/swscale_template.c
181 181
    "add                   $8, %%"REG_a"  \n\t"\
182 182
    "jnc                   1b             \n\t"
183 183

  
184
#define YSCALEYUV2YV121_ACCURATE \
185
    "mov %2, %%"REG_a"                    \n\t"\
186
    "pcmpeqw %%mm7, %%mm7                 \n\t"\
187
    "psrlw                 $15, %%mm7     \n\t"\
188
    "psllw                  $6, %%mm7     \n\t"\
189
    ASMALIGN(4) /* FIXME Unroll? */\
190
    "1:                                   \n\t"\
191
    "movq  (%0, %%"REG_a", 2), %%mm0      \n\t"\
192
    "movq 8(%0, %%"REG_a", 2), %%mm1      \n\t"\
193
    "paddw              %%mm7, %%mm0      \n\t"\
194
    "paddw              %%mm7, %%mm1      \n\t"\
195
    "psraw                 $7, %%mm0      \n\t"\
196
    "psraw                 $7, %%mm1      \n\t"\
197
    "packuswb           %%mm1, %%mm0      \n\t"\
198
    MOVNTQ(%%mm0, (%1, %%REGa))\
199
    "add                   $8, %%"REG_a"  \n\t"\
200
    "jnc                   1b             \n\t"
201

  
184 202
/*
185 203
    :: "m" (-lumFilterSize), "m" (-chrFilterSize),
186 204
       "m" (lumMmxFilter+lumFilterSize*4), "m" (chrMmxFilter+chrFilterSize*4),
......
969 987
             dest, uDest, dstW, chrDstW, dstFormat);
970 988
}
971 989

  
972
static inline void RENAME(yuv2yuv1)(int16_t *lumSrc, int16_t *chrSrc,
990
static inline void RENAME(yuv2yuv1)(SwsContext *c, int16_t *lumSrc, int16_t *chrSrc,
973 991
                                    uint8_t *dest, uint8_t *uDest, uint8_t *vDest, long dstW, long chrDstW)
974 992
{
975 993
#ifdef HAVE_MMX
......
978 996
    uint8_t *dst[3]= {dest, uDest, vDest};
979 997
    long counter[3] = {dstW, chrDstW, chrDstW};
980 998

  
999
    if (c->flags & SWS_ACCURATE_RND){
1000
        while(p--){
1001
            asm volatile(
1002
                YSCALEYUV2YV121_ACCURATE
1003
                :: "r" (src[p]), "r" (dst[p] + counter[p]),
1004
                "g" (-counter[p])
1005
                : "%"REG_a
1006
            );
1007
        }
1008
    }else{
981 1009
    while(p--){
982 1010
        asm volatile(
983 1011
            YSCALEYUV2YV121
......
986 1014
            : "%"REG_a
987 1015
        );
988 1016
    }
1017
    }
989 1018

  
990 1019
#else
991 1020
    int i;
......
3178 3207
                {
3179 3208
                    int16_t *lumBuf = lumPixBuf[0];
3180 3209
                    int16_t *chrBuf= chrPixBuf[0];
3181
                    RENAME(yuv2yuv1)(lumBuf, chrBuf, dest, uDest, vDest, dstW, chrDstW);
3210
                    RENAME(yuv2yuv1)(c, lumBuf, chrBuf, dest, uDest, vDest, dstW, chrDstW);
3182 3211
                }
3183 3212
                else //General YV12
3184 3213
                {

Also available in: Unified diff