DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
src/gui/render_templates_hq2x.h
00001 /*
00002  *  Copyright (C) 2002-2020  The DOSBox Team
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License along
00015  *  with this program; if not, write to the Free Software Foundation, Inc.,
00016  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 
00019 /*
00020  * The HQ2x high quality 2x graphics filter.
00021  * Original author Maxim Stepin (see http://www.hiend3d.com/hq2x.html).
00022  * Adapted for DOSBox from ScummVM and HiEnd3D code by Kronuz.
00023  */
00024 
00025 #ifndef RENDER_TEMPLATES_HQ2X_TABLE_H
00026 #define RENDER_TEMPLATES_HQ2X_TABLE_H
00027 
00028 #define PIXEL00_0       line0[0] = C4;
00029 #define PIXEL00_10      line0[0] = interp_w2(C4,C0,3U,1U);
00030 #define PIXEL00_11      line0[0] = interp_w2(C4,C3,3U,1U);
00031 #define PIXEL00_12      line0[0] = interp_w2(C4,C1,3U,1U);
00032 #define PIXEL00_20      line0[0] = interp_w3(C4,C3,C1,2U,1U,1U);
00033 #define PIXEL00_21      line0[0] = interp_w3(C4,C0,C1,2U,1U,1U);
00034 #define PIXEL00_22      line0[0] = interp_w3(C4,C0,C3,2U,1U,1U);
00035 #define PIXEL00_60      line0[0] = interp_w3(C4,C1,C3,5U,2U,1U);
00036 #define PIXEL00_61      line0[0] = interp_w3(C4,C3,C1,5U,2U,1U);
00037 #define PIXEL00_70      line0[0] = interp_w3(C4,C3,C1,6U,1U,1U);
00038 #define PIXEL00_90      line0[0] = interp_w3(C4,C3,C1,2U,3U,3U);
00039 #define PIXEL00_100     line0[0] = interp_w3(C4,C3,C1,14U,1U,1U);
00040 
00041 #define PIXEL01_0       line0[1] = C4;
00042 #define PIXEL01_10      line0[1] = interp_w2(C4,C2,3U,1U);
00043 #define PIXEL01_11      line0[1] = interp_w2(C4,C1,3U,1U);
00044 #define PIXEL01_12      line0[1] = interp_w2(C4,C5,3U,1U);
00045 #define PIXEL01_20      line0[1] = interp_w3(C4,C1,C5,2U,1U,1U);
00046 #define PIXEL01_21      line0[1] = interp_w3(C4,C2,C5,2U,1U,1U);
00047 #define PIXEL01_22      line0[1] = interp_w3(C4,C2,C1,2U,1U,1U);
00048 #define PIXEL01_60      line0[1] = interp_w3(C4,C5,C1,5U,2U,1U);
00049 #define PIXEL01_61      line0[1] = interp_w3(C4,C1,C5,5U,2U,1U);
00050 #define PIXEL01_70      line0[1] = interp_w3(C4,C1,C5,6U,1U,1U);
00051 #define PIXEL01_90      line0[1] = interp_w3(C4,C1,C5,2U,3U,3U);
00052 #define PIXEL01_100     line0[1] = interp_w3(C4,C1,C5,14U,1U,1U);
00053 
00054 #define PIXEL10_0       line1[0] = C4;
00055 #define PIXEL10_10      line1[0] = interp_w2(C4,C6,3U,1U);
00056 #define PIXEL10_11      line1[0] = interp_w2(C4,C7,3U,1U);
00057 #define PIXEL10_12      line1[0] = interp_w2(C4,C3,3U,1U);
00058 #define PIXEL10_20      line1[0] = interp_w3(C4,C7,C3,2U,1U,1U);
00059 #define PIXEL10_21      line1[0] = interp_w3(C4,C6,C3,2U,1U,1U);
00060 #define PIXEL10_22      line1[0] = interp_w3(C4,C6,C7,2U,1U,1U);
00061 #define PIXEL10_60      line1[0] = interp_w3(C4,C3,C7,5U,2U,1U);
00062 #define PIXEL10_61      line1[0] = interp_w3(C4,C7,C3,5U,2U,1U);
00063 #define PIXEL10_70      line1[0] = interp_w3(C4,C7,C3,6U,1U,1U);
00064 #define PIXEL10_90      line1[0] = interp_w3(C4,C7,C3,2U,3U,3U);
00065 #define PIXEL10_100     line1[0] = interp_w3(C4,C7,C3,14U,1U,1U);
00066 
00067 #define PIXEL11_0       line1[1] = C4;
00068 #define PIXEL11_10      line1[1] = interp_w2(C4,C8,3U,1U);
00069 #define PIXEL11_11      line1[1] = interp_w2(C4,C5,3U,1U);
00070 #define PIXEL11_12      line1[1] = interp_w2(C4,C7,3U,1U);
00071 #define PIXEL11_20      line1[1] = interp_w3(C4,C5,C7,2U,1U,1U);
00072 #define PIXEL11_21      line1[1] = interp_w3(C4,C8,C7,2U,1U,1U);
00073 #define PIXEL11_22      line1[1] = interp_w3(C4,C8,C5,2U,1U,1U);
00074 #define PIXEL11_60      line1[1] = interp_w3(C4,C7,C5,5U,2U,1U);
00075 #define PIXEL11_61      line1[1] = interp_w3(C4,C5,C7,5U,2U,1U);
00076 #define PIXEL11_70      line1[1] = interp_w3(C4,C5,C7,6U,1U,1U);
00077 #define PIXEL11_90      line1[1] = interp_w3(C4,C5,C7,2U,3U,3U);
00078 #define PIXEL11_100     line1[1] = interp_w3(C4,C5,C7,14U,1U,1U);
00079 
00080 #endif
00081 
00082 #if SBPP == 32
00083 #define RGBtoYUV(c) _RGBtoYUV[((c & 0xf80000) >> 8) | ((c & 0x00fc00) >> 5) | ((c & 0x0000f8) >> 3)]
00084 #else
00085 #define RGBtoYUV(c) _RGBtoYUV[c]
00086 #endif
00087 
00088 inline void conc2d(Hq2x,SBPP)(PTYPE * line0, PTYPE * line1, const PTYPE * fc)
00089 {
00090 # if !defined(_MSC_VER) /* Microsoft C++ thinks this is a failed attempt at a function call---it's not */
00091         (void)conc2d(Hq2x,SBPP);
00092 # endif
00093 
00094         if (_RGBtoYUV == 0) conc2d(InitLUTs,SBPP)();
00095 
00096         Bit32u pattern = 0;
00097         const Bit32u YUV4 = RGBtoYUV(C4);
00098         if (C4 != C0 && diffYUV(YUV4, RGBtoYUV(C0))) pattern |= 0x0001;
00099         if (C4 != C1 && diffYUV(YUV4, RGBtoYUV(C1))) pattern |= 0x0002;
00100         if (C4 != C2 && diffYUV(YUV4, RGBtoYUV(C2))) pattern |= 0x0004;
00101         if (C4 != C3 && diffYUV(YUV4, RGBtoYUV(C3))) pattern |= 0x0008;
00102         if (C4 != C5 && diffYUV(YUV4, RGBtoYUV(C5))) pattern |= 0x0010;
00103         if (C4 != C6 && diffYUV(YUV4, RGBtoYUV(C6))) pattern |= 0x0020;
00104         if (C4 != C7 && diffYUV(YUV4, RGBtoYUV(C7))) pattern |= 0x0040;
00105         if (C4 != C8 && diffYUV(YUV4, RGBtoYUV(C8))) pattern |= 0x0080;
00106 
00107         switch (pattern) {
00108         case 0:
00109         case 1:
00110         case 4:
00111         case 32:
00112         case 128:
00113         case 5:
00114         case 132:
00115         case 160:
00116         case 33:
00117         case 129:
00118         case 36:
00119         case 133:
00120         case 164:
00121         case 161:
00122         case 37:
00123         case 165:
00124                 PIXEL00_20
00125                 PIXEL01_20
00126                 PIXEL10_20
00127                 PIXEL11_20
00128                 break;
00129         case 2:
00130         case 34:
00131         case 130:
00132         case 162:
00133                 PIXEL00_22
00134                 PIXEL01_21
00135                 PIXEL10_20
00136                 PIXEL11_20
00137                 break;
00138         case 16:
00139         case 17:
00140         case 48:
00141         case 49:
00142                 PIXEL00_20
00143                 PIXEL01_22
00144                 PIXEL10_20
00145                 PIXEL11_21
00146                 break;
00147         case 64:
00148         case 65:
00149         case 68:
00150         case 69:
00151                 PIXEL00_20
00152                 PIXEL01_20
00153                 PIXEL10_21
00154                 PIXEL11_22
00155                 break;
00156         case 8:
00157         case 12:
00158         case 136:
00159         case 140:
00160                 PIXEL00_21
00161                 PIXEL01_20
00162                 PIXEL10_22
00163                 PIXEL11_20
00164                 break;
00165         case 3:
00166         case 35:
00167         case 131:
00168         case 163:
00169                 PIXEL00_11
00170                 PIXEL01_21
00171                 PIXEL10_20
00172                 PIXEL11_20
00173                 break;
00174         case 6:
00175         case 38:
00176         case 134:
00177         case 166:
00178                 PIXEL00_22
00179                 PIXEL01_12
00180                 PIXEL10_20
00181                 PIXEL11_20
00182                 break;
00183         case 20:
00184         case 21:
00185         case 52:
00186         case 53:
00187                 PIXEL00_20
00188                 PIXEL01_11
00189                 PIXEL10_20
00190                 PIXEL11_21
00191                 break;
00192         case 144:
00193         case 145:
00194         case 176:
00195         case 177:
00196                 PIXEL00_20
00197                 PIXEL01_22
00198                 PIXEL10_20
00199                 PIXEL11_12
00200                 break;
00201         case 192:
00202         case 193:
00203         case 196:
00204         case 197:
00205                 PIXEL00_20
00206                 PIXEL01_20
00207                 PIXEL10_21
00208                 PIXEL11_11
00209                 break;
00210         case 96:
00211         case 97:
00212         case 100:
00213         case 101:
00214                 PIXEL00_20
00215                 PIXEL01_20
00216                 PIXEL10_12
00217                 PIXEL11_22
00218                 break;
00219         case 40:
00220         case 44:
00221         case 168:
00222         case 172:
00223                 PIXEL00_21
00224                 PIXEL01_20
00225                 PIXEL10_11
00226                 PIXEL11_20
00227                 break;
00228         case 9:
00229         case 13:
00230         case 137:
00231         case 141:
00232                 PIXEL00_12
00233                 PIXEL01_20
00234                 PIXEL10_22
00235                 PIXEL11_20
00236                 break;
00237         case 18:
00238         case 50:
00239                 PIXEL00_22
00240                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
00241                         PIXEL01_10
00242                 } else {
00243                         PIXEL01_20
00244                 }
00245                 PIXEL10_20
00246                 PIXEL11_21
00247                 break;
00248         case 80:
00249         case 81:
00250                 PIXEL00_20
00251                 PIXEL01_22
00252                 PIXEL10_21
00253                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
00254                         PIXEL11_10
00255                 } else {
00256                         PIXEL11_20
00257                 }
00258                 break;
00259         case 72:
00260         case 76:
00261                 PIXEL00_21
00262                 PIXEL01_20
00263                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
00264                         PIXEL10_10
00265                 } else {
00266                         PIXEL10_20
00267                 }
00268                 PIXEL11_22
00269                 break;
00270         case 10:
00271         case 138:
00272                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
00273                         PIXEL00_10
00274                 } else {
00275                         PIXEL00_20
00276                 }
00277                 PIXEL01_21
00278                 PIXEL10_22
00279                 PIXEL11_20
00280                 break;
00281         case 66:
00282                 PIXEL00_22
00283                 PIXEL01_21
00284                 PIXEL10_21
00285                 PIXEL11_22
00286                 break;
00287         case 24:
00288                 PIXEL00_21
00289                 PIXEL01_22
00290                 PIXEL10_22
00291                 PIXEL11_21
00292                 break;
00293         case 7:
00294         case 39:
00295         case 135:
00296                 PIXEL00_11
00297                 PIXEL01_12
00298                 PIXEL10_20
00299                 PIXEL11_20
00300                 break;
00301         case 148:
00302         case 149:
00303         case 180:
00304                 PIXEL00_20
00305                 PIXEL01_11
00306                 PIXEL10_20
00307                 PIXEL11_12
00308                 break;
00309         case 224:
00310         case 228:
00311         case 225:
00312                 PIXEL00_20
00313                 PIXEL01_20
00314                 PIXEL10_12
00315                 PIXEL11_11
00316                 break;
00317         case 41:
00318         case 169:
00319         case 45:
00320                 PIXEL00_12
00321                 PIXEL01_20
00322                 PIXEL10_11
00323                 PIXEL11_20
00324                 break;
00325         case 22:
00326         case 54:
00327                 PIXEL00_22
00328                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
00329                         PIXEL01_0
00330                 } else {
00331                         PIXEL01_20
00332                 }
00333                 PIXEL10_20
00334                 PIXEL11_21
00335                 break;
00336         case 208:
00337         case 209:
00338                 PIXEL00_20
00339                 PIXEL01_22
00340                 PIXEL10_21
00341                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
00342                         PIXEL11_0
00343                 } else {
00344                         PIXEL11_20
00345                 }
00346                 break;
00347         case 104:
00348         case 108:
00349                 PIXEL00_21
00350                 PIXEL01_20
00351                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
00352                         PIXEL10_0
00353                 } else {
00354                         PIXEL10_20
00355                 }
00356                 PIXEL11_22
00357                 break;
00358         case 11:
00359         case 139:
00360                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
00361                         PIXEL00_0
00362                 } else {
00363                         PIXEL00_20
00364                 }
00365                 PIXEL01_21
00366                 PIXEL10_22
00367                 PIXEL11_20
00368                 break;
00369         case 19:
00370         case 51:
00371                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
00372                         PIXEL00_11
00373                         PIXEL01_10
00374                 } else {
00375                         PIXEL00_60
00376                         PIXEL01_90
00377                 }
00378                 PIXEL10_20
00379                 PIXEL11_21
00380                 break;
00381         case 146:
00382         case 178:
00383                 PIXEL00_22
00384                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
00385                         PIXEL01_10
00386                         PIXEL11_12
00387                 } else {
00388                         PIXEL01_90
00389                         PIXEL11_61
00390                 }
00391                 PIXEL10_20
00392                 break;
00393         case 84:
00394         case 85:
00395                 PIXEL00_20
00396                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
00397                         PIXEL01_11
00398                         PIXEL11_10
00399                 } else {
00400                         PIXEL01_60
00401                         PIXEL11_90
00402                 }
00403                 PIXEL10_21
00404                 break;
00405         case 112:
00406         case 113:
00407                 PIXEL00_20
00408                 PIXEL01_22
00409                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
00410                         PIXEL10_12
00411                         PIXEL11_10
00412                 } else {
00413                         PIXEL10_61
00414                         PIXEL11_90
00415                 }
00416                 break;
00417         case 200:
00418         case 204:
00419                 PIXEL00_21
00420                 PIXEL01_20
00421                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
00422                         PIXEL10_10
00423                         PIXEL11_11
00424                 } else {
00425                         PIXEL10_90
00426                         PIXEL11_60
00427                 }
00428                 break;
00429         case 73:
00430         case 77:
00431                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
00432                         PIXEL00_12
00433                         PIXEL10_10
00434                 } else {
00435                         PIXEL00_61
00436                         PIXEL10_90
00437                 }
00438                 PIXEL01_20
00439                 PIXEL11_22
00440                 break;
00441         case 42:
00442         case 170:
00443                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
00444                         PIXEL00_10
00445                         PIXEL10_11
00446                 } else {
00447                         PIXEL00_90
00448                         PIXEL10_60
00449                 }
00450                 PIXEL01_21
00451                 PIXEL11_20
00452                 break;
00453         case 14:
00454         case 142:
00455                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
00456                         PIXEL00_10
00457                         PIXEL01_12
00458                 } else {
00459                         PIXEL00_90
00460                         PIXEL01_61
00461                 }
00462                 PIXEL10_22
00463                 PIXEL11_20
00464                 break;
00465         case 67:
00466                 PIXEL00_11
00467                 PIXEL01_21
00468                 PIXEL10_21
00469                 PIXEL11_22
00470                 break;
00471         case 70:
00472                 PIXEL00_22
00473                 PIXEL01_12
00474                 PIXEL10_21
00475                 PIXEL11_22
00476                 break;
00477         case 28:
00478                 PIXEL00_21
00479                 PIXEL01_11
00480                 PIXEL10_22
00481                 PIXEL11_21
00482                 break;
00483         case 152:
00484                 PIXEL00_21
00485                 PIXEL01_22
00486                 PIXEL10_22
00487                 PIXEL11_12
00488                 break;
00489         case 194:
00490                 PIXEL00_22
00491                 PIXEL01_21
00492                 PIXEL10_21
00493                 PIXEL11_11
00494                 break;
00495         case 98:
00496                 PIXEL00_22
00497                 PIXEL01_21
00498                 PIXEL10_12
00499                 PIXEL11_22
00500                 break;
00501         case 56:
00502                 PIXEL00_21
00503                 PIXEL01_22
00504                 PIXEL10_11
00505                 PIXEL11_21
00506                 break;
00507         case 25:
00508                 PIXEL00_12
00509                 PIXEL01_22
00510                 PIXEL10_22
00511                 PIXEL11_21
00512                 break;
00513         case 26:
00514         case 31:
00515                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
00516                         PIXEL00_0
00517                 } else {
00518                         PIXEL00_20
00519                 }
00520                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
00521                         PIXEL01_0
00522                 } else {
00523                         PIXEL01_20
00524                 }
00525                 PIXEL10_22
00526                 PIXEL11_21
00527                 break;
00528         case 82:
00529         case 214:
00530                 PIXEL00_22
00531                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
00532                         PIXEL01_0
00533                 } else {
00534                         PIXEL01_20
00535                 }
00536                 PIXEL10_21
00537                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
00538                         PIXEL11_0
00539                 } else {
00540                         PIXEL11_20
00541                 }
00542                 break;
00543         case 88:
00544         case 248:
00545                 PIXEL00_21
00546                 PIXEL01_22
00547                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
00548                         PIXEL10_0
00549                 } else {
00550                         PIXEL10_20
00551                 }
00552                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
00553                         PIXEL11_0
00554                 } else {
00555                         PIXEL11_20
00556                 }
00557                 break;
00558         case 74:
00559         case 107:
00560                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
00561                         PIXEL00_0
00562                 } else {
00563                         PIXEL00_20
00564                 }
00565                 PIXEL01_21
00566                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
00567                         PIXEL10_0
00568                 } else {
00569                         PIXEL10_20
00570                 }
00571                 PIXEL11_22
00572                 break;
00573         case 27:
00574                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
00575                         PIXEL00_0
00576                 } else {
00577                         PIXEL00_20
00578                 }
00579                 PIXEL01_10
00580                 PIXEL10_22
00581                 PIXEL11_21
00582                 break;
00583         case 86:
00584                 PIXEL00_22
00585                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
00586                         PIXEL01_0
00587                 } else {
00588                         PIXEL01_20
00589                 }
00590                 PIXEL10_21
00591                 PIXEL11_10
00592                 break;
00593         case 216:
00594                 PIXEL00_21
00595                 PIXEL01_22
00596                 PIXEL10_10
00597                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
00598                         PIXEL11_0
00599                 } else {
00600                         PIXEL11_20
00601                 }
00602                 break;
00603         case 106:
00604                 PIXEL00_10
00605                 PIXEL01_21
00606                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
00607                         PIXEL10_0
00608                 } else {
00609                         PIXEL10_20
00610                 }
00611                 PIXEL11_22
00612                 break;
00613         case 30:
00614                 PIXEL00_10
00615                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
00616                         PIXEL01_0
00617                 } else {
00618                         PIXEL01_20
00619                 }
00620                 PIXEL10_22
00621                 PIXEL11_21
00622                 break;
00623         case 210:
00624                 PIXEL00_22
00625                 PIXEL01_10
00626                 PIXEL10_21
00627                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
00628                         PIXEL11_0
00629                 } else {
00630                         PIXEL11_20
00631                 }
00632                 break;
00633         case 120:
00634                 PIXEL00_21
00635                 PIXEL01_22
00636                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
00637                         PIXEL10_0
00638                 } else {
00639                         PIXEL10_20
00640                 }
00641                 PIXEL11_10
00642                 break;
00643         case 75:
00644                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
00645                         PIXEL00_0
00646                 } else {
00647                         PIXEL00_20
00648                 }
00649                 PIXEL01_21
00650                 PIXEL10_10
00651                 PIXEL11_22
00652                 break;
00653         case 29:
00654                 PIXEL00_12
00655                 PIXEL01_11
00656                 PIXEL10_22
00657                 PIXEL11_21
00658                 break;
00659         case 198:
00660                 PIXEL00_22
00661                 PIXEL01_12
00662                 PIXEL10_21
00663                 PIXEL11_11
00664                 break;
00665         case 184:
00666                 PIXEL00_21
00667                 PIXEL01_22
00668                 PIXEL10_11
00669                 PIXEL11_12
00670                 break;
00671         case 99:
00672                 PIXEL00_11
00673                 PIXEL01_21
00674                 PIXEL10_12
00675                 PIXEL11_22
00676                 break;
00677         case 57:
00678                 PIXEL00_12
00679                 PIXEL01_22
00680                 PIXEL10_11
00681                 PIXEL11_21
00682                 break;
00683         case 71:
00684                 PIXEL00_11
00685                 PIXEL01_12
00686                 PIXEL10_21
00687                 PIXEL11_22
00688                 break;
00689         case 156:
00690                 PIXEL00_21
00691                 PIXEL01_11
00692                 PIXEL10_22
00693                 PIXEL11_12
00694                 break;
00695         case 226:
00696                 PIXEL00_22
00697                 PIXEL01_21
00698                 PIXEL10_12
00699                 PIXEL11_11
00700                 break;
00701         case 60:
00702                 PIXEL00_21
00703                 PIXEL01_11
00704                 PIXEL10_11
00705                 PIXEL11_21
00706                 break;
00707         case 195:
00708                 PIXEL00_11
00709                 PIXEL01_21
00710                 PIXEL10_21
00711                 PIXEL11_11
00712                 break;
00713         case 102:
00714                 PIXEL00_22
00715                 PIXEL01_12
00716                 PIXEL10_12
00717                 PIXEL11_22
00718                 break;
00719         case 153:
00720                 PIXEL00_12
00721                 PIXEL01_22
00722                 PIXEL10_22
00723                 PIXEL11_12
00724                 break;
00725         case 58:
00726                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
00727                         PIXEL00_10
00728                 } else {
00729                         PIXEL00_70
00730                 }
00731                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
00732                         PIXEL01_10
00733                 } else {
00734                         PIXEL01_70
00735                 }
00736                 PIXEL10_11
00737                 PIXEL11_21
00738                 break;
00739         case 83:
00740                 PIXEL00_11
00741                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
00742                         PIXEL01_10
00743                 } else {
00744                         PIXEL01_70
00745                 }
00746                 PIXEL10_21
00747                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
00748                         PIXEL11_10
00749                 } else {
00750                         PIXEL11_70
00751                 }
00752                 break;
00753         case 92:
00754                 PIXEL00_21
00755                 PIXEL01_11
00756                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
00757                         PIXEL10_10
00758                 } else {
00759                         PIXEL10_70
00760                 }
00761                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
00762                         PIXEL11_10
00763                 } else {
00764                         PIXEL11_70
00765                 }
00766                 break;
00767         case 202:
00768                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
00769                         PIXEL00_10
00770                 } else {
00771                         PIXEL00_70
00772                 }
00773                 PIXEL01_21
00774                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
00775                         PIXEL10_10
00776                 } else {
00777                         PIXEL10_70
00778                 }
00779                 PIXEL11_11
00780                 break;
00781         case 78:
00782                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
00783                         PIXEL00_10
00784                 } else {
00785                         PIXEL00_70
00786                 }
00787                 PIXEL01_12
00788                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
00789                         PIXEL10_10
00790                 } else {
00791                         PIXEL10_70
00792                 }
00793                 PIXEL11_22
00794                 break;
00795         case 154:
00796                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
00797                         PIXEL00_10
00798                 } else {
00799                         PIXEL00_70
00800                 }
00801                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
00802                         PIXEL01_10
00803                 } else {
00804                         PIXEL01_70
00805                 }
00806                 PIXEL10_22
00807                 PIXEL11_12
00808                 break;
00809         case 114:
00810                 PIXEL00_22
00811                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
00812                         PIXEL01_10
00813                 } else {
00814                         PIXEL01_70
00815                 }
00816                 PIXEL10_12
00817                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
00818                         PIXEL11_10
00819                 } else {
00820                         PIXEL11_70
00821                 }
00822                 break;
00823         case 89:
00824                 PIXEL00_12
00825                 PIXEL01_22
00826                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
00827                         PIXEL10_10
00828                 } else {
00829                         PIXEL10_70
00830                 }
00831                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
00832                         PIXEL11_10
00833                 } else {
00834                         PIXEL11_70
00835                 }
00836                 break;
00837         case 90:
00838                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
00839                         PIXEL00_10
00840                 } else {
00841                         PIXEL00_70
00842                 }
00843                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
00844                         PIXEL01_10
00845                 } else {
00846                         PIXEL01_70
00847                 }
00848                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
00849                         PIXEL10_10
00850                 } else {
00851                         PIXEL10_70
00852                 }
00853                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
00854                         PIXEL11_10
00855                 } else {
00856                         PIXEL11_70
00857                 }
00858                 break;
00859         case 55:
00860         case 23:
00861                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
00862                         PIXEL00_11
00863                         PIXEL01_0
00864                 } else {
00865                         PIXEL00_60
00866                         PIXEL01_90
00867                 }
00868                 PIXEL10_20
00869                 PIXEL11_21
00870                 break;
00871         case 182:
00872         case 150:
00873                 PIXEL00_22
00874                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
00875                         PIXEL01_0
00876                         PIXEL11_12
00877                 } else {
00878                         PIXEL01_90
00879                         PIXEL11_61
00880                 }
00881                 PIXEL10_20
00882                 break;
00883         case 213:
00884         case 212:
00885                 PIXEL00_20
00886                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
00887                         PIXEL01_11
00888                         PIXEL11_0
00889                 } else {
00890                         PIXEL01_60
00891                         PIXEL11_90
00892                 }
00893                 PIXEL10_21
00894                 break;
00895         case 241:
00896         case 240:
00897                 PIXEL00_20
00898                 PIXEL01_22
00899                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
00900                         PIXEL10_12
00901                         PIXEL11_0
00902                 } else {
00903                         PIXEL10_61
00904                         PIXEL11_90
00905                 }
00906                 break;
00907         case 236:
00908         case 232:
00909                 PIXEL00_21
00910                 PIXEL01_20
00911                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
00912                         PIXEL10_0
00913                         PIXEL11_11
00914                 } else {
00915                         PIXEL10_90
00916                         PIXEL11_60
00917                 }
00918                 break;
00919         case 109:
00920         case 105:
00921                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
00922                         PIXEL00_12
00923                         PIXEL10_0
00924                 } else {
00925                         PIXEL00_61
00926                         PIXEL10_90
00927                 }
00928                 PIXEL01_20
00929                 PIXEL11_22
00930                 break;
00931         case 171:
00932         case 43:
00933                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
00934                         PIXEL00_0
00935                         PIXEL10_11
00936                 } else {
00937                         PIXEL00_90
00938                         PIXEL10_60
00939                 }
00940                 PIXEL01_21
00941                 PIXEL11_20
00942                 break;
00943         case 143:
00944         case 15:
00945                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
00946                         PIXEL00_0
00947                         PIXEL01_12
00948                 } else {
00949                         PIXEL00_90
00950                         PIXEL01_61
00951                 }
00952                 PIXEL10_22
00953                 PIXEL11_20
00954                 break;
00955         case 124:
00956                 PIXEL00_21
00957                 PIXEL01_11
00958                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
00959                         PIXEL10_0
00960                 } else {
00961                         PIXEL10_20
00962                 }
00963                 PIXEL11_10
00964                 break;
00965         case 203:
00966                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
00967                         PIXEL00_0
00968                 } else {
00969                         PIXEL00_20
00970                 }
00971                 PIXEL01_21
00972                 PIXEL10_10
00973                 PIXEL11_11
00974                 break;
00975         case 62:
00976                 PIXEL00_10
00977                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
00978                         PIXEL01_0
00979                 } else {
00980                         PIXEL01_20
00981                 }
00982                 PIXEL10_11
00983                 PIXEL11_21
00984                 break;
00985         case 211:
00986                 PIXEL00_11
00987                 PIXEL01_10
00988                 PIXEL10_21
00989                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
00990                         PIXEL11_0
00991                 } else {
00992                         PIXEL11_20
00993                 }
00994                 break;
00995         case 118:
00996                 PIXEL00_22
00997                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
00998                         PIXEL01_0
00999                 } else {
01000                         PIXEL01_20
01001                 }
01002                 PIXEL10_12
01003                 PIXEL11_10
01004                 break;
01005         case 217:
01006                 PIXEL00_12
01007                 PIXEL01_22
01008                 PIXEL10_10
01009                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01010                         PIXEL11_0
01011                 } else {
01012                         PIXEL11_20
01013                 }
01014                 break;
01015         case 110:
01016                 PIXEL00_10
01017                 PIXEL01_12
01018                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01019                         PIXEL10_0
01020                 } else {
01021                         PIXEL10_20
01022                 }
01023                 PIXEL11_22
01024                 break;
01025         case 155:
01026                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01027                         PIXEL00_0
01028                 } else {
01029                         PIXEL00_20
01030                 }
01031                 PIXEL01_10
01032                 PIXEL10_22
01033                 PIXEL11_12
01034                 break;
01035         case 188:
01036                 PIXEL00_21
01037                 PIXEL01_11
01038                 PIXEL10_11
01039                 PIXEL11_12
01040                 break;
01041         case 185:
01042                 PIXEL00_12
01043                 PIXEL01_22
01044                 PIXEL10_11
01045                 PIXEL11_12
01046                 break;
01047         case 61:
01048                 PIXEL00_12
01049                 PIXEL01_11
01050                 PIXEL10_11
01051                 PIXEL11_21
01052                 break;
01053         case 157:
01054                 PIXEL00_12
01055                 PIXEL01_11
01056                 PIXEL10_22
01057                 PIXEL11_12
01058                 break;
01059         case 103:
01060                 PIXEL00_11
01061                 PIXEL01_12
01062                 PIXEL10_12
01063                 PIXEL11_22
01064                 break;
01065         case 227:
01066                 PIXEL00_11
01067                 PIXEL01_21
01068                 PIXEL10_12
01069                 PIXEL11_11
01070                 break;
01071         case 230:
01072                 PIXEL00_22
01073                 PIXEL01_12
01074                 PIXEL10_12
01075                 PIXEL11_11
01076                 break;
01077         case 199:
01078                 PIXEL00_11
01079                 PIXEL01_12
01080                 PIXEL10_21
01081                 PIXEL11_11
01082                 break;
01083         case 220:
01084                 PIXEL00_21
01085                 PIXEL01_11
01086                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01087                         PIXEL10_10
01088                 } else {
01089                         PIXEL10_70
01090                 }
01091                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01092                         PIXEL11_0
01093                 } else {
01094                         PIXEL11_20
01095                 }
01096                 break;
01097         case 158:
01098                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01099                         PIXEL00_10
01100                 } else {
01101                         PIXEL00_70
01102                 }
01103                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01104                         PIXEL01_0
01105                 } else {
01106                         PIXEL01_20
01107                 }
01108                 PIXEL10_22
01109                 PIXEL11_12
01110                 break;
01111         case 234:
01112                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01113                         PIXEL00_10
01114                 } else {
01115                         PIXEL00_70
01116                 }
01117                 PIXEL01_21
01118                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01119                         PIXEL10_0
01120                 } else {
01121                         PIXEL10_20
01122                 }
01123                 PIXEL11_11
01124                 break;
01125         case 242:
01126                 PIXEL00_22
01127                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01128                         PIXEL01_10
01129                 } else {
01130                         PIXEL01_70
01131                 }
01132                 PIXEL10_12
01133                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01134                         PIXEL11_0
01135                 } else {
01136                         PIXEL11_20
01137                 }
01138                 break;
01139         case 59:
01140                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01141                         PIXEL00_0
01142                 } else {
01143                         PIXEL00_20
01144                 }
01145                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01146                         PIXEL01_10
01147                 } else {
01148                         PIXEL01_70
01149                 }
01150                 PIXEL10_11
01151                 PIXEL11_21
01152                 break;
01153         case 121:
01154                 PIXEL00_12
01155                 PIXEL01_22
01156                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01157                         PIXEL10_0
01158                 } else {
01159                         PIXEL10_20
01160                 }
01161                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01162                         PIXEL11_10
01163                 } else {
01164                         PIXEL11_70
01165                 }
01166                 break;
01167         case 87:
01168                 PIXEL00_11
01169                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01170                         PIXEL01_0
01171                 } else {
01172                         PIXEL01_20
01173                 }
01174                 PIXEL10_21
01175                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01176                         PIXEL11_10
01177                 } else {
01178                         PIXEL11_70
01179                 }
01180                 break;
01181         case 79:
01182                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01183                         PIXEL00_0
01184                 } else {
01185                         PIXEL00_20
01186                 }
01187                 PIXEL01_12
01188                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01189                         PIXEL10_10
01190                 } else {
01191                         PIXEL10_70
01192                 }
01193                 PIXEL11_22
01194                 break;
01195         case 122:
01196                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01197                         PIXEL00_10
01198                 } else {
01199                         PIXEL00_70
01200                 }
01201                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01202                         PIXEL01_10
01203                 } else {
01204                         PIXEL01_70
01205                 }
01206                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01207                         PIXEL10_0
01208                 } else {
01209                         PIXEL10_20
01210                 }
01211                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01212                         PIXEL11_10
01213                 } else {
01214                         PIXEL11_70
01215                 }
01216                 break;
01217         case 94:
01218                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01219                         PIXEL00_10
01220                 } else {
01221                         PIXEL00_70
01222                 }
01223                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01224                         PIXEL01_0
01225                 } else {
01226                         PIXEL01_20
01227                 }
01228                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01229                         PIXEL10_10
01230                 } else {
01231                         PIXEL10_70
01232                 }
01233                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01234                         PIXEL11_10
01235                 } else {
01236                         PIXEL11_70
01237                 }
01238                 break;
01239         case 218:
01240                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01241                         PIXEL00_10
01242                 } else {
01243                         PIXEL00_70
01244                 }
01245                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01246                         PIXEL01_10
01247                 } else {
01248                         PIXEL01_70
01249                 }
01250                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01251                         PIXEL10_10
01252                 } else {
01253                         PIXEL10_70
01254                 }
01255                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01256                         PIXEL11_0
01257                 } else {
01258                         PIXEL11_20
01259                 }
01260                 break;
01261         case 91:
01262                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01263                         PIXEL00_0
01264                 } else {
01265                         PIXEL00_20
01266                 }
01267                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01268                         PIXEL01_10
01269                 } else {
01270                         PIXEL01_70
01271                 }
01272                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01273                         PIXEL10_10
01274                 } else {
01275                         PIXEL10_70
01276                 }
01277                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01278                         PIXEL11_10
01279                 } else {
01280                         PIXEL11_70
01281                 }
01282                 break;
01283         case 229:
01284                 PIXEL00_20
01285                 PIXEL01_20
01286                 PIXEL10_12
01287                 PIXEL11_11
01288                 break;
01289         case 167:
01290                 PIXEL00_11
01291                 PIXEL01_12
01292                 PIXEL10_20
01293                 PIXEL11_20
01294                 break;
01295         case 173:
01296                 PIXEL00_12
01297                 PIXEL01_20
01298                 PIXEL10_11
01299                 PIXEL11_20
01300                 break;
01301         case 181:
01302                 PIXEL00_20
01303                 PIXEL01_11
01304                 PIXEL10_20
01305                 PIXEL11_12
01306                 break;
01307         case 186:
01308                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01309                         PIXEL00_10
01310                 } else {
01311                         PIXEL00_70
01312                 }
01313                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01314                         PIXEL01_10
01315                 } else {
01316                         PIXEL01_70
01317                 }
01318                 PIXEL10_11
01319                 PIXEL11_12
01320                 break;
01321         case 115:
01322                 PIXEL00_11
01323                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01324                         PIXEL01_10
01325                 } else {
01326                         PIXEL01_70
01327                 }
01328                 PIXEL10_12
01329                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01330                         PIXEL11_10
01331                 } else {
01332                         PIXEL11_70
01333                 }
01334                 break;
01335         case 93:
01336                 PIXEL00_12
01337                 PIXEL01_11
01338                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01339                         PIXEL10_10
01340                 } else {
01341                         PIXEL10_70
01342                 }
01343                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01344                         PIXEL11_10
01345                 } else {
01346                         PIXEL11_70
01347                 }
01348                 break;
01349         case 206:
01350                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01351                         PIXEL00_10
01352                 } else {
01353                         PIXEL00_70
01354                 }
01355                 PIXEL01_12
01356                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01357                         PIXEL10_10
01358                 } else {
01359                         PIXEL10_70
01360                 }
01361                 PIXEL11_11
01362                 break;
01363         case 205:
01364         case 201:
01365                 PIXEL00_12
01366                 PIXEL01_20
01367                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01368                         PIXEL10_10
01369                 } else {
01370                         PIXEL10_70
01371                 }
01372                 PIXEL11_11
01373                 break;
01374         case 174:
01375         case 46:
01376                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01377                         PIXEL00_10
01378                 } else {
01379                         PIXEL00_70
01380                 }
01381                 PIXEL01_12
01382                 PIXEL10_11
01383                 PIXEL11_20
01384                 break;
01385         case 179:
01386         case 147:
01387                 PIXEL00_11
01388                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01389                         PIXEL01_10
01390                 } else {
01391                         PIXEL01_70
01392                 }
01393                 PIXEL10_20
01394                 PIXEL11_12
01395                 break;
01396         case 117:
01397         case 116:
01398                 PIXEL00_20
01399                 PIXEL01_11
01400                 PIXEL10_12
01401                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01402                         PIXEL11_10
01403                 } else {
01404                         PIXEL11_70
01405                 }
01406                 break;
01407         case 189:
01408                 PIXEL00_12
01409                 PIXEL01_11
01410                 PIXEL10_11
01411                 PIXEL11_12
01412                 break;
01413         case 231:
01414                 PIXEL00_11
01415                 PIXEL01_12
01416                 PIXEL10_12
01417                 PIXEL11_11
01418                 break;
01419         case 126:
01420                 PIXEL00_10
01421                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01422                         PIXEL01_0
01423                 } else {
01424                         PIXEL01_20
01425                 }
01426                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01427                         PIXEL10_0
01428                 } else {
01429                         PIXEL10_20
01430                 }
01431                 PIXEL11_10
01432                 break;
01433         case 219:
01434                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01435                         PIXEL00_0
01436                 } else {
01437                         PIXEL00_20
01438                 }
01439                 PIXEL01_10
01440                 PIXEL10_10
01441                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01442                         PIXEL11_0
01443                 } else {
01444                         PIXEL11_20
01445                 }
01446                 break;
01447         case 125:
01448                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01449                         PIXEL00_12
01450                         PIXEL10_0
01451                 } else {
01452                         PIXEL00_61
01453                         PIXEL10_90
01454                 }
01455                 PIXEL01_11
01456                 PIXEL11_10
01457                 break;
01458         case 221:
01459                 PIXEL00_12
01460                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01461                         PIXEL01_11
01462                         PIXEL11_0
01463                 } else {
01464                         PIXEL01_60
01465                         PIXEL11_90
01466                 }
01467                 PIXEL10_10
01468                 break;
01469         case 207:
01470                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01471                         PIXEL00_0
01472                         PIXEL01_12
01473                 } else {
01474                         PIXEL00_90
01475                         PIXEL01_61
01476                 }
01477                 PIXEL10_10
01478                 PIXEL11_11
01479                 break;
01480         case 238:
01481                 PIXEL00_10
01482                 PIXEL01_12
01483                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01484                         PIXEL10_0
01485                         PIXEL11_11
01486                 } else {
01487                         PIXEL10_90
01488                         PIXEL11_60
01489                 }
01490                 break;
01491         case 190:
01492                 PIXEL00_10
01493                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01494                         PIXEL01_0
01495                         PIXEL11_12
01496                 } else {
01497                         PIXEL01_90
01498                         PIXEL11_61
01499                 }
01500                 PIXEL10_11
01501                 break;
01502         case 187:
01503                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01504                         PIXEL00_0
01505                         PIXEL10_11
01506                 } else {
01507                         PIXEL00_90
01508                         PIXEL10_60
01509                 }
01510                 PIXEL01_10
01511                 PIXEL11_12
01512                 break;
01513         case 243:
01514                 PIXEL00_11
01515                 PIXEL01_10
01516                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01517                         PIXEL10_12
01518                         PIXEL11_0
01519                 } else {
01520                         PIXEL10_61
01521                         PIXEL11_90
01522                 }
01523                 break;
01524         case 119:
01525                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01526                         PIXEL00_11
01527                         PIXEL01_0
01528                 } else {
01529                         PIXEL00_60
01530                         PIXEL01_90
01531                 }
01532                 PIXEL10_12
01533                 PIXEL11_10
01534                 break;
01535         case 237:
01536         case 233:
01537                 PIXEL00_12
01538                 PIXEL01_20
01539                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01540                         PIXEL10_0
01541                 } else {
01542                         PIXEL10_100
01543                 }
01544                 PIXEL11_11
01545                 break;
01546         case 175:
01547         case 47:
01548                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01549                         PIXEL00_0
01550                 } else {
01551                         PIXEL00_100
01552                 }
01553                 PIXEL01_12
01554                 PIXEL10_11
01555                 PIXEL11_20
01556                 break;
01557         case 183:
01558         case 151:
01559                 PIXEL00_11
01560                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01561                         PIXEL01_0
01562                 } else {
01563                         PIXEL01_100
01564                 }
01565                 PIXEL10_20
01566                 PIXEL11_12
01567                 break;
01568         case 245:
01569         case 244:
01570                 PIXEL00_20
01571                 PIXEL01_11
01572                 PIXEL10_12
01573                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01574                         PIXEL11_0
01575                 } else {
01576                         PIXEL11_100
01577                 }
01578                 break;
01579         case 250:
01580                 PIXEL00_10
01581                 PIXEL01_10
01582                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01583                         PIXEL10_0
01584                 } else {
01585                         PIXEL10_20
01586                 }
01587                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01588                         PIXEL11_0
01589                 } else {
01590                         PIXEL11_20
01591                 }
01592                 break;
01593         case 123:
01594                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01595                         PIXEL00_0
01596                 } else {
01597                         PIXEL00_20
01598                 }
01599                 PIXEL01_10
01600                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01601                         PIXEL10_0
01602                 } else {
01603                         PIXEL10_20
01604                 }
01605                 PIXEL11_10
01606                 break;
01607         case 95:
01608                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01609                         PIXEL00_0
01610                 } else {
01611                         PIXEL00_20
01612                 }
01613                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01614                         PIXEL01_0
01615                 } else {
01616                         PIXEL01_20
01617                 }
01618                 PIXEL10_10
01619                 PIXEL11_10
01620                 break;
01621         case 222:
01622                 PIXEL00_10
01623                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01624                         PIXEL01_0
01625                 } else {
01626                         PIXEL01_20
01627                 }
01628                 PIXEL10_10
01629                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01630                         PIXEL11_0
01631                 } else {
01632                         PIXEL11_20
01633                 }
01634                 break;
01635         case 252:
01636                 PIXEL00_21
01637                 PIXEL01_11
01638                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01639                         PIXEL10_0
01640                 } else {
01641                         PIXEL10_20
01642                 }
01643                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01644                         PIXEL11_0
01645                 } else {
01646                         PIXEL11_100
01647                 }
01648                 break;
01649         case 249:
01650                 PIXEL00_12
01651                 PIXEL01_22
01652                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01653                         PIXEL10_0
01654                 } else {
01655                         PIXEL10_100
01656                 }
01657                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01658                         PIXEL11_0
01659                 } else {
01660                         PIXEL11_20
01661                 }
01662                 break;
01663         case 235:
01664                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01665                         PIXEL00_0
01666                 } else {
01667                         PIXEL00_20
01668                 }
01669                 PIXEL01_21
01670                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01671                         PIXEL10_0
01672                 } else {
01673                         PIXEL10_100
01674                 }
01675                 PIXEL11_11
01676                 break;
01677         case 111:
01678                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01679                         PIXEL00_0
01680                 } else {
01681                         PIXEL00_100
01682                 }
01683                 PIXEL01_12
01684                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01685                         PIXEL10_0
01686                 } else {
01687                         PIXEL10_20
01688                 }
01689                 PIXEL11_22
01690                 break;
01691         case 63:
01692                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01693                         PIXEL00_0
01694                 } else {
01695                         PIXEL00_100
01696                 }
01697                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01698                         PIXEL01_0
01699                 } else {
01700                         PIXEL01_20
01701                 }
01702                 PIXEL10_11
01703                 PIXEL11_21
01704                 break;
01705         case 159:
01706                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01707                         PIXEL00_0
01708                 } else {
01709                         PIXEL00_20
01710                 }
01711                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01712                         PIXEL01_0
01713                 } else {
01714                         PIXEL01_100
01715                 }
01716                 PIXEL10_22
01717                 PIXEL11_12
01718                 break;
01719         case 215:
01720                 PIXEL00_11
01721                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01722                         PIXEL01_0
01723                 } else {
01724                         PIXEL01_100
01725                 }
01726                 PIXEL10_21
01727                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01728                         PIXEL11_0
01729                 } else {
01730                         PIXEL11_20
01731                 }
01732                 break;
01733         case 246:
01734                 PIXEL00_22
01735                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01736                         PIXEL01_0
01737                 } else {
01738                         PIXEL01_20
01739                 }
01740                 PIXEL10_12
01741                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01742                         PIXEL11_0
01743                 } else {
01744                         PIXEL11_100
01745                 }
01746                 break;
01747         case 254:
01748                 PIXEL00_10
01749                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01750                         PIXEL01_0
01751                 } else {
01752                         PIXEL01_20
01753                 }
01754                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01755                         PIXEL10_0
01756                 } else {
01757                         PIXEL10_20
01758                 }
01759                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01760                         PIXEL11_0
01761                 } else {
01762                         PIXEL11_100
01763                 }
01764                 break;
01765         case 253:
01766                 PIXEL00_12
01767                 PIXEL01_11
01768                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01769                         PIXEL10_0
01770                 } else {
01771                         PIXEL10_100
01772                 }
01773                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01774                         PIXEL11_0
01775                 } else {
01776                         PIXEL11_100
01777                 }
01778                 break;
01779         case 251:
01780                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01781                         PIXEL00_0
01782                 } else {
01783                         PIXEL00_20
01784                 }
01785                 PIXEL01_10
01786                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01787                         PIXEL10_0
01788                 } else {
01789                         PIXEL10_100
01790                 }
01791                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01792                         PIXEL11_0
01793                 } else {
01794                         PIXEL11_20
01795                 }
01796                 break;
01797         case 239:
01798                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01799                         PIXEL00_0
01800                 } else {
01801                         PIXEL00_100
01802                 }
01803                 PIXEL01_12
01804                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01805                         PIXEL10_0
01806                 } else {
01807                         PIXEL10_100
01808                 }
01809                 PIXEL11_11
01810                 break;
01811         case 127:
01812                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01813                         PIXEL00_0
01814                 } else {
01815                         PIXEL00_100
01816                 }
01817                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01818                         PIXEL01_0
01819                 } else {
01820                         PIXEL01_20
01821                 }
01822                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01823                         PIXEL10_0
01824                 } else {
01825                         PIXEL10_20
01826                 }
01827                 PIXEL11_10
01828                 break;
01829         case 191:
01830                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01831                         PIXEL00_0
01832                 } else {
01833                         PIXEL00_100
01834                 }
01835                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01836                         PIXEL01_0
01837                 } else {
01838                         PIXEL01_100
01839                 }
01840                 PIXEL10_11
01841                 PIXEL11_12
01842                 break;
01843         case 223:
01844                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01845                         PIXEL00_0
01846                 } else {
01847                         PIXEL00_20
01848                 }
01849                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01850                         PIXEL01_0
01851                 } else {
01852                         PIXEL01_100
01853                 }
01854                 PIXEL10_10
01855                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01856                         PIXEL11_0
01857                 } else {
01858                         PIXEL11_20
01859                 }
01860                 break;
01861         case 247:
01862                 PIXEL00_11
01863                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01864                         PIXEL01_0
01865                 } else {
01866                         PIXEL01_100
01867                 }
01868                 PIXEL10_12
01869                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01870                         PIXEL11_0
01871                 } else {
01872                         PIXEL11_100
01873                 }
01874                 break;
01875         case 255:
01876                 if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) {
01877                         PIXEL00_0
01878                 } else {
01879                         PIXEL00_100
01880                 }
01881                 if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) {
01882                         PIXEL01_0
01883                 } else {
01884                         PIXEL01_100
01885                 }
01886                 if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) {
01887                         PIXEL10_0
01888                 } else {
01889                         PIXEL10_100
01890                 }
01891                 if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) {
01892                         PIXEL11_0
01893                 } else {
01894                         PIXEL11_100
01895                 }
01896                 break;
01897         }
01898 }
01899 
01900 #undef RGBtoYUV