Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

i422_yuy2.h

00001 /*****************************************************************************
00002  * i422_yuy2.h : YUV to YUV conversion module for vlc
00003  *****************************************************************************
00004  * Copyright (C) 2002 the VideoLAN team
00005  * $Id: i422_yuy2.h 11664 2005-07-09 06:17:09Z courmisch $
00006  *
00007  * Authors: Samuel Hocevar <[email protected]>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  * 
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00022  *****************************************************************************/
00023 
00024 #ifdef MODULE_NAME_IS_i422_yuy2_mmx
00025 
00026 #define MMX_YUV422_YUYV "                                                 \n\
00027 movq       (%1), %%mm0  # Load 8 Y            y7 y6 y5 y4 y3 y2 y1 y0     \n\
00028 movd       (%2), %%mm1  # Load 4 Cb           00 00 00 00 u3 u2 u1 u0     \n\
00029 movd       (%3), %%mm2  # Load 4 Cr           00 00 00 00 v3 v2 v1 v0     \n\
00030 punpcklbw %%mm2, %%mm1  #                     v3 u3 v2 u2 v1 u1 v0 u0     \n\
00031 movq      %%mm0, %%mm2  #                     y7 y6 y5 y4 y3 y2 y1 y0     \n\
00032 punpcklbw %%mm1, %%mm2  #                     v1 y3 u1 y2 v0 y1 u0 y0     \n\
00033 movq      %%mm2, (%0)   # Store low YUYV                                  \n\
00034 punpckhbw %%mm1, %%mm0  #                     v3 y7 u3 y6 v2 y5 u2 y4     \n\
00035 movq      %%mm0, 8(%0)  # Store high YUYV                                 \n\
00036 "
00037 
00038 #define MMX_YUV422_YVYU "                                                 \n\
00039 movq       (%1), %%mm0  # Load 8 Y            y7 y6 y5 y4 y3 y2 y1 y0     \n\
00040 movd       (%2), %%mm2  # Load 4 Cb           00 00 00 00 u3 u2 u1 u0     \n\
00041 movd       (%3), %%mm1  # Load 4 Cr           00 00 00 00 v3 v2 v1 v0     \n\
00042 punpcklbw %%mm2, %%mm1  #                     u3 v3 u2 v2 u1 v1 u0 v0     \n\
00043 movq      %%mm0, %%mm2  #                     y7 y6 y5 y4 y3 y2 y1 y0     \n\
00044 punpcklbw %%mm1, %%mm2  #                     u1 y3 v1 y2 u0 y1 v0 y0     \n\
00045 movq      %%mm2, (%0)   # Store low YUYV                                  \n\
00046 punpckhbw %%mm1, %%mm0  #                     u3 y7 v3 y6 u2 y5 v2 y4     \n\
00047 movq      %%mm0, 8(%0)  # Store high YUYV                                 \n\
00048 "
00049 
00050 #define MMX_YUV422_UYVY "                                                 \n\
00051 movq       (%1), %%mm0  # Load 8 Y            y7 y6 y5 y4 y3 y2 y1 y0     \n\
00052 movd       (%2), %%mm2  # Load 4 Cb           00 00 00 00 u3 u2 u1 u0     \n\
00053 movd       (%3), %%mm1  # Load 4 Cr           00 00 00 00 v3 v2 v1 v0     \n\
00054 punpcklbw %%mm2, %%mm1  #                     u3 v3 u2 v2 u1 v1 u0 v0     \n\
00055 movq      %%mm1, %%mm2  #                     u3 v3 u2 v2 u1 v1 u0 v0     \n\
00056 punpcklbw %%mm0, %%mm2  #                     y3 v1 y2 u1 y1 v0 y0 u0     \n\
00057 movq      %%mm2, (%0)   # Store low UYVY                                  \n\
00058 punpckhbw %%mm0, %%mm1  #                     y7 v3 y6 u3 y5 v2 y4 u2     \n\
00059 movq      %%mm1, 8(%0)  # Store high UYVY                                 \n\
00060 "
00061 
00062 #define MMX_YUV422_Y211 "                                                 \n\
00063 "
00064 
00065 #else
00066 
00067 #define C_YUV422_YUYV( p_line, p_y, p_u, p_v )                              \
00068     *(p_line)++ = *(p_y)++;                                                 \
00069     *(p_line)++ = *(p_u)++;                                                 \
00070     *(p_line)++ = *(p_y)++;                                                 \
00071     *(p_line)++ = *(p_v)++;                                                 \
00072 
00073 #define C_YUV422_YVYU( p_line, p_y, p_u, p_v )                              \
00074     *(p_line)++ = *(p_y)++;                                                 \
00075     *(p_line)++ = *(p_v)++;                                                 \
00076     *(p_line)++ = *(p_y)++;                                                 \
00077     *(p_line)++ = *(p_u)++;                                                 \
00078 
00079 #define C_YUV422_UYVY( p_line, p_y, p_u, p_v )                              \
00080     *(p_line)++ = *(p_u)++;                                                 \
00081     *(p_line)++ = *(p_y)++;                                                 \
00082     *(p_line)++ = *(p_v)++;                                                 \
00083     *(p_line)++ = *(p_y)++;                                                 \
00084 
00085 #define C_YUV422_Y211( p_line, p_y, p_u, p_v )                              \
00086     *(p_line)++ = *(p_y); p_y += 2;                                         \
00087     *(p_line)++ = *(p_u) - 0x80; p_u += 2;                                  \
00088     *(p_line)++ = *(p_y); p_y += 2;                                         \
00089     *(p_line)++ = *(p_v) - 0x80; p_v += 2;                                  \
00090 
00091 #endif
00092 

Generated on Tue Dec 20 10:14:51 2005 for vlc-0.8.4a by  doxygen 1.4.2