Revision 88e2a9ae libswscale/yuv2rgb_template.c

View differences:

libswscale/yuv2rgb_template.c
134 134
    if(h_size*2 > FFABS(dstStride[0])) h_size-=8;
135 135

  
136 136
    asm volatile ("pxor %mm4, %mm4;" /* zero mm4 */ );
137
    //printf("%X %X %X %X %X %X %X %X %X %X\n", (int)&c->redDither, (int)&b5Dither, (int)src[0], (int)src[1], (int)src[2], (int)dst[0],
137
    //printf("%X %X %X %X %X %X %X %X %X %X\n", (int)&c->redDither, (int)&c->blueDither, (int)src[0], (int)src[1], (int)src[2], (int)dst[0],
138 138
    //srcStride[0],srcStride[1],srcStride[2],dstStride[0]);
139 139
    for (y= 0; y<srcSliceH; y++ ) {
140 140
        uint8_t *image = dst[0] + (y+srcSliceY)*dstStride[0];
......
143 143
        uint8_t *pv = src[2] + (y>>1)*srcStride[2];
144 144
        long index= -h_size/2;
145 145

  
146
        b5Dither= ff_dither8[y&1];
147
        g5Dither= ff_dither4[y&1];
148
        r5Dither= ff_dither8[(y+1)&1];
146
        c->blueDither= ff_dither8[y&1];
147
        c->greenDither= ff_dither4[y&1];
148
        c->redDither= ff_dither8[(y+1)&1];
149 149
        /* This MMX assembly code deals with a SINGLE scan line at a time,
150 150
         * it converts 8 pixels in each iteration. */
151 151
        asm volatile (
......
164 164
YUV2RGB
165 165

  
166 166
#ifdef DITHER1XBPP
167
        "paddusb "MANGLE(b5Dither)", %%mm0;"
168
        "paddusb "MANGLE(g5Dither)", %%mm2;"
169
        "paddusb "MANGLE(r5Dither)", %%mm1;"
167
        "paddusb "BLUE_DITHER"(%4), %%mm0;"
168
        "paddusb "GREEN_DITHER"(%4), %%mm2;"
169
        "paddusb "RED_DITHER"(%4), %%mm1;"
170 170
#endif
171 171
        /* mask unneeded bits off */
172 172
        "pand "MANGLE(mmx_redmask)", %%mm0;" /* b7b6b5b4 b3_0_0_0 b7b6b5b4 b3_0_0_0 */
......
228 228
    if(h_size*2 > FFABS(dstStride[0])) h_size-=8;
229 229

  
230 230
    asm volatile ("pxor %mm4, %mm4;" /* zero mm4 */ );
231
    //printf("%X %X %X %X %X %X %X %X %X %X\n", (int)&c->redDither, (int)&b5Dither, (int)src[0], (int)src[1], (int)src[2], (int)dst[0],
231
    //printf("%X %X %X %X %X %X %X %X %X %X\n", (int)&c->redDither, (int)&c->blueDither, (int)src[0], (int)src[1], (int)src[2], (int)dst[0],
232 232
    //srcStride[0],srcStride[1],srcStride[2],dstStride[0]);
233 233
    for (y= 0; y<srcSliceH; y++ ) {
234 234
        uint8_t *image = dst[0] + (y+srcSliceY)*dstStride[0];
......
237 237
        uint8_t *pv = src[2] + (y>>1)*srcStride[2];
238 238
        long index= -h_size/2;
239 239

  
240
        b5Dither= ff_dither8[y&1];
241
        g5Dither= ff_dither8[y&1];
242
        r5Dither= ff_dither8[(y+1)&1];
240
        c->blueDither= ff_dither8[y&1];
241
        c->greenDither= ff_dither8[y&1];
242
        c->redDither= ff_dither8[(y+1)&1];
243 243
        /* This MMX assembly code deals with a SINGLE scan line at a time,
244 244
         * it converts 8 pixels in each iteration. */
245 245
        asm volatile (
......
252 252
YUV2RGB
253 253

  
254 254
#ifdef DITHER1XBPP
255
        "paddusb "MANGLE(b5Dither)", %%mm0  \n\t"
256
        "paddusb "MANGLE(g5Dither)", %%mm2  \n\t"
257
        "paddusb "MANGLE(r5Dither)", %%mm1  \n\t"
255
        "paddusb "BLUE_DITHER"(%4), %%mm0  \n\t"
256
        "paddusb "GREEN_DITHER"(%4), %%mm2  \n\t"
257
        "paddusb "RED_DITHER"(%4), %%mm1  \n\t"
258 258
#endif
259 259

  
260 260
        /* mask unneeded bits off */

Also available in: Unified diff