1 /*
2 * Copyright (C) 2014 Peter Olsson
3 *
4 * Copyright (C) 2003 Maxim Stepin ( maxst@hiend3d.com )
5 *
6 * Copyright (C) 2010 Cameron Zemek ( grom@zeminvaders.net)
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23 #include <stdint.h>
24 #include "common.h"
25 #include "hqx.h"
26
27 #define PIXEL00_0 *dp = w[5];
28 #define PIXEL00_10 *dp = Interp1(w[5], w[1]);
29 #define PIXEL00_11 *dp = Interp1(w[5], w[4]);
30 #define PIXEL00_12 *dp = Interp1(w[5], w[2]);
31 #define PIXEL00_20 *dp = Interp2(w[5], w[4], w[2]);
32 #define PIXEL00_21 *dp = Interp2(w[5], w[1], w[2]);
33 #define PIXEL00_22 *dp = Interp2(w[5], w[1], w[4]);
34 #define PIXEL00_60 *dp = Interp6(w[5], w[2], w[4]);
35 #define PIXEL00_61 *dp = Interp6(w[5], w[4], w[2]);
36 #define PIXEL00_70 *dp = Interp7(w[5], w[4], w[2]);
37 #define PIXEL00_90 *dp = Interp9(w[5], w[4], w[2]);
38 #define PIXEL00_100 *dp = Interp10(w[5], w[4], w[2]);
39 #define PIXEL01_0 *(dp+1) = w[5];
40 #define PIXEL01_10 *(dp+1) = Interp1(w[5], w[3]);
41 #define PIXEL01_11 *(dp+1) = Interp1(w[5], w[2]);
42 #define PIXEL01_12 *(dp+1) = Interp1(w[5], w[6]);
43 #define PIXEL01_20 *(dp+1) = Interp2(w[5], w[2], w[6]);
44 #define PIXEL01_21 *(dp+1) = Interp2(w[5], w[3], w[6]);
45 #define PIXEL01_22 *(dp+1) = Interp2(w[5], w[3], w[2]);
46 #define PIXEL01_60 *(dp+1) = Interp6(w[5], w[6], w[2]);
47 #define PIXEL01_61 *(dp+1) = Interp6(w[5], w[2], w[6]);
48 #define PIXEL01_70 *(dp+1) = Interp7(w[5], w[2], w[6]);
49 #define PIXEL01_90 *(dp+1) = Interp9(w[5], w[2], w[6]);
50 #define PIXEL01_100 *(dp+1) = Interp10(w[5], w[2], w[6]);
51 #define PIXEL10_0 *(dp+dpL) = w[5];
52 #define PIXEL10_10 *(dp+dpL) = Interp1(w[5], w[7]);
53 #define PIXEL10_11 *(dp+dpL) = Interp1(w[5], w[8]);
54 #define PIXEL10_12 *(dp+dpL) = Interp1(w[5], w[4]);
55 #define PIXEL10_20 *(dp+dpL) = Interp2(w[5], w[8], w[4]);
56 #define PIXEL10_21 *(dp+dpL) = Interp2(w[5], w[7], w[4]);
57 #define PIXEL10_22 *(dp+dpL) = Interp2(w[5], w[7], w[8]);
58 #define PIXEL10_60 *(dp+dpL) = Interp6(w[5], w[4], w[8]);
59 #define PIXEL10_61 *(dp+dpL) = Interp6(w[5], w[8], w[4]);
60 #define PIXEL10_70 *(dp+dpL) = Interp7(w[5], w[8], w[4]);
61 #define PIXEL10_90 *(dp+dpL) = Interp9(w[5], w[8], w[4]);
62 #define PIXEL10_100 *(dp+dpL) = Interp10(w[5], w[8], w[4]);
63 #define PIXEL11_0 *(dp+dpL+1) = w[5];
64 #define PIXEL11_10 *(dp+dpL+1) = Interp1(w[5], w[9]);
65 #define PIXEL11_11 *(dp+dpL+1) = Interp1(w[5], w[6]);
66 #define PIXEL11_12 *(dp+dpL+1) = Interp1(w[5], w[8]);
67 #define PIXEL11_20 *(dp+dpL+1) = Interp2(w[5], w[6], w[8]);
68 #define PIXEL11_21 *(dp+dpL+1) = Interp2(w[5], w[9], w[8]);
69 #define PIXEL11_22 *(dp+dpL+1) = Interp2(w[5], w[9], w[6]);
70 #define PIXEL11_60 *(dp+dpL+1) = Interp6(w[5], w[8], w[6]);
71 #define PIXEL11_61 *(dp+dpL+1) = Interp6(w[5], w[6], w[8]);
72 #define PIXEL11_70 *(dp+dpL+1) = Interp7(w[5], w[6], w[8]);
73 #define PIXEL11_90 *(dp+dpL+1) = Interp9(w[5], w[6], w[8]);
74 #define PIXEL11_100 *(dp+dpL+1) = Interp10(w[5], w[6], w[8]);
75
76 extern const int GAME_WIDTH;
77 extern const int GAME_HEIGHT;
78
hq2x_32_rb(void * src,uint32_t srb,void * dst,uint32_t drb,int dx,int dy,int sx,int sy,int Xres,int Yres)79 HQX_API void HQX_CALLCONV hq2x_32_rb( void * src, uint32_t srb, void * dst, uint32_t drb, int dx, int dy, int sx, int sy, int Xres, int Yres )
80 {
81 uint32_t* sp = (uint32_t *) src + sx + sy * srb / 4;
82 uint32_t* dp = (uint32_t *) dst + dx + dy * drb / 4;
83
84 int i, j, k;
85 int prevline, nextline;
86 uint32_t w[10];
87 int dpL = (drb >> 2);
88 int spL = (srb >> 2);
89 uint8_t *sRowP = (uint8_t *) sp;
90 uint8_t *dRowP = (uint8_t *) dp;
91 uint32_t yuv1, yuv2;
92
93 // +----+----+----+
94 // | | | |
95 // | w1 | w2 | w3 |
96 // +----+----+----+
97 // | | | |
98 // | w4 | w5 | w6 |
99 // +----+----+----+
100 // | | | |
101 // | w7 | w8 | w9 |
102 // +----+----+----+
103
104 for (j=0; j<Yres; j++)
105 {
106 if (j>0 || sy > 0) prevline = -spL; else prevline = 0;
107 if (j<Yres-1 || sy + Yres < GAME_HEIGHT-1) nextline = spL; else nextline = 0;
108
109 for (i=0; i<Xres; i++)
110 {
111 w[2] = *(sp + prevline);
112 w[5] = *sp;
113 w[8] = *(sp + nextline);
114
115 if (i>0 || sx > 0)
116 {
117 w[1] = *(sp + prevline - 1);
118 w[4] = *(sp - 1);
119 w[7] = *(sp + nextline - 1);
120 }
121 else
122 {
123 w[1] = w[2];
124 w[4] = w[5];
125 w[7] = w[8];
126 }
127
128 if (i<Xres-1 || sx + Xres < GAME_WIDTH-1)
129 {
130 w[3] = *(sp + prevline + 1);
131 w[6] = *(sp + 1);
132 w[9] = *(sp + nextline + 1);
133 }
134 else
135 {
136 w[3] = w[2];
137 w[6] = w[5];
138 w[9] = w[8];
139 }
140
141 int pattern = 0;
142 int flag = 1;
143
144 yuv1 = rgb_to_yuv(w[5]);
145
146 for (k=1; k<=9; k++)
147 {
148 if (k==5) continue;
149
150 if ( w[k] != w[5] )
151 {
152 yuv2 = rgb_to_yuv(w[k]);
153 if (yuv_diff(yuv1, yuv2))
154 pattern |= flag;
155 }
156 flag <<= 1;
157 }
158
159 switch (pattern)
160 {
161 case 0:
162 case 1:
163 case 4:
164 case 32:
165 case 128:
166 case 5:
167 case 132:
168 case 160:
169 case 33:
170 case 129:
171 case 36:
172 case 133:
173 case 164:
174 case 161:
175 case 37:
176 case 165:
177 {
178 PIXEL00_20
179 PIXEL01_20
180 PIXEL10_20
181 PIXEL11_20
182 break;
183 }
184 case 2:
185 case 34:
186 case 130:
187 case 162:
188 {
189 PIXEL00_22
190 PIXEL01_21
191 PIXEL10_20
192 PIXEL11_20
193 break;
194 }
195 case 16:
196 case 17:
197 case 48:
198 case 49:
199 {
200 PIXEL00_20
201 PIXEL01_22
202 PIXEL10_20
203 PIXEL11_21
204 break;
205 }
206 case 64:
207 case 65:
208 case 68:
209 case 69:
210 {
211 PIXEL00_20
212 PIXEL01_20
213 PIXEL10_21
214 PIXEL11_22
215 break;
216 }
217 case 8:
218 case 12:
219 case 136:
220 case 140:
221 {
222 PIXEL00_21
223 PIXEL01_20
224 PIXEL10_22
225 PIXEL11_20
226 break;
227 }
228 case 3:
229 case 35:
230 case 131:
231 case 163:
232 {
233 PIXEL00_11
234 PIXEL01_21
235 PIXEL10_20
236 PIXEL11_20
237 break;
238 }
239 case 6:
240 case 38:
241 case 134:
242 case 166:
243 {
244 PIXEL00_22
245 PIXEL01_12
246 PIXEL10_20
247 PIXEL11_20
248 break;
249 }
250 case 20:
251 case 21:
252 case 52:
253 case 53:
254 {
255 PIXEL00_20
256 PIXEL01_11
257 PIXEL10_20
258 PIXEL11_21
259 break;
260 }
261 case 144:
262 case 145:
263 case 176:
264 case 177:
265 {
266 PIXEL00_20
267 PIXEL01_22
268 PIXEL10_20
269 PIXEL11_12
270 break;
271 }
272 case 192:
273 case 193:
274 case 196:
275 case 197:
276 {
277 PIXEL00_20
278 PIXEL01_20
279 PIXEL10_21
280 PIXEL11_11
281 break;
282 }
283 case 96:
284 case 97:
285 case 100:
286 case 101:
287 {
288 PIXEL00_20
289 PIXEL01_20
290 PIXEL10_12
291 PIXEL11_22
292 break;
293 }
294 case 40:
295 case 44:
296 case 168:
297 case 172:
298 {
299 PIXEL00_21
300 PIXEL01_20
301 PIXEL10_11
302 PIXEL11_20
303 break;
304 }
305 case 9:
306 case 13:
307 case 137:
308 case 141:
309 {
310 PIXEL00_12
311 PIXEL01_20
312 PIXEL10_22
313 PIXEL11_20
314 break;
315 }
316 case 18:
317 case 50:
318 {
319 PIXEL00_22
320 if (Diff(w[2], w[6]))
321 {
322 PIXEL01_10
323 }
324 else
325 {
326 PIXEL01_20
327 }
328 PIXEL10_20
329 PIXEL11_21
330 break;
331 }
332 case 80:
333 case 81:
334 {
335 PIXEL00_20
336 PIXEL01_22
337 PIXEL10_21
338 if (Diff(w[6], w[8]))
339 {
340 PIXEL11_10
341 }
342 else
343 {
344 PIXEL11_20
345 }
346 break;
347 }
348 case 72:
349 case 76:
350 {
351 PIXEL00_21
352 PIXEL01_20
353 if (Diff(w[8], w[4]))
354 {
355 PIXEL10_10
356 }
357 else
358 {
359 PIXEL10_20
360 }
361 PIXEL11_22
362 break;
363 }
364 case 10:
365 case 138:
366 {
367 if (Diff(w[4], w[2]))
368 {
369 PIXEL00_10
370 }
371 else
372 {
373 PIXEL00_20
374 }
375 PIXEL01_21
376 PIXEL10_22
377 PIXEL11_20
378 break;
379 }
380 case 66:
381 {
382 PIXEL00_22
383 PIXEL01_21
384 PIXEL10_21
385 PIXEL11_22
386 break;
387 }
388 case 24:
389 {
390 PIXEL00_21
391 PIXEL01_22
392 PIXEL10_22
393 PIXEL11_21
394 break;
395 }
396 case 7:
397 case 39:
398 case 135:
399 {
400 PIXEL00_11
401 PIXEL01_12
402 PIXEL10_20
403 PIXEL11_20
404 break;
405 }
406 case 148:
407 case 149:
408 case 180:
409 {
410 PIXEL00_20
411 PIXEL01_11
412 PIXEL10_20
413 PIXEL11_12
414 break;
415 }
416 case 224:
417 case 228:
418 case 225:
419 {
420 PIXEL00_20
421 PIXEL01_20
422 PIXEL10_12
423 PIXEL11_11
424 break;
425 }
426 case 41:
427 case 169:
428 case 45:
429 {
430 PIXEL00_12
431 PIXEL01_20
432 PIXEL10_11
433 PIXEL11_20
434 break;
435 }
436 case 22:
437 case 54:
438 {
439 PIXEL00_22
440 if (Diff(w[2], w[6]))
441 {
442 PIXEL01_0
443 }
444 else
445 {
446 PIXEL01_20
447 }
448 PIXEL10_20
449 PIXEL11_21
450 break;
451 }
452 case 208:
453 case 209:
454 {
455 PIXEL00_20
456 PIXEL01_22
457 PIXEL10_21
458 if (Diff(w[6], w[8]))
459 {
460 PIXEL11_0
461 }
462 else
463 {
464 PIXEL11_20
465 }
466 break;
467 }
468 case 104:
469 case 108:
470 {
471 PIXEL00_21
472 PIXEL01_20
473 if (Diff(w[8], w[4]))
474 {
475 PIXEL10_0
476 }
477 else
478 {
479 PIXEL10_20
480 }
481 PIXEL11_22
482 break;
483 }
484 case 11:
485 case 139:
486 {
487 if (Diff(w[4], w[2]))
488 {
489 PIXEL00_0
490 }
491 else
492 {
493 PIXEL00_20
494 }
495 PIXEL01_21
496 PIXEL10_22
497 PIXEL11_20
498 break;
499 }
500 case 19:
501 case 51:
502
503 {
504 if (Diff(w[2], w[6]))
505 {
506 PIXEL00_11
507 PIXEL01_10
508 }
509 else
510 {
511 PIXEL00_60
512 PIXEL01_90
513 }
514 PIXEL10_20
515 PIXEL11_21
516 break;
517 }
518 case 146:
519 case 178:
520 {
521 PIXEL00_22
522 if (Diff(w[2], w[6]))
523 {
524 PIXEL01_10
525 PIXEL11_12
526 }
527 else
528 {
529 PIXEL01_90
530 PIXEL11_61
531 }
532 PIXEL10_20
533 break;
534 }
535 case 84:
536 case 85:
537 {
538 PIXEL00_20
539 if (Diff(w[6], w[8]))
540 {
541 PIXEL01_11
542 PIXEL11_10
543 }
544 else
545 {
546 PIXEL01_60
547 PIXEL11_90
548 }
549 PIXEL10_21
550 break;
551 }
552 case 112:
553 case 113:
554 {
555 PIXEL00_20
556 PIXEL01_22
557 if (Diff(w[6], w[8]))
558 {
559 PIXEL10_12
560 PIXEL11_10
561 }
562 else
563 {
564 PIXEL10_61
565 PIXEL11_90
566 }
567 break;
568 }
569 case 200:
570 case 204:
571 {
572 PIXEL00_21
573 PIXEL01_20
574 if (Diff(w[8], w[4]))
575 {
576 PIXEL10_10
577 PIXEL11_11
578 }
579 else
580 {
581 PIXEL10_90
582 PIXEL11_60
583 }
584 break;
585 }
586 case 73:
587 case 77:
588 {
589 if (Diff(w[8], w[4]))
590 {
591 PIXEL00_12
592 PIXEL10_10
593 }
594 else
595 {
596 PIXEL00_61
597 PIXEL10_90
598 }
599 PIXEL01_20
600 PIXEL11_22
601 break;
602 }
603 case 42:
604 case 170:
605 {
606 if (Diff(w[4], w[2]))
607 {
608 PIXEL00_10
609 PIXEL10_11
610 }
611 else
612 {
613 PIXEL00_90
614 PIXEL10_60
615 }
616 PIXEL01_21
617 PIXEL11_20
618 break;
619 }
620 case 14:
621 case 142:
622 {
623 if (Diff(w[4], w[2]))
624 {
625 PIXEL00_10
626 PIXEL01_12
627 }
628 else
629 {
630 PIXEL00_90
631 PIXEL01_61
632 }
633 PIXEL10_22
634 PIXEL11_20
635 break;
636 }
637 case 67:
638 {
639 PIXEL00_11
640 PIXEL01_21
641 PIXEL10_21
642 PIXEL11_22
643 break;
644 }
645 case 70:
646 {
647 PIXEL00_22
648 PIXEL01_12
649 PIXEL10_21
650 PIXEL11_22
651 break;
652 }
653 case 28:
654 {
655 PIXEL00_21
656 PIXEL01_11
657 PIXEL10_22
658 PIXEL11_21
659 break;
660 }
661 case 152:
662 {
663 PIXEL00_21
664 PIXEL01_22
665 PIXEL10_22
666 PIXEL11_12
667 break;
668 }
669 case 194:
670 {
671 PIXEL00_22
672 PIXEL01_21
673 PIXEL10_21
674 PIXEL11_11
675 break;
676 }
677 case 98:
678 {
679 PIXEL00_22
680 PIXEL01_21
681 PIXEL10_12
682 PIXEL11_22
683 break;
684 }
685 case 56:
686 {
687 PIXEL00_21
688 PIXEL01_22
689 PIXEL10_11
690 PIXEL11_21
691 break;
692 }
693 case 25:
694 {
695 PIXEL00_12
696 PIXEL01_22
697 PIXEL10_22
698 PIXEL11_21
699 break;
700 }
701 case 26:
702 case 31:
703 {
704 if (Diff(w[4], w[2]))
705 {
706 PIXEL00_0
707 }
708 else
709 {
710 PIXEL00_20
711 }
712 if (Diff(w[2], w[6]))
713 {
714 PIXEL01_0
715 }
716 else
717 {
718 PIXEL01_20
719 }
720 PIXEL10_22
721 PIXEL11_21
722 break;
723 }
724 case 82:
725 case 214:
726 {
727 PIXEL00_22
728 if (Diff(w[2], w[6]))
729 {
730 PIXEL01_0
731 }
732 else
733 {
734 PIXEL01_20
735 }
736 PIXEL10_21
737 if (Diff(w[6], w[8]))
738 {
739 PIXEL11_0
740 }
741 else
742 {
743 PIXEL11_20
744 }
745 break;
746 }
747 case 88:
748 case 248:
749 {
750 PIXEL00_21
751 PIXEL01_22
752 if (Diff(w[8], w[4]))
753 {
754 PIXEL10_0
755 }
756 else
757 {
758 PIXEL10_20
759 }
760 if (Diff(w[6], w[8]))
761 {
762 PIXEL11_0
763 }
764 else
765 {
766 PIXEL11_20
767 }
768 break;
769 }
770 case 74:
771 case 107:
772 {
773 if (Diff(w[4], w[2]))
774 {
775 PIXEL00_0
776 }
777 else
778 {
779 PIXEL00_20
780 }
781 PIXEL01_21
782 if (Diff(w[8], w[4]))
783 {
784 PIXEL10_0
785 }
786 else
787 {
788 PIXEL10_20
789 }
790 PIXEL11_22
791 break;
792 }
793 case 27:
794 {
795 if (Diff(w[4], w[2]))
796 {
797 PIXEL00_0
798 }
799 else
800 {
801 PIXEL00_20
802 }
803 PIXEL01_10
804 PIXEL10_22
805 PIXEL11_21
806 break;
807 }
808 case 86:
809 {
810 PIXEL00_22
811 if (Diff(w[2], w[6]))
812 {
813 PIXEL01_0
814 }
815 else
816 {
817 PIXEL01_20
818 }
819 PIXEL10_21
820 PIXEL11_10
821 break;
822 }
823 case 216:
824 {
825 PIXEL00_21
826 PIXEL01_22
827 PIXEL10_10
828 if (Diff(w[6], w[8]))
829 {
830 PIXEL11_0
831 }
832 else
833 {
834 PIXEL11_20
835 }
836 break;
837 }
838 case 106:
839 {
840 PIXEL00_10
841 PIXEL01_21
842 if (Diff(w[8], w[4]))
843 {
844 PIXEL10_0
845 }
846 else
847 {
848 PIXEL10_20
849 }
850 PIXEL11_22
851 break;
852 }
853 case 30:
854 {
855 PIXEL00_10
856 if (Diff(w[2], w[6]))
857 {
858 PIXEL01_0
859 }
860 else
861 {
862 PIXEL01_20
863 }
864 PIXEL10_22
865 PIXEL11_21
866 break;
867 }
868 case 210:
869 {
870 PIXEL00_22
871 PIXEL01_10
872 PIXEL10_21
873 if (Diff(w[6], w[8]))
874 {
875 PIXEL11_0
876 }
877 else
878 {
879 PIXEL11_20
880 }
881 break;
882 }
883 case 120:
884 {
885 PIXEL00_21
886 PIXEL01_22
887 if (Diff(w[8], w[4]))
888 {
889 PIXEL10_0
890 }
891 else
892 {
893 PIXEL10_20
894 }
895 PIXEL11_10
896 break;
897 }
898 case 75:
899 {
900 if (Diff(w[4], w[2]))
901 {
902 PIXEL00_0
903 }
904 else
905 {
906 PIXEL00_20
907 }
908 PIXEL01_21
909 PIXEL10_10
910 PIXEL11_22
911 break;
912 }
913 case 29:
914 {
915 PIXEL00_12
916 PIXEL01_11
917 PIXEL10_22
918 PIXEL11_21
919 break;
920 }
921 case 198:
922 {
923 PIXEL00_22
924 PIXEL01_12
925 PIXEL10_21
926 PIXEL11_11
927 break;
928 }
929 case 184:
930 {
931 PIXEL00_21
932 PIXEL01_22
933 PIXEL10_11
934 PIXEL11_12
935 break;
936 }
937 case 99:
938 {
939 PIXEL00_11
940 PIXEL01_21
941 PIXEL10_12
942 PIXEL11_22
943 break;
944 }
945 case 57:
946 {
947 PIXEL00_12
948 PIXEL01_22
949 PIXEL10_11
950 PIXEL11_21
951 break;
952 }
953 case 71:
954 {
955 PIXEL00_11
956 PIXEL01_12
957 PIXEL10_21
958 PIXEL11_22
959 break;
960 }
961 case 156:
962 {
963 PIXEL00_21
964 PIXEL01_11
965 PIXEL10_22
966 PIXEL11_12
967 break;
968 }
969 case 226:
970 {
971 PIXEL00_22
972 PIXEL01_21
973 PIXEL10_12
974 PIXEL11_11
975 break;
976 }
977 case 60:
978 {
979 PIXEL00_21
980 PIXEL01_11
981 PIXEL10_11
982 PIXEL11_21
983 break;
984 }
985 case 195:
986 {
987 PIXEL00_11
988 PIXEL01_21
989 PIXEL10_21
990 PIXEL11_11
991 break;
992 }
993 case 102:
994 {
995 PIXEL00_22
996 PIXEL01_12
997 PIXEL10_12
998 PIXEL11_22
999 break;
1000 }
1001 case 153:
1002 {
1003 PIXEL00_12
1004 PIXEL01_22
1005 PIXEL10_22
1006 PIXEL11_12
1007 break;
1008 }
1009 case 58:
1010 {
1011 if (Diff(w[4], w[2]))
1012 {
1013 PIXEL00_10
1014 }
1015 else
1016 {
1017 PIXEL00_70
1018 }
1019 if (Diff(w[2], w[6]))
1020 {
1021 PIXEL01_10
1022 }
1023 else
1024 {
1025 PIXEL01_70
1026 }
1027 PIXEL10_11
1028 PIXEL11_21
1029 break;
1030 }
1031 case 83:
1032 {
1033 PIXEL00_11
1034 if (Diff(w[2], w[6]))
1035 {
1036 PIXEL01_10
1037 }
1038 else
1039 {
1040 PIXEL01_70
1041 }
1042 PIXEL10_21
1043 if (Diff(w[6], w[8]))
1044 {
1045 PIXEL11_10
1046 }
1047 else
1048 {
1049 PIXEL11_70
1050 }
1051 break;
1052 }
1053 case 92:
1054 {
1055 PIXEL00_21
1056 PIXEL01_11
1057 if (Diff(w[8], w[4]))
1058 {
1059 PIXEL10_10
1060 }
1061 else
1062 {
1063 PIXEL10_70
1064 }
1065 if (Diff(w[6], w[8]))
1066 {
1067 PIXEL11_10
1068 }
1069 else
1070 {
1071 PIXEL11_70
1072 }
1073 break;
1074 }
1075 case 202:
1076 {
1077 if (Diff(w[4], w[2]))
1078 {
1079 PIXEL00_10
1080 }
1081 else
1082 {
1083 PIXEL00_70
1084 }
1085 PIXEL01_21
1086 if (Diff(w[8], w[4]))
1087 {
1088 PIXEL10_10
1089 }
1090 else
1091 {
1092 PIXEL10_70
1093 }
1094 PIXEL11_11
1095 break;
1096 }
1097 case 78:
1098 {
1099 if (Diff(w[4], w[2]))
1100 {
1101 PIXEL00_10
1102 }
1103 else
1104 {
1105 PIXEL00_70
1106 }
1107 PIXEL01_12
1108 if (Diff(w[8], w[4]))
1109 {
1110 PIXEL10_10
1111 }
1112 else
1113 {
1114 PIXEL10_70
1115 }
1116 PIXEL11_22
1117 break;
1118 }
1119 case 154:
1120 {
1121 if (Diff(w[4], w[2]))
1122 {
1123 PIXEL00_10
1124 }
1125 else
1126 {
1127 PIXEL00_70
1128 }
1129 if (Diff(w[2], w[6]))
1130 {
1131 PIXEL01_10
1132 }
1133 else
1134 {
1135 PIXEL01_70
1136 }
1137 PIXEL10_22
1138 PIXEL11_12
1139 break;
1140 }
1141 case 114:
1142 {
1143 PIXEL00_22
1144 if (Diff(w[2], w[6]))
1145 {
1146 PIXEL01_10
1147 }
1148 else
1149 {
1150 PIXEL01_70
1151 }
1152 PIXEL10_12
1153 if (Diff(w[6], w[8]))
1154 {
1155 PIXEL11_10
1156 }
1157 else
1158 {
1159 PIXEL11_70
1160 }
1161 break;
1162 }
1163 case 89:
1164 {
1165 PIXEL00_12
1166 PIXEL01_22
1167 if (Diff(w[8], w[4]))
1168 {
1169 PIXEL10_10
1170 }
1171 else
1172 {
1173 PIXEL10_70
1174 }
1175 if (Diff(w[6], w[8]))
1176 {
1177 PIXEL11_10
1178 }
1179 else
1180 {
1181 PIXEL11_70
1182 }
1183 break;
1184 }
1185 case 90:
1186 {
1187 if (Diff(w[4], w[2]))
1188 {
1189 PIXEL00_10
1190 }
1191 else
1192 {
1193 PIXEL00_70
1194 }
1195 if (Diff(w[2], w[6]))
1196 {
1197 PIXEL01_10
1198 }
1199 else
1200 {
1201 PIXEL01_70
1202 }
1203 if (Diff(w[8], w[4]))
1204 {
1205 PIXEL10_10
1206 }
1207 else
1208 {
1209 PIXEL10_70
1210 }
1211 if (Diff(w[6], w[8]))
1212 {
1213 PIXEL11_10
1214 }
1215 else
1216 {
1217 PIXEL11_70
1218 }
1219 break;
1220 }
1221 case 55:
1222 case 23:
1223 {
1224 if (Diff(w[2], w[6]))
1225 {
1226 PIXEL00_11
1227 PIXEL01_0
1228 }
1229 else
1230 {
1231 PIXEL00_60
1232 PIXEL01_90
1233 }
1234 PIXEL10_20
1235 PIXEL11_21
1236 break;
1237 }
1238 case 182:
1239 case 150:
1240 {
1241 PIXEL00_22
1242 if (Diff(w[2], w[6]))
1243 {
1244 PIXEL01_0
1245 PIXEL11_12
1246 }
1247 else
1248 {
1249 PIXEL01_90
1250 PIXEL11_61
1251 }
1252 PIXEL10_20
1253 break;
1254 }
1255 case 213:
1256 case 212:
1257 {
1258 PIXEL00_20
1259 if (Diff(w[6], w[8]))
1260 {
1261 PIXEL01_11
1262 PIXEL11_0
1263 }
1264 else
1265 {
1266 PIXEL01_60
1267 PIXEL11_90
1268 }
1269 PIXEL10_21
1270 break;
1271 }
1272 case 241:
1273 case 240:
1274 {
1275 PIXEL00_20
1276 PIXEL01_22
1277 if (Diff(w[6], w[8]))
1278 {
1279 PIXEL10_12
1280 PIXEL11_0
1281 }
1282 else
1283 {
1284 PIXEL10_61
1285 PIXEL11_90
1286 }
1287 break;
1288 }
1289 case 236:
1290 case 232:
1291 {
1292 PIXEL00_21
1293 PIXEL01_20
1294 if (Diff(w[8], w[4]))
1295 {
1296 PIXEL10_0
1297 PIXEL11_11
1298 }
1299 else
1300 {
1301 PIXEL10_90
1302 PIXEL11_60
1303 }
1304 break;
1305 }
1306 case 109:
1307 case 105:
1308 {
1309 if (Diff(w[8], w[4]))
1310 {
1311 PIXEL00_12
1312 PIXEL10_0
1313 }
1314 else
1315 {
1316 PIXEL00_61
1317 PIXEL10_90
1318 }
1319 PIXEL01_20
1320 PIXEL11_22
1321 break;
1322 }
1323 case 171:
1324 case 43:
1325 {
1326 if (Diff(w[4], w[2]))
1327 {
1328 PIXEL00_0
1329 PIXEL10_11
1330 }
1331 else
1332 {
1333 PIXEL00_90
1334 PIXEL10_60
1335 }
1336 PIXEL01_21
1337 PIXEL11_20
1338 break;
1339 }
1340 case 143:
1341 case 15:
1342 {
1343 if (Diff(w[4], w[2]))
1344 {
1345 PIXEL00_0
1346 PIXEL01_12
1347 }
1348 else
1349 {
1350 PIXEL00_90
1351 PIXEL01_61
1352 }
1353 PIXEL10_22
1354 PIXEL11_20
1355 break;
1356 }
1357 case 124:
1358 {
1359 PIXEL00_21
1360 PIXEL01_11
1361 if (Diff(w[8], w[4]))
1362 {
1363 PIXEL10_0
1364 }
1365 else
1366 {
1367 PIXEL10_20
1368 }
1369 PIXEL11_10
1370 break;
1371 }
1372 case 203:
1373 {
1374 if (Diff(w[4], w[2]))
1375 {
1376 PIXEL00_0
1377 }
1378 else
1379 {
1380 PIXEL00_20
1381 }
1382 PIXEL01_21
1383 PIXEL10_10
1384 PIXEL11_11
1385 break;
1386 }
1387 case 62:
1388 {
1389 PIXEL00_10
1390 if (Diff(w[2], w[6]))
1391 {
1392 PIXEL01_0
1393 }
1394 else
1395 {
1396 PIXEL01_20
1397 }
1398 PIXEL10_11
1399 PIXEL11_21
1400 break;
1401 }
1402 case 211:
1403 {
1404 PIXEL00_11
1405 PIXEL01_10
1406 PIXEL10_21
1407 if (Diff(w[6], w[8]))
1408 {
1409 PIXEL11_0
1410 }
1411 else
1412 {
1413 PIXEL11_20
1414 }
1415 break;
1416 }
1417 case 118:
1418 {
1419 PIXEL00_22
1420 if (Diff(w[2], w[6]))
1421 {
1422 PIXEL01_0
1423 }
1424 else
1425 {
1426 PIXEL01_20
1427 }
1428 PIXEL10_12
1429 PIXEL11_10
1430 break;
1431 }
1432 case 217:
1433 {
1434 PIXEL00_12
1435 PIXEL01_22
1436 PIXEL10_10
1437 if (Diff(w[6], w[8]))
1438 {
1439 PIXEL11_0
1440 }
1441 else
1442 {
1443 PIXEL11_20
1444 }
1445 break;
1446 }
1447 case 110:
1448 {
1449 PIXEL00_10
1450 PIXEL01_12
1451 if (Diff(w[8], w[4]))
1452 {
1453 PIXEL10_0
1454 }
1455 else
1456 {
1457 PIXEL10_20
1458 }
1459 PIXEL11_22
1460 break;
1461 }
1462 case 155:
1463 {
1464 if (Diff(w[4], w[2]))
1465 {
1466 PIXEL00_0
1467 }
1468 else
1469 {
1470 PIXEL00_20
1471 }
1472 PIXEL01_10
1473 PIXEL10_22
1474 PIXEL11_12
1475 break;
1476 }
1477 case 188:
1478 {
1479 PIXEL00_21
1480 PIXEL01_11
1481 PIXEL10_11
1482 PIXEL11_12
1483 break;
1484 }
1485 case 185:
1486 {
1487 PIXEL00_12
1488 PIXEL01_22
1489 PIXEL10_11
1490 PIXEL11_12
1491 break;
1492 }
1493 case 61:
1494 {
1495 PIXEL00_12
1496 PIXEL01_11
1497 PIXEL10_11
1498 PIXEL11_21
1499 break;
1500 }
1501 case 157:
1502 {
1503 PIXEL00_12
1504 PIXEL01_11
1505 PIXEL10_22
1506 PIXEL11_12
1507 break;
1508 }
1509 case 103:
1510 {
1511 PIXEL00_11
1512 PIXEL01_12
1513 PIXEL10_12
1514 PIXEL11_22
1515 break;
1516 }
1517 case 227:
1518 {
1519 PIXEL00_11
1520 PIXEL01_21
1521 PIXEL10_12
1522 PIXEL11_11
1523 break;
1524 }
1525 case 230:
1526 {
1527 PIXEL00_22
1528 PIXEL01_12
1529 PIXEL10_12
1530 PIXEL11_11
1531 break;
1532 }
1533 case 199:
1534 {
1535 PIXEL00_11
1536 PIXEL01_12
1537 PIXEL10_21
1538 PIXEL11_11
1539 break;
1540 }
1541 case 220:
1542 {
1543 PIXEL00_21
1544 PIXEL01_11
1545 if (Diff(w[8], w[4]))
1546 {
1547 PIXEL10_10
1548 }
1549 else
1550 {
1551 PIXEL10_70
1552 }
1553 if (Diff(w[6], w[8]))
1554 {
1555 PIXEL11_0
1556 }
1557 else
1558 {
1559 PIXEL11_20
1560 }
1561 break;
1562 }
1563 case 158:
1564 {
1565 if (Diff(w[4], w[2]))
1566 {
1567 PIXEL00_10
1568 }
1569 else
1570 {
1571 PIXEL00_70
1572 }
1573 if (Diff(w[2], w[6]))
1574 {
1575 PIXEL01_0
1576 }
1577 else
1578 {
1579 PIXEL01_20
1580 }
1581 PIXEL10_22
1582 PIXEL11_12
1583 break;
1584 }
1585 case 234:
1586 {
1587 if (Diff(w[4], w[2]))
1588 {
1589 PIXEL00_10
1590 }
1591 else
1592 {
1593 PIXEL00_70
1594 }
1595 PIXEL01_21
1596 if (Diff(w[8], w[4]))
1597 {
1598 PIXEL10_0
1599 }
1600 else
1601 {
1602 PIXEL10_20
1603 }
1604 PIXEL11_11
1605 break;
1606 }
1607 case 242:
1608 {
1609 PIXEL00_22
1610 if (Diff(w[2], w[6]))
1611 {
1612 PIXEL01_10
1613 }
1614 else
1615 {
1616 PIXEL01_70
1617 }
1618 PIXEL10_12
1619 if (Diff(w[6], w[8]))
1620 {
1621 PIXEL11_0
1622 }
1623 else
1624 {
1625 PIXEL11_20
1626 }
1627 break;
1628 }
1629 case 59:
1630 {
1631 if (Diff(w[4], w[2]))
1632 {
1633 PIXEL00_0
1634 }
1635 else
1636 {
1637 PIXEL00_20
1638 }
1639 if (Diff(w[2], w[6]))
1640 {
1641 PIXEL01_10
1642 }
1643 else
1644 {
1645 PIXEL01_70
1646 }
1647 PIXEL10_11
1648 PIXEL11_21
1649 break;
1650 }
1651 case 121:
1652 {
1653 PIXEL00_12
1654 PIXEL01_22
1655 if (Diff(w[8], w[4]))
1656 {
1657 PIXEL10_0
1658 }
1659 else
1660 {
1661 PIXEL10_20
1662 }
1663 if (Diff(w[6], w[8]))
1664 {
1665 PIXEL11_10
1666 }
1667 else
1668 {
1669 PIXEL11_70
1670 }
1671 break;
1672 }
1673 case 87:
1674 {
1675 PIXEL00_11
1676 if (Diff(w[2], w[6]))
1677 {
1678 PIXEL01_0
1679 }
1680 else
1681 {
1682 PIXEL01_20
1683 }
1684 PIXEL10_21
1685 if (Diff(w[6], w[8]))
1686 {
1687 PIXEL11_10
1688 }
1689 else
1690 {
1691 PIXEL11_70
1692 }
1693 break;
1694 }
1695 case 79:
1696 {
1697 if (Diff(w[4], w[2]))
1698 {
1699 PIXEL00_0
1700 }
1701 else
1702 {
1703 PIXEL00_20
1704 }
1705 PIXEL01_12
1706 if (Diff(w[8], w[4]))
1707 {
1708 PIXEL10_10
1709 }
1710 else
1711 {
1712 PIXEL10_70
1713 }
1714 PIXEL11_22
1715 break;
1716 }
1717 case 122:
1718 {
1719 if (Diff(w[4], w[2]))
1720 {
1721 PIXEL00_10
1722 }
1723 else
1724 {
1725 PIXEL00_70
1726 }
1727 if (Diff(w[2], w[6]))
1728 {
1729 PIXEL01_10
1730 }
1731 else
1732 {
1733 PIXEL01_70
1734 }
1735 if (Diff(w[8], w[4]))
1736 {
1737 PIXEL10_0
1738 }
1739 else
1740 {
1741 PIXEL10_20
1742 }
1743 if (Diff(w[6], w[8]))
1744 {
1745 PIXEL11_10
1746 }
1747 else
1748 {
1749 PIXEL11_70
1750 }
1751 break;
1752 }
1753 case 94:
1754 {
1755 if (Diff(w[4], w[2]))
1756 {
1757 PIXEL00_10
1758 }
1759 else
1760 {
1761 PIXEL00_70
1762 }
1763 if (Diff(w[2], w[6]))
1764 {
1765 PIXEL01_0
1766 }
1767 else
1768 {
1769 PIXEL01_20
1770 }
1771 if (Diff(w[8], w[4]))
1772 {
1773 PIXEL10_10
1774 }
1775 else
1776 {
1777 PIXEL10_70
1778 }
1779 if (Diff(w[6], w[8]))
1780 {
1781 PIXEL11_10
1782 }
1783 else
1784 {
1785 PIXEL11_70
1786 }
1787 break;
1788 }
1789 case 218:
1790 {
1791 if (Diff(w[4], w[2]))
1792 {
1793 PIXEL00_10
1794 }
1795 else
1796 {
1797 PIXEL00_70
1798 }
1799 if (Diff(w[2], w[6]))
1800 {
1801 PIXEL01_10
1802 }
1803 else
1804 {
1805 PIXEL01_70
1806 }
1807 if (Diff(w[8], w[4]))
1808 {
1809 PIXEL10_10
1810 }
1811 else
1812 {
1813 PIXEL10_70
1814 }
1815 if (Diff(w[6], w[8]))
1816 {
1817 PIXEL11_0
1818 }
1819 else
1820 {
1821 PIXEL11_20
1822 }
1823 break;
1824 }
1825 case 91:
1826 {
1827 if (Diff(w[4], w[2]))
1828 {
1829 PIXEL00_0
1830 }
1831 else
1832 {
1833 PIXEL00_20
1834 }
1835 if (Diff(w[2], w[6]))
1836 {
1837 PIXEL01_10
1838 }
1839 else
1840 {
1841 PIXEL01_70
1842 }
1843 if (Diff(w[8], w[4]))
1844 {
1845 PIXEL10_10
1846 }
1847 else
1848 {
1849 PIXEL10_70
1850 }
1851 if (Diff(w[6], w[8]))
1852 {
1853 PIXEL11_10
1854 }
1855 else
1856 {
1857 PIXEL11_70
1858 }
1859 break;
1860 }
1861 case 229:
1862 {
1863 PIXEL00_20
1864 PIXEL01_20
1865 PIXEL10_12
1866 PIXEL11_11
1867 break;
1868 }
1869 case 167:
1870 {
1871 PIXEL00_11
1872 PIXEL01_12
1873 PIXEL10_20
1874 PIXEL11_20
1875 break;
1876 }
1877 case 173:
1878 {
1879 PIXEL00_12
1880 PIXEL01_20
1881 PIXEL10_11
1882 PIXEL11_20
1883 break;
1884 }
1885 case 181:
1886 {
1887 PIXEL00_20
1888 PIXEL01_11
1889 PIXEL10_20
1890 PIXEL11_12
1891 break;
1892 }
1893 case 186:
1894 {
1895 if (Diff(w[4], w[2]))
1896 {
1897 PIXEL00_10
1898 }
1899 else
1900 {
1901 PIXEL00_70
1902 }
1903 if (Diff(w[2], w[6]))
1904 {
1905 PIXEL01_10
1906 }
1907 else
1908 {
1909 PIXEL01_70
1910 }
1911 PIXEL10_11
1912 PIXEL11_12
1913 break;
1914 }
1915 case 115:
1916 {
1917 PIXEL00_11
1918 if (Diff(w[2], w[6]))
1919 {
1920 PIXEL01_10
1921 }
1922 else
1923 {
1924 PIXEL01_70
1925 }
1926 PIXEL10_12
1927 if (Diff(w[6], w[8]))
1928 {
1929 PIXEL11_10
1930 }
1931 else
1932 {
1933 PIXEL11_70
1934 }
1935 break;
1936 }
1937 case 93:
1938 {
1939 PIXEL00_12
1940 PIXEL01_11
1941 if (Diff(w[8], w[4]))
1942 {
1943 PIXEL10_10
1944 }
1945 else
1946 {
1947 PIXEL10_70
1948 }
1949 if (Diff(w[6], w[8]))
1950 {
1951 PIXEL11_10
1952 }
1953 else
1954 {
1955 PIXEL11_70
1956 }
1957 break;
1958 }
1959 case 206:
1960 {
1961 if (Diff(w[4], w[2]))
1962 {
1963 PIXEL00_10
1964 }
1965 else
1966 {
1967 PIXEL00_70
1968 }
1969 PIXEL01_12
1970 if (Diff(w[8], w[4]))
1971 {
1972 PIXEL10_10
1973 }
1974 else
1975 {
1976 PIXEL10_70
1977 }
1978 PIXEL11_11
1979 break;
1980 }
1981 case 205:
1982 case 201:
1983 {
1984 PIXEL00_12
1985 PIXEL01_20
1986 if (Diff(w[8], w[4]))
1987 {
1988 PIXEL10_10
1989 }
1990 else
1991 {
1992 PIXEL10_70
1993 }
1994 PIXEL11_11
1995 break;
1996 }
1997 case 174:
1998 case 46:
1999 {
2000 if (Diff(w[4], w[2]))
2001 {
2002 PIXEL00_10
2003 }
2004 else
2005 {
2006 PIXEL00_70
2007 }
2008 PIXEL01_12
2009 PIXEL10_11
2010 PIXEL11_20
2011 break;
2012 }
2013 case 179:
2014 case 147:
2015 {
2016 PIXEL00_11
2017 if (Diff(w[2], w[6]))
2018 {
2019 PIXEL01_10
2020 }
2021 else
2022 {
2023 PIXEL01_70
2024 }
2025 PIXEL10_20
2026 PIXEL11_12
2027 break;
2028 }
2029 case 117:
2030 case 116:
2031 {
2032 PIXEL00_20
2033 PIXEL01_11
2034 PIXEL10_12
2035 if (Diff(w[6], w[8]))
2036 {
2037 PIXEL11_10
2038 }
2039 else
2040 {
2041 PIXEL11_70
2042 }
2043 break;
2044 }
2045 case 189:
2046 {
2047 PIXEL00_12
2048 PIXEL01_11
2049 PIXEL10_11
2050 PIXEL11_12
2051 break;
2052 }
2053 case 231:
2054 {
2055 PIXEL00_11
2056 PIXEL01_12
2057 PIXEL10_12
2058 PIXEL11_11
2059 break;
2060 }
2061 case 126:
2062 {
2063 PIXEL00_10
2064 if (Diff(w[2], w[6]))
2065 {
2066 PIXEL01_0
2067 }
2068 else
2069 {
2070 PIXEL01_20
2071 }
2072 if (Diff(w[8], w[4]))
2073 {
2074 PIXEL10_0
2075 }
2076 else
2077 {
2078 PIXEL10_20
2079 }
2080 PIXEL11_10
2081 break;
2082 }
2083 case 219:
2084 {
2085 if (Diff(w[4], w[2]))
2086 {
2087 PIXEL00_0
2088 }
2089 else
2090 {
2091 PIXEL00_20
2092 }
2093 PIXEL01_10
2094 PIXEL10_10
2095 if (Diff(w[6], w[8]))
2096 {
2097 PIXEL11_0
2098 }
2099 else
2100 {
2101 PIXEL11_20
2102 }
2103 break;
2104 }
2105 case 125:
2106 {
2107 if (Diff(w[8], w[4]))
2108 {
2109 PIXEL00_12
2110 PIXEL10_0
2111 }
2112 else
2113 {
2114 PIXEL00_61
2115 PIXEL10_90
2116 }
2117 PIXEL01_11
2118 PIXEL11_10
2119 break;
2120 }
2121 case 221:
2122 {
2123 PIXEL00_12
2124 if (Diff(w[6], w[8]))
2125 {
2126 PIXEL01_11
2127 PIXEL11_0
2128 }
2129 else
2130 {
2131 PIXEL01_60
2132 PIXEL11_90
2133 }
2134 PIXEL10_10
2135 break;
2136 }
2137 case 207:
2138 {
2139 if (Diff(w[4], w[2]))
2140 {
2141 PIXEL00_0
2142 PIXEL01_12
2143 }
2144 else
2145 {
2146 PIXEL00_90
2147 PIXEL01_61
2148 }
2149 PIXEL10_10
2150 PIXEL11_11
2151 break;
2152 }
2153 case 238:
2154 {
2155 PIXEL00_10
2156 PIXEL01_12
2157 if (Diff(w[8], w[4]))
2158 {
2159 PIXEL10_0
2160 PIXEL11_11
2161 }
2162 else
2163 {
2164 PIXEL10_90
2165 PIXEL11_60
2166 }
2167 break;
2168 }
2169 case 190:
2170 {
2171 PIXEL00_10
2172 if (Diff(w[2], w[6]))
2173 {
2174 PIXEL01_0
2175 PIXEL11_12
2176 }
2177 else
2178 {
2179 PIXEL01_90
2180 PIXEL11_61
2181 }
2182 PIXEL10_11
2183 break;
2184 }
2185 case 187:
2186 {
2187 if (Diff(w[4], w[2]))
2188 {
2189 PIXEL00_0
2190 PIXEL10_11
2191 }
2192 else
2193 {
2194 PIXEL00_90
2195 PIXEL10_60
2196 }
2197 PIXEL01_10
2198 PIXEL11_12
2199 break;
2200 }
2201 case 243:
2202 {
2203 PIXEL00_11
2204 PIXEL01_10
2205 if (Diff(w[6], w[8]))
2206 {
2207 PIXEL10_12
2208 PIXEL11_0
2209 }
2210 else
2211 {
2212 PIXEL10_61
2213 PIXEL11_90
2214 }
2215 break;
2216 }
2217 case 119:
2218 {
2219 if (Diff(w[2], w[6]))
2220 {
2221 PIXEL00_11
2222 PIXEL01_0
2223 }
2224 else
2225 {
2226 PIXEL00_60
2227 PIXEL01_90
2228 }
2229 PIXEL10_12
2230 PIXEL11_10
2231 break;
2232 }
2233 case 237:
2234 case 233:
2235 {
2236 PIXEL00_12
2237 PIXEL01_20
2238 if (Diff(w[8], w[4]))
2239 {
2240 PIXEL10_0
2241 }
2242 else
2243 {
2244 PIXEL10_100
2245 }
2246 PIXEL11_11
2247 break;
2248 }
2249 case 175:
2250 case 47:
2251 {
2252 if (Diff(w[4], w[2]))
2253 {
2254 PIXEL00_0
2255 }
2256 else
2257 {
2258 PIXEL00_100
2259 }
2260 PIXEL01_12
2261 PIXEL10_11
2262 PIXEL11_20
2263 break;
2264 }
2265 case 183:
2266 case 151:
2267 {
2268 PIXEL00_11
2269 if (Diff(w[2], w[6]))
2270 {
2271 PIXEL01_0
2272 }
2273 else
2274 {
2275 PIXEL01_100
2276 }
2277 PIXEL10_20
2278 PIXEL11_12
2279 break;
2280 }
2281 case 245:
2282 case 244:
2283 {
2284 PIXEL00_20
2285 PIXEL01_11
2286 PIXEL10_12
2287 if (Diff(w[6], w[8]))
2288 {
2289 PIXEL11_0
2290 }
2291 else
2292 {
2293 PIXEL11_100
2294 }
2295 break;
2296 }
2297 case 250:
2298 {
2299 PIXEL00_10
2300 PIXEL01_10
2301 if (Diff(w[8], w[4]))
2302 {
2303 PIXEL10_0
2304 }
2305 else
2306 {
2307 PIXEL10_20
2308 }
2309 if (Diff(w[6], w[8]))
2310 {
2311 PIXEL11_0
2312 }
2313 else
2314 {
2315 PIXEL11_20
2316 }
2317 break;
2318 }
2319 case 123:
2320 {
2321 if (Diff(w[4], w[2]))
2322 {
2323 PIXEL00_0
2324 }
2325 else
2326 {
2327 PIXEL00_20
2328 }
2329 PIXEL01_10
2330 if (Diff(w[8], w[4]))
2331 {
2332 PIXEL10_0
2333 }
2334 else
2335 {
2336 PIXEL10_20
2337 }
2338 PIXEL11_10
2339 break;
2340 }
2341 case 95:
2342 {
2343 if (Diff(w[4], w[2]))
2344 {
2345 PIXEL00_0
2346 }
2347 else
2348 {
2349 PIXEL00_20
2350 }
2351 if (Diff(w[2], w[6]))
2352 {
2353 PIXEL01_0
2354 }
2355 else
2356 {
2357 PIXEL01_20
2358 }
2359 PIXEL10_10
2360 PIXEL11_10
2361 break;
2362 }
2363 case 222:
2364 {
2365 PIXEL00_10
2366 if (Diff(w[2], w[6]))
2367 {
2368 PIXEL01_0
2369 }
2370 else
2371 {
2372 PIXEL01_20
2373 }
2374 PIXEL10_10
2375 if (Diff(w[6], w[8]))
2376 {
2377 PIXEL11_0
2378 }
2379 else
2380 {
2381 PIXEL11_20
2382 }
2383 break;
2384 }
2385 case 252:
2386 {
2387 PIXEL00_21
2388 PIXEL01_11
2389 if (Diff(w[8], w[4]))
2390 {
2391 PIXEL10_0
2392 }
2393 else
2394 {
2395 PIXEL10_20
2396 }
2397 if (Diff(w[6], w[8]))
2398 {
2399 PIXEL11_0
2400 }
2401 else
2402 {
2403 PIXEL11_100
2404 }
2405 break;
2406 }
2407 case 249:
2408 {
2409 PIXEL00_12
2410 PIXEL01_22
2411 if (Diff(w[8], w[4]))
2412 {
2413 PIXEL10_0
2414 }
2415 else
2416 {
2417 PIXEL10_100
2418 }
2419 if (Diff(w[6], w[8]))
2420 {
2421 PIXEL11_0
2422 }
2423 else
2424 {
2425 PIXEL11_20
2426 }
2427 break;
2428 }
2429 case 235:
2430 {
2431 if (Diff(w[4], w[2]))
2432 {
2433 PIXEL00_0
2434 }
2435 else
2436 {
2437 PIXEL00_20
2438 }
2439 PIXEL01_21
2440 if (Diff(w[8], w[4]))
2441 {
2442 PIXEL10_0
2443 }
2444 else
2445 {
2446 PIXEL10_100
2447 }
2448 PIXEL11_11
2449 break;
2450 }
2451 case 111:
2452 {
2453 if (Diff(w[4], w[2]))
2454 {
2455 PIXEL00_0
2456 }
2457 else
2458 {
2459 PIXEL00_100
2460 }
2461 PIXEL01_12
2462 if (Diff(w[8], w[4]))
2463 {
2464 PIXEL10_0
2465 }
2466 else
2467 {
2468 PIXEL10_20
2469 }
2470 PIXEL11_22
2471 break;
2472 }
2473 case 63:
2474 {
2475 if (Diff(w[4], w[2]))
2476 {
2477 PIXEL00_0
2478 }
2479 else
2480 {
2481 PIXEL00_100
2482 }
2483 if (Diff(w[2], w[6]))
2484 {
2485 PIXEL01_0
2486 }
2487 else
2488 {
2489 PIXEL01_20
2490 }
2491 PIXEL10_11
2492 PIXEL11_21
2493 break;
2494 }
2495 case 159:
2496 {
2497 if (Diff(w[4], w[2]))
2498 {
2499 PIXEL00_0
2500 }
2501 else
2502 {
2503 PIXEL00_20
2504 }
2505 if (Diff(w[2], w[6]))
2506 {
2507 PIXEL01_0
2508 }
2509 else
2510 {
2511 PIXEL01_100
2512 }
2513 PIXEL10_22
2514 PIXEL11_12
2515 break;
2516 }
2517 case 215:
2518 {
2519 PIXEL00_11
2520 if (Diff(w[2], w[6]))
2521 {
2522 PIXEL01_0
2523 }
2524 else
2525 {
2526 PIXEL01_100
2527 }
2528 PIXEL10_21
2529 if (Diff(w[6], w[8]))
2530 {
2531 PIXEL11_0
2532 }
2533 else
2534 {
2535 PIXEL11_20
2536 }
2537 break;
2538 }
2539 case 246:
2540 {
2541 PIXEL00_22
2542 if (Diff(w[2], w[6]))
2543 {
2544 PIXEL01_0
2545 }
2546 else
2547 {
2548 PIXEL01_20
2549 }
2550 PIXEL10_12
2551 if (Diff(w[6], w[8]))
2552 {
2553 PIXEL11_0
2554 }
2555 else
2556 {
2557 PIXEL11_100
2558 }
2559 break;
2560 }
2561 case 254:
2562 {
2563 PIXEL00_10
2564 if (Diff(w[2], w[6]))
2565 {
2566 PIXEL01_0
2567 }
2568 else
2569 {
2570 PIXEL01_20
2571 }
2572 if (Diff(w[8], w[4]))
2573 {
2574 PIXEL10_0
2575 }
2576 else
2577 {
2578 PIXEL10_20
2579 }
2580 if (Diff(w[6], w[8]))
2581 {
2582 PIXEL11_0
2583 }
2584 else
2585 {
2586 PIXEL11_100
2587 }
2588 break;
2589 }
2590 case 253:
2591 {
2592 PIXEL00_12
2593 PIXEL01_11
2594 if (Diff(w[8], w[4]))
2595 {
2596 PIXEL10_0
2597 }
2598 else
2599 {
2600 PIXEL10_100
2601 }
2602 if (Diff(w[6], w[8]))
2603 {
2604 PIXEL11_0
2605 }
2606 else
2607 {
2608 PIXEL11_100
2609 }
2610 break;
2611 }
2612 case 251:
2613 {
2614 if (Diff(w[4], w[2]))
2615 {
2616 PIXEL00_0
2617 }
2618 else
2619 {
2620 PIXEL00_20
2621 }
2622 PIXEL01_10
2623 if (Diff(w[8], w[4]))
2624 {
2625 PIXEL10_0
2626 }
2627 else
2628 {
2629 PIXEL10_100
2630 }
2631 if (Diff(w[6], w[8]))
2632 {
2633 PIXEL11_0
2634 }
2635 else
2636 {
2637 PIXEL11_20
2638 }
2639 break;
2640 }
2641 case 239:
2642 {
2643 if (Diff(w[4], w[2]))
2644 {
2645 PIXEL00_0
2646 }
2647 else
2648 {
2649 PIXEL00_100
2650 }
2651 PIXEL01_12
2652 if (Diff(w[8], w[4]))
2653 {
2654 PIXEL10_0
2655 }
2656 else
2657 {
2658 PIXEL10_100
2659 }
2660 PIXEL11_11
2661 break;
2662 }
2663 case 127:
2664 {
2665 if (Diff(w[4], w[2]))
2666 {
2667 PIXEL00_0
2668 }
2669 else
2670 {
2671 PIXEL00_100
2672 }
2673 if (Diff(w[2], w[6]))
2674 {
2675 PIXEL01_0
2676 }
2677 else
2678 {
2679 PIXEL01_20
2680 }
2681 if (Diff(w[8], w[4]))
2682 {
2683 PIXEL10_0
2684 }
2685 else
2686 {
2687 PIXEL10_20
2688 }
2689 PIXEL11_10
2690 break;
2691 }
2692 case 191:
2693 {
2694 if (Diff(w[4], w[2]))
2695 {
2696 PIXEL00_0
2697 }
2698 else
2699 {
2700 PIXEL00_100
2701 }
2702 if (Diff(w[2], w[6]))
2703 {
2704 PIXEL01_0
2705 }
2706 else
2707 {
2708 PIXEL01_100
2709 }
2710 PIXEL10_11
2711 PIXEL11_12
2712 break;
2713 }
2714 case 223:
2715 {
2716 if (Diff(w[4], w[2]))
2717 {
2718 PIXEL00_0
2719 }
2720 else
2721 {
2722 PIXEL00_20
2723 }
2724 if (Diff(w[2], w[6]))
2725 {
2726 PIXEL01_0
2727 }
2728 else
2729 {
2730 PIXEL01_100
2731 }
2732 PIXEL10_10
2733 if (Diff(w[6], w[8]))
2734 {
2735 PIXEL11_0
2736 }
2737 else
2738 {
2739 PIXEL11_20
2740 }
2741 break;
2742 }
2743 case 247:
2744 {
2745 PIXEL00_11
2746 if (Diff(w[2], w[6]))
2747 {
2748 PIXEL01_0
2749 }
2750 else
2751 {
2752 PIXEL01_100
2753 }
2754 PIXEL10_12
2755 if (Diff(w[6], w[8]))
2756 {
2757 PIXEL11_0
2758 }
2759 else
2760 {
2761 PIXEL11_100
2762 }
2763 break;
2764 }
2765 case 255:
2766 {
2767 if (Diff(w[4], w[2]))
2768 {
2769 PIXEL00_0
2770 }
2771 else
2772 {
2773 PIXEL00_100
2774 }
2775 if (Diff(w[2], w[6]))
2776 {
2777 PIXEL01_0
2778 }
2779 else
2780 {
2781 PIXEL01_100
2782 }
2783 if (Diff(w[8], w[4]))
2784 {
2785 PIXEL10_0
2786 }
2787 else
2788 {
2789 PIXEL10_100
2790 }
2791 if (Diff(w[6], w[8]))
2792 {
2793 PIXEL11_0
2794 }
2795 else
2796 {
2797 PIXEL11_100
2798 }
2799 break;
2800 }
2801 }
2802 sp++;
2803 dp += 2;
2804 }
2805
2806 sRowP += srb;
2807 sp = (uint32_t *) sRowP;
2808
2809 dRowP += drb * 2;
2810 dp = (uint32_t *) dRowP;
2811 }
2812 }
2813