Logo
  • Main Page
  • Related Pages
  • Modules
  • Classes
  • Files

mmsfbconv.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005-2007 Stefan Schwarzer, Jens Schneider,             *
00003  *                           Matthias Hardt, Guido Madaus                  *
00004  *                                                                         *
00005  *   Copyright (C) 2007-2008 BerLinux Solutions GbR                        *
00006  *                           Stefan Schwarzer & Guido Madaus               *
00007  *                                                                         *
00008  *   Copyright (C) 2009-2013 BerLinux Solutions GmbH                       *
00009  *                                                                         *
00010  *   Authors:                                                              *
00011  *      Stefan Schwarzer   <stefan.schwarzer@diskohq.org>,                 *
00012  *      Matthias Hardt     <matthias.hardt@diskohq.org>,                   *
00013  *      Jens Schneider     <jens.schneider@diskohq.org>,                   *
00014  *      Guido Madaus       <guido.madaus@diskohq.org>,                     *
00015  *      Patrick Helterhoff <patrick.helterhoff@diskohq.org>,               *
00016  *      René Bählkow       <rene.baehlkow@diskohq.org>                     *
00017  *                                                                         *
00018  *   This library is free software; you can redistribute it and/or         *
00019  *   modify it under the terms of the GNU Lesser General Public            *
00020  *   License version 2.1 as published by the Free Software Foundation.     *
00021  *                                                                         *
00022  *   This library is distributed in the hope that it will be useful,       *
00023  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00024  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00025  *   Lesser General Public License for more details.                       *
00026  *                                                                         *
00027  *   You should have received a copy of the GNU Lesser General Public      *
00028  *   License along with this library; if not, write to the                 *
00029  *   Free Software Foundation, Inc.,                                       *
00030  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
00031  **************************************************************************/
00032 
00033 #ifndef MMSFBCONV_H_
00034 #define MMSFBCONV_H_
00035 
00036 #include "mmsgui/fb/mmsfbbase.h"
00037 #include "mmsgui/fb/mmsfbfont.h"
00038 
00039 // check which pixelformats we should support
00040 #ifndef __HAVE_PF_ALL__
00041 #ifndef __HAVE_PF_ARGB__
00042 #ifndef __HAVE_PF_AiRGB__
00043 #ifndef __HAVE_PF_ARGB4444__
00044 #ifndef __HAVE_PF_ARGB3565__
00045 #ifndef __HAVE_PF_RGB16__
00046 #ifndef __HAVE_PF_RGB24__
00047 #ifndef __HAVE_PF_RGB32__
00048 #ifndef __HAVE_PF_BGR24__
00049 #ifndef __HAVE_PF_BGR555__
00050 #ifndef __HAVE_PF_AYUV__
00051 #ifndef __HAVE_PF_YV12__
00052 #ifndef __HAVE_PF_I420__
00053 #ifndef __HAVE_PF_YUY2__
00054 // no pixelformats defined
00055 #ifndef __HAVE_PF_NONE__
00056 #define __HAVE_PF_NONE__
00057 #endif
00058 #endif
00059 #endif
00060 #endif
00061 #endif
00062 #endif
00063 #endif
00064 #endif
00065 #endif
00066 #endif
00067 #endif
00068 #endif
00069 #endif
00070 #endif
00071 #endif
00072 
00073 #ifdef __HAVE_PF_ALL__
00074 // all pixelformats requested, enable all
00075 #ifndef __HAVE_PF_ARGB__
00076 #define __HAVE_PF_ARGB__
00077 #endif
00078 #ifndef __HAVE_PF_AiRGB__
00079 #define __HAVE_PF_AiRGB__
00080 #endif
00081 #ifndef __HAVE_PF_ARGB4444__
00082 #define __HAVE_PF_ARGB4444__
00083 #endif
00084 #ifndef __HAVE_PF_ARGB3565__
00085 #define __HAVE_PF_ARGB3565__
00086 #endif
00087 #ifndef __HAVE_PF_RGB16__
00088 #define __HAVE_PF_RGB16__
00089 #endif
00090 #ifndef __HAVE_PF_RGB24__
00091 #define __HAVE_PF_RGB24__
00092 #endif
00093 #ifndef __HAVE_PF_RGB32__
00094 #define __HAVE_PF_RGB32__
00095 #endif
00096 #ifndef __HAVE_PF_BGR24__
00097 #define __HAVE_PF_BGR24__
00098 #endif
00099 #ifndef __HAVE_PF_BGR555__
00100 #define __HAVE_PF_BGR555__
00101 #endif
00102 #ifndef __HAVE_PF_AYUV__
00103 #define __HAVE_PF_AYUV__
00104 #endif
00105 #ifndef __HAVE_PF_YV12__
00106 #define __HAVE_PF_YV12__
00107 #endif
00108 #ifndef __HAVE_PF_I420__
00109 #define __HAVE_PF_I420__
00110 #endif
00111 #ifndef __HAVE_PF_YUY2__
00112 #define __HAVE_PF_YUY2__
00113 #endif
00114 #endif
00115 
00116 // always enable ARGB format which is basically needed
00117 #ifndef __HAVE_PF_ARGB__
00118 #define __HAVE_PF_ARGB__
00119 #endif
00120 
00121 // enable also YV12 if I420 format is requested
00122 #ifdef __HAVE_PF_I420__
00123 #ifndef __HAVE_PF_YV12__
00124 #define __HAVE_PF_YV12__
00125 #endif
00126 #endif
00127 
00128 
00129 //#define MMSFB_CONV_RGB2Y(r,g,b) ((((66*r+129*g+25*b+128)>>8)+16) & 0xff)
00130 //#define MMSFB_CONV_RGB2U(r,g,b) ((((-38*r-74*g+112*b+128)>>8)+128) & 0xff)
00131 //#define MMSFB_CONV_RGB2V(r,g,b) ((((112*r-94*g-18*b+128)>>8)+128) & 0xff)
00132 #define MMSFB_CONV_RGB2Y(r,g,b) (((66*r+129*g+25*b+128)>>8)+16)
00133 #define MMSFB_CONV_RGB2U(r,g,b) (((-38*r-74*g+112*b+128)>>8)+128)
00134 #define MMSFB_CONV_RGB2V(r,g,b) (((112*r-94*g-18*b+128)>>8)+128)
00135 
00136 #define MMSFB_CONV_PREPARE_YUV2RGB(y,u,v)  y=(int)y-16;u=(int)u-128;v=(int)v-128;
00137 #define MMSFB_CONV_PREPARE_YUVBLEND(y,u,v) y=(int)y-16;u=(int)u-128;v=(int)v-128;
00138 #define MMSFB_CONV_RESET_YUVBLEND(y,u,v) y=(int)y+16;u=(int)u+128;v=(int)v+128;
00139 
00140 //#define MMSFB_CONV_YUV2R(y,u,v,r) if ((r=(298*(int)y+409*(int)v+128+0x200)>>8)>>8) r=0xff;
00141 //#define MMSFB_CONV_YUV2G(y,u,v,g) if ((g=(298*(int)y-100*(int)u-208*(int)v+128+0x200)>>8)>>8) g=0xff;
00142 //#define MMSFB_CONV_YUV2B(y,u,v,b) if ((b=(298*(int)y+516*(int)u+128+0x200)>>8)>>8) b=0xff;
00143 #define MMSFB_CONV_YUV2R(y,u,v,r) if ((r=(298*(int)y+409*(int)v+128+0x200)>>8)<0)r=0;else if(r>0xff)r=0xff;
00144 #define MMSFB_CONV_YUV2G(y,u,v,g) if ((g=(298*(int)y-100*(int)u-208*(int)v+128+0x200)>>8)<0)g=0;else if(g>0xff)g=0xff;
00145 #define MMSFB_CONV_YUV2B(y,u,v,b) if ((b=(298*(int)y+516*(int)u+128+0x200)>>8)<0)b=0;else if(b>0xff)b=0xff;
00146 
00147 #define MMSFB_CONV_YUV2RX(y,u,v,r) if ((r=298*(int)y+409*(int)v+128+0x200)>>16) r=0xff00;
00148 #define MMSFB_CONV_YUV2GX(y,u,v,g) if ((g=298*(int)y-100*(int)u-208*(int)v+128+0x200)>>16) g=0xff00;
00149 #define MMSFB_CONV_YUV2BX(y,u,v,b) if ((b=298*(int)y+516*(int)u+128+0x200)>>16) b=0xff00;
00150 
00151 
00152 #define MMSFB_CONV_RGB24_TO_YV12_PUSHPTR \
00153     unsigned char *saved_src   = src;   \
00154     unsigned char *saved_dst_y = dst_y; \
00155     unsigned char *saved_dst_u = dst_u; \
00156     unsigned char *saved_dst_v = dst_v;
00157 
00158 #define MMSFB_CONV_RGB24_TO_YV12_POPPTR \
00159     src   = saved_src;   \
00160     dst_y = saved_dst_y; \
00161     dst_u = saved_dst_u; \
00162     dst_v = saved_dst_v;
00163 
00164 #define MMSFB_CONV_RGB24_TO_YV12_PIXEL(src, dst_y, dst_u, dst_v, d_u, d_v) \
00165     {   register int r = *(src);                \
00166         register int g = *(src+1);              \
00167         register int b = *(src+2);              \
00168         dst_y = MMSFB_CONV_RGB2Y(r,g,b);        \
00169         d_u     MMSFB_CONV_RGB2U(r,g,b);        \
00170         d_v     MMSFB_CONV_RGB2V(r,g,b); }
00171 
00172 
00173 
00174 #define MMSFB_CONV_ARGB_TO_YV12_PUSHPTR \
00175     unsigned int  *saved_src   = src;   \
00176     unsigned char *saved_dst_y = dst_y; \
00177     unsigned char *saved_dst_u = dst_u; \
00178     unsigned char *saved_dst_v = dst_v;
00179 
00180 #define MMSFB_CONV_ARGB_TO_YV12_POPPTR \
00181     src   = saved_src;   \
00182     dst_y = saved_dst_y; \
00183     dst_u = saved_dst_u; \
00184     dst_v = saved_dst_v;
00185 
00186 #define MMSFB_CONV_ARGB_TO_YV12_PIXEL(src, dst_y, dst_u, dst_v, d_u, d_v) \
00187     SRC = src;                                                  \
00188     A = SRC >> 24;                                              \
00189                                                                 \
00190     if (A == 0xff) {                                            \
00191         if (SRC!=OLDSRC) {                                      \
00192             int r = (SRC >> 16) & 0xff;                         \
00193             int g = (SRC >> 8) & 0xff;                          \
00194             int b = SRC  & 0xff;                                \
00195             old_y = MMSFB_CONV_RGB2Y(r,g,b);                    \
00196             old_u = MMSFB_CONV_RGB2U(r,g,b);                    \
00197             old_v = MMSFB_CONV_RGB2V(r,g,b);                    \
00198             OLDSRC = SRC;                                       \
00199         }                                                       \
00200         dst_y = old_y;                                          \
00201         d_u     old_u;                                          \
00202         d_v     old_v;                                          \
00203     }                                                           \
00204     else                                                        \
00205     if (!A) {                                                   \
00206         dst_y = 0;                                              \
00207         d_u 128;                                                \
00208         d_v 128;                                                \
00209     }                                                           \
00210     else                                                        \
00211     {                                                           \
00212         if (SRC!=OLDSRC) {                                      \
00213             int r = (SRC >> 16) & 0xff;                         \
00214             int g = (SRC >> 8) & 0xff;                          \
00215             int b = SRC  & 0xff;                                \
00216             old_y = MMSFB_CONV_RGB2Y(r,g,b);                    \
00217             old_u = MMSFB_CONV_RGB2U(r,g,b);                    \
00218             old_v = MMSFB_CONV_RGB2V(r,g,b);                    \
00219             MMSFB_CONV_PREPARE_YUVBLEND(old_y, old_u, old_v);   \
00220             old_y = (A * old_y) >> 8;                           \
00221             old_u = (A * old_u) >> 8;                           \
00222             old_v = (A * old_v) >> 8;                           \
00223             MMSFB_CONV_RESET_YUVBLEND(old_y, old_u, old_v);     \
00224             OLDSRC = SRC;                                       \
00225         }                                                       \
00226                                                                 \
00227         dst_y = old_y;                                          \
00228         d_u     old_u;                                          \
00229         d_v     old_v;                                          \
00230     }
00231 
00232 
00233 #define MMSFB_CONV_YV12_TO_RGB32_PIXEL(src_y, src_u, src_v, dst) \
00234     { int y, u, v, r, g, b;                                     \
00235     y = src_y; u = src_u; v = src_v;                            \
00236     MMSFB_CONV_PREPARE_YUV2RGB(y,u,v);                          \
00237     MMSFB_CONV_YUV2R(y, u, v, r);                               \
00238     MMSFB_CONV_YUV2G(y, u, v, g);                               \
00239     MMSFB_CONV_YUV2B(y, u, v, b);                               \
00240     dst = 0xff000000 | (r << 16) | (g << 8) | b; }
00241 
00242 
00243 
00244 #define MMSFB_CONV_BLEND_ARGB_TO_YV12_PUSHPTR \
00245     unsigned int  *saved_src   = src;   \
00246     unsigned char *saved_dst_y = dst_y; \
00247     unsigned char *saved_dst_u = dst_u; \
00248     unsigned char *saved_dst_v = dst_v;
00249 
00250 #define MMSFB_CONV_BLEND_ARGB_TO_YV12_POPPTR \
00251     src   = saved_src;   \
00252     dst_y = saved_dst_y; \
00253     dst_u = saved_dst_u; \
00254     dst_v = saved_dst_v;
00255 
00256 
00257 
00258 #define MMSFB_CONV_BLEND_ARGB_TO_YV12_PIXEL(src, dst_y, dst_u, dst_v, d_u, d_v) \
00259     SRC = src;                                          \
00260     A = SRC >> 24;                                      \
00261                                                         \
00262     if (A == 0xff) {                                    \
00263         if (SRC!=OLDSRC) {                              \
00264             int r = (SRC >> 16) & 0xff;                 \
00265             int g = (SRC >> 8) & 0xff;                  \
00266             int b = SRC  & 0xff;                        \
00267             old_y = MMSFB_CONV_RGB2Y(r,g,b);            \
00268             old_u = MMSFB_CONV_RGB2U(r,g,b);            \
00269             old_v = MMSFB_CONV_RGB2V(r,g,b);            \
00270             OLDSRC = SRC;                               \
00271         }                                               \
00272         dst_y = old_y;                                  \
00273         d_u     old_u;                                  \
00274         d_v     old_v;                                  \
00275     }                                                   \
00276     else                                                \
00277     if (!A) {                                           \
00278         d_u dst_u;                                      \
00279         d_v dst_v;                                      \
00280     }                                                   \
00281     else                                                \
00282     {                                                   \
00283         if (SRC!=OLDSRC) {                              \
00284             int r = (SRC >> 16) & 0xff;                 \
00285             int g = (SRC >> 8) & 0xff;                  \
00286             int b = SRC  & 0xff;                        \
00287             old_y = A * MMSFB_CONV_RGB2Y(r,g,b);        \
00288             old_u = A * MMSFB_CONV_RGB2U(r,g,b);        \
00289             old_v = A * MMSFB_CONV_RGB2V(r,g,b);        \
00290             OLDSRC = SRC;                               \
00291         }                                               \
00292                                                         \
00293         register unsigned int SA = 0x100 - A;           \
00294         unsigned int y = dst_y;                         \
00295         unsigned int u = dst_u;                         \
00296         unsigned int v = dst_v;                         \
00297                                                         \
00298         y = SA * y + old_y;                             \
00299         u = SA * u + old_u;                             \
00300         v = SA * v + old_v;                             \
00301                                                         \
00302         dst_y = y >> 8;                                 \
00303         d_u     u >> 8;                                 \
00304         d_v     v >> 8;                                 \
00305     }
00306 
00307 
00308 
00309 
00310 
00311 
00312 
00313 
00314 #define MMSFB_CONV_YUY2_TO_YV12_PUSHPTR  \
00315     unsigned short int *saved_src = src; \
00316     unsigned char *saved_dst_y = dst_y;  \
00317     unsigned char *saved_dst_u = dst_u;  \
00318     unsigned char *saved_dst_v = dst_v;
00319 
00320 #define MMSFB_CONV_YUY2_TO_YV12_POPPTR \
00321     src   = saved_src;   \
00322     dst_y = saved_dst_y; \
00323     dst_u = saved_dst_u; \
00324     dst_v = saved_dst_v;
00325 
00326 
00327 #if __BYTE_ORDER ==  __BIG_ENDIAN
00328     // e.g. ARM
00329 #define MMSFB_CONV_YUY2_TO_YV12_PIXEL(src, dst_y, d_uv) \
00330     SRC = src;                                          \
00331     dst_y = SRC >> 8;                                   \
00332     d_uv    SRC & 0xff;
00333 
00334 #define MMSFB_CONV_YUY2_TO_YV12_PIXEL_2(src, dst_y, d_uv) \
00335     SRC = src;                                            \
00336     dst_y = SRC >> 8;                                     \
00337     d_uv    (SRC & 0xff) << 1;
00338 
00339 #else
00340     // e.g. Intel
00341 #define MMSFB_CONV_YUY2_TO_YV12_PIXEL(src, dst_y, d_uv) \
00342     SRC = src;                                          \
00343     dst_y = SRC & 0xff;                                 \
00344     d_uv    SRC >> 8;
00345 
00346 #define MMSFB_CONV_YUY2_TO_YV12_PIXEL_2(src, dst_y, d_uv) \
00347     SRC = src;                                            \
00348     dst_y = SRC & 0xff;                                   \
00349     d_uv    (SRC >> 8) << 1;
00350 #endif
00351 
00352 
00353 
00354 
00355 /*
00356 typedef int v4si __attribute__ ((vector_size (8)));
00357 typedef long long unsigned int v4sia __attribute__ ((vector_size (8)));
00358 typedef short int v4six __attribute__ ((vector_size (8)));
00359 typedef signed char v4siy __attribute__ ((vector_size (8)));
00360 
00361 typedef union
00362 {
00363 v4si v;
00364 v4sia va;
00365 v4six vv;
00366 v4siy vvv;
00367 short s[4];
00368 int i[2];
00369 unsigned char c[8];
00370 } _v4si;
00371 */
00372 
00373 #ifdef __HAVE_SSE__
00374 
00375 typedef int v4si[2];
00376 typedef short int v4six[4];
00377 typedef signed char v4siy[8];
00378 
00379 typedef union
00380 {
00381 v4si v;
00382 v4six vv;
00383 v4siy vvv;
00384 short s[4];
00385 int i[2];
00386 unsigned char c[8];
00387 } _v4si;
00388 
00389 #endif
00390 
00391 //#ifdef __SSE2__
00392 //#ifdef __MMX__
00393 
00394 /*AA = __builtin_ia32_psadbw(A, TTT); \
00395 if (!AA) { \
00396 */
00397 /*
00398 #define MMSFB_CONV_BLEND_ARGB_TO_YV12_PIXEL_MMX(src, dst_y1, dst_y2, dst_u, dst_v, d_u, d_v) \
00399     if ((src->c[3]==0xff)&&(src->c[7]==0xff)) { \
00400         if ((src->i[0] != OLDSRC_MMX.i[0])&&(src->i[1] != OLDSRC_MMX.i[1])) { \
00401             x1 = __builtin_ia32_pand(src->v, X1); \
00402             x2 = __builtin_ia32_psrlw(src->v, 8); \
00403             _v4si yy; \
00404             yy.vv = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, Y_RBRB), __builtin_ia32_pmaddwd(x2, Y_GG)); \
00405             yy.vv = __builtin_ia32_paddd(__builtin_ia32_psrld(yy.vv, 8), YY); \
00406             old_y1 = yy.c[0]; \
00407             old_y2 = yy.c[4]; \
00408             ou = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, U_RBRB), __builtin_ia32_pmaddwd(x2, U_GG)); \
00409             ou = __builtin_ia32_paddd(__builtin_ia32_psrld(ou, 8), UV); \
00410             old_u = __builtin_ia32_psadbw(ou, TTT); \
00411             ov = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, V_RBRB), __builtin_ia32_pmaddwd(x2, V_GG)); \
00412             ov = __builtin_ia32_paddd(__builtin_ia32_psrld(ov, 8), UV); \
00413             old_v = __builtin_ia32_psadbw(ov, TTT); \
00414             OLDSRC_MMX = *src;                              \
00415         } \
00416         dst_y1 = old_y1; \
00417         dst_y2 = old_y2; \
00418         d_u old_u; \
00419         d_v old_v; \
00420     } \
00421     else \
00422     if ((!src->c[3])&&(!src->c[7])) { \
00423         d_u (dst_u << 1);                                       \
00424         d_v (dst_v << 1);                                       \
00425     } \
00426     else { \
00427         if ((src->i[0] != OLDSRC_MMX.i[0])&&(src->i[1] != OLDSRC_MMX.i[1])) { \
00428             x1 = __builtin_ia32_pand(src->v, X1); \
00429             x2 = __builtin_ia32_psrlw(src->v, 8); \
00430             A  = __builtin_ia32_psrld(x2, 16); \
00431             oy = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, Y_RBRB), __builtin_ia32_pmaddwd(x2, Y_GG)); \
00432             oy = __builtin_ia32_paddd(__builtin_ia32_psrld(oy, 8), YY); \
00433             oy = __builtin_ia32_pmullw(oy, A); \
00434             ou = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, U_RBRB), __builtin_ia32_pmaddwd(x2, U_GG)); \
00435             ou = __builtin_ia32_paddd(__builtin_ia32_psrld(ou, 8), UV); \
00436             ou = __builtin_ia32_pmullw(ou, A); \
00437             ov = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, V_RBRB), __builtin_ia32_pmaddwd(x2, V_GG)); \
00438             ov = __builtin_ia32_paddd(__builtin_ia32_psrld(ov, 8), UV); \
00439             ov = __builtin_ia32_pmullw(ov, A); \
00440             A = __builtin_ia32_psubd(TTTT, A); \
00441             OLDSRC_MMX = *src;                              \
00442         } \
00443         { \
00444         _v4si yy; yy.i[0] = dst_y1; yy.i[1] = dst_y2; \
00445         _v4si uu; uu.i[0] = uu.i[1] = dst_u; \
00446         _v4si vv; vv.i[0] = vv.i[1] = dst_v; \
00447         \
00448         v4six qq; \
00449         qq = __builtin_ia32_pmullw(yy.vv, A); \
00450         qq = __builtin_ia32_paddw(qq, oy); \
00451         yy.vv = __builtin_ia32_psrlw(qq, 8); \
00452         dst_y1 = yy.c[0]; dst_y2 = yy.c[4]; \
00453         \
00454         qq = __builtin_ia32_pmullw(uu.vv, A); \
00455         qq = __builtin_ia32_paddw(qq, ou); \
00456         qq = __builtin_ia32_psrlw(qq, 8); \
00457         d_u  __builtin_ia32_psadbw(qq, TTT); \
00458         \
00459         qq = __builtin_ia32_pmullw(vv.vv, A); \
00460         qq = __builtin_ia32_paddw(qq, ov); \
00461         qq = __builtin_ia32_psrlw(qq, 8); \
00462         d_v  __builtin_ia32_psadbw(qq, TTT); \
00463         } \
00464     }
00465 
00466 */
00467 //       __asm__ __volatile__ ( "mov %%eax,%%ebx" : [x] "=m" (x));
00468 
00469 /*
00470 #define MMSFB_CONV_BLEND_ARGB_TO_YV12_PIXEL_MMX(src, dst_y1, dst_y2, dst_u, dst_v, d_u, d_v) \
00471     if ((src->c[3]==0xff)&&(src->c[7]==0xff)) { \
00472         if ((src->i[0] != OLDSRC_MMX.i[0])&&(src->i[1] != OLDSRC_MMX.i[1])) { \
00473             x1 = __builtin_ia32_pand(src->v, X1); \
00474             x2 = __builtin_ia32_psrlw(src->v, 8); \
00475             _v4si yy; \
00476             yy.vv = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, Y_RBRB), __builtin_ia32_pmaddwd(x2, Y_GG)); \
00477             yy.vv = __builtin_ia32_paddd(__builtin_ia32_psrld(yy.vv, 8), YY); \
00478             old_y1 = yy.c[0]; \
00479             old_y2 = yy.c[4]; \
00480             ou = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, U_RBRB), __builtin_ia32_pmaddwd(x2, U_GG)); \
00481             ou = __builtin_ia32_paddd(__builtin_ia32_psrld(ou, 8), UV); \
00482             old_u = __builtin_ia32_psadbw(ou, TTT); \
00483             ov = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, V_RBRB), __builtin_ia32_pmaddwd(x2, V_GG)); \
00484             ov = __builtin_ia32_paddd(__builtin_ia32_psrld(ov, 8), UV); \
00485             old_v = __builtin_ia32_psadbw(ov, TTT); \
00486             OLDSRC_MMX = *src;                              \
00487         } \
00488         dst_y1 = old_y1; \
00489         dst_y2 = old_y2; \
00490         d_u old_u; \
00491         d_v old_v; \
00492     } \
00493     else \
00494     if ((!src->c[3])&&(!src->c[7])) { \
00495         d_u (dst_u << 1);                                       \
00496         d_v (dst_v << 1);                                       \
00497     } \
00498     else { \
00499         if ((src->i[0] != OLDSRC_MMX.i[0])&&(src->i[1] != OLDSRC_MMX.i[1])) { \
00500             x1 = __builtin_ia32_pand(src->v, X1); \
00501             x2 = __builtin_ia32_psrlw(src->v, 8); \
00502             A  = __builtin_ia32_psrld(x2, 16); \
00503             oy = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, Y_RBRB), __builtin_ia32_pmaddwd(x2, Y_GG)); \
00504             oy = __builtin_ia32_paddd(__builtin_ia32_psrld(oy, 8), YY); \
00505             oy = __builtin_ia32_pmullw(oy, A); \
00506             ou = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, U_RBRB), __builtin_ia32_pmaddwd(x2, U_GG)); \
00507             ou = __builtin_ia32_paddd(__builtin_ia32_psrld(ou, 8), UV); \
00508             ou = __builtin_ia32_pmullw(ou, A); \
00509             ov = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, V_RBRB), __builtin_ia32_pmaddwd(x2, V_GG)); \
00510             ov = __builtin_ia32_paddd(__builtin_ia32_psrld(ov, 8), UV); \
00511             ov = __builtin_ia32_pmullw(ov, A); \
00512             A = __builtin_ia32_psubd(TTTT, A); \
00513             OLDSRC_MMX = *src;                              \
00514         } \
00515         { \
00516         _v4si yy; yy.i[0] = dst_y1; yy.i[1] = dst_y2; \
00517         _v4si uu; uu.i[0] = uu.i[1] = dst_u; \
00518         _v4si vv; vv.i[0] = vv.i[1] = dst_v; \
00519         \
00520         v4six qq; \
00521         qq = __builtin_ia32_pmullw(yy.vv, A); \
00522         qq = __builtin_ia32_paddw(qq, oy); \
00523         yy.vv = __builtin_ia32_psrlw(qq, 8); \
00524         dst_y1 = yy.c[0]; dst_y2 = yy.c[4]; \
00525         \
00526         qq = __builtin_ia32_pmullw(uu.vv, A); \
00527         qq = __builtin_ia32_paddw(qq, ou); \
00528         qq = __builtin_ia32_psrlw(qq, 8); \
00529         d_u  __builtin_ia32_psadbw(qq, TTT); \
00530         \
00531         qq = __builtin_ia32_pmullw(vv.vv, A); \
00532         qq = __builtin_ia32_paddw(qq, ov); \
00533         qq = __builtin_ia32_psrlw(qq, 8); \
00534         d_v  __builtin_ia32_psadbw(qq, TTT); \
00535         } \
00536     }
00537 */
00538 /*
00539 #define MMSFB_CONV_BLEND_ARGB_TO_YV12_PIXEL_MMX(src, dst_y1, dst_y2, dst_u, dst_v, d_u, d_v) \
00540     if ((src->c[3]==0xff)&&(src->c[7]==0xff)) { \
00541         if ((src->i[0] != OLDSRC_MMX.i[0])&&(src->i[1] != OLDSRC_MMX.i[1])) { \
00542             x1 = __builtin_ia32_pand(src->v, X1); \
00543             x2 = __builtin_ia32_psrlw(src->v, 8); \
00544             _v4si yy; \
00545             yy.vv = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, Y_RBRB), __builtin_ia32_pmaddwd(x2, Y_GG)); \
00546             yy.vv = __builtin_ia32_paddd(__builtin_ia32_psrld(yy.vv, 8), YY); \
00547             old_y1 = yy.c[0]; \
00548             old_y2 = yy.c[4]; \
00549             ou = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, U_RBRB), __builtin_ia32_pmaddwd(x2, U_GG)); \
00550             ou = __builtin_ia32_paddd(__builtin_ia32_psrld(ou, 8), UV); \
00551             old_u = __builtin_ia32_psadbw(ou, TTT); \
00552             ov = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, V_RBRB), __builtin_ia32_pmaddwd(x2, V_GG)); \
00553             ov = __builtin_ia32_paddd(__builtin_ia32_psrld(ov, 8), UV); \
00554             old_v = __builtin_ia32_psadbw(ov, TTT); \
00555             OLDSRC_MMX = *src;                              \
00556         } \
00557         dst_y1 = old_y1; \
00558         dst_y2 = old_y2; \
00559         d_u old_u; \
00560         d_v old_v; \
00561     } \
00562     else \
00563     if ((!src->c[3])&&(!src->c[7])) { \
00564         d_u (dst_u << 1);                                       \
00565         d_v (dst_v << 1);                                       \
00566     } \
00567     else { \
00568             x1 = __builtin_ia32_pand(src->v, X1); \
00569             x2 = __builtin_ia32_psrlw(src->v, 8); \
00570             A  = __builtin_ia32_psrld(x2, 16); \
00571             oy = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, Y_RBRB), __builtin_ia32_pmaddwd(x2, Y_GG)); \
00572             oy = __builtin_ia32_paddd(__builtin_ia32_psrld(oy, 8), YY); \
00573             oy = __builtin_ia32_pmullw(oy, A); \
00574             ou = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, U_RBRB), __builtin_ia32_pmaddwd(x2, U_GG)); \
00575             ou = __builtin_ia32_paddd(__builtin_ia32_psrld(ou, 8), UV); \
00576             ou = __builtin_ia32_pmullw(ou, A); \
00577             ov = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, V_RBRB), __builtin_ia32_pmaddwd(x2, V_GG)); \
00578             ov = __builtin_ia32_paddd(__builtin_ia32_psrld(ov, 8), UV); \
00579             ov = __builtin_ia32_pmullw(ov, A); \
00580             A = __builtin_ia32_psubd(TTTT, A); \
00581         { \
00582         _v4si yy; yy.i[0] = dst_y1; yy.i[1] = dst_y2; \
00583         _v4si uu; uu.i[0] = dst_u; \
00584         _v4si vv; vv.i[0] = dst_v; \
00585         \
00586         yy.vv = __builtin_ia32_psrlw(__builtin_ia32_paddw(__builtin_ia32_pmullw(yy.vv, A), oy), 8); \
00587         dst_y1 = yy.c[0]; dst_y2 = yy.c[4]; \
00588         \
00589         d_u  __builtin_ia32_psadbw(__builtin_ia32_psrlw(__builtin_ia32_paddw(__builtin_ia32_pmullw(__builtin_ia32_pshufw(uu.vv, 68), A), ou), 8), TTT); \
00590         d_v  __builtin_ia32_psadbw(__builtin_ia32_psrlw(__builtin_ia32_paddw(__builtin_ia32_pmullw(__builtin_ia32_pshufw(vv.vv, 68), A), ov), 8), TTT); \
00591         } \
00592     }
00593 */
00594 
00595 /*
00596 
00597 #define MMSFB_CONV_BLEND_ARGB_TO_YV12_PIXEL_MMX(src, dst_y1, dst_y2, dst_u, dst_v, d_u, d_v) \
00598     if ((src->c[3]==0xff)&&(src->c[7]==0xff)) { \
00599         SRC = src->v; \
00600         if (SRC!=OLDSRC_MMX) {                              \
00601             x1 = __builtin_ia32_pand(SRC, X1); \
00602             x2 = __builtin_ia32_psrlw(SRC, 8); \
00603             _v4si yy; \
00604             yy.vv = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, Y_RBRB), __builtin_ia32_pmaddwd(x2, Y_GG)); \
00605             yy.vv = __builtin_ia32_paddd(__builtin_ia32_psrld(yy.vv, 8), YY); \
00606             old_y1 = yy.c[0]; \
00607             old_y2 = yy.c[4]; \
00608             u = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, U_RBRB), __builtin_ia32_pmaddwd(x2, U_GG)); \
00609             u = __builtin_ia32_paddd(__builtin_ia32_psrld(u, 8), UV); \
00610             old_u = __builtin_ia32_psadbw(u, TTT); \
00611             v = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, V_RBRB), __builtin_ia32_pmaddwd(x2, V_GG)); \
00612             v = __builtin_ia32_paddd(__builtin_ia32_psrld(v, 8), UV); \
00613             old_v = d_v __builtin_ia32_psadbw(v, TTT); \
00614             OLDSRC_MMX = SRC;                               \
00615         } \
00616         dst_y1 = old_y1; \
00617         dst_y2 = old_y2; \
00618         d_u old_u; \
00619         d_v old_v; \
00620     } \
00621     else \
00622     if ((!src->c[3])&&(!src->c[7])) { \
00623         d_u (dst_u << 1);                                       \
00624         d_v (dst_v << 1);                                       \
00625     } \
00626     else { \
00627         SRC = src->v; \
00628         x1 = __builtin_ia32_pand(SRC, X1); \
00629         x2 = __builtin_ia32_psrlw(SRC, 8); \
00630         A  = __builtin_ia32_psrld(x2, 16); \
00631         y = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, Y_RBRB), __builtin_ia32_pmaddwd(x2, Y_GG)); \
00632         y = __builtin_ia32_paddd(__builtin_ia32_psrld(y, 8), YY); \
00633         y = __builtin_ia32_pmullw(y, A); \
00634         u = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, U_RBRB), __builtin_ia32_pmaddwd(x2, U_GG)); \
00635         u = __builtin_ia32_paddd(__builtin_ia32_psrld(u, 8), UV); \
00636         u = __builtin_ia32_pmullw(u, A); \
00637         v = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, V_RBRB), __builtin_ia32_pmaddwd(x2, V_GG)); \
00638         v = __builtin_ia32_paddd(__builtin_ia32_psrld(v, 8), UV); \
00639         v = __builtin_ia32_pmullw(v, A); \
00640         { \
00641         _v4si yy; yy.i[0] = dst_y1; yy.i[1] = dst_y2; \
00642         _v4si uu; uu.i[0] = dst_u; \
00643         _v4si vv; vv.i[0] = dst_v; \
00644         \
00645         A = __builtin_ia32_psubd(TTTT, A); \
00646         yy.vv = __builtin_ia32_psrlw(__builtin_ia32_paddw(__builtin_ia32_pmullw(yy.vv, A), y), 8); \
00647         dst_y1 = yy.c[0]; dst_y2 = yy.c[4]; \
00648         \
00649         d_u  __builtin_ia32_psadbw(__builtin_ia32_psrlw(__builtin_ia32_paddw(__builtin_ia32_pmullw(__builtin_ia32_pshufw(uu.vv, 68), A), u), 8), TTT); \
00650         d_v  __builtin_ia32_psadbw(__builtin_ia32_psrlw(__builtin_ia32_paddw(__builtin_ia32_pmullw(__builtin_ia32_pshufw(vv.vv, 68), A), v), 8), TTT); \
00651         } \
00652     }
00653 */
00654 
00655 /*
00656 #define MMSFB_CONV_BLEND_ARGB_TO_YV12_PIXEL_MMX(src, dst_y1, dst_y2, dst_u, dst_v, d_u, d_v) \
00657     SRC = src->v; \
00658     x1 = __builtin_ia32_pand(SRC, X1); \
00659     x2 = __builtin_ia32_psrlw(SRC, 8); \
00660     A  = __builtin_ia32_psrld(x2, 16); \
00661     y.vv = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, Y_RBRB), __builtin_ia32_pmaddwd(x2, Y_GG)); \
00662     y.vv = __builtin_ia32_paddd(__builtin_ia32_psrld(y.vv, 8), YY); \
00663     y.vv = __builtin_ia32_pmullw(y.vv, A); \
00664     u = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, U_RBRB), __builtin_ia32_pmaddwd(x2, U_GG)); \
00665     u = __builtin_ia32_paddd(__builtin_ia32_psrld(u, 8), UV); \
00666     u = __builtin_ia32_pmullw(u, A); \
00667     v = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, V_RBRB), __builtin_ia32_pmaddwd(x2, V_GG)); \
00668     v = __builtin_ia32_paddd(__builtin_ia32_psrld(v, 8), UV); \
00669     v = __builtin_ia32_pmullw(v, A); \
00670     { \
00671     _v4si yy; \
00672     yy.i[0] = dst_y1; \
00673     yy.i[1] = dst_y2; \
00674     _v4si uu; \
00675     uu.i[0] = dst_u; \
00676     _v4si vv; \
00677     vv.i[0] = dst_v; \
00678     \
00679     A = __builtin_ia32_psubd(TTTT, A); \
00680     yy.vv = __builtin_ia32_psrlw(__builtin_ia32_paddw(__builtin_ia32_pmullw(yy.vv, A), y.vv), 8); \
00681     dst_y1 = yy.c[0]; \
00682     dst_y2 = yy.c[4]; \
00683     \
00684     d_u  __builtin_ia32_psadbw(__builtin_ia32_psrlw(__builtin_ia32_paddw(__builtin_ia32_pmullw(__builtin_ia32_pshufw(uu.vv, 68), A), u), 8), TTT); \
00685     d_v  __builtin_ia32_psadbw(__builtin_ia32_psrlw(__builtin_ia32_paddw(__builtin_ia32_pmullw(__builtin_ia32_pshufw(vv.vv, 68), A), v), 8), TTT); \
00686     }
00687 */
00688 
00689 
00690 /*
00691 #define MMSFB_CONV_BLEND_ARGB_TO_YV12_PIXEL_MMX(src, dst_y1, dst_y2, dst_u, dst_v, d_u, d_v) \
00692     SRC = src->v; \
00693     x1 = __builtin_ia32_pand(SRC, X1); \
00694     x2 = __builtin_ia32_psrlw(SRC, 8); \
00695     A.vv = __builtin_ia32_psrld(x2, 16); \
00696     y.vv = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, Y_RBRB), __builtin_ia32_pmaddwd(x2, Y_GG)); \
00697     y.vv = __builtin_ia32_paddd(__builtin_ia32_psrld(y.vv, 8), YY); \
00698     y.vv = __builtin_ia32_pmullw(y.vv, A.vv); \
00699     u = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, U_RBRB), __builtin_ia32_pmaddwd(x2, U_GG)); \
00700     u = __builtin_ia32_paddd(__builtin_ia32_psrld(u, 8), UV); \
00701     u = __builtin_ia32_pmullw(u, A.vv); \
00702     v = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, V_RBRB), __builtin_ia32_pmaddwd(x2, V_GG)); \
00703     v = __builtin_ia32_paddd(__builtin_ia32_psrld(v, 8), UV); \
00704     v = __builtin_ia32_pmullw(v, A.vv); \
00705     { \
00706     _v4si yy; \
00707     yy.i[0] = dst_y1; \
00708     yy.i[1] = dst_y2; \
00709     _v4si uu; \
00710     uu.i[0] = dst_u; \
00711     uu.i[1] = dst_u; \
00712     _v4si vv; \
00713     vv.i[0] = dst_v; \
00714     vv.i[1] = dst_v; \
00715     _v4si SA; \
00716     SA.vv = __builtin_ia32_psubd(TTTT, A.vv); \
00717     yy.vv = __builtin_ia32_pmullw(yy.vv, SA.vv); \
00718     uu.vv = __builtin_ia32_pmullw(uu.vv, SA.vv); \
00719     vv.vv = __builtin_ia32_pmullw(vv.vv, SA.vv); \
00720     yy.vv = __builtin_ia32_paddw(yy.vv, y.vv); \
00721     uu.vv = __builtin_ia32_paddw(uu.vv, u); \
00722     vv.vv = __builtin_ia32_paddw(vv.vv, v); \
00723     yy.vv = __builtin_ia32_psrlw(yy.vv, 8); \
00724     uu.vv = __builtin_ia32_psrlw(uu.vv, 8); \
00725     vv.vv = __builtin_ia32_psrlw(vv.vv, 8); \
00726     dst_y1 = yy.c[0]; \
00727     dst_y2 = yy.c[4]; \
00728     d_u  __builtin_ia32_psadbw(uu.vv, TTT); \
00729     d_v  __builtin_ia32_psadbw(vv.vv, TTT); \
00730     }
00731 */
00732 
00733 /*
00734 #define MMSFB_CONV_BLEND_ARGB_TO_YV12_PIXEL_MMX(src, dst_y1, dst_y2, dst_u, dst_v, d_u, d_v) \
00735     SRC = src->v; \
00736     x1 = __builtin_ia32_pand(SRC, X1); \
00737     x2 = __builtin_ia32_psrlw(SRC, 8); \
00738     y.vv = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, Y_RBRB), __builtin_ia32_pmaddwd(x2, Y_GG)); \
00739     y.vv = __builtin_ia32_paddd(__builtin_ia32_psrld(y.vv, 8), YY); \
00740     dst_y1 = y.c[0]; \
00741     dst_y2 = y.c[4]; \
00742     uv = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, U_RBRB), __builtin_ia32_pmaddwd(x2, U_GG)); \
00743     uv = __builtin_ia32_paddd(__builtin_ia32_psrld(uv, 8), UV); \
00744     d_u __builtin_ia32_psadbw(uv, TTT); \
00745     uv = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, V_RBRB), __builtin_ia32_pmaddwd(x2, V_GG)); \
00746     uv = __builtin_ia32_paddd(__builtin_ia32_psrld(uv, 8), UV); \
00747     d_v __builtin_ia32_psadbw(uv, TTT);
00748 
00749  */
00750 
00751 
00752 /*
00753 #define MMSFB_CONV_BLEND_ARGB_TO_YV12_PIXEL_MMX(src, dst_y1, dst_y2, dst_u, dst_v, d_u, d_v) \
00754  { \
00755     register v4si t = src->v; \
00756     register v4six x1, x2; \
00757     x1 = __builtin_ia32_pand(t, X1); \
00758     x2 = __builtin_ia32_psrlw(t, 8); \
00759     _v4si y; \
00760     y.vv = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, Y_RBRB), __builtin_ia32_pmaddwd(x2, Y_GG)); \
00761     y.vv = __builtin_ia32_pand(__builtin_ia32_paddd(__builtin_ia32_psrld(y.vv, 8), YY), X1); \
00762     dst_y1 = y.c[0]; \
00763     dst_y2 = y.c[4]; \
00764     _v4si u; \
00765     u.vv = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, U_RBRB), __builtin_ia32_pmaddwd(x2, U_GG)); \
00766     u.vv = __builtin_ia32_pand(__builtin_ia32_paddd(__builtin_ia32_psrld(u.vv, 8), UV), X1); \
00767     d_u (u.s[0] + u.s[2]); \
00768     _v4si v; \
00769     v.vv = __builtin_ia32_paddd(__builtin_ia32_pmaddwd(x1, V_RBRB), __builtin_ia32_pmaddwd(x2, V_GG)); \
00770     v.vv = __builtin_ia32_pand(__builtin_ia32_paddd(__builtin_ia32_psrld(v.vv, 8), UV), X1); \
00771     d_v (v.s[0] + v.s[2]); }
00772 */
00773 
00774 /*
00775 
00776  \
00777     SRC = src;                                          \
00778     A = SRC >> 24;                                      \
00779                                                         \
00780     if (A == 0xff) {                                    \
00781         if (SRC!=OLDSRC) {                              \
00782             int r = (SRC >> 16) & 0xff;                 \
00783             int g = (SRC >> 8) & 0xff;                  \
00784             int b = SRC  & 0xff;                        \
00785             old_y = MMSFB_CONV_RGB2Y(r,g,b);            \
00786             old_u = MMSFB_CONV_RGB2U(r,g,b);            \
00787             old_v = MMSFB_CONV_RGB2V(r,g,b);            \
00788             OLDSRC = SRC;                               \
00789         }                                               \
00790         dst_y = old_y;                                  \
00791         d_u     old_u;                                  \
00792         d_v     old_v;                                  \
00793     }                                                   \
00794     else                                                \
00795     if (!A) {                                           \
00796         d_u dst_u;                                      \
00797         d_v dst_v;                                      \
00798     }                                                   \
00799     else                                                \
00800     {                                                   \
00801         if (SRC!=OLDSRC) {                              \
00802             int r = (SRC >> 16) & 0xff;                 \
00803             int g = (SRC >> 8) & 0xff;                  \
00804             int b = SRC  & 0xff;                        \
00805             old_y = A * MMSFB_CONV_RGB2Y(r,g,b);        \
00806             old_u = A * MMSFB_CONV_RGB2U(r,g,b);        \
00807             old_v = A * MMSFB_CONV_RGB2V(r,g,b);        \
00808             OLDSRC = SRC;                               \
00809         }                                               \
00810                                                         \
00811         register unsigned int SA = 0x100 - A;           \
00812         unsigned int y = dst_y;                         \
00813         unsigned int u = dst_u;                         \
00814         unsigned int v = dst_v;                         \
00815                                                         \
00816         y = SA * y + old_y;                             \
00817         u = SA * u + old_u;                             \
00818         v = SA * v + old_v;                             \
00819                                                         \
00820         dst_y = y >> 8;                                 \
00821         d_u     u >> 8;                                 \
00822         d_v     v >> 8;                                 \
00823     }
00824 */
00825 
00826 
00827 #define MMSFB_CONV_BLEND_COLORALPHA_ARGB_TO_YV12_PIXEL(src, dst_y, dst_u, dst_v, d_u, d_v) \
00828     SRC = src;                                          \
00829     A = SRC >> 24;                                      \
00830                                                         \
00831     if (!A) {                                           \
00832         d_u dst_u;                                      \
00833         d_v dst_v;                                      \
00834     }                                                   \
00835     else                                                \
00836     {                                                   \
00837         if (SRC!=OLDSRC) {                              \
00838             int r = (ALPHA * (SRC & 0xff0000)) >> 24;   \
00839             int g = (ALPHA * (SRC & 0xff00)) >> 16;     \
00840             int b = (ALPHA * (SRC & 0xff)) >> 8;        \
00841             old_y = A * MMSFB_CONV_RGB2Y(r,g,b);        \
00842             A = (ALPHA * A) >> 8;                       \
00843             old_u = A * MMSFB_CONV_RGB2U(r,g,b);        \
00844             old_v = A * MMSFB_CONV_RGB2V(r,g,b);        \
00845             OLDSRC = SRC;                               \
00846         }                                               \
00847         else                                            \
00848             A = (ALPHA * A) >> 8;                       \
00849                                                         \
00850         register unsigned int SA = 0x100 - A;           \
00851         unsigned int y = dst_y;                         \
00852         unsigned int u = dst_u;                         \
00853         unsigned int v = dst_v;                         \
00854                                                         \
00855         y = SA * y + old_y;                             \
00856         u = SA * u + old_u;                             \
00857         v = SA * v + old_v;                             \
00858                                                         \
00859         dst_y = y >> 8;                                 \
00860         d_u     u >> 8;                                 \
00861         d_v     v >> 8;                                 \
00862     }
00863 
00864 
00865 
00866 
00867 
00868 
00869 #define MMSFB_CONV_BLEND_AYUV_TO_YV12_PIXEL(src, dst_y, dst_u, dst_v, d_u, d_v) \
00870     SRC = src;                                          \
00871     A = SRC >> 24;                                      \
00872                                                         \
00873     if (A == 0xff) {                                    \
00874         if (SRC!=OLDSRC) {                              \
00875             old_y = (SRC >> 16) & 0xff;                 \
00876             old_u = (SRC >> 8) & 0xff;                  \
00877             old_v = SRC  & 0xff;                        \
00878             OLDSRC = SRC;                               \
00879         }                                               \
00880         dst_y = old_y;                                  \
00881         d_u     old_u;                                  \
00882         d_v     old_v;                                  \
00883     }                                                   \
00884     else                                                \
00885     if (!A) {                                           \
00886         d_u dst_u;                                      \
00887         d_v dst_v;                                      \
00888     }                                                   \
00889     else                                                \
00890     {                                                   \
00891         if (SRC!=OLDSRC) {                              \
00892             old_y = A * ((SRC >> 16) & 0xff);           \
00893             old_u = A * ((SRC >> 8) & 0xff);            \
00894             old_v = A * (SRC  & 0xff);                  \
00895             OLDSRC = SRC;                               \
00896         }                                               \
00897                                                         \
00898         register unsigned int SA = 0x100 - A;           \
00899         unsigned int y = dst_y;                         \
00900         unsigned int u = dst_u;                         \
00901         unsigned int v = dst_v;                         \
00902                                                         \
00903         y = SA * y + old_y;                             \
00904         u = SA * u + old_u;                             \
00905         v = SA * v + old_v;                             \
00906                                                         \
00907         dst_y = y >> 8;                                 \
00908         d_u     u >> 8;                                 \
00909         d_v     v >> 8;                                 \
00910     }
00911 
00912 
00913 #define MMSFB_CONV_BLEND_COLORALPHA_AYUV_TO_YV12_PIXEL(src, dst_y, dst_u, dst_v, d_u, d_v) \
00914     SRC = src;                                          \
00915     A = SRC >> 24;                                      \
00916                                                         \
00917     if (!A) {                                           \
00918         d_u dst_u;                                      \
00919         d_v dst_v;                                      \
00920     }                                                   \
00921     else                                                \
00922     {                                                   \
00923         if (SRC!=OLDSRC) {                              \
00924             int sy = (SRC << 8) >> 24;                  \
00925             int su = (SRC << 16) >> 24;                 \
00926             int sv = SRC & 0xff;                        \
00927             MMSFB_CONV_PREPARE_YUVBLEND(sy,su,sv);  \
00928             sy = (ALPHA * sy) >> 8;                     \
00929             su = (ALPHA * su) >> 8;                     \
00930             sv = (ALPHA * sv) >> 8;                     \
00931             MMSFB_CONV_RESET_YUVBLEND(sy,su,sv);        \
00932             old_y = A * sy;                             \
00933             A = (ALPHA * A) >> 8;                       \
00934             old_u = A * su;                             \
00935             old_v = A * sv;                             \
00936             OLDSRC = SRC;                               \
00937         }                                               \
00938         else                                            \
00939             A = (ALPHA * A) >> 8;                       \
00940                                                         \
00941         register unsigned int SA = 0x100 - A;           \
00942         unsigned int y = dst_y;                         \
00943         unsigned int u = dst_u;                         \
00944         unsigned int v = dst_v;                         \
00945                                                         \
00946         y = SA * y + old_y;                             \
00947         u = SA * u + old_u;                             \
00948         v = SA * v + old_v;                             \
00949                                                         \
00950         dst_y = y >> 8;                                 \
00951         d_u     u >> 8;                                 \
00952         d_v     v >> 8;                                 \
00953     }
00954 
00955 
00956 
00957 
00958 
00959 //! bresenham algorithm
00960 #define MMSFB_DRAWLINE_BRESENHAM(putpixel) { \
00961     int x = x1; int y = y1; \
00962     int dx = x2 - x1; int dy = y2 - y1; \
00963     int ix = (dx > 0) ? 1 : (dx < 0) ? -1 : 0; int iy = (dy > 0) ? 1 : (dy < 0) ? -1 : 0; \
00964     if (!dx && !dy) { putpixel; } else { \
00965     if (dx < 0) dx = -dx; if (dy < 0) dy = -dy; \
00966     int pdx, pdy, ddx, ddy, es, el; \
00967     if (dx > dy) { pdx=ix; pdy=0; ddx=ix; ddy=iy; es=dy; el=dx; } else { pdx=0;  pdy=iy; ddx=ix; ddy=iy; es=dx; el=dy; } \
00968     int err = el >> 1; putpixel; \
00969     for(int i = 0; i < el; ++i) { err-=es; if (err < 0) { err+=el; x+=ddx; y+=ddy; } else { x+=pdx; y+=pdy; } putpixel; } } }
00970 
00971 //! put pixel macro will be used e.g. as parameter for the bresenham algorithm
00972 #define MMSFB_DRAWLINE_PUT_PIXEL \
00973     if ((x >= clipreg.x1)&&(x <= clipreg.x2)&&(y >= clipreg.y1)&&(y <= clipreg.y2)) \
00974         dst[x+y*dst_pitch_pix]=SRC;
00975 
00976 
00977 //! used for text output
00978 #define MMSFBSURFACE_BLIT_TEXT_INIT(pw) \
00979     int FH = 0;   font->getHeight(&FH); \
00980     int desc = 0; font->getDescender(&desc); \
00981     int DY = FH - (desc + 1); \
00982     int dst_pitch_pix = dst_pitch >> pw;
00983 
00984 //! used for text output
00985 #define MMSFBSURFACE_BLIT_TEXT_LOAD_GLYPH(font, character) \
00986     int           src_pitch_pix; \
00987     int           src_w; \
00988     int           src_h; \
00989     unsigned char *src; \
00990     MMSFBFont_Glyph glyph; \
00991     bool glyph_loaded = font->getGlyph(character, &glyph); \
00992     if (glyph_loaded) { \
00993         src_pitch_pix = glyph.pitch; \
00994         src_w         = glyph.width; \
00995         src_h         = glyph.height; \
00996         src           = glyph.buffer; \
00997     }
00998 
00999 //! used for text output
01000 #define MMSFBSURFACE_BLIT_TEXT_START_RENDER(pt) \
01001     if (glyph_loaded) { \
01002         int dx, dy; \
01003         if (!MMSFBBase_rotate180) { \
01004             dx = x + glyph.left; \
01005             dy = y + DY - glyph.top; \
01006         } else { \
01007             dx = x - glyph.left - glyph.width + 1; \
01008             dy = y - (DY - glyph.top) - glyph.height + 1; \
01009         } \
01010         if (dx < clipreg.x1) { \
01011             src_w -= clipreg.x1 - dx; \
01012             src   += clipreg.x1 - dx; \
01013             dx     = clipreg.x1; } \
01014         if (dx + src_w - 1 > clipreg.x2) src_w = clipreg.x2 - dx + 1; \
01015         if (dy < clipreg.y1) { \
01016             src_h -= clipreg.y1 - dy; \
01017             src   +=(clipreg.y1 - dy) * src_pitch_pix; \
01018             dy     = clipreg.y1; } \
01019         if (dy + src_h - 1 > clipreg.y2) src_h = clipreg.y2 - dy + 1; \
01020         unsigned char *src_end = src + src_h * src_pitch_pix; \
01021         unsigned char *line_end = src + src_w; \
01022         int src_pitch_pix_diff = src_pitch_pix - src_w; \
01023         int dst_pitch_pix_diff = dst_pitch_pix - src_w; \
01024         pt *dst = ((pt *)dst_ptr) + dx + dy * dst_pitch_pix;
01025 
01026 //! used for text output
01027 #define MMSFBSURFACE_BLIT_TEXT_END_RENDER \
01028     if (!MMSFBBase_rotate180) \
01029         x+=glyph.advanceX; \
01030     else \
01031         x-=glyph.advanceX;  }
01032 
01033 
01034 //! calculate region if screen is rotated by 180°
01035 #define MMSFB_ROTATE_180_REGION(SURFACE, X1, Y1, X2, Y2) \
01036     if (MMSFBBase_rotate180) { \
01037         int tmp; \
01038         tmp = X2; \
01039         X2 = ((!(SURFACE)->root_parent)?(SURFACE)->config.w:(SURFACE)->root_parent->config.w) - X1 - 1; \
01040         X1 = ((!(SURFACE)->root_parent)?(SURFACE)->config.w:(SURFACE)->root_parent->config.w) - tmp - 1; \
01041         tmp = Y2; \
01042         Y2 = ((!(SURFACE)->root_parent)?(SURFACE)->config.h:(SURFACE)->root_parent->config.h) - Y1 - 1; \
01043         Y1 = ((!(SURFACE)->root_parent)?(SURFACE)->config.h:(SURFACE)->root_parent->config.h) - tmp - 1; \
01044     }
01045 
01046 //! calculate rectangle if screen is rotated by 180°
01047 #define MMSFB_ROTATE_180_RECT(SURFACE, X, Y, W, H) \
01048     if (MMSFBBase_rotate180) { \
01049         X = ((!(SURFACE)->root_parent)?(SURFACE)->config.w:(SURFACE)->root_parent->config.w) - X - (W); \
01050         Y = ((!(SURFACE)->root_parent)?(SURFACE)->config.h:(SURFACE)->root_parent->config.h) - Y - (H); \
01051     }
01052 
01053 //! calculate rectangle if screen is rotated by 180°
01054 #define MMSFB_ROTATE_180_RECT_WH(WIDTH, HEIGHT, X, Y, W, H) \
01055     if (MMSFBBase_rotate180) { \
01056         X = WIDTH - X - (W); \
01057         Y = HEIGHT - Y - (H); \
01058     }
01059 
01060 
01061 
01062 
01063 //! Stretching the source byte buffer to a destination.
01064 /*!
01065 \note src and dst have to point to the first pixel which is to process
01066 \author Jens Schneider
01067 */
01068 void stretch_byte_buffer(bool h_antialiasing, bool v_antialiasing,
01069                          unsigned char *src, int src_pitch, int src_pitch_pix, int src_height, int sw, int sh,
01070                          unsigned char *dst, int dst_pitch, int dst_pitch_pix, int dst_height, int dw, int dh);
01071 
01072 //! Compressing a 2x2 matrix (arithmetic mean), e.g. used for U/V components (YV12 pixel format).
01073 /*!
01074 \note src and dst have to point to the first pixel which is to process
01075 \author Jens Schneider
01076 */
01077 void compress_2x2_matrix(unsigned char *src, int src_pitch, int src_pitch_pix, int src_height, int sw, int sh,
01078                          unsigned char *dst, int dst_pitch, int dst_pitch_pix, int dst_height, int dw, int dh);
01079 
01080 
01081 
01082 //! Stretching the source unsigned int buffer to a destination.
01083 /*!
01084 \author Jens Schneider
01085 */
01086 void stretch_uint_buffer(bool h_antialiasing, bool v_antialiasing,
01087                          unsigned int *src, int src_pitch, int src_pitch_pix, int src_height,
01088                          int sx, int sy, int sw, int sh,
01089                          unsigned int *dst, int dst_pitch, int dst_pitch_pix, int dst_height,
01090                          int dx, int dy, int dw, int dh);
01091 
01092 //! Stretching the source unsigned short int buffer to a destination.
01093 /*!
01094 \author Jens Schneider
01095 */
01096 void stretch_usint_buffer(bool h_antialiasing, bool v_antialiasing,
01097                           unsigned short int *src, int src_pitch, int src_pitch_pix,
01098                           int src_height, int sx, int sy, int sw, int sh,
01099                           unsigned short int *dst, int dst_pitch, int dst_pitch_pix,
01100                           int dst_height, int dx, int dy, int dw, int dh);
01101 
01102 //! Stretching the source 3-byte-buffer to a unsigned int destination.
01103 /*!
01104 \author Jens Schneider
01105 */
01106 void stretch_324byte_buffer(bool h_antialiasing, bool v_antialiasing,
01107                             unsigned char *src, int src_pitch, int src_pitch_pix,
01108                             int src_height, int sx, int sy, int sw, int sh,
01109                             unsigned int *dst, int dst_pitch, int dst_pitch_pix,
01110                             int dst_height, int dx, int dy, int dw, int dh);
01111 
01112 //! Blitting unsigned int (4 byte) source to unsigned int destination.
01113 /*!
01114 \author Jens Schneider
01115 */
01116 void mmsfb_blit_uint(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01117                      MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01118 
01119 //! Blitting unsigned short int (2 byte) source to unsigned short int destination.
01120 /*!
01121 \author Jens Schneider
01122 */
01123 void mmsfb_blit_usint(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01124                       MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01125 
01126 
01127 
01128 // --- BLITTING TO ARGB -------------------------------------------------------
01129 // ----------------------------------------------------------------------------
01130 
01131 //! Blit ARGB to ARGB.
01132 /*!
01133 \author Jens Schneider
01134 */
01135 void mmsfb_blit_argb_to_argb(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01136                              MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01137 
01138 
01139 //! Blit RGB32 to ARGB.
01140 /*!
01141 \author Stefan Schwarzer
01142 */
01143 void mmsfb_blit_rgb32_to_argb(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01144            MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01145 
01146 
01147 //! Blit AiRGB to ARGB.
01148 /*!
01149 \author Matthias Hardt
01150 */
01151 void mmsfb_blit_airgb_to_argb(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01152                                 unsigned int *dst, int dst_pitch, int dst_height, int dx, int dy);
01153 
01154 
01155 //! Blit with alpha blending ARGB to ARGB.
01156 /*!
01157 \author Jens Schneider
01158 */
01159 void mmsfb_blit_blend_argb_to_argb(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01160                                    MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01161 
01162 
01163 //! Blit with alpha blending AiRGB to ARGB.
01164 /*!
01165 \author Jens Schneider
01166 */
01167 void mmsfb_blit_blend_airgb_to_argb(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01168                                     unsigned int *dst, int dst_pitch, int dst_height, int dx, int dy);
01169 
01170 
01171 //! Blit with alpha blending with alpha from color ARGB to ARGB.
01172 /*!
01173 \author Jens Schneider
01174 */
01175 void mmsfb_blit_blend_coloralpha_argb_to_argb(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01176                                               MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy,
01177                                               unsigned char alpha);
01178 
01179 //! Blit RGB16 to ARGB.
01180 /*!
01181 \author Jens Schneider
01182 */
01183 void mmsfb_blit_rgb16_to_argb(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01184                               MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01185 
01186 //! Blit RGB24 to ARGB.
01187 /*!
01188 \author Jens Schneider
01189 */
01190 void mmsfb_blit_rgb24_to_argb(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01191                               MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01192 
01193 // ----------------------------------------------------------------------------
01194 // ------------------------------------------------------- BLITTING TO ARGB ---
01195 
01196 
01197 // --- BLITTING TO RGB32 ------------------------------------------------------
01198 // ----------------------------------------------------------------------------
01199 
01200 //! Blit RGB32 to RGB32.
01201 /*!
01202 \author Jens Schneider
01203 */
01204 void mmsfb_blit_rgb32_to_rgb32(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01205                                MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01206 
01207 //! Blit ARGB to RGB32.
01208 /*!
01209 \author Jens Schneider
01210 */
01211 void mmsfb_blit_argb_to_rgb32(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01212                              MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01213 
01214 
01215 //! Blit with alpha blending ARGB to RGB32.
01216 /*!
01217 \author Jens Schneider
01218 */
01219 void mmsfb_blit_blend_argb_to_rgb32(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01220                                     MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01221 
01222 
01223 //! Blit with alpha blending with alpha from color ARGB to RGB32.
01224 /*!
01225 \author Jens Schneider
01226 */
01227 void mmsfb_blit_blend_coloralpha_argb_to_rgb32(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01228                                                MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy,
01229                                                unsigned char alpha);
01230 
01231 
01232 //! Blit with alpha blending with alpha from color ARGB to RGB32, ignoring alpha channel from source.
01233 /*!
01234 \author Jens Schneider
01235 */
01236 void mmsfb_blit_coloralpha_argb_to_rgb32(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01237                                                MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy,
01238                                                unsigned char alpha);
01239 
01240 //! Blit with alpha from color RGB32 to RGB32.
01241 /*!
01242 \author Jens Schneider
01243 */
01244 void mmsfb_blit_coloralpha_rgb32_to_rgb32(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01245                                           MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy,
01246                                           unsigned char alpha);
01247 
01248 //! Blit RGB16 to RGB32.
01249 /*!
01250 \author Jens Schneider
01251 */
01252 void mmsfb_blit_rgb16_to_rgb32(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01253                                MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01254 
01255 //! Blit RGB24 to RGB32.
01256 /*!
01257 \author Jens Schneider
01258 */
01259 void mmsfb_blit_rgb24_to_rgb32(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01260                                MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01261 
01262 
01263 //! Blit YV12 to RGB32.
01264 /*!
01265 \author Jens Schneider
01266 */
01267 void mmsfb_blit_yv12_to_rgb32(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01268                               unsigned int *dst, int dst_pitch, int dst_height, int dx, int dy);
01269 
01270 
01271 //! Blit with alpha blending ARGB4444 to RGB32.
01272 /*!
01273 \author Jens Schneider
01274 */
01275 void mmsfb_blit_blend_argb4444_to_rgb32(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01276                                         MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01277 
01278 
01279 //! Blit with alpha blending with alpha from color ARGB4444 to RGB32.
01280 /*!
01281 \author Jens Schneider
01282 */
01283 void mmsfb_blit_blend_coloralpha_argb4444_to_rgb32(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01284                                                    MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy,
01285                                                    unsigned char alpha);
01286 
01287 // ----------------------------------------------------------------------------
01288 // ------------------------------------------------------ BLITTING TO RGB32 ---
01289 
01290 
01291 // --- BLITTING TO AiRGB ------------------------------------------------------
01292 // ----------------------------------------------------------------------------
01293 
01294 //! Blit AiRGB to AiRGB.
01295 /*!
01296 \author Jens Schneider
01297 */
01298 void mmsfb_blit_airgb_to_airgb(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01299                                MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01300 
01301 
01302 //! Blit with alpha blending AiRGB to AiRGB.
01303 /*!
01304 \author Jens Schneider
01305 */
01306 void mmsfb_blit_blend_airgb_to_airgb(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01307                                      unsigned int *dst, int dst_pitch, int dst_height, int dx, int dy);
01308 
01309 
01310 //! Blit with alpha blending with alpha from color AiRGB to AiRGB.
01311 /*!
01312 \author Jens Schneider
01313 */
01314 void mmsfb_blit_blend_coloralpha_airgb_to_airgb(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01315                                                 unsigned int *dst, int dst_pitch, int dst_height, int dx, int dy,
01316                                                 unsigned char alpha);
01317 
01318 
01319 //! Blit with alpha blending ARGB to AiRGB.
01320 /*!
01321 \author Jens Schneider
01322 */
01323 void mmsfb_blit_blend_argb_to_airgb(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01324                                     unsigned int *dst, int dst_pitch, int dst_height, int dx, int dy);
01325 
01326 
01327 // ----------------------------------------------------------------------------
01328 // ------------------------------------------------------ BLITTING TO AiRGB ---
01329 
01330 
01331 
01332 // --- BLITTING TO RGB24 ------------------------------------------------------
01333 // ----------------------------------------------------------------------------
01334 
01335 //! Blit RGB24 to RGB24.
01336 /*!
01337 \note RGB24 byte order: blue@0, green@1, red@2
01338 \author Jens Schneider
01339 */
01340 void mmsfb_blit_rgb24_to_rgb24(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01341                                MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01342 
01343 
01344 //! Blit with alpha blending ARGB to RGB24.
01345 /*!
01346 \note RGB24 byte order: blue@0, green@1, red@2
01347 \author Jens Schneider
01348 */
01349 void mmsfb_blit_blend_argb_to_rgb24(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01350                                     MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01351 
01352 //! Blit with alpha blending ARGB to RGB24.
01353 /*!
01354 \note RGB24 byte order: blue@0, green@1, red@2
01355 \author Jens Schneider
01356 */
01357 void mmsfb_blit_argb_to_rgb24(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01358                                     MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01359 
01360 // ----------------------------------------------------------------------------
01361 // ------------------------------------------------------ BLITTING TO RGB24 ---
01362 
01363 
01364 // --- BLITTING TO BGR24 ------------------------------------------------------
01365 // ----------------------------------------------------------------------------
01366 
01367 //! Blit BGR24 to BGR24.
01368 /*!
01369 \note BGR24 byte order: red@0, green@1, blue@2
01370 \author Jens Schneider
01371 */
01372 void mmsfb_blit_bgr24_to_bgr24(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01373                                MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01374 
01375 
01376 //! Blit with alpha blending ARGB to BGR24.
01377 /*!
01378 \note BGR24 byte order: red@0, green@1, blue@2
01379 \author Jens Schneider
01380 */
01381 void mmsfb_blit_blend_argb_to_bgr24(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01382                                     MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01383 
01384 
01385 //! Blit with alpha blending with alpha from color ARGB to BGR24.
01386 /*!
01387 \author Jens Schneider
01388 */
01389 void mmsfb_blit_blend_coloralpha_argb_to_bgr24(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01390                                                MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy,
01391                                                unsigned char alpha);
01392 
01393 
01394 //! Blit with alpha from color BGR24 to BGR24.
01395 /*!
01396 \author Jens Schneider
01397 */
01398 void mmsfb_blit_coloralpha_bgr24_to_bgr24(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01399                                           MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy,
01400                                           unsigned char alpha);
01401 
01402 // ----------------------------------------------------------------------------
01403 // ------------------------------------------------------ BLITTING TO BGR24 ---
01404 
01405 
01406 // --- BLITTING TO RGB16 ------------------------------------------------------
01407 // ----------------------------------------------------------------------------
01408 
01409 //! Blit RGB16 to RGB16.
01410 /*!
01411 \author Jens Schneider
01412 */
01413 void mmsfb_blit_rgb16_to_rgb16(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01414                                MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01415 
01416 
01417 //! Blit ARGB to RGB16.
01418 /*!
01419 \author Jens Schneider
01420 */
01421 void mmsfb_blit_argb_to_rgb16(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01422                               unsigned short int *dst, int dst_pitch, int dst_height, int dx, int dy);
01423 
01424 
01425 //! Blit with alpha blending ARGB to RGB16.
01426 /*!
01427 \author Jens Schneider
01428 */
01429 void mmsfb_blit_blend_argb_to_rgb16(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01430                                     MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01431 
01432 
01433 //! Blit AiRGB to RGB16.
01434 /*!
01435 \author Jens Schneider
01436 */
01437 void mmsfb_blit_airgb_to_rgb16(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01438                                unsigned short int *dst, int dst_pitch, int dst_height, int dx, int dy);
01439 
01440 
01441 //! Blit with alpha blending AiRGB to RGB16.
01442 /*!
01443 \author Jens Schneider
01444 */
01445 void mmsfb_blit_blend_airgb_to_rgb16(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01446                                      unsigned short int *dst, int dst_pitch, int dst_height, int dx, int dy);
01447 
01448 
01449 //! Blit AYUV to RGB16.
01450 /*!
01451 \author Jens Schneider
01452 */
01453 void mmsfb_blit_ayuv_to_rgb16(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01454                               unsigned short int *dst, int dst_pitch, int dst_height, int dx, int dy);
01455 
01456 
01457 //! Blit with alpha blending AYUV to RGB16.
01458 /*!
01459 \author Jens Schneider
01460 */
01461 void mmsfb_blit_blend_ayuv_to_rgb16(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01462                                     unsigned short int *dst, int dst_pitch, int dst_height, int dx, int dy);
01463 
01464 // ----------------------------------------------------------------------------
01465 // ------------------------------------------------------ BLITTING TO RGB16 ---
01466 
01467 
01468 // --- BLITTING TO AYUV -------------------------------------------------------
01469 // ----------------------------------------------------------------------------
01470 
01471 //! Blit AYUV to AYUV.
01472 /*!
01473 \author Jens Schneider
01474 */
01475 void mmsfb_blit_ayuv_to_ayuv(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01476                              MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01477 
01478 
01479 //! Blit with alpha blending AYUV to AYUV.
01480 /*!
01481 \author Jens Schneider
01482 */
01483 void mmsfb_blit_blend_ayuv_to_ayuv(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01484                                    unsigned int *dst, int dst_pitch, int dst_height, int dx, int dy);
01485 
01486 
01487 //! Blit with alpha blending with alpha from color AYUV to AYUV.
01488 /*!
01489 \author Jens Schneider
01490 */
01491 void mmsfb_blit_blend_coloralpha_ayuv_to_ayuv(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01492                                               unsigned int *dst, int dst_pitch, int dst_height, int dx, int dy,
01493                                               unsigned char alpha);
01494 
01495 // ----------------------------------------------------------------------------
01496 // ------------------------------------------------------- BLITTING TO AYUV ---
01497 
01498 
01499 // --- BLITTING TO YV12 -------------------------------------------------------
01500 // ----------------------------------------------------------------------------
01501 
01502 //! Blit YV12 to YV12.
01503 /*!
01504 \author Jens Schneider
01505 */
01506 void mmsfb_blit_yv12_to_yv12(MMSFBSurfacePlanes *extbuf, int src_height, int sx, int sy, int sw, int sh,
01507                              MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01508 
01509 
01510 //! Blit I420 to YV12.
01511 /*!
01512 \author Jens Schneider
01513 */
01514 void mmsfb_blit_i420_to_yv12(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01515                              MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01516 
01517 
01518 //! Blit YUY2 to YV12.
01519 /*!
01520 \author Jens Schneider
01521 */
01522 void mmsfb_blit_yuy2_to_yv12(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01523                              MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01524 
01525 
01526 //! Blit RGB24 to YV12.
01527 /*!
01528 \author Jens Schneider
01529 */
01530 void mmsfb_blit_rgb24_to_yv12(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01531                               unsigned char *dst, int dst_pitch, int dst_height, int dx, int dy);
01532 
01533 
01534 //! Blit ARGB to YV12.
01535 /*!
01536 \author Jens Schneider
01537 */
01538 void mmsfb_blit_argb_to_yv12(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01539                              unsigned char *dst, int dst_pitch, int dst_height, int dx, int dy);
01540 
01541 
01542 //! Blit with alpha blending ARGB to YV12.
01543 /*!
01544 \author Jens Schneider
01545 */
01546 void mmsfb_blit_blend_argb_to_yv12(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01547                                    unsigned char *dst, int dst_pitch, int dst_height, int dx, int dy);
01548 
01549 
01550 //! Blit with alpha blending with alpha from color ARGB to YV12.
01551 /*!
01552 \author Jens Schneider
01553 */
01554 void mmsfb_blit_blend_coloralpha_argb_to_yv12(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01555                                               unsigned char *dst, int dst_pitch, int dst_height, int dx, int dy,
01556                                               unsigned char alpha);
01557 
01558 
01559 //! Blit with alpha blending AYUV to YV12.
01560 /*!
01561 \author Jens Schneider
01562 */
01563 void mmsfb_blit_blend_ayuv_to_yv12(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01564                                    unsigned char *dst, int dst_pitch, int dst_height, int dx, int dy);
01565 
01566 
01567 //! Blit with alpha blending with alpha from color AYUV to YV12.
01568 /*!
01569 \author Jens Schneider
01570 */
01571 void mmsfb_blit_blend_coloralpha_ayuv_to_yv12(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01572                                               unsigned char *dst, int dst_pitch, int dst_height, int dx, int dy,
01573                                               unsigned char alpha);
01574 
01575 // ----------------------------------------------------------------------------
01576 // ------------------------------------------------------- BLITTING TO YV12 ---
01577 
01578 
01579 // --- BLITTING TO I420 -------------------------------------------------------
01580 // ----------------------------------------------------------------------------
01581 
01582 //! Blit I420 to I420.
01583 /*!
01584 \author Jens Schneider
01585 */
01586 void mmsfb_blit_i420_to_i420(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01587                              MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01588 
01589 // ----------------------------------------------------------------------------
01590 // ------------------------------------------------------- BLITTING TO I420 ---
01591 
01592 
01593 // --- BLITTING TO YUY2 -------------------------------------------------------
01594 // ----------------------------------------------------------------------------
01595 
01596 //! Blit YUY2 to YUY2.
01597 /*!
01598 \author Jens Schneider
01599 */
01600 void mmsfb_blit_yuy2_to_yuy2(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01601                              MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01602 
01603 // ----------------------------------------------------------------------------
01604 // ------------------------------------------------------- BLITTING TO YUY2 ---
01605 
01606 
01607 
01608 // --- BLITTING TO ARGB3565 ---------------------------------------------------
01609 // ----------------------------------------------------------------------------
01610 
01611 //! Blit ARGB3565 to ARGB3565.
01612 /*!
01613 \author Jens Schneider
01614 */
01615 void mmsfb_blit_argb3565_to_argb3565(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01616                                      MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01617 
01618 
01619 //! Blit ARGB to ARGB3565.
01620 /*!
01621 \author Jens Schneider
01622 */
01623 void mmsfb_blit_argb_to_argb3565(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01624                                  MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01625 
01626 
01627 //! Blit with alpha blending ARGB to ARGB3565.
01628 /*!
01629 \author Jens Schneider
01630 */
01631 void mmsfb_blit_blend_argb_to_argb3565(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01632                                        MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01633 
01634 // ----------------------------------------------------------------------------
01635 // --------------------------------------------------- BLITTING TO ARGB3565 ---
01636 
01637 
01638 // --- BLITTING TO ARGB4444 ---------------------------------------------------
01639 // ----------------------------------------------------------------------------
01640 
01641 //! Blit ARGB4444 to ARGB4444.
01642 /*!
01643 \author Jens Schneider
01644 */
01645 void mmsfb_blit_argb4444_to_argb4444(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01646                                      MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01647 
01648 
01649 //! Blit with alpha blending ARGB4444 to ARGB4444.
01650 /*!
01651 \author Jens Schneider
01652 */
01653 void mmsfb_blit_blend_argb4444_to_argb4444(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01654                                            MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01655 
01656 
01657 //! Blit with alpha blending with alpha from color ARGB4444 to ARGB4444.
01658 /*!
01659 \author Jens Schneider
01660 */
01661 void mmsfb_blit_blend_coloralpha_argb4444_to_argb4444(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01662                                                       MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy,
01663                                                       unsigned char alpha);
01664 
01665 // ----------------------------------------------------------------------------
01666 // --------------------------------------------------- BLITTING TO ARGB4444 ---
01667 
01668 
01669 // --- BLITTING TO BGR555 -----------------------------------------------------
01670 // ----------------------------------------------------------------------------
01671 
01672 //! Blit BGR555 to BGR555.
01673 /*!
01674 \author Jens Schneider
01675 */
01676 void mmsfb_blit_bgr555_to_bgr555(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01677                                  MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01678 
01679 //! Blit with alpha blending ARGB to BGR555.
01680 /*!
01681 \author Jens Schneider
01682 */
01683 void mmsfb_blit_blend_argb_to_bgr555(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01684                                      MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy);
01685 
01686 // ----------------------------------------------------------------------------
01687 // ----------------------------------------------------- BLITTING TO BGR555 ---
01688 
01689 
01690 
01691 // --- STRETCH TO ARGB --------------------------------------------------------
01692 // ----------------------------------------------------------------------------
01693 
01694 //! Stretch blit ARGB to ARGB.
01695 /*!
01696 \author Jens Schneider
01697 */
01698 void mmsfb_stretchblit_argb_to_argb(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01699                                     MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy, int dw, int dh,
01700                                     bool antialiasing);
01701 
01702 
01703 //! Stretch blit with alpha blending ARGB to ARGB.
01704 /*!
01705 \author Jens Schneider
01706 */
01707 void mmsfb_stretchblit_blend_argb_to_argb(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01708                                           MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy, int dw, int dh);
01709 
01710 
01711 //! Stretch blit with alpha blending with alpha from color ARGB to ARGB.
01712 /*!
01713 \author Jens Schneider
01714 */
01715 void mmsfb_stretchblit_blend_coloralpha_argb_to_argb(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01716                                                      MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy, int dw, int dh,
01717                                                      unsigned char alpha);
01718 
01719 
01720 //! Stretch blit RGB24 to ARGB.
01721 /*!
01722 \author Jens Schneider
01723 */
01724 void mmsfb_stretchblit_rgb24_to_argb(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01725                                      unsigned int *dst, int dst_pitch, int dst_height, int dx, int dy, int dw, int dh,
01726                                      bool antialiasing);
01727 
01728 // ----------------------------------------------------------------------------
01729 // -------------------------------------------------------- STRETCH TO ARGB ---
01730 
01731 
01732 // --- STRETCH TO RGB32 -------------------------------------------------------
01733 // ----------------------------------------------------------------------------
01734 
01735 //! Stretch blit with alpha blending ARGB to RGB32.
01736 /*!
01737 \author Jens Schneider
01738 */
01739 void mmsfb_stretchblit_blend_argb_to_rgb32(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01740                                           MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy, int dw, int dh);
01741 
01742 //! Stretch blit RGB32 to RGB32.
01743 /*!
01744 \author Jens Schneider
01745 */
01746 void mmsfb_stretchblit_rgb32_to_rgb32(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01747                                       MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy, int dw, int dh,
01748                                       bool antialiasing);
01749 
01750 //! Stretch blit RGB24 to RGB32.
01751 /*!
01752 \author Jens Schneider
01753 */
01754 void mmsfb_stretchblit_rgb24_to_rgb32(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01755                                       unsigned int *dst, int dst_pitch, int dst_height, int dx, int dy, int dw, int dh,
01756                                       bool antialiasing);
01757 
01758 // ----------------------------------------------------------------------------
01759 // ------------------------------------------------------- STRETCH TO RGB32 ---
01760 
01761 
01762 // --- STRETCH TO AiRGB -------------------------------------------------------
01763 // ----------------------------------------------------------------------------
01764 
01765 //! Stretch blit AiRGB to AiRGB.
01766 /*!
01767 \author Jens Schneider
01768 */
01769 void mmsfb_stretchblit_airgb_to_airgb(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01770                                       MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy, int dw, int dh,
01771                                       bool antialiasing);
01772 
01773 
01774 //! Stretch blit with alpha blending AiRGB to AiRGB.
01775 /*!
01776 \author Jens Schneider
01777 */
01778 void mmsfb_stretchblit_blend_airgb_to_airgb(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01779                                             unsigned int *dst, int dst_pitch, int dst_height, int dx, int dy, int dw, int dh);
01780 
01781 
01782 //! Stretch blit with alpha blending with alpha from color AiRGB to AiRGB.
01783 /*!
01784 \author Jens Schneider
01785 */
01786 void mmsfb_stretchblit_blend_coloralpha_airgb_to_airgb(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01787                                                        unsigned int *dst, int dst_pitch, int dst_height, int dx, int dy, int dw, int dh,
01788                                                        unsigned char alpha);
01789 
01790 // ----------------------------------------------------------------------------
01791 // ------------------------------------------------------- STRETCH TO AiRGB ---
01792 
01793 
01794 // --- STRETCH TO AYUV --------------------------------------------------------
01795 // ----------------------------------------------------------------------------
01796 
01797 //! Stretch blit AYUV to AYUV.
01798 /*!
01799 \author Jens Schneider
01800 */
01801 void mmsfb_stretchblit_ayuv_to_ayuv(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01802                                     MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy, int dw, int dh,
01803                                     bool antialiasing);
01804 
01805 
01806 //! Stretch blit with alpha blending AYUV to AYUV.
01807 /*!
01808 \author Jens Schneider
01809 */
01810 void mmsfb_stretchblit_blend_ayuv_to_ayuv(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01811                                           unsigned int *dst, int dst_pitch, int dst_height, int dx, int dy, int dw, int dh);
01812 
01813 
01814 //! Stretch blit with alpha blending with alpha from color AYUV to AYUV.
01815 /*!
01816 \author Jens Schneider
01817 */
01818 void mmsfb_stretchblit_blend_coloralpha_ayuv_to_ayuv(MMSFBExternalSurfaceBuffer *extbuf, int src_height, int sx, int sy, int sw, int sh,
01819                                                      unsigned int *dst, int dst_pitch, int dst_height, int dx, int dy, int dw, int dh,
01820                                                      unsigned char alpha);
01821 
01822 // ----------------------------------------------------------------------------
01823 // -------------------------------------------------------- STRETCH TO AYUV ---
01824 
01825 
01826 // --- STRETCH TO YV12 --------------------------------------------------------
01827 // ----------------------------------------------------------------------------
01828 
01829 //! Stretch blit YV12 to YV12 with antialiasing.
01830 /*!
01831 \author Jens Schneider
01832 */
01833 void mmsfb_stretchblit_yv12_to_yv12(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01834                                     MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy, int dw, int dh,
01835                                     bool antialiasing);
01836 
01837 
01838 //! Stretch blit I420 to YV12 with antialiasing.
01839 /*!
01840 \author Jens Schneider
01841 */
01842 void mmsfb_stretchblit_i420_to_yv12(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01843                                     MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy, int dw, int dh,
01844                                     bool antialiasing);
01845 
01846 //! Stretch blit YUY2 to YV12 with antialiasing.
01847 /*!
01848 \author Jens Schneider
01849 */
01850 void mmsfb_stretchblit_yuy2_to_yv12(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01851                                     MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy, int dw, int dh,
01852                                     bool antialiasing);
01853 
01854 // ----------------------------------------------------------------------------
01855 // -------------------------------------------------------- STRETCH TO YV12 ---
01856 
01857 
01858 // --- STRETCH TO ARGB4444 ----------------------------------------------------
01859 // ----------------------------------------------------------------------------
01860 
01861 //! Stretch blit with alpha blending ARGB4444 to ARGB4444.
01862 /*!
01863 \author Jens Schneider
01864 */
01865 void mmsfb_stretchblit_blend_argb4444_to_argb4444(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01866                                                   MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy, int dw, int dh);
01867 
01868 
01869 //! Stretch blit with alpha blending with alpha from color ARGB4444 to ARGB4444.
01870 /*!
01871 \author Jens Schneider
01872 */
01873 void mmsfb_stretchblit_blend_coloralpha_argb4444_to_argb4444(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01874                                                              MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy, int dw, int dh,
01875                                                              unsigned char alpha);
01876 
01877 // ----------------------------------------------------------------------------
01878 // ---------------------------------------------------- STRETCH TO ARGB4444 ---
01879 
01880 
01881 // --- STRETCH TO RGB16 -------------------------------------------------------
01882 // ----------------------------------------------------------------------------
01883 
01884 //! Stretch blit RGB16 to RGB16.
01885 /*!
01886 \author Jens Schneider
01887 */
01888 void mmsfb_stretchblit_rgb16_to_rgb16(MMSFBSurfacePlanes *src_planes, int src_height, int sx, int sy, int sw, int sh,
01889                                       MMSFBSurfacePlanes *dst_planes, int dst_height, int dx, int dy, int dw, int dh,
01890                                       bool antialiasing);
01891 
01892 // ----------------------------------------------------------------------------
01893 // ------------------------------------------------------- STRETCH TO RGB16 ---
01894 
01895 
01896 // --- FILL ARGB RECTANGLE ----------------------------------------------------
01897 // ----------------------------------------------------------------------------
01898 
01899 //! Fill rectangle ARGB.
01900 /*!
01901 \author Jens Schneider
01902 */
01903 void mmsfb_fillrectangle_argb(MMSFBSurfacePlanes *dst_planes, int dst_height,
01904                               int dx, int dy, int dw, int dh, MMSFBColor color);
01905 
01906 
01907 //! Fill rectangle with alpha blending ARGB.
01908 /*!
01909 \author Jens Schneider
01910 */
01911 void mmsfb_fillrectangle_blend_argb(MMSFBSurfacePlanes *dst_planes, int dst_height,
01912                                     int dx, int dy, int dw, int dh, MMSFBColor color);
01913 
01914 // ----------------------------------------------------------------------------
01915 // ---------------------------------------------------- FILL ARGB RECTANGLE ---
01916 
01917 
01918 // --- FILL RGB32 RECTANGLE ---------------------------------------------------
01919 // ----------------------------------------------------------------------------
01920 
01921 //! Fill rectangle RGB32.
01922 /*!
01923 \author Jens Schneider
01924 */
01925 void mmsfb_fillrectangle_rgb32(MMSFBSurfacePlanes *dst_planes, int dst_height,
01926                                int dx, int dy, int dw, int dh, MMSFBColor color);
01927 
01928 // ----------------------------------------------------------------------------
01929 // --------------------------------------------------- FILL RGB32 RECTANGLE ---
01930 
01931 
01932 // --- FILL RGB24 RECTANGLE ---------------------------------------------------
01933 // ----------------------------------------------------------------------------
01934 
01935 //! Fill rectangle RGB24.
01936 /*!
01937 \note RGB24 byte order: blue@0, green@1, red@2
01938 \author Jens Schneider
01939 */
01940 void mmsfb_fillrectangle_rgb24(MMSFBSurfacePlanes *dst_planes, int dst_height,
01941                                int dx, int dy, int dw, int dh, MMSFBColor color);
01942 
01943 // ----------------------------------------------------------------------------
01944 // --------------------------------------------------- FILL RGB24 RECTANGLE ---
01945 
01946 
01947 // --- FILL RGB16 RECTANGLE ---------------------------------------------------
01948 // ----------------------------------------------------------------------------
01949 
01950 //! Fill rectangle RGB16.
01951 /*!
01952 \author Jens Schneider
01953 */
01954 void mmsfb_fillrectangle_rgb16(MMSFBSurfacePlanes *dst_planes, int dst_height,
01955                                int dx, int dy, int dw, int dh, MMSFBColor color);
01956 
01957 //! Fill rectangle with alpha blending RGB16.
01958 /*!
01959 \author Jens Schneider
01960 */
01961 void mmsfb_fillrectangle_blend_rgb16(MMSFBSurfacePlanes *dst_planes, int dst_height,
01962                                      int dx, int dy, int dw, int dh, MMSFBColor color);
01963 
01964 // ----------------------------------------------------------------------------
01965 // --------------------------------------------------- FILL RGB16 RECTANGLE ---
01966 
01967 
01968 // --- FILL AYUV RECTANGLE ----------------------------------------------------
01969 // ----------------------------------------------------------------------------
01970 
01971 //! Fill rectangle AYUV.
01972 /*!
01973 \author Jens Schneider
01974 */
01975 void mmsfb_fillrectangle_ayuv(MMSFBSurfacePlanes *dst_planes, int dst_height,
01976                               int dx, int dy, int dw, int dh, MMSFBColor color);
01977 
01978 
01979 //! Fill rectangle with alpha blending AYUV.
01980 /*!
01981 \author Jens Schneider
01982 */
01983 void mmsfb_fillrectangle_blend_ayuv(MMSFBSurfacePlanes *dst_planes, int dst_height,
01984                                     int dx, int dy, int dw, int dh, MMSFBColor color);
01985 
01986 // ----------------------------------------------------------------------------
01987 // ---------------------------------------------------- FILL AYUV RECTANGLE ---
01988 
01989 
01990 // --- FILL YV12 RECTANGLE ----------------------------------------------------
01991 // ----------------------------------------------------------------------------
01992 
01993 //! Fill rectangle YV12.
01994 /*!
01995 \author Jens Schneider
01996 */
01997 void mmsfb_fillrectangle_yv12(MMSFBSurfacePlanes *dst_planes, int dst_height,
01998                               int dx, int dy, int dw, int dh, MMSFBColor color);
01999 
02000 // ----------------------------------------------------------------------------
02001 // ---------------------------------------------------- FILL YV12 RECTANGLE ---
02002 
02003 
02004 // --- FILL I420 RECTANGLE ----------------------------------------------------
02005 // ----------------------------------------------------------------------------
02006 
02007 //! Fill rectangle I420.
02008 /*!
02009 \author Jens Schneider
02010 */
02011 void mmsfb_fillrectangle_i420(MMSFBSurfacePlanes *dst_planes, int dst_height,
02012                               int dx, int dy, int dw, int dh, MMSFBColor color);
02013 
02014 // ----------------------------------------------------------------------------
02015 // ---------------------------------------------------- FILL I420 RECTANGLE ---
02016 
02017 
02018 // --- FILL YUY2 RECTANGLE ----------------------------------------------------
02019 // ----------------------------------------------------------------------------
02020 
02021 //! Fill rectangle YUY2.
02022 /*!
02023 \author Jens Schneider
02024 */
02025 void mmsfb_fillrectangle_yuy2(MMSFBSurfacePlanes *dst_planes, int dst_height,
02026                               int dx, int dy, int dw, int dh, MMSFBColor color);
02027 
02028 // ----------------------------------------------------------------------------
02029 // ---------------------------------------------------- FILL YUY2 RECTANGLE ---
02030 
02031 
02032 // --- FILL ARGB3565 RECTANGLE ------------------------------------------------
02033 // ----------------------------------------------------------------------------
02034 
02035 //! Fill rectangle ARGB3565.
02036 /*!
02037 \author Jens Schneider
02038 */
02039 void mmsfb_fillrectangle_argb3565(MMSFBSurfacePlanes *dst_planes, int dst_height,
02040                                   int dx, int dy, int dw, int dh, MMSFBColor color);
02041 
02042 // ----------------------------------------------------------------------------
02043 // ------------------------------------------------ FILL ARGB3565 RECTANGLE ---
02044 
02045 
02046 // --- FILL ARGB4444 RECTANGLE ------------------------------------------------
02047 // ----------------------------------------------------------------------------
02048 
02049 //! Fill rectangle ARGB3565.
02050 /*!
02051 \author Jens Schneider
02052 */
02053 void mmsfb_fillrectangle_argb4444(MMSFBSurfacePlanes *dst_planes, int dst_height,
02054                                   int dx, int dy, int dw, int dh, MMSFBColor color);
02055 
02056 
02057 //! Fill rectangle with alpha blending ARGB4444.
02058 /*!
02059 \author Jens Schneider
02060 */
02061 void mmsfb_fillrectangle_blend_argb4444(MMSFBSurfacePlanes *dst_planes, int dst_height,
02062                                         int dx, int dy, int dw, int dh, MMSFBColor color);
02063 
02064 // ----------------------------------------------------------------------------
02065 // ------------------------------------------------ FILL ARGB4444 RECTANGLE ---
02066 
02067 
02068 // --- FILL BGR24 RECTANGLE ---------------------------------------------------
02069 // ----------------------------------------------------------------------------
02070 
02071 //! Fill rectangle BGR24.
02072 /*!
02073 \note BGR24 byte order: red@0, green@1, blue@2
02074 \author Jens Schneider
02075 */
02076 void mmsfb_fillrectangle_bgr24(MMSFBSurfacePlanes *dst_planes, int dst_height,
02077                                int dx, int dy, int dw, int dh, MMSFBColor color);
02078 
02079 // ----------------------------------------------------------------------------
02080 // --------------------------------------------------- FILL BGR24 RECTANGLE ---
02081 
02082 
02083 // --- FILL BGR555 RECTANGLE --------------------------------------------------
02084 // ----------------------------------------------------------------------------
02085 
02086 //! Fill rectangle BGR555.
02087 /*!
02088 \author Jens Schneider
02089 */
02090 void mmsfb_fillrectangle_bgr555(MMSFBSurfacePlanes *dst_planes, int dst_height,
02091                                 int dx, int dy, int dw, int dh, MMSFBColor color);
02092 
02093 // ----------------------------------------------------------------------------
02094 // -------------------------------------------------- FILL BGR555 RECTANGLE ---
02095 
02096 
02097 // --- DRAW LINE TO ARGB ------------------------------------------------------
02098 // ----------------------------------------------------------------------------
02099 
02100 //! Draw line ARGB.
02101 /*!
02102 \author Jens Schneider
02103 */
02104 void mmsfb_drawline_argb(MMSFBSurfacePlanes *dst_planes, int dst_height,
02105                          MMSFBRegion &clipreg, int x1, int y1, int x2, int y2, MMSFBColor &color);
02106 
02107 
02108 //! Draw line with alpha blending ARGB.
02109 /*!
02110 \author Jens Schneider
02111 */
02112 void mmsfb_drawline_blend_argb(MMSFBSurfacePlanes *dst_planes, int dst_height,
02113                                MMSFBRegion &clipreg, int x1, int y1, int x2, int y2, MMSFBColor &color);
02114 
02115 // ----------------------------------------------------------------------------
02116 // ------------------------------------------------------ DRAW LINE TO ARGB ---
02117 
02118 
02119 // --- DRAW LINE TO ARGB4444 --------------------------------------------------
02120 // ----------------------------------------------------------------------------
02121 
02122 //! Draw line ARGB4444.
02123 /*!
02124 \author Jens Schneider
02125 */
02126 void mmsfb_drawline_argb4444(MMSFBSurfacePlanes *dst_planes, int dst_height,
02127                              MMSFBRegion &clipreg, int x1, int y1, int x2, int y2, MMSFBColor &color);
02128 
02129 // ----------------------------------------------------------------------------
02130 // -------------------------------------------------- DRAW LINE TO ARGB4444 ---
02131 
02132 
02133 // --- DRAW STRING TO ARGB ----------------------------------------------------
02134 // ----------------------------------------------------------------------------
02135 
02136 //! Draw string with alpha blending ARGB.
02137 /*!
02138 \author Jens Schneider
02139 */
02140 void mmsfb_drawstring_blend_argb(MMSFBSurfacePlanes *dst_planes, MMSFBFont *font,
02141                                  MMSFBRegion &clipreg, string &text, int len, int x, int y, MMSFBColor &color);
02142 
02143 
02144 //! Draw string with alpha blending with alpha from color ARGB.
02145 /*!
02146 \author Jens Schneider
02147 */
02148 void mmsfb_drawstring_blend_coloralpha_argb(MMSFBSurfacePlanes *dst_planes, MMSFBFont *font,
02149                                             MMSFBRegion &clipreg, string &text, int len, int x, int y, MMSFBColor &color);
02150 
02151 // ----------------------------------------------------------------------------
02152 // ---------------------------------------------------- DRAW STRING TO ARGB ---
02153 
02154 
02155 // --- DRAW STRING TO RGB32 ---------------------------------------------------
02156 // ----------------------------------------------------------------------------
02157 
02158 //! Draw string with alpha blending RGB32.
02159 /*!
02160 \author Jens Schneider
02161 */
02162 void mmsfb_drawstring_blend_rgb32(MMSFBSurfacePlanes *dst_planes, MMSFBFont *font,
02163                                   MMSFBRegion &clipreg, string &text, int len, int x, int y, MMSFBColor &color);
02164 
02165 
02166 //! Draw string with alpha blending with alpha from color RGB32.
02167 /*!
02168 \author Jens Schneider
02169 */
02170 void mmsfb_drawstring_blend_coloralpha_rgb32(MMSFBSurfacePlanes *dst_planes, MMSFBFont *font,
02171                                              MMSFBRegion &clipreg, string &text, int len, int x, int y, MMSFBColor &color);
02172 
02173 // ----------------------------------------------------------------------------
02174 // --------------------------------------------------- DRAW STRING TO RGB32 ---
02175 
02176 
02177 // --- DRAW STRING TO ARGB4444 ------------------------------------------------
02178 // ----------------------------------------------------------------------------
02179 
02180 //! Draw string with alpha blending ARGB4444.
02181 /*!
02182 \author Jens Schneider
02183 */
02184 void mmsfb_drawstring_blend_argb4444(MMSFBSurfacePlanes *dst_planes, MMSFBFont *font,
02185                                      MMSFBRegion &clipreg, string &text, int len, int x, int y, MMSFBColor &color);
02186 
02187 // ----------------------------------------------------------------------------
02188 // ------------------------------------------------ DRAW STRING TO ARGB4444 ---
02189 
02190 
02191 // --- DRAW STRING TO RGB16 ---------------------------------------------------
02192 // ----------------------------------------------------------------------------
02193 
02194 //! Draw string with alpha blending RGB16.
02195 /*!
02196 \author Jens Schneider
02197 */
02198 void mmsfb_drawstring_blend_rgb16(MMSFBSurfacePlanes *dst_planes, MMSFBFont *font,
02199                                   MMSFBRegion &clipreg, string &text, int len, int x, int y, MMSFBColor &color);
02200 
02201 //! Draw string with alpha blending with alpha from color RGB16.
02202 /*!
02203 \author Jens Schneider
02204 */
02205 void mmsfb_drawstring_blend_coloralpha_rgb16(MMSFBSurfacePlanes *dst_planes, MMSFBFont *font,
02206                                             MMSFBRegion &clipreg, string &text, int len, int x, int y, MMSFBColor &color);
02207 
02208 // ----------------------------------------------------------------------------
02209 // --------------------------------------------------- DRAW STRING TO RGB16 ---
02210 
02211 
02212 #endif /* MMSFBCONV_H_ */
02213 

Generated by doxygen