Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 179872 | Differences between
and this patch

Collapse All | Expand All

(-)a/libswscale/rgb2rgb.c (+12 lines)
Lines 133-138 Link Here
133
DECLARE_ASM_CONST(8, uint64_t, red_15mask)   = 0x00007c0000007c00ULL;
133
DECLARE_ASM_CONST(8, uint64_t, red_15mask)   = 0x00007c0000007c00ULL;
134
DECLARE_ASM_CONST(8, uint64_t, green_15mask) = 0x000003e0000003e0ULL;
134
DECLARE_ASM_CONST(8, uint64_t, green_15mask) = 0x000003e0000003e0ULL;
135
DECLARE_ASM_CONST(8, uint64_t, blue_15mask)  = 0x0000001f0000001fULL;
135
DECLARE_ASM_CONST(8, uint64_t, blue_15mask)  = 0x0000001f0000001fULL;
136
#ifdef FAST_BGR2YV12
137
DECLARE_ASM_CONST(8, uint64_t, ff_bgr2YCoeff)   = 0x000000210041000DULL;
138
DECLARE_ASM_CONST(8, uint64_t, ff_bgr2UCoeff)   = 0x0000FFEEFFDC0038ULL;
139
DECLARE_ASM_CONST(8, uint64_t, ff_bgr2VCoeff)   = 0x00000038FFD2FFF8ULL;
140
#else
141
DECLARE_ASM_CONST(8, uint64_t, ff_bgr2YCoeff)   = 0x000020E540830C8BULL;
142
DECLARE_ASM_CONST(8, uint64_t, ff_bgr2UCoeff)   = 0x0000ED0FDAC23831ULL;
143
DECLARE_ASM_CONST(8, uint64_t, ff_bgr2VCoeff)   = 0x00003831D0E6F6EAULL;
144
#endif /* FAST_BGR2YV12 */
145
DECLARE_ASM_CONST(8, uint64_t, ff_bgr2YOffset)  = 0x1010101010101010ULL;
146
DECLARE_ASM_CONST(8, uint64_t, ff_bgr2UVOffset) = 0x8080808080808080ULL;
147
DECLARE_ASM_CONST(8, uint64_t, ff_w1111)        = 0x0001000100010001ULL;
136
#endif /* ARCH_X86 */
148
#endif /* ARCH_X86 */
137
149
138
#define RGB2YUV_SHIFT 8
150
#define RGB2YUV_SHIFT 8
(-)a/libswscale/rgb2rgb_template.c (-31 / +33 lines)
Lines 127-140 Link Here
127
            "psrlq         $8, %%mm3    \n\t" \
127
            "psrlq         $8, %%mm3    \n\t" \
128
            "psrlq         $8, %%mm6    \n\t" \
128
            "psrlq         $8, %%mm6    \n\t" \
129
            "psrlq         $8, %%mm7    \n\t" \
129
            "psrlq         $8, %%mm7    \n\t" \
130
            "pand "MANGLE(mask24l)", %%mm0\n\t" \
130
            "pand        %2, %%mm0\n\t" \
131
            "pand "MANGLE(mask24l)", %%mm1\n\t" \
131
            "pand        %2, %%mm1\n\t" \
132
            "pand "MANGLE(mask24l)", %%mm4\n\t" \
132
            "pand        %2, %%mm4\n\t" \
133
            "pand "MANGLE(mask24l)", %%mm5\n\t" \
133
            "pand        %2, %%mm5\n\t" \
134
            "pand "MANGLE(mask24h)", %%mm2\n\t" \
134
            "pand        %3, %%mm2\n\t" \
135
            "pand "MANGLE(mask24h)", %%mm3\n\t" \
135
            "pand        %3, %%mm3\n\t" \
136
            "pand "MANGLE(mask24h)", %%mm6\n\t" \
136
            "pand        %3, %%mm6\n\t" \
137
            "pand "MANGLE(mask24h)", %%mm7\n\t" \
137
            "pand        %3, %%mm7\n\t" \
138
            "por        %%mm2, %%mm0    \n\t" \
138
            "por        %%mm2, %%mm0    \n\t" \
139
            "por        %%mm3, %%mm1    \n\t" \
139
            "por        %%mm3, %%mm1    \n\t" \
140
            "por        %%mm6, %%mm4    \n\t" \
140
            "por        %%mm6, %%mm4    \n\t" \
Lines 144-157 Link Here
144
            "movq       %%mm4, %%mm3    \n\t" \
144
            "movq       %%mm4, %%mm3    \n\t" \
145
            "psllq        $48, %%mm2    \n\t" \
145
            "psllq        $48, %%mm2    \n\t" \
146
            "psllq        $32, %%mm3    \n\t" \
146
            "psllq        $32, %%mm3    \n\t" \
147
            "pand "MANGLE(mask24hh)", %%mm2\n\t" \
147
            "pand         %4, %%mm2\n\t" \
148
            "pand "MANGLE(mask24hhh)", %%mm3\n\t" \
148
            "pand         %5, %%mm3\n\t" \
149
            "por        %%mm2, %%mm0    \n\t" \
149
            "por        %%mm2, %%mm0    \n\t" \
150
            "psrlq        $16, %%mm1    \n\t" \
150
            "psrlq        $16, %%mm1    \n\t" \
151
            "psrlq        $32, %%mm4    \n\t" \
151
            "psrlq        $32, %%mm4    \n\t" \
152
            "psllq        $16, %%mm5    \n\t" \
152
            "psllq        $16, %%mm5    \n\t" \
153
            "por        %%mm3, %%mm1    \n\t" \
153
            "por        %%mm3, %%mm1    \n\t" \
154
            "pand  "MANGLE(mask24hhhh)", %%mm5\n\t" \
154
            "pand         %6, %%mm5\n\t" \
155
            "por        %%mm5, %%mm4    \n\t" \
155
            "por        %%mm5, %%mm4    \n\t" \
156
 \
156
 \
157
            MOVNTQ"     %%mm0,   %0     \n\t" \
157
            MOVNTQ"     %%mm0,   %0     \n\t" \
Lines 184-190 Link Here
184
            "movq       %%mm5, %%mm7    \n\t"
184
            "movq       %%mm5, %%mm7    \n\t"
185
            STORE_BGR24_MMX
185
            STORE_BGR24_MMX
186
            :"=m"(*dest)
186
            :"=m"(*dest)
187
            :"m"(*s)
187
            :"m"(*s), "m"(mask24l), "m"(mask24h), "m"(mask24hh), "m"(mask24hhh), "m"(mask24hhhh)
188
            :"memory");
188
            :"memory");
189
        dest += 24;
189
        dest += 24;
190
        s += 32;
190
        s += 32;
Lines 977-983 Link Here
977
            STORE_BGR24_MMX
977
            STORE_BGR24_MMX
978
978
979
            :"=m"(*d)
979
            :"=m"(*d)
980
            :"m"(*s)
980
            :"m"(*s), "m"(mask24l), "m"(mask24h), "m"(mask24hh), "m"(mask24hhh), "m"(mask24hhhh)
981
            :"memory");
981
            :"memory");
982
        d += 24;
982
        d += 24;
983
        s += 8;
983
        s += 8;
Lines 1083-1089 Link Here
1083
            STORE_BGR24_MMX
1083
            STORE_BGR24_MMX
1084
1084
1085
            :"=m"(*d)
1085
            :"=m"(*d)
1086
            :"m"(*s)
1086
            :"m"(*s), "m"(mask24l), "m"(mask24h), "m"(mask24hh), "m"(mask24hhh), "m"(mask24hhhh)
1087
            :"memory");
1087
            :"memory");
1088
        d += 24;
1088
        d += 24;
1089
        s += 8;
1089
        s += 8;
Lines 1297-1305 Link Here
1297
    __asm__ volatile (
1297
    __asm__ volatile (
1298
        "test             %%"REG_a", %%"REG_a"          \n\t"
1298
        "test             %%"REG_a", %%"REG_a"          \n\t"
1299
        "jns                     2f                     \n\t"
1299
        "jns                     2f                     \n\t"
1300
        "movq     "MANGLE(mask24r)", %%mm5              \n\t"
1300
        "movq                %3, %%mm5              \n\t"
1301
        "movq     "MANGLE(mask24g)", %%mm6              \n\t"
1301
        "movq                %4, %%mm6              \n\t"
1302
        "movq     "MANGLE(mask24b)", %%mm7              \n\t"
1302
        "movq                %5, %%mm7              \n\t"
1303
        ASMALIGN(4)
1303
        ASMALIGN(4)
1304
        "1:                                             \n\t"
1304
        "1:                                             \n\t"
1305
        PREFETCH" 32(%1, %%"REG_a")                     \n\t"
1305
        PREFETCH" 32(%1, %%"REG_a")                     \n\t"
Lines 1335-1341 Link Here
1335
        " js                     1b                     \n\t"
1335
        " js                     1b                     \n\t"
1336
        "2:                                             \n\t"
1336
        "2:                                             \n\t"
1337
        : "+a" (mmx_size)
1337
        : "+a" (mmx_size)
1338
        : "r" (src-mmx_size), "r"(dst-mmx_size)
1338
        : "r" (src-mmx_size), "r"(dst-mmx_size), "m"(mask24r), "m"(mask24g), "m"(mask24b)
1339
    );
1339
    );
1340
1340
1341
    __asm__ volatile(SFENCE:::"memory");
1341
    __asm__ volatile(SFENCE:::"memory");
Lines 2007-2014 Link Here
2007
        for (i=0; i<2; i++) {
2007
        for (i=0; i<2; i++) {
2008
            __asm__ volatile(
2008
            __asm__ volatile(
2009
                "mov                        %2, %%"REG_a"   \n\t"
2009
                "mov                        %2, %%"REG_a"   \n\t"
2010
                "movq  "MANGLE(ff_bgr2YCoeff)", %%mm6       \n\t"
2010
                "movq                      %3, %%mm6       \n\t"
2011
                "movq       "MANGLE(ff_w1111)", %%mm5       \n\t"
2011
                "movq                      %4, %%mm5       \n\t"
2012
                "pxor                    %%mm7, %%mm7       \n\t"
2012
                "pxor                    %%mm7, %%mm7       \n\t"
2013
                "lea (%%"REG_a", %%"REG_a", 2), %%"REG_d"   \n\t"
2013
                "lea (%%"REG_a", %%"REG_a", 2), %%"REG_d"   \n\t"
2014
                ASMALIGN(4)
2014
                ASMALIGN(4)
Lines 2066-2077 Link Here
2066
                "psraw                      $7, %%mm4       \n\t"
2066
                "psraw                      $7, %%mm4       \n\t"
2067
2067
2068
                "packuswb                %%mm4, %%mm0       \n\t"
2068
                "packuswb                %%mm4, %%mm0       \n\t"
2069
                "paddusb "MANGLE(ff_bgr2YOffset)", %%mm0    \n\t"
2069
                "paddusb                           %5, %%mm0    \n\t"
2070
2070
2071
                MOVNTQ"                  %%mm0, (%1, %%"REG_a") \n\t"
2071
                MOVNTQ"                  %%mm0, (%1, %%"REG_a") \n\t"
2072
                "add                        $8,      %%"REG_a"  \n\t"
2072
                "add                        $8,      %%"REG_a"  \n\t"
2073
                " js                        1b                  \n\t"
2073
                " js                        1b                  \n\t"
2074
                : : "r" (src+width*3), "r" (ydst+width), "g" ((x86_reg)-width)
2074
                : : "r" (src+width*3), "r" (ydst+width), "g" ((x86_reg)-width),
2075
                "m"(ff_bgr2YCoeff), "m"(ff_w1111), "m"(ff_bgr2YOffset)
2075
                : "%"REG_a, "%"REG_d
2076
                : "%"REG_a, "%"REG_d
2076
            );
2077
            );
2077
            ydst += lumStride;
2078
            ydst += lumStride;
Lines 2080-2087 Link Here
2080
        src -= srcStride*2;
2081
        src -= srcStride*2;
2081
        __asm__ volatile(
2082
        __asm__ volatile(
2082
            "mov                        %4, %%"REG_a"   \n\t"
2083
            "mov                        %4, %%"REG_a"   \n\t"
2083
            "movq       "MANGLE(ff_w1111)", %%mm5       \n\t"
2084
            "movq                      %5, %%mm5       \n\t"
2084
            "movq  "MANGLE(ff_bgr2UCoeff)", %%mm6       \n\t"
2085
            "movq                      %6, %%mm6       \n\t"
2085
            "pxor                    %%mm7, %%mm7       \n\t"
2086
            "pxor                    %%mm7, %%mm7       \n\t"
2086
            "lea (%%"REG_a", %%"REG_a", 2), %%"REG_d"   \n\t"
2087
            "lea (%%"REG_a", %%"REG_a", 2), %%"REG_d"   \n\t"
2087
            "add                 %%"REG_d", %%"REG_d"   \n\t"
2088
            "add                 %%"REG_d", %%"REG_d"   \n\t"
Lines 2130-2137 Link Here
2130
            "psrlw                      $2, %%mm0       \n\t"
2131
            "psrlw                      $2, %%mm0       \n\t"
2131
            "psrlw                      $2, %%mm2       \n\t"
2132
            "psrlw                      $2, %%mm2       \n\t"
2132
#endif
2133
#endif
2133
            "movq  "MANGLE(ff_bgr2VCoeff)", %%mm1       \n\t"
2134
            "movq                     %7, %%mm1       \n\t"
2134
            "movq  "MANGLE(ff_bgr2VCoeff)", %%mm3       \n\t"
2135
            "movq                     %7, %%mm3       \n\t"
2135
2136
2136
            "pmaddwd                 %%mm0, %%mm1       \n\t"
2137
            "pmaddwd                 %%mm0, %%mm1       \n\t"
2137
            "pmaddwd                 %%mm2, %%mm3       \n\t"
2138
            "pmaddwd                 %%mm2, %%mm3       \n\t"
Lines 2188-2199 Link Here
2188
            "paddw                   %%mm1, %%mm5       \n\t"
2189
            "paddw                   %%mm1, %%mm5       \n\t"
2189
            "paddw                   %%mm3, %%mm2       \n\t"
2190
            "paddw                   %%mm3, %%mm2       \n\t"
2190
            "paddw                   %%mm5, %%mm2       \n\t"
2191
            "paddw                   %%mm5, %%mm2       \n\t"
2191
            "movq       "MANGLE(ff_w1111)", %%mm5       \n\t"
2192
            "movq                              %5, %%mm5       \n\t"
2192
            "psrlw                      $2, %%mm4       \n\t"
2193
            "psrlw                      $2, %%mm4       \n\t"
2193
            "psrlw                      $2, %%mm2       \n\t"
2194
            "psrlw                      $2, %%mm2       \n\t"
2194
#endif
2195
#endif
2195
            "movq  "MANGLE(ff_bgr2VCoeff)", %%mm1       \n\t"
2196
            "movq                      %7, %%mm1       \n\t"
2196
            "movq  "MANGLE(ff_bgr2VCoeff)", %%mm3       \n\t"
2197
            "movq                      %7, %%mm3       \n\t"
2197
2198
2198
            "pmaddwd                 %%mm4, %%mm1       \n\t"
2199
            "pmaddwd                 %%mm4, %%mm1       \n\t"
2199
            "pmaddwd                 %%mm2, %%mm3       \n\t"
2200
            "pmaddwd                 %%mm2, %%mm3       \n\t"
Lines 2217-2229 Link Here
2217
            "punpckldq               %%mm4, %%mm0           \n\t"
2218
            "punpckldq               %%mm4, %%mm0           \n\t"
2218
            "punpckhdq               %%mm4, %%mm1           \n\t"
2219
            "punpckhdq               %%mm4, %%mm1           \n\t"
2219
            "packsswb                %%mm1, %%mm0           \n\t"
2220
            "packsswb                %%mm1, %%mm0           \n\t"
2220
            "paddb "MANGLE(ff_bgr2UVOffset)", %%mm0         \n\t"
2221
            "paddb                      %8, %%mm0         \n\t"
2221
            "movd                    %%mm0, (%2, %%"REG_a") \n\t"
2222
            "movd                    %%mm0, (%2, %%"REG_a") \n\t"
2222
            "punpckhdq               %%mm0, %%mm0           \n\t"
2223
            "punpckhdq               %%mm0, %%mm0           \n\t"
2223
            "movd                    %%mm0, (%3, %%"REG_a") \n\t"
2224
            "movd                    %%mm0, (%3, %%"REG_a") \n\t"
2224
            "add                        $4, %%"REG_a"       \n\t"
2225
            "add                        $4, %%"REG_a"       \n\t"
2225
            " js                        1b                  \n\t"
2226
            " js                        1b                  \n\t"
2226
            : : "r" (src+chromWidth*6), "r" (src+srcStride+chromWidth*6), "r" (udst+chromWidth), "r" (vdst+chromWidth), "g" (-chromWidth)
2227
            : : "r" (src+chromWidth*6), "r" (src+srcStride+chromWidth*6), "r" (udst+chromWidth), "r" (vdst+chromWidth), "g" (-chromWidth),
2228
            "m"(ff_w1111), "m"(ff_bgr2UCoeff), "m"(ff_bgr2VCoeff), "m"(ff_bgr2UVOffset)
2227
            : "%"REG_a, "%"REG_d
2229
            : "%"REG_a, "%"REG_d
2228
        );
2230
        );
2229
2231
(-)a/libswscale/swscale.c (-13 lines)
Lines 156-174 Link Here
156
DECLARE_ALIGNED(8, const uint64_t, ff_M24B)         = 0xFF0000FF0000FF00LL;
156
DECLARE_ALIGNED(8, const uint64_t, ff_M24B)         = 0xFF0000FF0000FF00LL;
157
DECLARE_ALIGNED(8, const uint64_t, ff_M24C)         = 0x0000FF0000FF0000LL;
157
DECLARE_ALIGNED(8, const uint64_t, ff_M24C)         = 0x0000FF0000FF0000LL;
158
158
159
#ifdef FAST_BGR2YV12
160
DECLARE_ALIGNED(8, const uint64_t, ff_bgr2YCoeff)   = 0x000000210041000DULL;
161
DECLARE_ALIGNED(8, const uint64_t, ff_bgr2UCoeff)   = 0x0000FFEEFFDC0038ULL;
162
DECLARE_ALIGNED(8, const uint64_t, ff_bgr2VCoeff)   = 0x00000038FFD2FFF8ULL;
163
#else
164
DECLARE_ALIGNED(8, const uint64_t, ff_bgr2YCoeff)   = 0x000020E540830C8BULL;
165
DECLARE_ALIGNED(8, const uint64_t, ff_bgr2UCoeff)   = 0x0000ED0FDAC23831ULL;
166
DECLARE_ALIGNED(8, const uint64_t, ff_bgr2VCoeff)   = 0x00003831D0E6F6EAULL;
167
#endif /* FAST_BGR2YV12 */
168
DECLARE_ALIGNED(8, const uint64_t, ff_bgr2YOffset)  = 0x1010101010101010ULL;
169
DECLARE_ALIGNED(8, const uint64_t, ff_bgr2UVOffset) = 0x8080808080808080ULL;
170
DECLARE_ALIGNED(8, const uint64_t, ff_w1111)        = 0x0001000100010001ULL;
171
172
DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toY1Coeff) = 0x0C88000040870C88ULL;
159
DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toY1Coeff) = 0x0C88000040870C88ULL;
173
DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toY2Coeff) = 0x20DE4087000020DEULL;
160
DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toY2Coeff) = 0x20DE4087000020DEULL;
174
DECLARE_ASM_CONST(8, uint64_t, ff_rgb24toY1Coeff) = 0x20DE0000408720DEULL;
161
DECLARE_ASM_CONST(8, uint64_t, ff_rgb24toY1Coeff) = 0x20DE0000408720DEULL;

Return to bug 179872