Revision 3164d25e

View differences:

libswscale/swscale_template.c
979 979

  
980 980
        if (c->flags & SWS_ACCURATE_RND){
981 981
            while(p--){
982
            if (dst[p]){
983
                __asm__ volatile(
984
                    YSCALEYUV2YV121_ACCURATE
985
                    :: "r" (src[p]), "r" (dst[p] + counter[p]),
986
                    "g" (-counter[p])
987
                    : "%"REG_a
988
                );
989
            }
982
                if (dst[p]){
983
                    __asm__ volatile(
984
                        YSCALEYUV2YV121_ACCURATE
985
                        :: "r" (src[p]), "r" (dst[p] + counter[p]),
986
                        "g" (-counter[p])
987
                        : "%"REG_a
988
                    );
989
                }
990 990
            }
991 991
        }else{
992 992
            while(p--){
993
            if (dst[p]){
994
                __asm__ volatile(
995
                    YSCALEYUV2YV121
996
                    :: "r" (src[p]), "r" (dst[p] + counter[p]),
997
                    "g" (-counter[p])
998
                    : "%"REG_a
999
                );
1000
            }
993
                if (dst[p]){
994
                    __asm__ volatile(
995
                        YSCALEYUV2YV121
996
                        :: "r" (src[p]), "r" (dst[p] + counter[p]),
997
                        "g" (-counter[p])
998
                        : "%"REG_a
999
                    );
1000
                }
1001 1001
            }
1002 1002
        }
1003 1003
        return;
......
1068 1068

  
1069 1069
                    YSCALEYUV2PACKEDX_END
1070 1070
                }else{
1071
                YSCALEYUV2PACKEDX_ACCURATE
1072
                YSCALEYUV2RGBX
1073
                "pcmpeqd %%mm7, %%mm7 \n\t"
1074
                WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
1071
                    YSCALEYUV2PACKEDX_ACCURATE
1072
                    YSCALEYUV2RGBX
1073
                    "pcmpeqd %%mm7, %%mm7 \n\t"
1074
                    WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
1075 1075

  
1076
                YSCALEYUV2PACKEDX_END
1076
                    YSCALEYUV2PACKEDX_END
1077 1077
                }
1078 1078
                return;
1079 1079
            case PIX_FMT_BGR24:
......
1145 1145
                    WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
1146 1146
                    YSCALEYUV2PACKEDX_END
1147 1147
                }else{
1148
                YSCALEYUV2PACKEDX
1149
                YSCALEYUV2RGBX
1150
                "pcmpeqd %%mm7, %%mm7 \n\t"
1151
                WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
1152
                YSCALEYUV2PACKEDX_END
1148
                    YSCALEYUV2PACKEDX
1149
                    YSCALEYUV2RGBX
1150
                    "pcmpeqd %%mm7, %%mm7 \n\t"
1151
                    WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
1152
                    YSCALEYUV2PACKEDX_END
1153 1153
                }
1154 1154
                return;
1155 1155
            case PIX_FMT_BGR24:
......
1285 1285
                    );
1286 1286
#endif
1287 1287
                }else{
1288
                __asm__ volatile(
1289
                "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
1290
                "mov        %4, %%"REG_b"               \n\t"
1291
                "push %%"REG_BP"                        \n\t"
1292
                YSCALEYUV2RGB(%%REGBP, %5)
1293
                "pcmpeqd %%mm7, %%mm7                   \n\t"
1294
                WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
1295
                "pop %%"REG_BP"                         \n\t"
1296
                "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
1288
                    __asm__ volatile(
1289
                    "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
1290
                    "mov        %4, %%"REG_b"               \n\t"
1291
                    "push %%"REG_BP"                        \n\t"
1292
                    YSCALEYUV2RGB(%%REGBP, %5)
1293
                    "pcmpeqd %%mm7, %%mm7                   \n\t"
1294
                    WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
1295
                    "pop %%"REG_BP"                         \n\t"
1296
                    "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
1297 1297

  
1298
                :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
1299
                "a" (&c->redDither)
1300
                );
1298
                    :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
1299
                    "a" (&c->redDither)
1300
                    );
1301 1301
                }
1302 1302
                return;
1303 1303
            case PIX_FMT_BGR24:
......
1417 1417
                    "a" (&c->redDither)
1418 1418
                    );
1419 1419
                }else{
1420
                __asm__ volatile(
1421
                "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
1422
                "mov        %4, %%"REG_b"               \n\t"
1423
                "push %%"REG_BP"                        \n\t"
1424
                YSCALEYUV2RGB1(%%REGBP, %5)
1425
                "pcmpeqd %%mm7, %%mm7                   \n\t"
1426
                WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
1427
                "pop %%"REG_BP"                         \n\t"
1428
                "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
1420
                    __asm__ volatile(
1421
                    "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
1422
                    "mov        %4, %%"REG_b"               \n\t"
1423
                    "push %%"REG_BP"                        \n\t"
1424
                    YSCALEYUV2RGB1(%%REGBP, %5)
1425
                    "pcmpeqd %%mm7, %%mm7                   \n\t"
1426
                    WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
1427
                    "pop %%"REG_BP"                         \n\t"
1428
                    "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
1429 1429

  
1430
                :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
1431
                "a" (&c->redDither)
1432
                );
1430
                    :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
1431
                    "a" (&c->redDither)
1432
                    );
1433 1433
                }
1434 1434
                return;
1435 1435
            case PIX_FMT_BGR24:
......
1526 1526
                    "a" (&c->redDither)
1527 1527
                    );
1528 1528
                }else{
1529
                __asm__ volatile(
1530
                "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
1531
                "mov        %4, %%"REG_b"               \n\t"
1532
                "push %%"REG_BP"                        \n\t"
1533
                YSCALEYUV2RGB1b(%%REGBP, %5)
1534
                "pcmpeqd %%mm7, %%mm7                   \n\t"
1535
                WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
1536
                "pop %%"REG_BP"                         \n\t"
1537
                "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
1529
                    __asm__ volatile(
1530
                    "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
1531
                    "mov        %4, %%"REG_b"               \n\t"
1532
                    "push %%"REG_BP"                        \n\t"
1533
                    YSCALEYUV2RGB1b(%%REGBP, %5)
1534
                    "pcmpeqd %%mm7, %%mm7                   \n\t"
1535
                    WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
1536
                    "pop %%"REG_BP"                         \n\t"
1537
                    "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
1538 1538

  
1539
                :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
1540
                "a" (&c->redDither)
1541
                );
1539
                    :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
1540
                    "a" (&c->redDither)
1541
                    );
1542 1542
                }
1543 1543
                return;
1544 1544
            case PIX_FMT_BGR24:
......
2281 2281
        if (isAlpha)
2282 2282
            RENAME(abgrToA)(formatConvBuffer, src+3, srcW, pal);
2283 2283
        else
2284
        RENAME(bgr32ToY)(formatConvBuffer, src, srcW, pal);
2284
            RENAME(bgr32ToY)(formatConvBuffer, src, srcW, pal);
2285 2285
        src= formatConvBuffer;
2286 2286
    }
2287 2287
    else if (srcFormat==PIX_FMT_RGB32_1)
......
2289 2289
        if (isAlpha)
2290 2290
            RENAME(abgrToA)(formatConvBuffer, src, srcW, pal);
2291 2291
        else
2292
        RENAME(bgr32ToY)(formatConvBuffer, src+ALT32_CORR, srcW, pal);
2292
            RENAME(bgr32ToY)(formatConvBuffer, src+ALT32_CORR, srcW, pal);
2293 2293
        src= formatConvBuffer;
2294 2294
    }
2295 2295
    else if (srcFormat==PIX_FMT_BGR24)
......
2312 2312
        if (isAlpha)
2313 2313
            RENAME(abgrToA)(formatConvBuffer, src+3, srcW, pal);
2314 2314
        else
2315
        RENAME(rgb32ToY)(formatConvBuffer, src, srcW, pal);
2315
            RENAME(rgb32ToY)(formatConvBuffer, src, srcW, pal);
2316 2316
        src= formatConvBuffer;
2317 2317
    }
2318 2318
    else if (srcFormat==PIX_FMT_BGR32_1)
......
2320 2320
        if (isAlpha)
2321 2321
            RENAME(abgrToA)(formatConvBuffer, src, srcW, pal);
2322 2322
        else
2323
        RENAME(rgb32ToY)(formatConvBuffer, src+ALT32_CORR, srcW, pal);
2323
            RENAME(rgb32ToY)(formatConvBuffer, src+ALT32_CORR, srcW, pal);
2324 2324
        src= formatConvBuffer;
2325 2325
    }
2326 2326
    else if (srcFormat==PIX_FMT_RGB24)

Also available in: Unified diff