~ubuntu-branches/ubuntu/lucid/gavl/lucid

« back to all changes in this revision

Viewing changes to gavl/mmx/_yuv_rgb_mmx.c

  • Committer: Bazaar Package Importer
  • Author(s): Romain Beauxis
  • Date: 2008-11-07 13:47:46 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20081107134746-s4s970fo1bcde9zw
Tags: 1.0.1-1
* Adopted package for debian, with the blessing of previous maintainer.
* Based new package on Christian Marillat's package for debian-multimedia.
* Removed support for ccache until I figure out how to make it work
  with cdbs.
* Changed library package name since ABI is not backward compatible, but
  upstream did not bump major soversion.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*****************************************************************
2
 
 
3
 
  _yuv_rgb_mmx.c
4
 
 
5
 
  Copyright (c) 2001 by Burkhard Plaum - plaum@ipf.uni-stuttgart.de
6
 
 
7
 
  http://gmerlin.sourceforge.net
8
 
 
9
 
  This program is distributed in the hope that it will be useful,
10
 
  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 
  GNU General Public License for more details.
13
 
 
14
 
  You should have received a copy of the GNU General Public License
15
 
  along with this program; if not, write to the Free Software
16
 
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
17
 
 
18
 
*****************************************************************/
19
 
 
20
 
/*
21
 
 *  Support for mmxext
22
 
 *  this macro procudes another set of
23
 
 *  functions in ../mmxext
24
 
 */
25
 
 
26
 
#ifdef MMXEXT
27
 
#define MOVQ_R2M(reg,mem) movntq_r2m(reg, mem)
28
 
#else
29
 
#define MOVQ_R2M(reg,mem) movq_r2m(reg, mem)
30
 
#endif
31
 
 
32
 
 
33
 
/* Constants for YUV -> RGB conversion */
34
 
 
35
 
static mmx_t mmx_80w =     { 0x0080008000800080LL };
36
 
 
37
 
 
38
 
static mmx_t mmx_U_green = { 0xf37df37df37df37dLL }; // U Green: -3203 (= -0.34414*255.0/224.0 * 8192)
39
 
static mmx_t mmx_U_blue =  { 0x4093409340934093LL }; // U Blue:  16531 (=  1.77200*255.0/224.0 * 8192)
40
 
static mmx_t mmx_V_red =   { 0x3312331233123312LL }; // V red:   13074 (=  1.40200*255.0/224.0 * 8192)
41
 
static mmx_t mmx_V_green = { 0xe5fce5fce5fce5fcLL }; // V Green: -6660 (= -0.71414*255.0/224.0 * 8192)
42
 
static mmx_t mmx_Y_coeff = { 0x253f253f253f253fLL }; // Y Coeff:  9535 (=          255.0/219.0 * 8192)
43
 
 
44
 
#if 1
45
 
static mmx_t mmx_UJ_green = { 0xf4fdf4fdf4fdf4fdLL }; // U Green: -2819 (= -0.34414 * 8192)
46
 
static mmx_t mmx_UJ_blue =  { 0x38b438b438b438b4LL }; // U Blue:  14516 (=  1.77200 * 8192)
47
 
static mmx_t mmx_VJ_red =   { 0x2cdd2cdd2cdd2cddLL }; // V red:   11485 (=  1.40200 * 8192)
48
 
static mmx_t mmx_VJ_green = { 0xe926e926e926e926LL }; // V Green: -5850 (= -0.71414 * 8192)
49
 
static mmx_t mmx_YJ_coeff = { 0x2000200020002000LL }; // Y Coeff:  8192 (=            8192)
50
 
#endif
51
 
 
52
 
static mmx_t mmx_10w =     { 0x1010101010101010LL };
53
 
static mmx_t mmx_00ffw =   { 0x00ff00ff00ff00ffLL };
54
 
static mmx_t mmx_ff00w =   { 0xff00ff00ff00ff00LL };
55
 
 
56
 
/* Macros for loading the YUV images into the MMX registers */
57
 
 
58
 
#define LOAD_YUV_PLANAR_2 movq_m2r (*src_y, mm6);\
59
 
                          movd_m2r (*src_u, mm0);\
60
 
                          movd_m2r (*src_v, mm1);\
61
 
                          pxor_r2r (mm4, mm4);
62
 
 
63
 
#define INIT_YUV_PLANAR_4 int32_t i_tmp;
64
 
 
65
 
#define LOAD_YUV_PLANAR_4 movq_m2r (*src_y, mm6);\
66
 
                          i_tmp = (((int32_t)src_u[1])) << 8 | src_u[0];\
67
 
                          movd_m2r (i_tmp, mm0); \
68
 
                          i_tmp = (((int32_t)src_v[1])) << 8 | src_v[0];\
69
 
                          movd_m2r (i_tmp, mm1);\
70
 
                          pxor_r2r (mm4, mm4);\
71
 
                          punpcklbw_r2r(mm4, mm0);\
72
 
                          punpcklbw_r2r(mm4, mm1);\
73
 
                          movq_r2r (mm0, mm2);\
74
 
                          psllw_i2r(8,mm2);\
75
 
                          por_r2r(mm2, mm0);\
76
 
                          movq_r2r (mm1, mm2);\
77
 
                          psllw_i2r(8,mm2);\
78
 
                          por_r2r(mm2, mm1);
79
 
 
80
 
#define LOAD_YUY2  movq_m2r(*src,mm0);/*          mm0: V2 Y3 U2 Y2 V0 Y1 U0 Y0 */\
81
 
                   movq_m2r(*(src+8),mm1);/*      mm1: V6 Y7 U6 Y6 V4 Y5 U4 Y4 */\
82
 
                   movq_r2r(mm0,mm2);/*           mm2: V2 Y3 U2 Y2 V0 Y1 U0 Y0 */\
83
 
                   pand_m2r(mmx_00ffw,mm2);/*     mm2: 00 Y3 00 Y2 00 Y1 00 Y0 */\
84
 
                   pxor_r2r(mm4, mm4);/*          Zero mm4 */\
85
 
                   packuswb_r2r(mm4,mm2);/*       mm2: 00 00 00 00 Y3 Y2 Y1 Y0 */\
86
 
                   movq_r2r(mm1,mm3);/*           mm3: V6 Y7 U6 Y6 V4 Y5 U4 Y4 */\
87
 
                   pand_m2r(mmx_00ffw,mm3);/*     mm3: 00 Y7 00 Y6 00 Y5 00 Y4 */\
88
 
                   pxor_r2r(mm6, mm6);/*          Zero mm6 */\
89
 
                   packuswb_r2r(mm3,mm6);/*       mm6: Y7 Y6 Y5 Y4 00 00 00 00 */\
90
 
                   por_r2r(mm2,mm6);/*            mm6: Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 */\
91
 
                   psrlw_i2r(8,mm0);/*            mm0: 00 V2 00 U2 00 V0 00 U0 */\
92
 
                   psrlw_i2r(8,mm1);/*            mm1: 00 V6 00 U6 00 V4 00 U4 */\
93
 
                   packuswb_r2r(mm1,mm0);/*       mm0: V6 U6 V4 U4 V2 U2 V0 U0 */\
94
 
                   movq_r2r(mm0,mm1);/*           mm1: V6 U6 V4 U4 V2 U2 V0 U0 */\
95
 
                   pand_m2r(mmx_00ffw,mm0);/*     mm0: 00 U6 00 U4 00 U2 00 U0 */\
96
 
                   psrlw_i2r(8,mm1);/*            mm1: 00 V6 00 V4 00 V2 00 V0 */\
97
 
                   packuswb_r2r(mm4,mm0);/*       mm0: 00 00 00 00 U6 U4 U2 U0 */\
98
 
                   packuswb_r2r(mm4,mm1);/*       mm1: 00 00 00 00 V6 V4 V2 V0 */
99
 
 
100
 
#define LOAD_UYVY  movq_m2r(*src,mm0);/*          mm0: Y3 V2 Y2 U2 Y1 V0 Y0 U0 */\
101
 
                   movq_m2r(*(src+8),mm1);/*      mm1: Y7 V6 Y6 U6 Y5 V4 Y4 U4 */\
102
 
                   movq_r2r(mm0,mm2);/*           mm2: Y3 V2 Y2 U2 Y1 V0 Y0 U0 */\
103
 
                   pand_m2r(mmx_ff00w,mm2);/*     mm2: Y3 00 Y2 00 Y1 00 Y0 00 */\
104
 
                   psrlw_i2r(8,mm2);/*            mm2: 00 Y3 00 Y2 00 Y1 00 Y0 */\
105
 
                   pxor_r2r(mm4, mm4);/*          Zero mm4 */                    \
106
 
                   packuswb_r2r(mm4,mm2);/*       mm2: 00 00 00 00 Y3 Y2 Y1 Y0 */\
107
 
                   movq_r2r(mm1,mm3);/*           mm3: Y7 V6 Y6 U6 Y5 V4 Y4 U4 */\
108
 
                   pand_m2r(mmx_ff00w,mm3);/*     mm3: Y7 00 Y6 00 Y5 00 Y4 00 */\
109
 
                   psrlw_i2r(8,mm3);/*            mm3: 00 Y7 00 Y6 00 Y5 00 Y4 */\
110
 
                   pxor_r2r(mm6, mm6);/*          Zero mm6 */\
111
 
                   packuswb_r2r(mm3,mm6);/*       mm6: Y7 Y6 Y5 Y4 00 00 00 00 */\
112
 
                   por_r2r(mm2,mm6);/*            mm6: Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 */\
113
 
                   pand_m2r(mmx_00ffw,mm0);/*     mm0: 00 V2 00 U2 00 V0 00 U0 */\
114
 
                   pand_m2r(mmx_00ffw,mm1);/*     mm1: 00 V6 00 U6 00 V4 00 U4 */\
115
 
                   packuswb_r2r(mm1,mm0);/*       mm0: V6 U6 V4 U4 V2 U2 V0 U0 */\
116
 
                   movq_r2r(mm0,mm1);/*           mm1: V6 U6 V4 U4 V2 U2 V0 U0 */\
117
 
                   pand_m2r(mmx_00ffw,mm0);/*     mm0: 00 U6 00 U4 00 U2 00 U0 */\
118
 
                   psrlw_i2r(8,mm1);/*            mm1: 00 V6 00 V4 00 V2 00 V0 */\
119
 
                   packuswb_r2r(mm4,mm0);/*       mm0: 00 00 00 00 U6 U4 U2 U0 */\
120
 
                   packuswb_r2r(mm4,mm1);/*       mm1: 00 00 00 00 V6 V4 V2 V0 */
121
 
 
122
 
/* This macro converts 8 Pixels at once (taken from mpeg2dec) */
123
 
 
124
 
/*
125
 
 * Before the conversion:
126
 
 *
127
 
 * mm0 = 00 00 00 00 u3 u2 u1 u0
128
 
 * mm1 = 00 00 00 00 v3 v2 v1 v0
129
 
 * mm6 = Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0
130
 
 * mm4 = 00 00 00 00 00 00 00 00 (must be zerod before!)
131
 
 * After the conversion:
132
 
 *
133
 
 * mm0 = B7 B6 B5 B4 B3 B2 B1 B0
134
 
 * mm1 = R7 R6 R5 R4 R3 R2 R1 R0
135
 
 * mm2 = G7 G6 G5 G4 G3 G2 G1 G0
136
 
 *
137
 
 */
138
 
 
139
 
#define YUV_2_RGB punpcklbw_r2r (mm4, mm0);/*      mm0 = u3 u2 u1 u0 */\
140
 
                  punpcklbw_r2r (mm4, mm1);/*      mm1 = v3 v2 v1 v0 */\
141
 
                  psubsw_m2r (mmx_80w, mm0);/*     u -= 128 */\
142
 
                  psubsw_m2r (mmx_80w, mm1);/*     v -= 128 */\
143
 
                  psllw_i2r (3, mm0);/*            promote precision */\
144
 
                  psllw_i2r (3, mm1);/*            promote precision */\
145
 
                  movq_r2r (mm0, mm2);/*           mm2 = u3 u2 u1 u0 */\
146
 
                  movq_r2r (mm1, mm3);/*           mm3 = v3 v2 v1 v0 */\
147
 
                  pmulhw_m2r (mmx_U_green, mm2);/* mm2 = u * u_green */\
148
 
                  pmulhw_m2r (mmx_V_green, mm3);/* mm3 = v * v_green */\
149
 
                  pmulhw_m2r (mmx_U_blue, mm0);/*  mm0 = chroma_b */\
150
 
                  pmulhw_m2r (mmx_V_red, mm1);/*   mm1 = chroma_r */\
151
 
                  paddsw_r2r (mm3, mm2);/*         mm2 = chroma_g */\
152
 
                  psubusb_m2r (mmx_10w, mm6);/*    Y -= 16  */\
153
 
                  movq_r2r (mm6, mm7);/*           mm7 = Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 */\
154
 
                  pand_m2r (mmx_00ffw, mm6);/*     mm6 =    Y6    Y4    Y2    Y0 */\
155
 
                  psrlw_i2r (8, mm7);/*            mm7 =    Y7    Y5    Y3    Y1 */\
156
 
                  psllw_i2r (3, mm6);/*            promote precision */\
157
 
                  psllw_i2r (3, mm7);/*            promote precision */\
158
 
                  pmulhw_m2r (mmx_Y_coeff, mm6);/* mm6 = luma_rgb even */\
159
 
                  pmulhw_m2r (mmx_Y_coeff, mm7);/* mm7 = luma_rgb odd */\
160
 
                  movq_r2r (mm0, mm3);/*           mm3 = chroma_b */\
161
 
                  movq_r2r (mm1, mm4);/*           mm4 = chroma_r */\
162
 
                  movq_r2r (mm2, mm5);/*           mm5 = chroma_g */\
163
 
                  paddsw_r2r (mm6, mm0);/*         mm0 = B6 B4 B2 B0 */\
164
 
                  paddsw_r2r (mm7, mm3);/*         mm3 = B7 B5 B3 B1 */\
165
 
                  paddsw_r2r (mm6, mm1);/*         mm1 = R6 R4 R2 R0 */\
166
 
                  paddsw_r2r (mm7, mm4);/*         mm4 = R7 R5 R3 R1 */\
167
 
                  paddsw_r2r (mm6, mm2);/*         mm2 = G6 G4 G2 G0 */\
168
 
                  paddsw_r2r (mm7, mm5);/*         mm5 = G7 G5 G3 G1 */\
169
 
                  packuswb_r2r (mm0, mm0);/*       saturate to 0-255 */\
170
 
                  packuswb_r2r (mm1, mm1);/*       saturate to 0-255 */\
171
 
                  packuswb_r2r (mm2, mm2);/*       saturate to 0-255 */\
172
 
                  packuswb_r2r (mm3, mm3);/*       saturate to 0-255 */\
173
 
                  packuswb_r2r (mm4, mm4);/*       saturate to 0-255 */\
174
 
                  packuswb_r2r (mm5, mm5);/*       saturate to 0-255 */\
175
 
                  punpcklbw_r2r (mm3, mm0);/*      mm0 = B7 B6 B5 B4 B3 B2 B1 B0 */\
176
 
                  punpcklbw_r2r (mm4, mm1);/*      mm1 = R7 R6 R5 R4 R3 R2 R1 R0 */\
177
 
                  punpcklbw_r2r (mm5, mm2);/*      mm2 = G7 G6 G5 G4 G3 G2 G1 G0 */
178
 
 
179
 
/* Same as above, but for JPEG quantization */
180
 
 
181
 
#define YUVJ_2_RGB punpcklbw_r2r (mm4, mm0);/*      mm0 = u3 u2 u1 u0 */\
182
 
                  punpcklbw_r2r (mm4, mm1);/*      mm1 = v3 v2 v1 v0 */\
183
 
                  psubsw_m2r (mmx_80w, mm0);/*     u -= 128 */\
184
 
                  psubsw_m2r (mmx_80w, mm1);/*     v -= 128 */\
185
 
                  psllw_i2r (3, mm0);/*            promote precision */\
186
 
                  psllw_i2r (3, mm1);/*            promote precision */\
187
 
                  movq_r2r (mm0, mm2);/*           mm2 = u3 u2 u1 u0 */\
188
 
                  movq_r2r (mm1, mm3);/*           mm3 = v3 v2 v1 v0 */\
189
 
                  pmulhw_m2r (mmx_UJ_green, mm2);/* mm2 = u * u_green */\
190
 
                  pmulhw_m2r (mmx_VJ_green, mm3);/* mm3 = v * v_green */\
191
 
                  pmulhw_m2r (mmx_UJ_blue, mm0);/*  mm0 = chroma_b */\
192
 
                  pmulhw_m2r (mmx_VJ_red, mm1);/*   mm1 = chroma_r */\
193
 
                  paddsw_r2r (mm3, mm2);/*         mm2 = chroma_g */\
194
 
                  /* psubusb_m2r (mmx_10w, mm6);      Y -= 16  */\
195
 
                  movq_r2r (mm6, mm7);/*           mm7 = Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 */\
196
 
                  pand_m2r (mmx_00ffw, mm6);/*     mm6 =    Y6    Y4    Y2    Y0 */\
197
 
                  psrlw_i2r (8, mm7);/*            mm7 =    Y7    Y5    Y3    Y1 */\
198
 
                  psllw_i2r (3, mm6);/*            promote precision */\
199
 
                  psllw_i2r (3, mm7);/*            promote precision */\
200
 
                  pmulhw_m2r (mmx_YJ_coeff, mm6);/* mm6 = luma_rgb even */\
201
 
                  pmulhw_m2r (mmx_YJ_coeff, mm7);/* mm7 = luma_rgb odd */\
202
 
                  movq_r2r (mm0, mm3);/*           mm3 = chroma_b */\
203
 
                  movq_r2r (mm1, mm4);/*           mm4 = chroma_r */\
204
 
                  movq_r2r (mm2, mm5);/*           mm5 = chroma_g */\
205
 
                  paddsw_r2r (mm6, mm0);/*         mm0 = B6 B4 B2 B0 */\
206
 
                  paddsw_r2r (mm7, mm3);/*         mm3 = B7 B5 B3 B1 */\
207
 
                  paddsw_r2r (mm6, mm1);/*         mm1 = R6 R4 R2 R0 */\
208
 
                  paddsw_r2r (mm7, mm4);/*         mm4 = R7 R5 R3 R1 */\
209
 
                  paddsw_r2r (mm6, mm2);/*         mm2 = G6 G4 G2 G0 */\
210
 
                  paddsw_r2r (mm7, mm5);/*         mm5 = G7 G5 G3 G1 */\
211
 
                  packuswb_r2r (mm0, mm0);/*       saturate to 0-255 */\
212
 
                  packuswb_r2r (mm1, mm1);/*       saturate to 0-255 */\
213
 
                  packuswb_r2r (mm2, mm2);/*       saturate to 0-255 */\
214
 
                  packuswb_r2r (mm3, mm3);/*       saturate to 0-255 */\
215
 
                  packuswb_r2r (mm4, mm4);/*       saturate to 0-255 */\
216
 
                  packuswb_r2r (mm5, mm5);/*       saturate to 0-255 */\
217
 
                  punpcklbw_r2r (mm3, mm0);/*      mm0 = B7 B6 B5 B4 B3 B2 B1 B0 */\
218
 
                  punpcklbw_r2r (mm4, mm1);/*      mm1 = R7 R6 R5 R4 R3 R2 R1 R0 */\
219
 
                  punpcklbw_r2r (mm5, mm2);/*      mm2 = G7 G6 G5 G4 G3 G2 G1 G0 */
220
 
 
221
 
 
222
 
/*******************************************
223
 
 *   Output Macros
224
 
 *******************************************/
225
 
 
226
 
/*
227
 
 *  mm0 = B7 B6 B5 B4 B3 B2 B1 B0
228
 
 *  mm1 = R7 R6 R5 R4 R3 R2 R1 R0
229
 
 *  mm2 = G7 G6 G5 G4 G3 G2 G1 G0
230
 
 */
231
 
 
232
 
#define OUTPUT_BGR_32 pxor_r2r (mm3, mm3);\
233
 
                      movq_r2r (mm0, mm6);\
234
 
                      punpcklbw_r2r (mm2, mm6);\
235
 
                      movq_r2r (mm1, mm7);\
236
 
                      punpcklbw_r2r (mm3, mm7);\
237
 
                      movq_r2r (mm0, mm4);\
238
 
                      punpcklwd_r2r (mm7, mm6);\
239
 
                      movq_r2r (mm1, mm5);\
240
 
                      MOVQ_R2M (mm6, *dst);\
241
 
                      movq_r2r (mm0, mm6);\
242
 
                      punpcklbw_r2r (mm2, mm6);\
243
 
                      punpckhwd_r2r (mm7, mm6);\
244
 
                      MOVQ_R2M (mm6, *(dst+8));\
245
 
                      punpckhbw_r2r (mm2, mm4);\
246
 
                      punpckhbw_r2r (mm3, mm5);\
247
 
                      punpcklwd_r2r (mm5, mm4);\
248
 
                      MOVQ_R2M (mm4, *(dst+16));\
249
 
                      movq_r2r (mm0, mm4);\
250
 
                      punpckhbw_r2r (mm2, mm4);\
251
 
                      punpckhwd_r2r (mm5, mm4);\
252
 
                      MOVQ_R2M (mm4, *(dst+24));
253
 
 
254
 
#define OUTPUT_RGB_32 pxor_r2r (mm3, mm3);\
255
 
                      movq_r2r (mm1, mm6);\
256
 
                      punpcklbw_r2r (mm2, mm6);\
257
 
                      movq_r2r (mm0, mm7);\
258
 
                      punpcklbw_r2r (mm3, mm7);\
259
 
                      movq_r2r (mm1, mm4);\
260
 
                      punpcklwd_r2r (mm7, mm6);\
261
 
                      movq_r2r (mm0, mm5);\
262
 
                      MOVQ_R2M (mm6, *dst);\
263
 
                      movq_r2r (mm1, mm6);\
264
 
                      punpcklbw_r2r (mm2, mm6);\
265
 
                      punpckhwd_r2r (mm7, mm6);\
266
 
                      MOVQ_R2M (mm6, *(dst+8));\
267
 
                      punpckhbw_r2r (mm2, mm4);\
268
 
                      punpckhbw_r2r (mm3, mm5);\
269
 
                      punpcklwd_r2r (mm5, mm4);\
270
 
                      MOVQ_R2M (mm4, *(dst+16));\
271
 
                      movq_r2r (mm1, mm4);\
272
 
                      punpckhbw_r2r (mm2, mm4);\
273
 
                      punpckhwd_r2r (mm5, mm4);\
274
 
                      MOVQ_R2M (mm4, *(dst+24));
275
 
 
276
 
static mmx_t yuv_rgb_lowest_word = { 0x000000000000FFFFLL };
277
 
static mmx_t yuv_rgb_lowest_byte = { 0x00000000000000FFLL };
278
 
 
279
 
/*
280
 
 *  mm0 = B7 B6 B5 B4 B3 B2 B1 B0
281
 
 *  mm1 = R7 R6 R5 R4 R3 R2 R1 R0
282
 
 *  mm2 = G7 G6 G5 G4 G3 G2 G1 G0
283
 
 */
284
 
 
285
 
#define OUTPUT_RGB_24 pxor_r2r(mm3, mm3);/*                 Zero -> mm3 */\
286
 
                      movq_r2r(mm2, mm4);/*                 mm4: G7 G6 G5 G4 G3 G2 G1 G0 */\
287
 
                      movq_r2r(mm1, mm5);/*                 mm5: R7 R6 R5 R4 R3 R2 R1 R0 */\
288
 
                      movq_r2r(mm1, mm5);/*                 mm5: R7 R6 R5 R4 R3 R2 R1 R0 */\
289
 
                      punpcklbw_r2r(mm3, mm5);/*            mm5: 00 R3 00 R2 00 R1 00 R0 */\
290
 
                      punpcklbw_r2r(mm4, mm3);/*            mm3: G3 00 G2 00 G1 00 G0 00 */\
291
 
                      por_r2r(mm5, mm3);/*                  mm3: G3 R3 G2 R2 G1 R1 G0 R0 */\
292
 
                      movq_r2r(mm0, mm5);/*                 mm5: B7 B6 B5 B4 B3 B2 B1 B0 */\
293
 
                      pand_m2r(yuv_rgb_lowest_byte, mm5);/* mm5: 00 00 00 00 00 00 00 B0 */\
294
 
                      movq_r2r(mm3, mm7);/*                 mm7: G3 R3 G2 R2 G1 R1 G0 R0 */\
295
 
                      pand_m2r(yuv_rgb_lowest_word, mm7);/* mm7: 00 00 00 00 00 00 G0 R0 */\
296
 
                      psllq_i2r(16, mm5);/*                 mm5: 00 00 00 00 00 B0 00 00 */\
297
 
                      por_r2r(mm5, mm7);/*                  mm7: 00 00 00 00 00 B0 G0 R0 */\
298
 
                      psrlq_i2r(16, mm3);/*                 mm3: 00 00 G3 R3 G2 R2 G1 R1 */\
299
 
                      psrlq_i2r(8, mm0);/*                  mm0: 00 B7 B6 B5 B4 B3 B2 B1 */\
300
 
                      movq_r2r(mm0, mm5);/*                 mm5: 00 B7 B6 B5 B4 B3 B2 B1 */\
301
 
                      pand_m2r(yuv_rgb_lowest_byte, mm5);/* mm5: 00 00 00 00 00 00 00 B1 */\
302
 
                      psllq_i2r(40, mm5);/*                 mm5: 00 00 B1 00 00 00 00 00 */\
303
 
                      por_r2r(mm5, mm7);/*                  mm7: 00 00 B1 00 00 B0 G0 R0 */\
304
 
                      movq_r2r(mm3, mm6);/*                 mm7: 00 00 G3 R3 G2 R2 G1 R1 */\
305
 
                      pand_m2r(yuv_rgb_lowest_word, mm6);/* mm6: 00 00 00 00 00 00 G1 R1 */\
306
 
                      psllq_i2r(24, mm6);/*                 mm6: 00 00 00 G1 R1 00 00 00 */\
307
 
                      por_r2r(mm6, mm7);/*                  mm7: 00 00 B1 G1 R1 B0 G0 R0 */\
308
 
                      psrlq_i2r(16, mm3);/*                 mm3: 00 00 00 00 G3 R3 G2 R2 */\
309
 
                      psrlq_i2r(8, mm0);/*                  mm0: 00 00 B7 B6 B5 B4 B3 B2 */\
310
 
                      movq_r2r(mm3, mm6);/*                 mm6: 00 00 00 00 G3 R3 G2 R2 */\
311
 
                      pand_m2r(yuv_rgb_lowest_word, mm6);/* mm6: 00 00 00 00 00 00 G2 R2 */\
312
 
                      psllq_i2r(48, mm6);/*                 mm6: G2 R2 00 00 00 00 00 00 */\
313
 
                      por_r2r(mm6, mm7);/*                  mm7: G2 R2 B1 G1 R1 B0 G0 R0 */\
314
 
                      MOVQ_R2M(mm7, *dst);\
315
 
                      movq_r2r(mm0, mm7);/*                 mm7: 00 00 B7 B6 B5 B4 B3 B2 */\
316
 
                      pand_m2r(yuv_rgb_lowest_byte, mm7);/* mm7: 00 00 00 00 00 00 00 B2 */\
317
 
                      psrlq_i2r(16, mm3);/*                 mm3: 00 00 00 00 00 00 G3 R3 */\
318
 
                      psllq_i2r(8, mm3);/*                  mm3: 00 00 00 00 00 G3 R3 00 */\
319
 
                      por_r2r(mm3, mm7);/*                  mm7: 00 00 00 00 00 G3 R3 B2 */\
320
 
                      psrlq_i2r(8, mm0);/*                  mm0: 00 00 00 B7 B6 B5 B4 B3 */\
321
 
                      movq_r2r(mm0, mm5);/*                 mm5: 00 00 00 B7 B6 B5 B4 B3 */\
322
 
                      pand_m2r(yuv_rgb_lowest_byte, mm5);/* mm5: 00 00 00 00 00 00 00 B3 */\
323
 
                      psllq_i2r(24, mm5);/*                 mm5: 00 00 00 00 B3 00 00 00 */\
324
 
                      por_r2r(mm5, mm7);/*                  mm7: 00 00 00 00 B3 G3 R3 B2 */\
325
 
                      psrlq_i2r(32, mm1);/*                 mm1: 00 00 00 00 R7 R6 R5 R4 */\
326
 
                      psrlq_i2r(32, mm2);/*                 mm2: 00 00 00 00 G7 G6 G5 G4 */\
327
 
                      psrlq_i2r(8, mm0);/*                  mm0: 00 00 00 00 B7 B6 B5 B4 */\
328
 
                      punpcklbw_r2r(mm0, mm2);/*            mm2: B7 G7 B6 G6 B5 G5 B4 G4 */\
329
 
                      movq_r2r(mm1, mm5);/*                 mm5: 00 00 00 00 R7 R6 R5 R4 */\
330
 
                      pand_m2r(yuv_rgb_lowest_byte, mm5);/* mm5: 00 00 00 00 00 00 00 R4 */\
331
 
                      psllq_i2r(32, mm5);/*                 mm5: 00 00 00 R4 00 00 00 00 */\
332
 
                      por_r2r(mm5, mm7);/*                  mm7: 00 00 00 R4 B3 G3 R3 B2 */\
333
 
                      movq_r2r(mm2, mm6);/*                 mm6: B7 G7 B6 G6 B5 G5 B4 G4 */\
334
 
                      pand_m2r(yuv_rgb_lowest_word, mm6);/* mm6: 00 00 00 00 00 00 B4 G4 */\
335
 
                      psllq_i2r(40, mm6);/*                 mm6: 00 B4 G4 00 00 00 00 00 */\
336
 
                      por_r2r(mm6, mm7);/*                  mm7: 00 B4 G4 R4 B3 G3 R3 B2 */\
337
 
                      psrlq_i2r(8, mm1);/*                  mm1: 00 00 00 00 00 R7 R6 R5 */\
338
 
                      psrlq_i2r(16, mm2);/*                 mm2: 00 00 B7 G7 B6 G6 B5 G5 */\
339
 
                      movq_r2r(mm1, mm5);/*                 mm5: 00 00 00 00 00 R7 R6 R5 */\
340
 
                      psllq_i2r(56, mm5);/*                 mm5: R5 00 00 00 00 00 00 00 */\
341
 
                      por_r2r(mm5, mm7);/*                  mm7: R5 B4 G4 R4 B3 G3 R3 B2 */\
342
 
                      MOVQ_R2M(mm7, *(dst+8));\
343
 
                      movq_r2r(mm2, mm7);/*                 mm7: 00 00 B7 G7 B6 G6 B5 G5 */\
344
 
                      pand_m2r(yuv_rgb_lowest_word, mm7);/* mm7: 00 00 00 00 00 00 B5 G5 */\
345
 
                      psrlq_i2r(8, mm1);/*                  mm1: 00 00 00 00 00 00 R7 R6 */\
346
 
                      psrlq_i2r(16, mm2);/*                 mm2: 00 00 00 00 B7 G7 B6 G6 */\
347
 
                      movq_r2r(mm1, mm5);/*                 mm5: 00 00 00 00 00 00 R7 R6 */\
348
 
                      pand_m2r(yuv_rgb_lowest_byte, mm5);/* mm5: 00 00 00 00 00 00 00 R6 */\
349
 
                      psllq_i2r(16, mm5);/*                 mm5: 00 00 00 00 00 R6 00 00 */\
350
 
                      por_r2r(mm5, mm7);/*                  mm7: 00 00 00 00 00 R6 B5 G5 */\
351
 
                      movq_r2r(mm2, mm6);/*                 mm6: 00 00 00 00 B7 G7 B6 G6 */\
352
 
                      pand_m2r(yuv_rgb_lowest_word, mm6);/* mm6: 00 00 00 00 00 00 B6 G6 */\
353
 
                      psllq_i2r(24, mm6);/*                 mm5: 00 00 00 B6 G6 00 00 00 */\
354
 
                      por_r2r(mm6, mm7);/*                  mm7: 00 00 00 B6 G6 R6 B5 G5 */\
355
 
                      psrlq_i2r(8, mm1);/*                  mm1: 00 00 00 00 00 00 00 R7 */\
356
 
                      psrlq_i2r(16, mm2);/*                 mm2: 00 00 00 00 00 00 B7 G7 */\
357
 
                      psllq_i2r(40, mm1);/*                 mm1: 00 00 R7 00 00 00 00 00 */\
358
 
                      psllq_i2r(48, mm2);/*                 mm2: B7 G7 00 00 00 00 00 00 */\
359
 
                      por_r2r(mm1, mm7);\
360
 
                      por_r2r(mm2, mm7);\
361
 
                      MOVQ_R2M(mm7, *(dst+16));\
362
 
 
363
 
#define OUTPUT_BGR_24 pxor_r2r(mm3, mm3);/*                 Zero -> mm3 */\
364
 
                      movq_r2r(mm2, mm4);/*                 mm4: G7 G6 G5 G4 G3 G2 G1 G0 */\
365
 
                      movq_r2r(mm0, mm5);/*                 mm5: R7 R6 R5 R4 R3 R2 R1 R0 */\
366
 
                      movq_r2r(mm0, mm5);/*                 mm5: R7 R6 R5 R4 R3 R2 R1 R0 */\
367
 
                      punpcklbw_r2r(mm3, mm5);/*            mm5: 00 R3 00 R2 00 R1 00 R0 */\
368
 
                      punpcklbw_r2r(mm4, mm3);/*            mm3: G3 00 G2 00 G1 00 G0 00 */\
369
 
                      por_r2r(mm5, mm3);/*                  mm3: G3 R3 G2 R2 G1 R1 G0 R0 */\
370
 
                      movq_r2r(mm1, mm5);/*                 mm5: B7 B6 B5 B4 B3 B2 B1 B0 */\
371
 
                      pand_m2r(yuv_rgb_lowest_byte, mm5);/* mm5: 00 00 00 00 00 00 00 B0 */\
372
 
                      movq_r2r(mm3, mm7);/*                 mm7: G3 R3 G2 R2 G1 R1 G0 R0 */\
373
 
                      pand_m2r(yuv_rgb_lowest_word, mm7);/* mm7: 00 00 00 00 00 00 G0 R0 */\
374
 
                      psllq_i2r(16, mm5);/*                 mm5: 00 00 00 00 00 B0 00 00 */\
375
 
                      por_r2r(mm5, mm7);/*                  mm7: 00 00 00 00 00 B0 G0 R0 */\
376
 
                      psrlq_i2r(16, mm3);/*                 mm3: 00 00 G3 R3 G2 R2 G1 R1 */\
377
 
                      psrlq_i2r(8, mm1);/*                  mm1: 00 B7 B6 B5 B4 B3 B2 B1 */\
378
 
                      movq_r2r(mm1, mm5);/*                 mm5: 00 B7 B6 B5 B4 B3 B2 B1 */\
379
 
                      pand_m2r(yuv_rgb_lowest_byte, mm5);/* mm5: 00 00 00 00 00 00 00 B1 */\
380
 
                      psllq_i2r(40, mm5);/*                 mm5: 00 00 B1 00 00 00 00 00 */\
381
 
                      por_r2r(mm5, mm7);/*                  mm7: 00 00 B1 00 00 B0 G0 R0 */\
382
 
                      movq_r2r(mm3, mm6);/*                 mm7: 00 00 G3 R3 G2 R2 G1 R1 */\
383
 
                      pand_m2r(yuv_rgb_lowest_word, mm6);/* mm6: 00 00 00 00 00 00 G1 R1 */\
384
 
                      psllq_i2r(24, mm6);/*                 mm6: 00 00 00 G1 R1 00 00 00 */\
385
 
                      por_r2r(mm6, mm7);/*                  mm7: 00 00 B1 G1 R1 B0 G0 R0 */\
386
 
                      psrlq_i2r(16, mm3);/*                 mm3: 00 00 00 00 G3 R3 G2 R2 */\
387
 
                      psrlq_i2r(8, mm1);/*                  mm1: 00 00 B7 B6 B5 B4 B3 B2 */\
388
 
                      movq_r2r(mm3, mm6);/*                 mm6: 00 00 00 00 G3 R3 G2 R2 */\
389
 
                      pand_m2r(yuv_rgb_lowest_word, mm6);/* mm6: 00 00 00 00 00 00 G2 R2 */\
390
 
                      psllq_i2r(48, mm6);/*                 mm6: G2 R2 00 00 00 00 00 00 */\
391
 
                      por_r2r(mm6, mm7);/*                  mm7: G2 R2 B1 G1 R1 B0 G0 R0 */\
392
 
                      MOVQ_R2M(mm7, *dst);\
393
 
                      movq_r2r(mm1, mm7);/*                 mm7: 00 00 B7 B6 B5 B4 B3 B2 */\
394
 
                      pand_m2r(yuv_rgb_lowest_byte, mm7);/* mm7: 00 00 00 00 00 00 00 B2 */\
395
 
                      psrlq_i2r(16, mm3);/*                 mm3: 00 00 00 00 00 00 G3 R3 */\
396
 
                      psllq_i2r(8, mm3);/*                  mm3: 00 00 00 00 00 G3 R3 00 */\
397
 
                      por_r2r(mm3, mm7);/*                  mm7: 00 00 00 00 00 G3 R3 B2 */\
398
 
                      psrlq_i2r(8, mm1);/*                  mm1: 00 00 00 B7 B6 B5 B4 B3 */\
399
 
                      movq_r2r(mm1, mm5);/*                 mm5: 00 00 00 B7 B6 B5 B4 B3 */\
400
 
                      pand_m2r(yuv_rgb_lowest_byte, mm5);/* mm5: 00 00 00 00 00 00 00 B3 */\
401
 
                      psllq_i2r(24, mm5);/*                 mm5: 00 00 00 00 B3 00 00 00 */\
402
 
                      por_r2r(mm5, mm7);/*                  mm7: 00 00 00 00 B3 G3 R3 B2 */\
403
 
                      psrlq_i2r(32, mm0);/*                 mm0: 00 00 00 00 R7 R6 R5 R4 */\
404
 
                      psrlq_i2r(32, mm2);/*                 mm2: 00 00 00 00 G7 G6 G5 G4 */\
405
 
                      psrlq_i2r(8, mm1);/*                  mm1: 00 00 00 00 B7 B6 B5 B4 */\
406
 
                      punpcklbw_r2r(mm1, mm2);/*            mm2: B7 G7 B6 G6 B5 G5 B4 G4 */\
407
 
                      movq_r2r(mm0, mm5);/*                 mm5: 00 00 00 00 R7 R6 R5 R4 */\
408
 
                      pand_m2r(yuv_rgb_lowest_byte, mm5);/* mm5: 00 00 00 00 00 00 00 R4 */\
409
 
                      psllq_i2r(32, mm5);/*                 mm5: 00 00 00 R4 00 00 00 00 */\
410
 
                      por_r2r(mm5, mm7);/*                  mm7: 00 00 00 R4 B3 G3 R3 B2 */\
411
 
                      movq_r2r(mm2, mm6);/*                 mm6: B7 G7 B6 G6 B5 G5 B4 G4 */\
412
 
                      pand_m2r(yuv_rgb_lowest_word, mm6);/* mm6: 00 00 00 00 00 00 B4 G4 */\
413
 
                      psllq_i2r(40, mm6);/*                 mm6: 00 B4 G4 00 00 00 00 00 */\
414
 
                      por_r2r(mm6, mm7);/*                  mm7: 00 B4 G4 R4 B3 G3 R3 B2 */\
415
 
                      psrlq_i2r(8, mm0);/*                  mm0: 00 00 00 00 00 R7 R6 R5 */\
416
 
                      psrlq_i2r(16, mm2);/*                 mm2: 00 00 B7 G7 B6 G6 B5 G5 */\
417
 
                      movq_r2r(mm0, mm5);/*                 mm5: 00 00 00 00 00 R7 R6 R5 */\
418
 
                      psllq_i2r(56, mm5);/*                 mm5: R5 00 00 00 00 00 00 00 */\
419
 
                      por_r2r(mm5, mm7);/*                  mm7: R5 B4 G4 R4 B3 G3 R3 B2 */\
420
 
                      MOVQ_R2M(mm7, *(dst+8));\
421
 
                      movq_r2r(mm2, mm7);/*                 mm7: 00 00 B7 G7 B6 G6 B5 G5 */\
422
 
                      pand_m2r(yuv_rgb_lowest_word, mm7);/* mm7: 00 00 00 00 00 00 B5 G5 */\
423
 
                      psrlq_i2r(8, mm0);/*                  mm0: 00 00 00 00 00 00 R7 R6 */\
424
 
                      psrlq_i2r(16, mm2);/*                 mm2: 00 00 00 00 B7 G7 B6 G6 */\
425
 
                      movq_r2r(mm0, mm5);/*                 mm5: 00 00 00 00 00 00 R7 R6 */\
426
 
                      pand_m2r(yuv_rgb_lowest_byte, mm5);/* mm5: 00 00 00 00 00 00 00 R6 */\
427
 
                      psllq_i2r(16, mm5);/*                 mm5: 00 00 00 00 00 R6 00 00 */\
428
 
                      por_r2r(mm5, mm7);/*                  mm7: 00 00 00 00 00 R6 B5 G5 */\
429
 
                      movq_r2r(mm2, mm6);/*                 mm6: 00 00 00 00 B7 G7 B6 G6 */\
430
 
                      pand_m2r(yuv_rgb_lowest_word, mm6);/* mm6: 00 00 00 00 00 00 B6 G6 */\
431
 
                      psllq_i2r(24, mm6);/*                 mm5: 00 00 00 B6 G6 00 00 00 */\
432
 
                      por_r2r(mm6, mm7);/*                  mm7: 00 00 00 B6 G6 R6 B5 G5 */\
433
 
                      psrlq_i2r(8, mm0);/*                  mm0: 00 00 00 00 00 00 00 R7 */\
434
 
                      psrlq_i2r(16, mm2);/*                 mm2: 00 00 00 00 00 00 B7 G7 */\
435
 
                      psllq_i2r(40, mm0);/*                 mm0: 00 00 R7 00 00 00 00 00 */\
436
 
                      psllq_i2r(48, mm2);/*                 mm2: B7 G7 00 00 00 00 00 00 */\
437
 
                      por_r2r(mm0, mm7);\
438
 
                      por_r2r(mm2, mm7);\
439
 
                      MOVQ_R2M(mm7, *(dst+16));\
440
 
 
441
 
 
442
 
 
443
 
static mmx_t rgba32_alphamask = {0xff000000ff000000LL};
444
 
 
445
 
#define OUTPUT_RGBA_32 pxor_r2r (mm3, mm3);\
446
 
                       movq_r2r (mm1, mm6);\
447
 
                       punpcklbw_r2r (mm2, mm6);\
448
 
                       movq_r2r (mm0, mm7);\
449
 
                       punpcklbw_r2r (mm3, mm7);\
450
 
                       movq_r2r (mm1, mm4);\
451
 
                       punpcklwd_r2r (mm7, mm6);\
452
 
                       movq_r2r (mm0, mm5);\
453
 
                       por_m2r (rgba32_alphamask, mm6);\
454
 
                       MOVQ_R2M (mm6, *dst);\
455
 
                       movq_r2r (mm1, mm6);\
456
 
                       punpcklbw_r2r (mm2, mm6);\
457
 
                       punpckhwd_r2r (mm7, mm6);\
458
 
                       por_m2r (rgba32_alphamask, mm6);\
459
 
                       MOVQ_R2M (mm6, *(dst+8));\
460
 
                       punpckhbw_r2r (mm2, mm4);\
461
 
                       punpckhbw_r2r (mm3, mm5);\
462
 
                       punpcklwd_r2r (mm5, mm4);\
463
 
                       por_m2r (rgba32_alphamask, mm4);\
464
 
                       MOVQ_R2M (mm4, *(dst+16));\
465
 
                       movq_r2r (mm1, mm4);\
466
 
                       punpckhbw_r2r (mm2, mm4);\
467
 
                       punpckhwd_r2r (mm5, mm4);\
468
 
                       por_m2r (rgba32_alphamask, mm4);\
469
 
                       MOVQ_R2M (mm4, *(dst+24));
470
 
 
471
 
static mmx_t rgb16_bluemask = {0xf8f8f8f8f8f8f8f8LL};
472
 
static mmx_t rgb16_greenmask = {0xfcfcfcfcfcfcfcfcLL};
473
 
static mmx_t rgb16_redmask = {0xf8f8f8f8f8f8f8f8LL};
474
 
 
475
 
#define OUTPUT_RGB_16 pand_m2r (rgb16_bluemask, mm0);/*  mm0 = b7b6b5b4b3______ */\
476
 
                      pxor_r2r (mm4, mm4);/*             mm4 = 0                */\
477
 
                      pand_m2r (rgb16_greenmask, mm2);/* mm2 = g7g6g5g4g3g2____ */\
478
 
                      psrlq_i2r (3, mm0);/*              mm0 = ______b7b6b5b4b3 */\
479
 
                      movq_r2r (mm2, mm7);/*             mm7 = g7g6g5g4g3g2____ */\
480
 
                      movq_r2r (mm0, mm5);/*             mm5 = ______b7b6b5b4b3 */\
481
 
                      pand_m2r (rgb16_redmask, mm1);/*   mm1 = r7r6r5r4r3______ */\
482
 
                      punpcklbw_r2r (mm4, mm2);\
483
 
                      punpcklbw_r2r (mm1, mm0);\
484
 
                      psllq_i2r (3, mm2);\
485
 
                      punpckhbw_r2r (mm4, mm7);\
486
 
                      por_r2r (mm2, mm0);\
487
 
                      psllq_i2r (3, mm7);\
488
 
                      MOVQ_R2M (mm0, *dst);\
489
 
                      punpckhbw_r2r (mm1, mm5);\
490
 
                      por_r2r (mm7, mm5);\
491
 
                      MOVQ_R2M (mm5, *(dst+8));
492
 
 
493
 
#define OUTPUT_BGR_16 pand_m2r (rgb16_bluemask, mm1);/*  mm0 = b7b6b5b4b3______ */\
494
 
                      pxor_r2r (mm4, mm4);/*             mm4 = 0                */\
495
 
                      pand_m2r (rgb16_greenmask, mm2);/* mm2 = g7g6g5g4g3g2____ */\
496
 
                      psrlq_i2r (3, mm1);/*              mm0 = ______b7b6b5b4b3 */\
497
 
                      movq_r2r (mm2, mm7);/*             mm7 = g7g6g5g4g3g2____ */\
498
 
                      movq_r2r (mm1, mm5);/*             mm5 = ______b7b6b5b4b3 */\
499
 
                      pand_m2r (rgb16_redmask, mm0);/*   mm1 = r7r6r5r4r3______ */\
500
 
                      punpcklbw_r2r (mm4, mm2);\
501
 
                      punpcklbw_r2r (mm0, mm1);\
502
 
                      psllq_i2r (3, mm2);\
503
 
                      punpckhbw_r2r (mm4, mm7);\
504
 
                      por_r2r (mm2, mm1);\
505
 
                      psllq_i2r (3, mm7);\
506
 
                      MOVQ_R2M (mm1, *dst);\
507
 
                      punpckhbw_r2r (mm0, mm5);\
508
 
                      por_r2r (mm7, mm5);\
509
 
                      MOVQ_R2M (mm5, *(dst+8));\
510
 
 
511
 
 
512
 
static mmx_t rgb15_bluemask = {0xf8f8f8f8f8f8f8f8LL};
513
 
static mmx_t rgb15_greenmask = {0xf8f8f8f8f8f8f8f8LL};
514
 
static mmx_t rgb15_redmask = {0xf8f8f8f8f8f8f8f8LL};
515
 
 
516
 
#define OUTPUT_RGB_15 pand_m2r (rgb15_bluemask, mm0);/*  mm0 = b7b6b5b4b3______ */\
517
 
                      pxor_r2r (mm4, mm4);/*             mm4 = 0                */\
518
 
                      pand_m2r (rgb15_greenmask, mm2);/* mm2 = g7g6g5g4g3g2____ */\
519
 
                      psrlq_i2r (3, mm0);/*              mm0 = ______b7b6b5b4b3 */\
520
 
                      movq_r2r (mm2, mm7);/*             mm7 = g7g6g5g4g3g2____ */\
521
 
                      movq_r2r (mm0, mm5);/*             mm5 = ______b7b6b5b4b3 */\
522
 
                      pand_m2r (rgb15_redmask, mm1);/*   mm1 = r7r6r5r4r3______ */\
523
 
                      punpcklbw_r2r (mm4, mm2);\
524
 
                      psrlq_i2r (1, mm1);\
525
 
                      punpcklbw_r2r (mm1, mm0);\
526
 
                      psllq_i2r (2, mm2);\
527
 
                      punpckhbw_r2r (mm4, mm7);\
528
 
                      por_r2r (mm2, mm0);\
529
 
                      psllq_i2r (2, mm7);\
530
 
                      MOVQ_R2M(mm0, *dst);\
531
 
                      punpckhbw_r2r (mm1, mm5);\
532
 
                      por_r2r (mm7, mm5);\
533
 
                      MOVQ_R2M(mm5, *(dst+8));
534
 
 
535
 
#define OUTPUT_BGR_15 pand_m2r (rgb15_bluemask, mm1);/*  mm0 = b7b6b5b4b3______ */\
536
 
                      pxor_r2r (mm4, mm4);/*             mm4 = 0                */\
537
 
                      pand_m2r (rgb15_greenmask, mm2);/* mm2 = g7g6g5g4g3g2____ */\
538
 
                      psrlq_i2r (3, mm1);/*              mm0 = ______b7b6b5b4b3 */\
539
 
                      movq_r2r (mm2, mm7);/*             mm7 = g7g6g5g4g3g2____ */\
540
 
                      movq_r2r (mm1, mm5);/*             mm5 = ______b7b6b5b4b3 */\
541
 
                      pand_m2r (rgb15_redmask, mm0);/*   mm1 = r7r6r5r4r3______ */\
542
 
                      punpcklbw_r2r (mm4, mm2);\
543
 
                      psrlq_i2r (1, mm0);\
544
 
                      punpcklbw_r2r (mm0, mm1);\
545
 
                      psllq_i2r (2, mm2);\
546
 
                      punpckhbw_r2r (mm4, mm7);\
547
 
                      por_r2r (mm2, mm1);\
548
 
                      psllq_i2r (2, mm7);\
549
 
                      MOVQ_R2M(mm1, *dst);\
550
 
                      punpckhbw_r2r (mm0, mm5);\
551
 
                      por_r2r (mm7, mm5);\
552
 
                      MOVQ_R2M(mm5, *(dst+8));
553
 
 
554
 
 
555
 
/***********************************************************
556
 
 * YUY2 ->
557
 
 ***********************************************************/
558
 
 
559
 
#define FUNC_NAME   yuy2_to_rgb_15_mmx
560
 
#define IN_TYPE     uint8_t
561
 
#define OUT_TYPE    uint8_t
562
 
#define IN_ADVANCE  16
563
 
#define OUT_ADVANCE 16
564
 
#define NUM_PIXELS  8
565
 
#define CONVERT     \
566
 
  LOAD_YUY2 \
567
 
  YUV_2_RGB \
568
 
  OUTPUT_RGB_15
569
 
 
570
 
#define CLEANUP emms();
571
 
 
572
 
// #define INIT
573
 
 
574
 
#include "../csp_packed_packed.h"
575
 
 
576
 
#define FUNC_NAME   yuy2_to_bgr_15_mmx
577
 
#define IN_TYPE     uint8_t
578
 
#define OUT_TYPE    uint8_t
579
 
#define IN_ADVANCE  16
580
 
#define OUT_ADVANCE 16
581
 
#define NUM_PIXELS  8
582
 
#define CONVERT     \
583
 
  LOAD_YUY2 \
584
 
  YUV_2_RGB \
585
 
  OUTPUT_BGR_15
586
 
 
587
 
#define CLEANUP emms();
588
 
 
589
 
// #define INIT
590
 
 
591
 
#include "../csp_packed_packed.h"
592
 
 
593
 
#define FUNC_NAME   yuy2_to_rgb_16_mmx
594
 
#define IN_TYPE     uint8_t
595
 
#define OUT_TYPE    uint8_t
596
 
#define IN_ADVANCE  16
597
 
#define OUT_ADVANCE 16
598
 
#define NUM_PIXELS  8
599
 
#define CONVERT     \
600
 
  LOAD_YUY2 \
601
 
  YUV_2_RGB \
602
 
  OUTPUT_RGB_16
603
 
 
604
 
#define CLEANUP emms();
605
 
 
606
 
// #define INIT
607
 
 
608
 
#include "../csp_packed_packed.h"
609
 
 
610
 
 
611
 
#define FUNC_NAME   yuy2_to_bgr_16_mmx
612
 
#define IN_TYPE     uint8_t
613
 
#define OUT_TYPE    uint8_t
614
 
#define IN_ADVANCE  16
615
 
#define OUT_ADVANCE 16
616
 
#define NUM_PIXELS  8
617
 
#define CONVERT     \
618
 
  LOAD_YUY2 \
619
 
  YUV_2_RGB \
620
 
  OUTPUT_BGR_16
621
 
 
622
 
#define CLEANUP emms();
623
 
 
624
 
// #define INIT
625
 
 
626
 
#include "../csp_packed_packed.h"
627
 
 
628
 
#define FUNC_NAME   yuy2_to_rgb_24_mmx
629
 
#define IN_TYPE     uint8_t
630
 
#define OUT_TYPE    uint8_t
631
 
#define IN_ADVANCE  16
632
 
#define OUT_ADVANCE 24
633
 
#define NUM_PIXELS  8
634
 
#define CONVERT     \
635
 
  LOAD_YUY2 \
636
 
  YUV_2_RGB \
637
 
  OUTPUT_RGB_24
638
 
 
639
 
#define CLEANUP emms();
640
 
 
641
 
// #define INIT
642
 
 
643
 
#include "../csp_packed_packed.h"
644
 
 
645
 
#define FUNC_NAME   yuy2_to_bgr_24_mmx
646
 
#define IN_TYPE     uint8_t
647
 
#define OUT_TYPE    uint8_t
648
 
#define IN_ADVANCE  16
649
 
#define OUT_ADVANCE 24
650
 
#define NUM_PIXELS  8
651
 
#define CONVERT     \
652
 
  LOAD_YUY2 \
653
 
  YUV_2_RGB \
654
 
  OUTPUT_BGR_24
655
 
 
656
 
#define CLEANUP emms();
657
 
 
658
 
// #define INIT
659
 
 
660
 
#include "../csp_packed_packed.h"
661
 
 
662
 
 
663
 
#define FUNC_NAME   yuy2_to_rgb_32_mmx
664
 
#define IN_TYPE     uint8_t
665
 
#define OUT_TYPE    uint8_t
666
 
#define IN_ADVANCE  16
667
 
#define OUT_ADVANCE 32
668
 
#define NUM_PIXELS  8
669
 
#define CONVERT     \
670
 
  LOAD_YUY2 \
671
 
  YUV_2_RGB \
672
 
  OUTPUT_RGB_32
673
 
 
674
 
#define CLEANUP emms();
675
 
 
676
 
// #define INIT
677
 
 
678
 
#include "../csp_packed_packed.h"
679
 
 
680
 
#define FUNC_NAME   yuy2_to_bgr_32_mmx
681
 
#define IN_TYPE     uint8_t
682
 
#define OUT_TYPE    uint8_t
683
 
#define IN_ADVANCE  16
684
 
#define OUT_ADVANCE 32
685
 
#define NUM_PIXELS  8
686
 
#define CONVERT     \
687
 
  LOAD_YUY2 \
688
 
  YUV_2_RGB \
689
 
  OUTPUT_BGR_32
690
 
 
691
 
#define CLEANUP emms();
692
 
 
693
 
// #define INIT
694
 
 
695
 
#include "../csp_packed_packed.h"
696
 
 
697
 
#define FUNC_NAME   yuy2_to_rgba_32_mmx
698
 
#define IN_TYPE     uint8_t
699
 
#define OUT_TYPE    uint8_t
700
 
#define IN_ADVANCE  16
701
 
#define OUT_ADVANCE 32
702
 
#define NUM_PIXELS  8
703
 
#define CONVERT     \
704
 
  LOAD_YUY2 \
705
 
  YUV_2_RGB \
706
 
  OUTPUT_RGBA_32
707
 
 
708
 
#define CLEANUP emms();
709
 
 
710
 
// #define INIT
711
 
 
712
 
#include "../csp_packed_packed.h"
713
 
 
714
 
/***********************************************************
715
 
 * UYVY ->
716
 
 ***********************************************************/
717
 
 
718
 
#define FUNC_NAME   uyvy_to_rgb_15_mmx
719
 
#define IN_TYPE     uint8_t
720
 
#define OUT_TYPE    uint8_t
721
 
#define IN_ADVANCE  16
722
 
#define OUT_ADVANCE 16
723
 
#define NUM_PIXELS  8
724
 
#define CONVERT     \
725
 
  LOAD_UYVY \
726
 
  YUV_2_RGB \
727
 
  OUTPUT_RGB_15
728
 
 
729
 
#define CLEANUP emms();
730
 
 
731
 
// #define INIT
732
 
 
733
 
#include "../csp_packed_packed.h"
734
 
 
735
 
#define FUNC_NAME   uyvy_to_bgr_15_mmx
736
 
#define IN_TYPE     uint8_t
737
 
#define OUT_TYPE    uint8_t
738
 
#define IN_ADVANCE  16
739
 
#define OUT_ADVANCE 16
740
 
#define NUM_PIXELS  8
741
 
#define CONVERT     \
742
 
  LOAD_UYVY \
743
 
  YUV_2_RGB \
744
 
  OUTPUT_BGR_15
745
 
 
746
 
#define CLEANUP emms();
747
 
 
748
 
// #define INIT
749
 
 
750
 
#include "../csp_packed_packed.h"
751
 
 
752
 
#define FUNC_NAME   uyvy_to_rgb_16_mmx
753
 
#define IN_TYPE     uint8_t
754
 
#define OUT_TYPE    uint8_t
755
 
#define IN_ADVANCE  16
756
 
#define OUT_ADVANCE 16
757
 
#define NUM_PIXELS  8
758
 
#define CONVERT     \
759
 
  LOAD_UYVY \
760
 
  YUV_2_RGB \
761
 
  OUTPUT_RGB_16
762
 
 
763
 
#define CLEANUP emms();
764
 
 
765
 
// #define INIT
766
 
 
767
 
#include "../csp_packed_packed.h"
768
 
 
769
 
 
770
 
#define FUNC_NAME   uyvy_to_bgr_16_mmx
771
 
#define IN_TYPE     uint8_t
772
 
#define OUT_TYPE    uint8_t
773
 
#define IN_ADVANCE  16
774
 
#define OUT_ADVANCE 16
775
 
#define NUM_PIXELS  8
776
 
#define CONVERT     \
777
 
  LOAD_UYVY \
778
 
  YUV_2_RGB \
779
 
  OUTPUT_BGR_16
780
 
 
781
 
#define CLEANUP emms();
782
 
 
783
 
// #define INIT
784
 
 
785
 
#include "../csp_packed_packed.h"
786
 
 
787
 
#define FUNC_NAME   uyvy_to_rgb_24_mmx
788
 
#define IN_TYPE     uint8_t
789
 
#define OUT_TYPE    uint8_t
790
 
#define IN_ADVANCE  16
791
 
#define OUT_ADVANCE 24
792
 
#define NUM_PIXELS  8
793
 
#define CONVERT     \
794
 
  LOAD_UYVY \
795
 
  YUV_2_RGB \
796
 
  OUTPUT_RGB_24
797
 
 
798
 
#define CLEANUP emms();
799
 
 
800
 
// #define INIT
801
 
 
802
 
#include "../csp_packed_packed.h"
803
 
 
804
 
#define FUNC_NAME   uyvy_to_bgr_24_mmx
805
 
#define IN_TYPE     uint8_t
806
 
#define OUT_TYPE    uint8_t
807
 
#define IN_ADVANCE  16
808
 
#define OUT_ADVANCE 24
809
 
#define NUM_PIXELS  8
810
 
#define CONVERT     \
811
 
  LOAD_UYVY \
812
 
  YUV_2_RGB \
813
 
  OUTPUT_BGR_24
814
 
 
815
 
#define CLEANUP emms();
816
 
 
817
 
// #define INIT
818
 
 
819
 
#include "../csp_packed_packed.h"
820
 
 
821
 
 
822
 
#define FUNC_NAME   uyvy_to_rgb_32_mmx
823
 
#define IN_TYPE     uint8_t
824
 
#define OUT_TYPE    uint8_t
825
 
#define IN_ADVANCE  16
826
 
#define OUT_ADVANCE 32
827
 
#define NUM_PIXELS  8
828
 
#define CONVERT     \
829
 
  LOAD_UYVY \
830
 
  YUV_2_RGB \
831
 
  OUTPUT_RGB_32
832
 
 
833
 
#define CLEANUP emms();
834
 
 
835
 
// #define INIT
836
 
 
837
 
#include "../csp_packed_packed.h"
838
 
 
839
 
#define FUNC_NAME   uyvy_to_bgr_32_mmx
840
 
#define IN_TYPE     uint8_t
841
 
#define OUT_TYPE    uint8_t
842
 
#define IN_ADVANCE  16
843
 
#define OUT_ADVANCE 32
844
 
#define NUM_PIXELS  8
845
 
#define CONVERT     \
846
 
  LOAD_UYVY \
847
 
  YUV_2_RGB \
848
 
  OUTPUT_BGR_32
849
 
 
850
 
#define CLEANUP emms();
851
 
 
852
 
// #define INIT
853
 
 
854
 
#include "../csp_packed_packed.h"
855
 
 
856
 
#define FUNC_NAME   uyvy_to_rgba_32_mmx
857
 
#define IN_TYPE     uint8_t
858
 
#define OUT_TYPE    uint8_t
859
 
#define IN_ADVANCE  16
860
 
#define OUT_ADVANCE 32
861
 
#define NUM_PIXELS  8
862
 
#define CONVERT     \
863
 
  LOAD_UYVY \
864
 
  YUV_2_RGB \
865
 
  OUTPUT_RGBA_32
866
 
 
867
 
#define CLEANUP emms();
868
 
 
869
 
// #define INIT
870
 
 
871
 
#include "../csp_packed_packed.h"
872
 
 
873
 
/***************************************************
874
 
 * YUV 420 P ->
875
 
 ***************************************************/
876
 
 
877
 
#define FUNC_NAME     yuv_420_p_to_rgb_15_mmx
878
 
#define IN_TYPE       uint8_t
879
 
#define OUT_TYPE      uint8_t
880
 
#define IN_ADVANCE_Y  8
881
 
#define IN_ADVANCE_UV 4
882
 
#define OUT_ADVANCE   16
883
 
#define NUM_PIXELS    8
884
 
#define CONVERT       \
885
 
  LOAD_YUV_PLANAR_2 \
886
 
  YUV_2_RGB \
887
 
  OUTPUT_RGB_15
888
 
 
889
 
#define CHROMA_SUB 2
890
 
 
891
 
// #define INIT
892
 
#define CLEANUP emms();
893
 
 
894
 
#include "../csp_planar_packed.h"
895
 
 
896
 
#define FUNC_NAME     yuv_420_p_to_bgr_15_mmx
897
 
#define IN_TYPE       uint8_t
898
 
#define OUT_TYPE      uint8_t
899
 
#define IN_ADVANCE_Y  8
900
 
#define IN_ADVANCE_UV 4
901
 
#define OUT_ADVANCE   16
902
 
#define NUM_PIXELS    8
903
 
#define CONVERT       \
904
 
  LOAD_YUV_PLANAR_2 \
905
 
  YUV_2_RGB \
906
 
  OUTPUT_BGR_15
907
 
 
908
 
#define CHROMA_SUB 2
909
 
 
910
 
// #define INIT
911
 
#define CLEANUP emms();
912
 
 
913
 
#include "../csp_planar_packed.h"
914
 
 
915
 
#define FUNC_NAME     yuv_420_p_to_rgb_16_mmx
916
 
#define IN_TYPE       uint8_t
917
 
#define OUT_TYPE      uint8_t
918
 
#define IN_ADVANCE_Y  8
919
 
#define IN_ADVANCE_UV 4
920
 
#define OUT_ADVANCE   16
921
 
#define NUM_PIXELS    8
922
 
#define CONVERT       \
923
 
  LOAD_YUV_PLANAR_2 \
924
 
  YUV_2_RGB \
925
 
  OUTPUT_RGB_16
926
 
 
927
 
#define CHROMA_SUB 2
928
 
 
929
 
// #define INIT
930
 
#define CLEANUP emms();
931
 
 
932
 
#include "../csp_planar_packed.h"
933
 
 
934
 
#define FUNC_NAME     yuv_420_p_to_bgr_16_mmx
935
 
#define IN_TYPE       uint8_t
936
 
#define OUT_TYPE      uint8_t
937
 
#define IN_ADVANCE_Y  8
938
 
#define IN_ADVANCE_UV 4
939
 
#define OUT_ADVANCE   16
940
 
#define NUM_PIXELS    8
941
 
#define CONVERT       \
942
 
  LOAD_YUV_PLANAR_2 \
943
 
  YUV_2_RGB \
944
 
  OUTPUT_BGR_16
945
 
 
946
 
#define CHROMA_SUB 2
947
 
 
948
 
// #define INIT
949
 
#define CLEANUP emms();
950
 
 
951
 
#include "../csp_planar_packed.h"
952
 
 
953
 
#define FUNC_NAME     yuv_420_p_to_rgb_24_mmx
954
 
#define IN_TYPE       uint8_t
955
 
#define OUT_TYPE      uint8_t
956
 
#define IN_ADVANCE_Y  8
957
 
#define IN_ADVANCE_UV 4
958
 
#define OUT_ADVANCE   24
959
 
#define NUM_PIXELS    8
960
 
#define CONVERT       \
961
 
  LOAD_YUV_PLANAR_2 \
962
 
  YUV_2_RGB \
963
 
  OUTPUT_RGB_24
964
 
 
965
 
#define CHROMA_SUB 2
966
 
 
967
 
// #define INIT
968
 
#define CLEANUP emms();
969
 
 
970
 
#include "../csp_planar_packed.h"
971
 
 
972
 
 
973
 
#define FUNC_NAME     yuv_420_p_to_bgr_24_mmx
974
 
#define IN_TYPE       uint8_t
975
 
#define OUT_TYPE      uint8_t
976
 
#define IN_ADVANCE_Y  8
977
 
#define IN_ADVANCE_UV 4
978
 
#define OUT_ADVANCE   24
979
 
#define NUM_PIXELS    8
980
 
#define CONVERT       \
981
 
  LOAD_YUV_PLANAR_2 \
982
 
  YUV_2_RGB \
983
 
  OUTPUT_BGR_24
984
 
 
985
 
#define CHROMA_SUB 2
986
 
 
987
 
// #define INIT
988
 
#define CLEANUP emms();
989
 
 
990
 
#include "../csp_planar_packed.h"
991
 
 
992
 
#define FUNC_NAME     yuv_420_p_to_rgb_32_mmx
993
 
#define IN_TYPE       uint8_t
994
 
#define OUT_TYPE      uint8_t
995
 
#define IN_ADVANCE_Y  8
996
 
#define IN_ADVANCE_UV 4
997
 
#define OUT_ADVANCE   32
998
 
#define NUM_PIXELS    8
999
 
#define CONVERT       \
1000
 
  LOAD_YUV_PLANAR_2 \
1001
 
  YUV_2_RGB \
1002
 
  OUTPUT_RGB_32
1003
 
 
1004
 
#define CHROMA_SUB 2
1005
 
 
1006
 
// #define INIT
1007
 
#define CLEANUP emms();
1008
 
 
1009
 
#include "../csp_planar_packed.h"
1010
 
 
1011
 
#define FUNC_NAME     yuv_420_p_to_bgr_32_mmx
1012
 
#define IN_TYPE       uint8_t
1013
 
#define OUT_TYPE      uint8_t
1014
 
#define IN_ADVANCE_Y  8
1015
 
#define IN_ADVANCE_UV 4
1016
 
#define OUT_ADVANCE   32
1017
 
#define NUM_PIXELS    8
1018
 
#define CONVERT       \
1019
 
  LOAD_YUV_PLANAR_2 \
1020
 
  YUV_2_RGB \
1021
 
  OUTPUT_BGR_32
1022
 
 
1023
 
#define CHROMA_SUB 2
1024
 
 
1025
 
// #define INIT
1026
 
#define CLEANUP emms();
1027
 
 
1028
 
#include "../csp_planar_packed.h"
1029
 
 
1030
 
#define FUNC_NAME     yuv_420_p_to_rgba_32_mmx
1031
 
#define IN_TYPE       uint8_t
1032
 
#define OUT_TYPE      uint8_t
1033
 
#define IN_ADVANCE_Y  8
1034
 
#define IN_ADVANCE_UV 4
1035
 
#define OUT_ADVANCE   32
1036
 
#define NUM_PIXELS    8
1037
 
#define CONVERT       \
1038
 
  LOAD_YUV_PLANAR_2 \
1039
 
  YUV_2_RGB \
1040
 
  OUTPUT_RGBA_32
1041
 
 
1042
 
#define CHROMA_SUB 2
1043
 
 
1044
 
// #define INIT
1045
 
#define CLEANUP emms();
1046
 
 
1047
 
#include "../csp_planar_packed.h"
1048
 
 
1049
 
/***************************************************
1050
 
 * YUV 410 P ->
1051
 
 ***************************************************/
1052
 
 
1053
 
#define FUNC_NAME     yuv_410_p_to_rgb_15_mmx
1054
 
#define IN_TYPE       uint8_t
1055
 
#define OUT_TYPE      uint8_t
1056
 
#define IN_ADVANCE_Y  8
1057
 
#define IN_ADVANCE_UV 2
1058
 
#define OUT_ADVANCE   16
1059
 
#define NUM_PIXELS    8
1060
 
#define CONVERT       \
1061
 
  LOAD_YUV_PLANAR_4 \
1062
 
  YUV_2_RGB \
1063
 
  OUTPUT_RGB_15
1064
 
 
1065
 
#define CHROMA_SUB 4
1066
 
 
1067
 
#define INIT INIT_YUV_PLANAR_4
1068
 
#define CLEANUP emms();
1069
 
 
1070
 
#include "../csp_planar_packed.h"
1071
 
 
1072
 
#define FUNC_NAME     yuv_410_p_to_bgr_15_mmx
1073
 
#define IN_TYPE       uint8_t
1074
 
#define OUT_TYPE      uint8_t
1075
 
#define IN_ADVANCE_Y  8
1076
 
#define IN_ADVANCE_UV 2
1077
 
#define OUT_ADVANCE   16
1078
 
#define NUM_PIXELS    8
1079
 
#define CONVERT       \
1080
 
  LOAD_YUV_PLANAR_4 \
1081
 
  YUV_2_RGB \
1082
 
  OUTPUT_BGR_15
1083
 
 
1084
 
#define CHROMA_SUB 4
1085
 
 
1086
 
#define INIT INIT_YUV_PLANAR_4
1087
 
#define CLEANUP emms();
1088
 
 
1089
 
#include "../csp_planar_packed.h"
1090
 
 
1091
 
#define FUNC_NAME     yuv_410_p_to_rgb_16_mmx
1092
 
#define IN_TYPE       uint8_t
1093
 
#define OUT_TYPE      uint8_t
1094
 
#define IN_ADVANCE_Y  8
1095
 
#define IN_ADVANCE_UV 2
1096
 
#define OUT_ADVANCE   16
1097
 
#define NUM_PIXELS    8
1098
 
#define CONVERT       \
1099
 
  LOAD_YUV_PLANAR_4 \
1100
 
  YUV_2_RGB \
1101
 
  OUTPUT_RGB_16
1102
 
 
1103
 
#define CHROMA_SUB 4
1104
 
 
1105
 
#define INIT INIT_YUV_PLANAR_4
1106
 
#define CLEANUP emms();
1107
 
 
1108
 
#include "../csp_planar_packed.h"
1109
 
 
1110
 
#define FUNC_NAME     yuv_410_p_to_bgr_16_mmx
1111
 
#define IN_TYPE       uint8_t
1112
 
#define OUT_TYPE      uint8_t
1113
 
#define IN_ADVANCE_Y  8
1114
 
#define IN_ADVANCE_UV 2
1115
 
#define OUT_ADVANCE   16
1116
 
#define NUM_PIXELS    8
1117
 
#define CONVERT       \
1118
 
  LOAD_YUV_PLANAR_4 \
1119
 
  YUV_2_RGB \
1120
 
  OUTPUT_BGR_16
1121
 
 
1122
 
#define CHROMA_SUB 4
1123
 
 
1124
 
#define INIT INIT_YUV_PLANAR_4
1125
 
#define CLEANUP emms();
1126
 
 
1127
 
#include "../csp_planar_packed.h"
1128
 
 
1129
 
#define FUNC_NAME     yuv_410_p_to_rgb_24_mmx
1130
 
#define IN_TYPE       uint8_t
1131
 
#define OUT_TYPE      uint8_t
1132
 
#define IN_ADVANCE_Y  8
1133
 
#define IN_ADVANCE_UV 2
1134
 
#define OUT_ADVANCE   24
1135
 
#define NUM_PIXELS    8
1136
 
#define CONVERT       \
1137
 
  LOAD_YUV_PLANAR_4 \
1138
 
  YUV_2_RGB \
1139
 
  OUTPUT_RGB_24
1140
 
 
1141
 
#define CHROMA_SUB 4
1142
 
 
1143
 
#define INIT INIT_YUV_PLANAR_4
1144
 
#define CLEANUP emms();
1145
 
 
1146
 
#include "../csp_planar_packed.h"
1147
 
 
1148
 
 
1149
 
#define FUNC_NAME     yuv_410_p_to_bgr_24_mmx
1150
 
#define IN_TYPE       uint8_t
1151
 
#define OUT_TYPE      uint8_t
1152
 
#define IN_ADVANCE_Y  8
1153
 
#define IN_ADVANCE_UV 2
1154
 
#define OUT_ADVANCE   24
1155
 
#define NUM_PIXELS    8
1156
 
#define CONVERT       \
1157
 
  LOAD_YUV_PLANAR_4 \
1158
 
  YUV_2_RGB \
1159
 
  OUTPUT_BGR_24
1160
 
 
1161
 
#define CHROMA_SUB 4
1162
 
 
1163
 
#define INIT INIT_YUV_PLANAR_4
1164
 
#define CLEANUP emms();
1165
 
 
1166
 
#include "../csp_planar_packed.h"
1167
 
 
1168
 
#define FUNC_NAME     yuv_410_p_to_rgb_32_mmx
1169
 
#define IN_TYPE       uint8_t
1170
 
#define OUT_TYPE      uint8_t
1171
 
#define IN_ADVANCE_Y  8
1172
 
#define IN_ADVANCE_UV 2
1173
 
#define OUT_ADVANCE   32
1174
 
#define NUM_PIXELS    8
1175
 
#define CONVERT       \
1176
 
  LOAD_YUV_PLANAR_4 \
1177
 
  YUV_2_RGB \
1178
 
  OUTPUT_RGB_32
1179
 
 
1180
 
#define CHROMA_SUB 4
1181
 
 
1182
 
#define INIT INIT_YUV_PLANAR_4
1183
 
#define CLEANUP emms();
1184
 
 
1185
 
#include "../csp_planar_packed.h"
1186
 
 
1187
 
#define FUNC_NAME     yuv_410_p_to_bgr_32_mmx
1188
 
#define IN_TYPE       uint8_t
1189
 
#define OUT_TYPE      uint8_t
1190
 
#define IN_ADVANCE_Y  8
1191
 
#define IN_ADVANCE_UV 2
1192
 
#define OUT_ADVANCE   32
1193
 
#define NUM_PIXELS    8
1194
 
#define CONVERT       \
1195
 
  LOAD_YUV_PLANAR_4 \
1196
 
  YUV_2_RGB \
1197
 
  OUTPUT_BGR_32
1198
 
 
1199
 
#define CHROMA_SUB 4
1200
 
 
1201
 
#define INIT INIT_YUV_PLANAR_4
1202
 
#define CLEANUP emms();
1203
 
 
1204
 
#include "../csp_planar_packed.h"
1205
 
 
1206
 
#define FUNC_NAME     yuv_410_p_to_rgba_32_mmx
1207
 
#define IN_TYPE       uint8_t
1208
 
#define OUT_TYPE      uint8_t
1209
 
#define IN_ADVANCE_Y  8
1210
 
#define IN_ADVANCE_UV 2
1211
 
#define OUT_ADVANCE   32
1212
 
#define NUM_PIXELS    8
1213
 
#define CONVERT       \
1214
 
  LOAD_YUV_PLANAR_4 \
1215
 
  YUV_2_RGB \
1216
 
  OUTPUT_RGBA_32
1217
 
 
1218
 
#define CHROMA_SUB 4
1219
 
 
1220
 
#define INIT INIT_YUV_PLANAR_4
1221
 
#define CLEANUP emms();
1222
 
 
1223
 
#include "../csp_planar_packed.h"
1224
 
 
1225
 
/********************************************************
1226
 
 * YUV 422 ->
1227
 
 ********************************************************/
1228
 
 
1229
 
#define FUNC_NAME     yuv_422_p_to_rgb_15_mmx
1230
 
#define IN_TYPE       uint8_t
1231
 
#define OUT_TYPE      uint8_t
1232
 
#define IN_ADVANCE_Y  8
1233
 
#define IN_ADVANCE_UV 4
1234
 
#define OUT_ADVANCE   16
1235
 
#define NUM_PIXELS    8
1236
 
#define CONVERT       \
1237
 
  LOAD_YUV_PLANAR_2 \
1238
 
  YUV_2_RGB \
1239
 
  OUTPUT_RGB_15
1240
 
 
1241
 
#define CHROMA_SUB 1
1242
 
 
1243
 
 
1244
 
#define CLEANUP emms();
1245
 
 
1246
 
#include "../csp_planar_packed.h"
1247
 
 
1248
 
#define FUNC_NAME     yuv_422_p_to_bgr_15_mmx
1249
 
#define IN_TYPE       uint8_t
1250
 
#define OUT_TYPE      uint8_t
1251
 
#define IN_ADVANCE_Y  8
1252
 
#define IN_ADVANCE_UV 4
1253
 
#define OUT_ADVANCE   16
1254
 
#define NUM_PIXELS    8
1255
 
#define CONVERT       \
1256
 
  LOAD_YUV_PLANAR_2 \
1257
 
  YUV_2_RGB \
1258
 
  OUTPUT_BGR_15
1259
 
 
1260
 
#define CHROMA_SUB 1
1261
 
 
1262
 
 
1263
 
#define CLEANUP emms();
1264
 
 
1265
 
#include "../csp_planar_packed.h"
1266
 
 
1267
 
#define FUNC_NAME     yuv_422_p_to_rgb_16_mmx
1268
 
#define IN_TYPE       uint8_t
1269
 
#define OUT_TYPE      uint8_t
1270
 
#define IN_ADVANCE_Y  8
1271
 
#define IN_ADVANCE_UV 4
1272
 
#define OUT_ADVANCE   16
1273
 
#define NUM_PIXELS    8
1274
 
#define CONVERT       \
1275
 
  LOAD_YUV_PLANAR_2 \
1276
 
  YUV_2_RGB \
1277
 
  OUTPUT_RGB_16
1278
 
 
1279
 
#define CHROMA_SUB 1
1280
 
 
1281
 
 
1282
 
#define CLEANUP emms();
1283
 
 
1284
 
#include "../csp_planar_packed.h"
1285
 
 
1286
 
#define FUNC_NAME     yuv_422_p_to_bgr_16_mmx
1287
 
#define IN_TYPE       uint8_t
1288
 
#define OUT_TYPE      uint8_t
1289
 
#define IN_ADVANCE_Y  8
1290
 
#define IN_ADVANCE_UV 4
1291
 
#define OUT_ADVANCE   16
1292
 
#define NUM_PIXELS    8
1293
 
#define CONVERT       \
1294
 
  LOAD_YUV_PLANAR_2 \
1295
 
  YUV_2_RGB \
1296
 
  OUTPUT_BGR_16
1297
 
 
1298
 
#define CHROMA_SUB 1
1299
 
 
1300
 
 
1301
 
#define CLEANUP emms();
1302
 
 
1303
 
#include "../csp_planar_packed.h"
1304
 
 
1305
 
#define FUNC_NAME     yuv_422_p_to_rgb_24_mmx
1306
 
#define IN_TYPE       uint8_t
1307
 
#define OUT_TYPE      uint8_t
1308
 
#define IN_ADVANCE_Y  8
1309
 
#define IN_ADVANCE_UV 4
1310
 
#define OUT_ADVANCE   24
1311
 
#define NUM_PIXELS    8
1312
 
#define CONVERT       \
1313
 
  LOAD_YUV_PLANAR_2 \
1314
 
  YUV_2_RGB \
1315
 
  OUTPUT_RGB_24
1316
 
 
1317
 
#define CHROMA_SUB 1
1318
 
 
1319
 
 
1320
 
#define CLEANUP emms();
1321
 
 
1322
 
#include "../csp_planar_packed.h"
1323
 
 
1324
 
 
1325
 
#define FUNC_NAME     yuv_422_p_to_bgr_24_mmx
1326
 
#define IN_TYPE       uint8_t
1327
 
#define OUT_TYPE      uint8_t
1328
 
#define IN_ADVANCE_Y  8
1329
 
#define IN_ADVANCE_UV 4
1330
 
#define OUT_ADVANCE   24
1331
 
#define NUM_PIXELS    8
1332
 
#define CONVERT       \
1333
 
  LOAD_YUV_PLANAR_2 \
1334
 
  YUV_2_RGB \
1335
 
  OUTPUT_BGR_24
1336
 
 
1337
 
#define CHROMA_SUB 1
1338
 
 
1339
 
 
1340
 
#define CLEANUP emms();
1341
 
 
1342
 
#include "../csp_planar_packed.h"
1343
 
 
1344
 
#define FUNC_NAME     yuv_422_p_to_rgb_32_mmx
1345
 
#define IN_TYPE       uint8_t
1346
 
#define OUT_TYPE      uint8_t
1347
 
#define IN_ADVANCE_Y  8
1348
 
#define IN_ADVANCE_UV 4
1349
 
#define OUT_ADVANCE   32
1350
 
#define NUM_PIXELS    8
1351
 
#define CONVERT       \
1352
 
  LOAD_YUV_PLANAR_2 \
1353
 
  YUV_2_RGB \
1354
 
  OUTPUT_RGB_32
1355
 
 
1356
 
#define CHROMA_SUB 1
1357
 
 
1358
 
 
1359
 
#define CLEANUP emms();
1360
 
 
1361
 
#include "../csp_planar_packed.h"
1362
 
 
1363
 
#define FUNC_NAME     yuv_422_p_to_bgr_32_mmx
1364
 
#define IN_TYPE       uint8_t
1365
 
#define OUT_TYPE      uint8_t
1366
 
#define IN_ADVANCE_Y  8
1367
 
#define IN_ADVANCE_UV 4
1368
 
#define OUT_ADVANCE   32
1369
 
#define NUM_PIXELS    8
1370
 
#define CONVERT       \
1371
 
  LOAD_YUV_PLANAR_2 \
1372
 
  YUV_2_RGB \
1373
 
  OUTPUT_BGR_32
1374
 
 
1375
 
#define CHROMA_SUB 1
1376
 
 
1377
 
 
1378
 
#define CLEANUP emms();
1379
 
 
1380
 
#include "../csp_planar_packed.h"
1381
 
 
1382
 
#define FUNC_NAME     yuv_422_p_to_rgba_32_mmx
1383
 
#define IN_TYPE       uint8_t
1384
 
#define OUT_TYPE      uint8_t
1385
 
#define IN_ADVANCE_Y  8
1386
 
#define IN_ADVANCE_UV 4
1387
 
#define OUT_ADVANCE   32
1388
 
#define NUM_PIXELS    8
1389
 
#define CONVERT       \
1390
 
  LOAD_YUV_PLANAR_2 \
1391
 
  YUV_2_RGB \
1392
 
  OUTPUT_RGBA_32
1393
 
 
1394
 
#define CHROMA_SUB 1
1395
 
 
1396
 
 
1397
 
#define CLEANUP emms();
1398
 
 
1399
 
#include "../csp_planar_packed.h"
1400
 
 
1401
 
/********************************************************
1402
 
 * YUV 411 ->
1403
 
 ********************************************************/
1404
 
 
1405
 
#define FUNC_NAME     yuv_411_p_to_rgb_15_mmx
1406
 
#define IN_TYPE       uint8_t
1407
 
#define OUT_TYPE      uint8_t
1408
 
#define IN_ADVANCE_Y  8
1409
 
#define IN_ADVANCE_UV 2
1410
 
#define OUT_ADVANCE   16
1411
 
#define NUM_PIXELS    8
1412
 
#define CONVERT       \
1413
 
  LOAD_YUV_PLANAR_4 \
1414
 
  YUV_2_RGB \
1415
 
  OUTPUT_RGB_15
1416
 
 
1417
 
#define CHROMA_SUB 1
1418
 
#define INIT INIT_YUV_PLANAR_4
1419
 
 
1420
 
#define CLEANUP emms();
1421
 
 
1422
 
#include "../csp_planar_packed.h"
1423
 
 
1424
 
#define FUNC_NAME     yuv_411_p_to_bgr_15_mmx
1425
 
#define IN_TYPE       uint8_t
1426
 
#define OUT_TYPE      uint8_t
1427
 
#define IN_ADVANCE_Y  8
1428
 
#define IN_ADVANCE_UV 2
1429
 
#define OUT_ADVANCE   16
1430
 
#define NUM_PIXELS    8
1431
 
#define CONVERT       \
1432
 
  LOAD_YUV_PLANAR_4 \
1433
 
  YUV_2_RGB \
1434
 
  OUTPUT_BGR_15
1435
 
 
1436
 
#define CHROMA_SUB 1
1437
 
#define INIT INIT_YUV_PLANAR_4
1438
 
 
1439
 
 
1440
 
#define CLEANUP emms();
1441
 
 
1442
 
#include "../csp_planar_packed.h"
1443
 
 
1444
 
#define FUNC_NAME     yuv_411_p_to_rgb_16_mmx
1445
 
#define IN_TYPE       uint8_t
1446
 
#define OUT_TYPE      uint8_t
1447
 
#define IN_ADVANCE_Y  8
1448
 
#define IN_ADVANCE_UV 2
1449
 
#define OUT_ADVANCE   16
1450
 
#define NUM_PIXELS    8
1451
 
#define CONVERT       \
1452
 
  LOAD_YUV_PLANAR_4 \
1453
 
  YUV_2_RGB \
1454
 
  OUTPUT_RGB_16
1455
 
 
1456
 
#define CHROMA_SUB 1
1457
 
#define INIT INIT_YUV_PLANAR_4
1458
 
 
1459
 
 
1460
 
#define CLEANUP emms();
1461
 
 
1462
 
#include "../csp_planar_packed.h"
1463
 
 
1464
 
#define FUNC_NAME     yuv_411_p_to_bgr_16_mmx
1465
 
#define IN_TYPE       uint8_t
1466
 
#define OUT_TYPE      uint8_t
1467
 
#define IN_ADVANCE_Y  8
1468
 
#define IN_ADVANCE_UV 2
1469
 
#define OUT_ADVANCE   16
1470
 
#define NUM_PIXELS    8
1471
 
#define CONVERT       \
1472
 
  LOAD_YUV_PLANAR_4 \
1473
 
  YUV_2_RGB \
1474
 
  OUTPUT_BGR_16
1475
 
 
1476
 
#define CHROMA_SUB 1
1477
 
#define INIT INIT_YUV_PLANAR_4
1478
 
 
1479
 
 
1480
 
#define CLEANUP emms();
1481
 
 
1482
 
#include "../csp_planar_packed.h"
1483
 
 
1484
 
#define FUNC_NAME     yuv_411_p_to_rgb_24_mmx
1485
 
#define IN_TYPE       uint8_t
1486
 
#define OUT_TYPE      uint8_t
1487
 
#define IN_ADVANCE_Y  8
1488
 
#define IN_ADVANCE_UV 2
1489
 
#define OUT_ADVANCE   24
1490
 
#define NUM_PIXELS    8
1491
 
#define CONVERT       \
1492
 
  LOAD_YUV_PLANAR_4 \
1493
 
  YUV_2_RGB \
1494
 
  OUTPUT_RGB_24
1495
 
 
1496
 
#define CHROMA_SUB 1
1497
 
#define INIT INIT_YUV_PLANAR_4
1498
 
 
1499
 
 
1500
 
#define CLEANUP emms();
1501
 
 
1502
 
#include "../csp_planar_packed.h"
1503
 
 
1504
 
 
1505
 
#define FUNC_NAME     yuv_411_p_to_bgr_24_mmx
1506
 
#define IN_TYPE       uint8_t
1507
 
#define OUT_TYPE      uint8_t
1508
 
#define IN_ADVANCE_Y  8
1509
 
#define IN_ADVANCE_UV 2
1510
 
#define OUT_ADVANCE   24
1511
 
#define NUM_PIXELS    8
1512
 
#define CONVERT       \
1513
 
  LOAD_YUV_PLANAR_4 \
1514
 
  YUV_2_RGB \
1515
 
  OUTPUT_BGR_24
1516
 
 
1517
 
#define CHROMA_SUB 1
1518
 
#define INIT INIT_YUV_PLANAR_4
1519
 
 
1520
 
 
1521
 
#define CLEANUP emms();
1522
 
 
1523
 
#include "../csp_planar_packed.h"
1524
 
 
1525
 
#define FUNC_NAME     yuv_411_p_to_rgb_32_mmx
1526
 
#define IN_TYPE       uint8_t
1527
 
#define OUT_TYPE      uint8_t
1528
 
#define IN_ADVANCE_Y  8
1529
 
#define IN_ADVANCE_UV 2
1530
 
#define OUT_ADVANCE   32
1531
 
#define NUM_PIXELS    8
1532
 
#define CONVERT       \
1533
 
  LOAD_YUV_PLANAR_4 \
1534
 
  YUV_2_RGB \
1535
 
  OUTPUT_RGB_32
1536
 
 
1537
 
#define CHROMA_SUB 1
1538
 
#define INIT INIT_YUV_PLANAR_4
1539
 
 
1540
 
 
1541
 
#define CLEANUP emms();
1542
 
 
1543
 
#include "../csp_planar_packed.h"
1544
 
 
1545
 
#define FUNC_NAME     yuv_411_p_to_bgr_32_mmx
1546
 
#define IN_TYPE       uint8_t
1547
 
#define OUT_TYPE      uint8_t
1548
 
#define IN_ADVANCE_Y  8
1549
 
#define IN_ADVANCE_UV 2
1550
 
#define OUT_ADVANCE   32
1551
 
#define NUM_PIXELS    8
1552
 
#define CONVERT       \
1553
 
  LOAD_YUV_PLANAR_4 \
1554
 
  YUV_2_RGB \
1555
 
  OUTPUT_BGR_32
1556
 
 
1557
 
#define CHROMA_SUB 1
1558
 
#define INIT INIT_YUV_PLANAR_4
1559
 
 
1560
 
 
1561
 
#define CLEANUP emms();
1562
 
 
1563
 
#include "../csp_planar_packed.h"
1564
 
 
1565
 
#define FUNC_NAME     yuv_411_p_to_rgba_32_mmx
1566
 
#define IN_TYPE       uint8_t
1567
 
#define OUT_TYPE      uint8_t
1568
 
#define IN_ADVANCE_Y  8
1569
 
#define IN_ADVANCE_UV 2
1570
 
#define OUT_ADVANCE   32
1571
 
#define NUM_PIXELS    8
1572
 
#define CONVERT       \
1573
 
  LOAD_YUV_PLANAR_4 \
1574
 
  YUV_2_RGB \
1575
 
  OUTPUT_RGBA_32
1576
 
 
1577
 
#define CHROMA_SUB 1
1578
 
#define INIT INIT_YUV_PLANAR_4
1579
 
 
1580
 
 
1581
 
#define CLEANUP emms();
1582
 
 
1583
 
#include "../csp_planar_packed.h"
1584
 
 
1585
 
/* JPEG */
1586
 
 
1587
 
/***************************************************
1588
 
 * YUVJ 420 P ->
1589
 
 ***************************************************/
1590
 
 
1591
 
#define FUNC_NAME     yuvj_420_p_to_rgb_15_mmx
1592
 
#define IN_TYPE       uint8_t
1593
 
#define OUT_TYPE      uint8_t
1594
 
#define IN_ADVANCE_Y  8
1595
 
#define IN_ADVANCE_UV 4
1596
 
#define OUT_ADVANCE   16
1597
 
#define NUM_PIXELS    8
1598
 
#define CONVERT       \
1599
 
  LOAD_YUV_PLANAR_2 \
1600
 
  YUVJ_2_RGB \
1601
 
  OUTPUT_RGB_15
1602
 
 
1603
 
#define CHROMA_SUB 2
1604
 
 
1605
 
 
1606
 
#define CLEANUP emms();
1607
 
 
1608
 
#include "../csp_planar_packed.h"
1609
 
 
1610
 
#define FUNC_NAME     yuvj_420_p_to_bgr_15_mmx
1611
 
#define IN_TYPE       uint8_t
1612
 
#define OUT_TYPE      uint8_t
1613
 
#define IN_ADVANCE_Y  8
1614
 
#define IN_ADVANCE_UV 4
1615
 
#define OUT_ADVANCE   16
1616
 
#define NUM_PIXELS    8
1617
 
#define CONVERT       \
1618
 
  LOAD_YUV_PLANAR_2 \
1619
 
  YUVJ_2_RGB \
1620
 
  OUTPUT_BGR_15
1621
 
 
1622
 
#define CHROMA_SUB 2
1623
 
 
1624
 
 
1625
 
#define CLEANUP emms();
1626
 
 
1627
 
#include "../csp_planar_packed.h"
1628
 
 
1629
 
#define FUNC_NAME     yuvj_420_p_to_rgb_16_mmx
1630
 
#define IN_TYPE       uint8_t
1631
 
#define OUT_TYPE      uint8_t
1632
 
#define IN_ADVANCE_Y  8
1633
 
#define IN_ADVANCE_UV 4
1634
 
#define OUT_ADVANCE   16
1635
 
#define NUM_PIXELS    8
1636
 
#define CONVERT       \
1637
 
  LOAD_YUV_PLANAR_2 \
1638
 
  YUVJ_2_RGB \
1639
 
  OUTPUT_RGB_16
1640
 
 
1641
 
#define CHROMA_SUB 2
1642
 
 
1643
 
 
1644
 
#define CLEANUP emms();
1645
 
 
1646
 
#include "../csp_planar_packed.h"
1647
 
 
1648
 
#define FUNC_NAME     yuvj_420_p_to_bgr_16_mmx
1649
 
#define IN_TYPE       uint8_t
1650
 
#define OUT_TYPE      uint8_t
1651
 
#define IN_ADVANCE_Y  8
1652
 
#define IN_ADVANCE_UV 4
1653
 
#define OUT_ADVANCE   16
1654
 
#define NUM_PIXELS    8
1655
 
#define CONVERT       \
1656
 
  LOAD_YUV_PLANAR_2 \
1657
 
  YUVJ_2_RGB \
1658
 
  OUTPUT_BGR_16
1659
 
 
1660
 
#define CHROMA_SUB 2
1661
 
 
1662
 
 
1663
 
#define CLEANUP emms();
1664
 
 
1665
 
#include "../csp_planar_packed.h"
1666
 
 
1667
 
#define FUNC_NAME     yuvj_420_p_to_rgb_24_mmx
1668
 
#define IN_TYPE       uint8_t
1669
 
#define OUT_TYPE      uint8_t
1670
 
#define IN_ADVANCE_Y  8
1671
 
#define IN_ADVANCE_UV 4
1672
 
#define OUT_ADVANCE   24
1673
 
#define NUM_PIXELS    8
1674
 
#define CONVERT       \
1675
 
  LOAD_YUV_PLANAR_2 \
1676
 
  YUVJ_2_RGB \
1677
 
  OUTPUT_RGB_24
1678
 
 
1679
 
#define CHROMA_SUB 2
1680
 
 
1681
 
 
1682
 
#define CLEANUP emms();
1683
 
 
1684
 
#include "../csp_planar_packed.h"
1685
 
 
1686
 
 
1687
 
#define FUNC_NAME     yuvj_420_p_to_bgr_24_mmx
1688
 
#define IN_TYPE       uint8_t
1689
 
#define OUT_TYPE      uint8_t
1690
 
#define IN_ADVANCE_Y  8
1691
 
#define IN_ADVANCE_UV 4
1692
 
#define OUT_ADVANCE   24
1693
 
#define NUM_PIXELS    8
1694
 
#define CONVERT       \
1695
 
  LOAD_YUV_PLANAR_2 \
1696
 
  YUVJ_2_RGB \
1697
 
  OUTPUT_BGR_24
1698
 
 
1699
 
#define CHROMA_SUB 2
1700
 
 
1701
 
 
1702
 
#define CLEANUP emms();
1703
 
 
1704
 
#include "../csp_planar_packed.h"
1705
 
 
1706
 
#define FUNC_NAME     yuvj_420_p_to_rgb_32_mmx
1707
 
#define IN_TYPE       uint8_t
1708
 
#define OUT_TYPE      uint8_t
1709
 
#define IN_ADVANCE_Y  8
1710
 
#define IN_ADVANCE_UV 4
1711
 
#define OUT_ADVANCE   32
1712
 
#define NUM_PIXELS    8
1713
 
#define CONVERT       \
1714
 
  LOAD_YUV_PLANAR_2 \
1715
 
  YUVJ_2_RGB \
1716
 
  OUTPUT_RGB_32
1717
 
 
1718
 
#define CHROMA_SUB 2
1719
 
 
1720
 
 
1721
 
#define CLEANUP emms();
1722
 
 
1723
 
#include "../csp_planar_packed.h"
1724
 
 
1725
 
#define FUNC_NAME     yuvj_420_p_to_bgr_32_mmx
1726
 
#define IN_TYPE       uint8_t
1727
 
#define OUT_TYPE      uint8_t
1728
 
#define IN_ADVANCE_Y  8
1729
 
#define IN_ADVANCE_UV 4
1730
 
#define OUT_ADVANCE   32
1731
 
#define NUM_PIXELS    8
1732
 
#define CONVERT       \
1733
 
  LOAD_YUV_PLANAR_2 \
1734
 
  YUVJ_2_RGB \
1735
 
  OUTPUT_BGR_32
1736
 
 
1737
 
#define CHROMA_SUB 2
1738
 
 
1739
 
 
1740
 
#define CLEANUP emms();
1741
 
 
1742
 
#include "../csp_planar_packed.h"
1743
 
 
1744
 
#define FUNC_NAME     yuvj_420_p_to_rgba_32_mmx
1745
 
#define IN_TYPE       uint8_t
1746
 
#define OUT_TYPE      uint8_t
1747
 
#define IN_ADVANCE_Y  8
1748
 
#define IN_ADVANCE_UV 4
1749
 
#define OUT_ADVANCE   32
1750
 
#define NUM_PIXELS    8
1751
 
#define CONVERT       \
1752
 
  LOAD_YUV_PLANAR_2 \
1753
 
  YUVJ_2_RGB \
1754
 
  OUTPUT_RGBA_32
1755
 
 
1756
 
#define CHROMA_SUB 2
1757
 
 
1758
 
 
1759
 
#define CLEANUP emms();
1760
 
 
1761
 
#include "../csp_planar_packed.h"
1762
 
 
1763
 
/********************************************************
1764
 
 * YUVJ 422 ->
1765
 
 ********************************************************/
1766
 
 
1767
 
#define FUNC_NAME     yuvj_422_p_to_rgb_15_mmx
1768
 
#define IN_TYPE       uint8_t
1769
 
#define OUT_TYPE      uint8_t
1770
 
#define IN_ADVANCE_Y  8
1771
 
#define IN_ADVANCE_UV 4
1772
 
#define OUT_ADVANCE   16
1773
 
#define NUM_PIXELS    8
1774
 
#define CONVERT       \
1775
 
  LOAD_YUV_PLANAR_2 \
1776
 
  YUVJ_2_RGB \
1777
 
  OUTPUT_RGB_15
1778
 
 
1779
 
#define CHROMA_SUB 1
1780
 
 
1781
 
 
1782
 
#define CLEANUP emms();
1783
 
 
1784
 
#include "../csp_planar_packed.h"
1785
 
 
1786
 
#define FUNC_NAME     yuvj_422_p_to_bgr_15_mmx
1787
 
#define IN_TYPE       uint8_t
1788
 
#define OUT_TYPE      uint8_t
1789
 
#define IN_ADVANCE_Y  8
1790
 
#define IN_ADVANCE_UV 4
1791
 
#define OUT_ADVANCE   16
1792
 
#define NUM_PIXELS    8
1793
 
#define CONVERT       \
1794
 
  LOAD_YUV_PLANAR_2 \
1795
 
  YUVJ_2_RGB \
1796
 
  OUTPUT_BGR_15
1797
 
 
1798
 
#define CHROMA_SUB 1
1799
 
 
1800
 
 
1801
 
#define CLEANUP emms();
1802
 
 
1803
 
#include "../csp_planar_packed.h"
1804
 
 
1805
 
#define FUNC_NAME     yuvj_422_p_to_rgb_16_mmx
1806
 
#define IN_TYPE       uint8_t
1807
 
#define OUT_TYPE      uint8_t
1808
 
#define IN_ADVANCE_Y  8
1809
 
#define IN_ADVANCE_UV 4
1810
 
#define OUT_ADVANCE   16
1811
 
#define NUM_PIXELS    8
1812
 
#define CONVERT       \
1813
 
  LOAD_YUV_PLANAR_2 \
1814
 
  YUVJ_2_RGB \
1815
 
  OUTPUT_RGB_16
1816
 
 
1817
 
#define CHROMA_SUB 1
1818
 
 
1819
 
 
1820
 
#define CLEANUP emms();
1821
 
 
1822
 
#include "../csp_planar_packed.h"
1823
 
 
1824
 
#define FUNC_NAME     yuvj_422_p_to_bgr_16_mmx
1825
 
#define IN_TYPE       uint8_t
1826
 
#define OUT_TYPE      uint8_t
1827
 
#define IN_ADVANCE_Y  8
1828
 
#define IN_ADVANCE_UV 4
1829
 
#define OUT_ADVANCE   16
1830
 
#define NUM_PIXELS    8
1831
 
#define CONVERT       \
1832
 
  LOAD_YUV_PLANAR_2 \
1833
 
  YUVJ_2_RGB \
1834
 
  OUTPUT_BGR_16
1835
 
 
1836
 
#define CHROMA_SUB 1
1837
 
 
1838
 
 
1839
 
#define CLEANUP emms();
1840
 
 
1841
 
#include "../csp_planar_packed.h"
1842
 
 
1843
 
#define FUNC_NAME     yuvj_422_p_to_rgb_24_mmx
1844
 
#define IN_TYPE       uint8_t
1845
 
#define OUT_TYPE      uint8_t
1846
 
#define IN_ADVANCE_Y  8
1847
 
#define IN_ADVANCE_UV 4
1848
 
#define OUT_ADVANCE   24
1849
 
#define NUM_PIXELS    8
1850
 
#define CONVERT       \
1851
 
  LOAD_YUV_PLANAR_2 \
1852
 
  YUVJ_2_RGB \
1853
 
  OUTPUT_RGB_24
1854
 
 
1855
 
#define CHROMA_SUB 1
1856
 
 
1857
 
 
1858
 
#define CLEANUP emms();
1859
 
 
1860
 
#include "../csp_planar_packed.h"
1861
 
 
1862
 
 
1863
 
#define FUNC_NAME     yuvj_422_p_to_bgr_24_mmx
1864
 
#define IN_TYPE       uint8_t
1865
 
#define OUT_TYPE      uint8_t
1866
 
#define IN_ADVANCE_Y  8
1867
 
#define IN_ADVANCE_UV 4
1868
 
#define OUT_ADVANCE   24
1869
 
#define NUM_PIXELS    8
1870
 
#define CONVERT       \
1871
 
  LOAD_YUV_PLANAR_2 \
1872
 
  YUVJ_2_RGB \
1873
 
  OUTPUT_BGR_24
1874
 
 
1875
 
#define CHROMA_SUB 1
1876
 
 
1877
 
 
1878
 
#define CLEANUP emms();
1879
 
 
1880
 
#include "../csp_planar_packed.h"
1881
 
 
1882
 
#define FUNC_NAME     yuvj_422_p_to_rgb_32_mmx
1883
 
#define IN_TYPE       uint8_t
1884
 
#define OUT_TYPE      uint8_t
1885
 
#define IN_ADVANCE_Y  8
1886
 
#define IN_ADVANCE_UV 4
1887
 
#define OUT_ADVANCE   32
1888
 
#define NUM_PIXELS    8
1889
 
#define CONVERT       \
1890
 
  LOAD_YUV_PLANAR_2 \
1891
 
  YUVJ_2_RGB \
1892
 
  OUTPUT_RGB_32
1893
 
 
1894
 
#define CHROMA_SUB 1
1895
 
 
1896
 
 
1897
 
#define CLEANUP emms();
1898
 
 
1899
 
#include "../csp_planar_packed.h"
1900
 
 
1901
 
#define FUNC_NAME     yuvj_422_p_to_bgr_32_mmx
1902
 
#define IN_TYPE       uint8_t
1903
 
#define OUT_TYPE      uint8_t
1904
 
#define IN_ADVANCE_Y  8
1905
 
#define IN_ADVANCE_UV 4
1906
 
#define OUT_ADVANCE   32
1907
 
#define NUM_PIXELS    8
1908
 
#define CONVERT       \
1909
 
  LOAD_YUV_PLANAR_2 \
1910
 
  YUVJ_2_RGB \
1911
 
  OUTPUT_BGR_32
1912
 
 
1913
 
#define CHROMA_SUB 1
1914
 
 
1915
 
 
1916
 
#define CLEANUP emms();
1917
 
 
1918
 
#include "../csp_planar_packed.h"
1919
 
 
1920
 
#define FUNC_NAME     yuvj_422_p_to_rgba_32_mmx
1921
 
#define IN_TYPE       uint8_t
1922
 
#define OUT_TYPE      uint8_t
1923
 
#define IN_ADVANCE_Y  8
1924
 
#define IN_ADVANCE_UV 4
1925
 
#define OUT_ADVANCE   32
1926
 
#define NUM_PIXELS    8
1927
 
#define CONVERT       \
1928
 
  LOAD_YUV_PLANAR_2 \
1929
 
  YUVJ_2_RGB \
1930
 
  OUTPUT_RGBA_32
1931
 
 
1932
 
#define CHROMA_SUB 1
1933
 
 
1934
 
 
1935
 
#define CLEANUP emms();
1936
 
 
1937
 
#include "../csp_planar_packed.h"
1938
 
 
1939
 
 
1940
 
 
1941
 
#ifdef MMXEXT
1942
 
 
1943
 
void gavl_init_yuv_rgb_funcs_mmxext(gavl_pixelformat_function_table_t * tab,
1944
 
                                    int width, const gavl_video_options_t * opt)
1945
 
     
1946
 
#else /* !MMXEXT */
1947
 
 
1948
 
void gavl_init_yuv_rgb_funcs_mmx(gavl_pixelformat_function_table_t * tab,
1949
 
                                 int width, const gavl_video_options_t * opt)
1950
 
 
1951
 
#endif /* MMXEXT */
1952
 
     
1953
 
  {
1954
 
  if(width % 8)
1955
 
    return;
1956
 
 
1957
 
  if(opt->quality && (opt->quality >= 3))
1958
 
    return;
1959
 
  
1960
 
  tab->yuy2_to_rgb_15 = yuy2_to_rgb_15_mmx;
1961
 
  tab->yuy2_to_bgr_15 = yuy2_to_bgr_15_mmx;
1962
 
  tab->yuy2_to_rgb_16 = yuy2_to_rgb_16_mmx;
1963
 
  tab->yuy2_to_bgr_16 = yuy2_to_bgr_16_mmx;
1964
 
  tab->yuy2_to_rgb_24 = yuy2_to_rgb_24_mmx;
1965
 
  tab->yuy2_to_bgr_24 = yuy2_to_bgr_24_mmx;
1966
 
  tab->yuy2_to_rgb_32 = yuy2_to_rgb_32_mmx;
1967
 
  tab->yuy2_to_bgr_32 = yuy2_to_bgr_32_mmx;
1968
 
  tab->yuy2_to_rgba_32 = yuy2_to_rgba_32_mmx;
1969
 
 
1970
 
  tab->uyvy_to_rgb_15 = uyvy_to_rgb_15_mmx;
1971
 
  tab->uyvy_to_bgr_15 = uyvy_to_bgr_15_mmx;
1972
 
  tab->uyvy_to_rgb_16 = uyvy_to_rgb_16_mmx;
1973
 
  tab->uyvy_to_bgr_16 = uyvy_to_bgr_16_mmx;
1974
 
  tab->uyvy_to_rgb_24 = uyvy_to_rgb_24_mmx;
1975
 
  tab->uyvy_to_bgr_24 = uyvy_to_bgr_24_mmx;
1976
 
  tab->uyvy_to_rgb_32 = uyvy_to_rgb_32_mmx;
1977
 
  tab->uyvy_to_bgr_32 = uyvy_to_bgr_32_mmx;
1978
 
  tab->uyvy_to_rgba_32 = uyvy_to_rgba_32_mmx;
1979
 
  
1980
 
  tab->yuv_420_p_to_rgb_15 = yuv_420_p_to_rgb_15_mmx;
1981
 
  tab->yuv_420_p_to_bgr_15 = yuv_420_p_to_bgr_15_mmx;
1982
 
  tab->yuv_420_p_to_rgb_16 = yuv_420_p_to_rgb_16_mmx;
1983
 
  tab->yuv_420_p_to_bgr_16 = yuv_420_p_to_bgr_16_mmx;
1984
 
  tab->yuv_420_p_to_rgb_24 = yuv_420_p_to_rgb_24_mmx;
1985
 
  tab->yuv_420_p_to_bgr_24 = yuv_420_p_to_bgr_24_mmx;
1986
 
  tab->yuv_420_p_to_rgb_32 = yuv_420_p_to_rgb_32_mmx;
1987
 
  tab->yuv_420_p_to_bgr_32 = yuv_420_p_to_bgr_32_mmx;
1988
 
  tab->yuv_420_p_to_rgba_32 = yuv_420_p_to_rgba_32_mmx;
1989
 
 
1990
 
  tab->yuv_410_p_to_rgb_15 = yuv_410_p_to_rgb_15_mmx;
1991
 
  tab->yuv_410_p_to_bgr_15 = yuv_410_p_to_bgr_15_mmx;
1992
 
  tab->yuv_410_p_to_rgb_16 = yuv_410_p_to_rgb_16_mmx;
1993
 
  tab->yuv_410_p_to_bgr_16 = yuv_410_p_to_bgr_16_mmx;
1994
 
  tab->yuv_410_p_to_rgb_24 = yuv_410_p_to_rgb_24_mmx;
1995
 
  tab->yuv_410_p_to_bgr_24 = yuv_410_p_to_bgr_24_mmx;
1996
 
  tab->yuv_410_p_to_rgb_32 = yuv_410_p_to_rgb_32_mmx;
1997
 
  tab->yuv_410_p_to_bgr_32 = yuv_410_p_to_bgr_32_mmx;
1998
 
  tab->yuv_410_p_to_rgba_32 = yuv_410_p_to_rgba_32_mmx;
1999
 
 
2000
 
  
2001
 
  tab->yuv_422_p_to_rgb_15 = yuv_422_p_to_rgb_15_mmx;
2002
 
  tab->yuv_422_p_to_bgr_15 = yuv_422_p_to_bgr_15_mmx;
2003
 
  tab->yuv_422_p_to_rgb_16 = yuv_422_p_to_rgb_16_mmx;
2004
 
  tab->yuv_422_p_to_bgr_16 = yuv_422_p_to_bgr_16_mmx;
2005
 
  tab->yuv_422_p_to_rgb_24 = yuv_422_p_to_rgb_24_mmx;
2006
 
  tab->yuv_422_p_to_bgr_24 = yuv_422_p_to_bgr_24_mmx;
2007
 
  tab->yuv_422_p_to_rgb_32 = yuv_422_p_to_rgb_32_mmx;
2008
 
  tab->yuv_422_p_to_bgr_32 = yuv_422_p_to_bgr_32_mmx;
2009
 
  tab->yuv_422_p_to_rgba_32 = yuv_422_p_to_rgba_32_mmx;
2010
 
 
2011
 
  tab->yuv_411_p_to_rgb_15 = yuv_411_p_to_rgb_15_mmx;
2012
 
  tab->yuv_411_p_to_bgr_15 = yuv_411_p_to_bgr_15_mmx;
2013
 
  tab->yuv_411_p_to_rgb_16 = yuv_411_p_to_rgb_16_mmx;
2014
 
  tab->yuv_411_p_to_bgr_16 = yuv_411_p_to_bgr_16_mmx;
2015
 
  tab->yuv_411_p_to_rgb_24 = yuv_411_p_to_rgb_24_mmx;
2016
 
  tab->yuv_411_p_to_bgr_24 = yuv_411_p_to_bgr_24_mmx;
2017
 
  tab->yuv_411_p_to_rgb_32 = yuv_411_p_to_rgb_32_mmx;
2018
 
  tab->yuv_411_p_to_bgr_32 = yuv_411_p_to_bgr_32_mmx;
2019
 
  tab->yuv_411_p_to_rgba_32 = yuv_411_p_to_rgba_32_mmx;
2020
 
 
2021
 
  
2022
 
  tab->yuvj_420_p_to_rgb_15 = yuvj_420_p_to_rgb_15_mmx;
2023
 
  tab->yuvj_420_p_to_bgr_15 = yuvj_420_p_to_bgr_15_mmx;
2024
 
  tab->yuvj_420_p_to_rgb_16 = yuvj_420_p_to_rgb_16_mmx;
2025
 
  tab->yuvj_420_p_to_bgr_16 = yuvj_420_p_to_bgr_16_mmx;
2026
 
  tab->yuvj_420_p_to_rgb_24 = yuvj_420_p_to_rgb_24_mmx;
2027
 
  tab->yuvj_420_p_to_bgr_24 = yuvj_420_p_to_bgr_24_mmx;
2028
 
  tab->yuvj_420_p_to_rgb_32 = yuvj_420_p_to_rgb_32_mmx;
2029
 
  tab->yuvj_420_p_to_bgr_32 = yuvj_420_p_to_bgr_32_mmx;
2030
 
  tab->yuvj_420_p_to_rgba_32 = yuvj_420_p_to_rgba_32_mmx;
2031
 
 
2032
 
  tab->yuvj_422_p_to_rgb_15 = yuvj_422_p_to_rgb_15_mmx;
2033
 
  tab->yuvj_422_p_to_bgr_15 = yuvj_422_p_to_bgr_15_mmx;
2034
 
  tab->yuvj_422_p_to_rgb_16 = yuvj_422_p_to_rgb_16_mmx;
2035
 
  tab->yuvj_422_p_to_bgr_16 = yuvj_422_p_to_bgr_16_mmx;
2036
 
  tab->yuvj_422_p_to_rgb_24 = yuvj_422_p_to_rgb_24_mmx;
2037
 
  tab->yuvj_422_p_to_bgr_24 = yuvj_422_p_to_bgr_24_mmx;
2038
 
  tab->yuvj_422_p_to_rgb_32 = yuvj_422_p_to_rgb_32_mmx;
2039
 
  tab->yuvj_422_p_to_bgr_32 = yuvj_422_p_to_bgr_32_mmx;
2040
 
  tab->yuvj_422_p_to_rgba_32 = yuvj_422_p_to_rgba_32_mmx;
2041
 
  }