Revision 8a322796 libswscale/rgb2rgb_template.c

View differences:

libswscale/rgb2rgb_template.c
1 1
/*
2
 *  rgb2rgb.c, Software RGB to RGB convertor
3
 *  pluralize by Software PAL8 to RGB convertor
4
 *               Software YUV to YUV convertor
5
 *               Software YUV to RGB convertor
6
 *  Written by Nick Kurshev.
7
 *  palette & YUV & runtime CPU stuff by Michael (michaelni@gmx.at)
8
 *  lot of big-endian byteorder fixes by Alex Beregszaszi
2
 * software RGB to RGB converter
3
 * pluralize by software PAL8 to RGB converter
4
 *              software YUV to YUV converter
5
 *              software YUV to RGB converter
6
 * Written by Nick Kurshev.
7
 * palette & YUV & runtime CPU stuff by Michael (michaelni@gmx.at)
8
 * lot of big-endian byte order fixes by Alex Beregszaszi
9 9
 *
10 10
 * This file is part of FFmpeg.
11 11
 *
......
23 23
 * along with FFmpeg; if not, write to the Free Software
24 24
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 25
 *
26
 * The C code (not assembly, mmx, ...) of this file can be used
26
 * The C code (not assembly, MMX, ...) of this file can be used
27 27
 * under the LGPL license.
28 28
 */
29 29

  
......
229 229
}
230 230

  
231 231
/*
232
 Original by Strepto/Astral
233
 ported to gcc & bugfixed : A'rpi
232
 original by Strepto/Astral
233
 ported to gcc & bugfixed: A'rpi
234 234
 MMX2, 3DNOW optimization by Nick Kurshev
235
 32 bit C version, and and&add trick by Michael Niedermayer
235
 32-bit C version, and and&add trick by Michael Niedermayer
236 236
*/
237 237
static inline void RENAME(rgb15to16)(const uint8_t *src, uint8_t *dst, long src_size)
238 238
{
......
926 926
   ----------------
927 927
   1 1 0 1 1  1 1 0
928 928
   |=======|  |===|
929
       |      Leftmost Bits Repeated to Fill Open Bits
929
       |      leftmost bits repeated to fill open bits
930 930
       |
931
   Original Bits
931
   original bits
932 932
*/
933 933
static inline void RENAME(rgb15to24)(const uint8_t *src, uint8_t *dst, long src_size)
934 934
{
......
1006 1006
        :"=m"(*d)
1007 1007
        :"m"(*s),"m"(mask15b),"m"(mask15g),"m"(mask15r), "m"(mmx_null)
1008 1008
        :"memory");
1009
        /* Borrowed 32 to 24 */
1009
        /* borrowed 32 to 24 */
1010 1010
        asm volatile(
1011 1011
        "movq       %%mm0, %%mm4    \n\t"
1012 1012
        "movq       %%mm3, %%mm5    \n\t"
......
1147 1147
        :"=m"(*d)
1148 1148
        :"m"(*s),"m"(mask16b),"m"(mask16g),"m"(mask16r),"m"(mmx_null)
1149 1149
        :"memory");
1150
        /* Borrowed 32 to 24 */
1150
        /* borrowed 32 to 24 */
1151 1151
        asm volatile(
1152 1152
        "movq       %%mm0, %%mm4    \n\t"
1153 1153
        "movq       %%mm3, %%mm5    \n\t"
......
1479 1479
    asm volatile(SFENCE:::"memory");
1480 1480
    asm volatile(EMMS:::"memory");
1481 1481

  
1482
    if (mmx_size==23) return; //finihsed, was multiple of 8
1482
    if (mmx_size==23) return; //finished, was multiple of 8
1483 1483

  
1484 1484
    src+= src_size;
1485 1485
    dst+= src_size;
......
1638 1638
}
1639 1639

  
1640 1640
/**
1641
 * Height should be a multiple of 2 and width should be a multiple of 16 (if
1642
 * this is a problem for anyone then tell me, and I will fix it).
1641
 * Height should be a multiple of 2 and width should be a multiple of 16.
1642
 * (If this is a problem for anyone then tell me, and I will fix it.)
1643 1643
 */
1644 1644
static inline void RENAME(yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
1645 1645
                                      long width, long height,
......
1720 1720
                (vc[0] << 8) + (yc[1] << 0);
1721 1721
#else
1722 1722
            *idst++ = uc[0] + (yc[0] << 8) +
1723
                (vc[0] << 16) + (yc[1] << 24);
1723
               (vc[0] << 16) + (yc[1] << 24);
1724 1724
#endif
1725 1725
            yc += 2;
1726 1726
            uc++;
......
1744 1744
}
1745 1745

  
1746 1746
/**
1747
 * Height should be a multiple of 2 and width should be a multiple of 16 (if
1748
 * this is a problem for anyone then tell me, and I will fix it).
1747
 * Height should be a multiple of 2 and width should be a multiple of 16
1748
 * (If this is a problem for anyone then tell me, and I will fix it.)
1749 1749
 */
1750 1750
static inline void RENAME(yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
1751 1751
                                      long width, long height,
......
1766 1766
}
1767 1767

  
1768 1768
/**
1769
 * Height should be a multiple of 2 and width should be a multiple of 16 (if
1770
 * this is a problem for anyone then tell me, and I will fix it).
1769
 * Height should be a multiple of 2 and width should be a multiple of 16.
1770
 * (If this is a problem for anyone then tell me, and I will fix it.)
1771 1771
 */
1772 1772
static inline void RENAME(yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
1773 1773
                                      long width, long height,
......
2002 2002
}
2003 2003

  
2004 2004
/**
2005
 * Height should be a multiple of 2 and width should be a multiple of 16 (if
2006
 * this is a problem for anyone then tell me, and I will fix it).
2007
 * Chrominance data is only taken from every secound line, others are ignored.
2005
 * Height should be a multiple of 2 and width should be a multiple of 16.
2006
 * (If this is a problem for anyone then tell me, and I will fix it.)
2007
 * Chrominance data is only taken from every second line, others are ignored.
2008 2008
 * FIXME: Write HQ version.
2009 2009
 */
2010 2010
static inline void RENAME(uyvytoyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
......
2128 2128
}
2129 2129

  
2130 2130
/**
2131
 * Height should be a multiple of 2 and width should be a multiple of 2 (if
2132
 * this is a problem for anyone then tell me, and I will fix it).
2133
 * Chrominance data is only taken from every secound line,
2131
 * Height should be a multiple of 2 and width should be a multiple of 2.
2132
 * (If this is a problem for anyone then tell me, and I will fix it.)
2133
 * Chrominance data is only taken from every second line,
2134 2134
 * others are ignored in the C version.
2135 2135
 * FIXME: Write HQ version.
2136 2136
 */

Also available in: Unified diff