1 /*
2 * Copyright (C) 2003 Maxim Stepin ( maxst@hiend3d.com )
3 *
4 * Copyright (C) 2010 Cameron Zemek ( grom@zeminvaders.net)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21 #include <stdint.h>
22 #include "common.h"
23 #include "hqx.h"
24
25
26 #define PIXEL00_1M *dp = Interp1(w[5], w[1]);
27 #define PIXEL00_1U *dp = Interp1(w[5], w[2]);
28 #define PIXEL00_1L *dp = Interp1(w[5], w[4]);
29 #define PIXEL00_2 *dp = Interp2(w[5], w[4], w[2]);
30 #define PIXEL00_4 *dp = Interp4(w[5], w[4], w[2]);
31 #define PIXEL00_5 *dp = Interp5(w[4], w[2]);
32 #define PIXEL00_C *dp = w[5];
33
34 #define PIXEL01_1 *(dp+1) = Interp1(w[5], w[2]);
35 #define PIXEL01_3 *(dp+1) = Interp3(w[5], w[2]);
36 #define PIXEL01_6 *(dp+1) = Interp1(w[2], w[5]);
37 #define PIXEL01_C *(dp+1) = w[5];
38
39 #define PIXEL02_1M *(dp+2) = Interp1(w[5], w[3]);
40 #define PIXEL02_1U *(dp+2) = Interp1(w[5], w[2]);
41 #define PIXEL02_1R *(dp+2) = Interp1(w[5], w[6]);
42 #define PIXEL02_2 *(dp+2) = Interp2(w[5], w[2], w[6]);
43 #define PIXEL02_4 *(dp+2) = Interp4(w[5], w[2], w[6]);
44 #define PIXEL02_5 *(dp+2) = Interp5(w[2], w[6]);
45 #define PIXEL02_C *(dp+2) = w[5];
46
47 #define PIXEL10_1 *(dp+dpL) = Interp1(w[5], w[4]);
48 #define PIXEL10_3 *(dp+dpL) = Interp3(w[5], w[4]);
49 #define PIXEL10_6 *(dp+dpL) = Interp1(w[4], w[5]);
50 #define PIXEL10_C *(dp+dpL) = w[5];
51
52 #define PIXEL11 *(dp+dpL+1) = w[5];
53
54 #define PIXEL12_1 *(dp+dpL+2) = Interp1(w[5], w[6]);
55 #define PIXEL12_3 *(dp+dpL+2) = Interp3(w[5], w[6]);
56 #define PIXEL12_6 *(dp+dpL+2) = Interp1(w[6], w[5]);
57 #define PIXEL12_C *(dp+dpL+2) = w[5];
58
59 #define PIXEL20_1M *(dp+dpL+dpL) = Interp1(w[5], w[7]);
60 #define PIXEL20_1D *(dp+dpL+dpL) = Interp1(w[5], w[8]);
61 #define PIXEL20_1L *(dp+dpL+dpL) = Interp1(w[5], w[4]);
62 #define PIXEL20_2 *(dp+dpL+dpL) = Interp2(w[5], w[8], w[4]);
63 #define PIXEL20_4 *(dp+dpL+dpL) = Interp4(w[5], w[8], w[4]);
64 #define PIXEL20_5 *(dp+dpL+dpL) = Interp5(w[8], w[4]);
65 #define PIXEL20_C *(dp+dpL+dpL) = w[5];
66
67 #define PIXEL21_1 *(dp+dpL+dpL+1) = Interp1(w[5], w[8]);
68 #define PIXEL21_3 *(dp+dpL+dpL+1) = Interp3(w[5], w[8]);
69 #define PIXEL21_6 *(dp+dpL+dpL+1) = Interp1(w[8], w[5]);
70 #define PIXEL21_C *(dp+dpL+dpL+1) = w[5];
71
72 #define PIXEL22_1M *(dp+dpL+dpL+2) = Interp1(w[5], w[9]);
73 #define PIXEL22_1D *(dp+dpL+dpL+2) = Interp1(w[5], w[8]);
74 #define PIXEL22_1R *(dp+dpL+dpL+2) = Interp1(w[5], w[6]);
75 #define PIXEL22_2 *(dp+dpL+dpL+2) = Interp2(w[5], w[6], w[8]);
76 #define PIXEL22_4 *(dp+dpL+dpL+2) = Interp4(w[5], w[6], w[8]);
77 #define PIXEL22_5 *(dp+dpL+dpL+2) = Interp5(w[6], w[8]);
78 #define PIXEL22_C *(dp+dpL+dpL+2) = w[5];
79
hq3x_32_rb(uint32_t * sp,uint32_t srb,uint32_t * dp,uint32_t drb,int Xres,int Yres)80 HQX_API void HQX_CALLCONV hq3x_32_rb( uint32_t * sp, uint32_t srb, uint32_t * dp, uint32_t drb, int Xres, int Yres )
81 {
82 int i, j, k;
83 int prevline, nextline;
84 uint32_t w[10];
85 int dpL = (drb >> 2);
86 int spL = (srb >> 2);
87 uint8_t *sRowP = (uint8_t *) sp;
88 uint8_t *dRowP = (uint8_t *) dp;
89 uint32_t yuv1, yuv2;
90
91 // +----+----+----+
92 // | | | |
93 // | w1 | w2 | w3 |
94 // +----+----+----+
95 // | | | |
96 // | w4 | w5 | w6 |
97 // +----+----+----+
98 // | | | |
99 // | w7 | w8 | w9 |
100 // +----+----+----+
101
102 for (j=0; j<Yres; j++)
103 {
104 if (j>0) prevline = -spL; else prevline = 0;
105 if (j<Yres-1) nextline = spL; else nextline = 0;
106
107 for (i=0; i<Xres; i++)
108 {
109 w[2] = *(sp + prevline);
110 w[5] = *sp;
111 w[8] = *(sp + nextline);
112
113 if (i>0)
114 {
115 w[1] = *(sp + prevline - 1);
116 w[4] = *(sp - 1);
117 w[7] = *(sp + nextline - 1);
118 }
119 else
120 {
121 w[1] = w[2];
122 w[4] = w[5];
123 w[7] = w[8];
124 }
125
126 if (i<Xres-1)
127 {
128 w[3] = *(sp + prevline + 1);
129 w[6] = *(sp + 1);
130 w[9] = *(sp + nextline + 1);
131 }
132 else
133 {
134 w[3] = w[2];
135 w[6] = w[5];
136 w[9] = w[8];
137 }
138
139 int pattern = 0;
140 int flag = 1;
141
142 yuv1 = rgb_to_yuv(w[5]);
143
144 for (k=1; k<=9; k++)
145 {
146 if (k==5) continue;
147
148 if ( w[k] != w[5] )
149 {
150 yuv2 = rgb_to_yuv(w[k]);
151 if (yuv_diff(yuv1, yuv2))
152 pattern |= flag;
153 }
154 flag <<= 1;
155 }
156
157 switch (pattern)
158 {
159 case 0:
160 case 1:
161 case 4:
162 case 32:
163 case 128:
164 case 5:
165 case 132:
166 case 160:
167 case 33:
168 case 129:
169 case 36:
170 case 133:
171 case 164:
172 case 161:
173 case 37:
174 case 165:
175 {
176 PIXEL00_2
177 PIXEL01_1
178 PIXEL02_2
179 PIXEL10_1
180 PIXEL11
181 PIXEL12_1
182 PIXEL20_2
183 PIXEL21_1
184 PIXEL22_2
185 break;
186 }
187 case 2:
188 case 34:
189 case 130:
190 case 162:
191 {
192 PIXEL00_1M
193 PIXEL01_C
194 PIXEL02_1M
195 PIXEL10_1
196 PIXEL11
197 PIXEL12_1
198 PIXEL20_2
199 PIXEL21_1
200 PIXEL22_2
201 break;
202 }
203 case 16:
204 case 17:
205 case 48:
206 case 49:
207 {
208 PIXEL00_2
209 PIXEL01_1
210 PIXEL02_1M
211 PIXEL10_1
212 PIXEL11
213 PIXEL12_C
214 PIXEL20_2
215 PIXEL21_1
216 PIXEL22_1M
217 break;
218 }
219 case 64:
220 case 65:
221 case 68:
222 case 69:
223 {
224 PIXEL00_2
225 PIXEL01_1
226 PIXEL02_2
227 PIXEL10_1
228 PIXEL11
229 PIXEL12_1
230 PIXEL20_1M
231 PIXEL21_C
232 PIXEL22_1M
233 break;
234 }
235 case 8:
236 case 12:
237 case 136:
238 case 140:
239 {
240 PIXEL00_1M
241 PIXEL01_1
242 PIXEL02_2
243 PIXEL10_C
244 PIXEL11
245 PIXEL12_1
246 PIXEL20_1M
247 PIXEL21_1
248 PIXEL22_2
249 break;
250 }
251 case 3:
252 case 35:
253 case 131:
254 case 163:
255 {
256 PIXEL00_1L
257 PIXEL01_C
258 PIXEL02_1M
259 PIXEL10_1
260 PIXEL11
261 PIXEL12_1
262 PIXEL20_2
263 PIXEL21_1
264 PIXEL22_2
265 break;
266 }
267 case 6:
268 case 38:
269 case 134:
270 case 166:
271 {
272 PIXEL00_1M
273 PIXEL01_C
274 PIXEL02_1R
275 PIXEL10_1
276 PIXEL11
277 PIXEL12_1
278 PIXEL20_2
279 PIXEL21_1
280 PIXEL22_2
281 break;
282 }
283 case 20:
284 case 21:
285 case 52:
286 case 53:
287 {
288 PIXEL00_2
289 PIXEL01_1
290 PIXEL02_1U
291 PIXEL10_1
292 PIXEL11
293 PIXEL12_C
294 PIXEL20_2
295 PIXEL21_1
296 PIXEL22_1M
297 break;
298 }
299 case 144:
300 case 145:
301 case 176:
302 case 177:
303 {
304 PIXEL00_2
305 PIXEL01_1
306 PIXEL02_1M
307 PIXEL10_1
308 PIXEL11
309 PIXEL12_C
310 PIXEL20_2
311 PIXEL21_1
312 PIXEL22_1D
313 break;
314 }
315 case 192:
316 case 193:
317 case 196:
318 case 197:
319 {
320 PIXEL00_2
321 PIXEL01_1
322 PIXEL02_2
323 PIXEL10_1
324 PIXEL11
325 PIXEL12_1
326 PIXEL20_1M
327 PIXEL21_C
328 PIXEL22_1R
329 break;
330 }
331 case 96:
332 case 97:
333 case 100:
334 case 101:
335 {
336 PIXEL00_2
337 PIXEL01_1
338 PIXEL02_2
339 PIXEL10_1
340 PIXEL11
341 PIXEL12_1
342 PIXEL20_1L
343 PIXEL21_C
344 PIXEL22_1M
345 break;
346 }
347 case 40:
348 case 44:
349 case 168:
350 case 172:
351 {
352 PIXEL00_1M
353 PIXEL01_1
354 PIXEL02_2
355 PIXEL10_C
356 PIXEL11
357 PIXEL12_1
358 PIXEL20_1D
359 PIXEL21_1
360 PIXEL22_2
361 break;
362 }
363 case 9:
364 case 13:
365 case 137:
366 case 141:
367 {
368 PIXEL00_1U
369 PIXEL01_1
370 PIXEL02_2
371 PIXEL10_C
372 PIXEL11
373 PIXEL12_1
374 PIXEL20_1M
375 PIXEL21_1
376 PIXEL22_2
377 break;
378 }
379 case 18:
380 case 50:
381 {
382 PIXEL00_1M
383 if (Diff(w[2], w[6]))
384 {
385 PIXEL01_C
386 PIXEL02_1M
387 PIXEL12_C
388 }
389 else
390 {
391 PIXEL01_3
392 PIXEL02_4
393 PIXEL12_3
394 }
395 PIXEL10_1
396 PIXEL11
397 PIXEL20_2
398 PIXEL21_1
399 PIXEL22_1M
400 break;
401 }
402 case 80:
403 case 81:
404 {
405 PIXEL00_2
406 PIXEL01_1
407 PIXEL02_1M
408 PIXEL10_1
409 PIXEL11
410 PIXEL20_1M
411 if (Diff(w[6], w[8]))
412 {
413 PIXEL12_C
414 PIXEL21_C
415 PIXEL22_1M
416 }
417 else
418 {
419 PIXEL12_3
420 PIXEL21_3
421 PIXEL22_4
422 }
423 break;
424 }
425 case 72:
426 case 76:
427 {
428 PIXEL00_1M
429 PIXEL01_1
430 PIXEL02_2
431 PIXEL11
432 PIXEL12_1
433 if (Diff(w[8], w[4]))
434 {
435 PIXEL10_C
436 PIXEL20_1M
437 PIXEL21_C
438 }
439 else
440 {
441 PIXEL10_3
442 PIXEL20_4
443 PIXEL21_3
444 }
445 PIXEL22_1M
446 break;
447 }
448 case 10:
449 case 138:
450 {
451 if (Diff(w[4], w[2]))
452 {
453 PIXEL00_1M
454 PIXEL01_C
455 PIXEL10_C
456 }
457 else
458 {
459 PIXEL00_4
460 PIXEL01_3
461 PIXEL10_3
462 }
463 PIXEL02_1M
464 PIXEL11
465 PIXEL12_1
466 PIXEL20_1M
467 PIXEL21_1
468 PIXEL22_2
469 break;
470 }
471 case 66:
472 {
473 PIXEL00_1M
474 PIXEL01_C
475 PIXEL02_1M
476 PIXEL10_1
477 PIXEL11
478 PIXEL12_1
479 PIXEL20_1M
480 PIXEL21_C
481 PIXEL22_1M
482 break;
483 }
484 case 24:
485 {
486 PIXEL00_1M
487 PIXEL01_1
488 PIXEL02_1M
489 PIXEL10_C
490 PIXEL11
491 PIXEL12_C
492 PIXEL20_1M
493 PIXEL21_1
494 PIXEL22_1M
495 break;
496 }
497 case 7:
498 case 39:
499 case 135:
500 {
501 PIXEL00_1L
502 PIXEL01_C
503 PIXEL02_1R
504 PIXEL10_1
505 PIXEL11
506 PIXEL12_1
507 PIXEL20_2
508 PIXEL21_1
509 PIXEL22_2
510 break;
511 }
512 case 148:
513 case 149:
514 case 180:
515 {
516 PIXEL00_2
517 PIXEL01_1
518 PIXEL02_1U
519 PIXEL10_1
520 PIXEL11
521 PIXEL12_C
522 PIXEL20_2
523 PIXEL21_1
524 PIXEL22_1D
525 break;
526 }
527 case 224:
528 case 228:
529 case 225:
530 {
531 PIXEL00_2
532 PIXEL01_1
533 PIXEL02_2
534 PIXEL10_1
535 PIXEL11
536 PIXEL12_1
537 PIXEL20_1L
538 PIXEL21_C
539 PIXEL22_1R
540 break;
541 }
542 case 41:
543 case 169:
544 case 45:
545 {
546 PIXEL00_1U
547 PIXEL01_1
548 PIXEL02_2
549 PIXEL10_C
550 PIXEL11
551 PIXEL12_1
552 PIXEL20_1D
553 PIXEL21_1
554 PIXEL22_2
555 break;
556 }
557 case 22:
558 case 54:
559 {
560 PIXEL00_1M
561 if (Diff(w[2], w[6]))
562 {
563 PIXEL01_C
564 PIXEL02_C
565 PIXEL12_C
566 }
567 else
568 {
569 PIXEL01_3
570 PIXEL02_4
571 PIXEL12_3
572 }
573 PIXEL10_1
574 PIXEL11
575 PIXEL20_2
576 PIXEL21_1
577 PIXEL22_1M
578 break;
579 }
580 case 208:
581 case 209:
582 {
583 PIXEL00_2
584 PIXEL01_1
585 PIXEL02_1M
586 PIXEL10_1
587 PIXEL11
588 PIXEL20_1M
589 if (Diff(w[6], w[8]))
590 {
591 PIXEL12_C
592 PIXEL21_C
593 PIXEL22_C
594 }
595 else
596 {
597 PIXEL12_3
598 PIXEL21_3
599 PIXEL22_4
600 }
601 break;
602 }
603 case 104:
604 case 108:
605 {
606 PIXEL00_1M
607 PIXEL01_1
608 PIXEL02_2
609 PIXEL11
610 PIXEL12_1
611 if (Diff(w[8], w[4]))
612 {
613 PIXEL10_C
614 PIXEL20_C
615 PIXEL21_C
616 }
617 else
618 {
619 PIXEL10_3
620 PIXEL20_4
621 PIXEL21_3
622 }
623 PIXEL22_1M
624 break;
625 }
626 case 11:
627 case 139:
628 {
629 if (Diff(w[4], w[2]))
630 {
631 PIXEL00_C
632 PIXEL01_C
633 PIXEL10_C
634 }
635 else
636 {
637 PIXEL00_4
638 PIXEL01_3
639 PIXEL10_3
640 }
641 PIXEL02_1M
642 PIXEL11
643 PIXEL12_1
644 PIXEL20_1M
645 PIXEL21_1
646 PIXEL22_2
647 break;
648 }
649 case 19:
650 case 51:
651 {
652 if (Diff(w[2], w[6]))
653 {
654 PIXEL00_1L
655 PIXEL01_C
656 PIXEL02_1M
657 PIXEL12_C
658 }
659 else
660 {
661 PIXEL00_2
662 PIXEL01_6
663 PIXEL02_5
664 PIXEL12_1
665 }
666 PIXEL10_1
667 PIXEL11
668 PIXEL20_2
669 PIXEL21_1
670 PIXEL22_1M
671 break;
672 }
673 case 146:
674 case 178:
675 {
676 if (Diff(w[2], w[6]))
677 {
678 PIXEL01_C
679 PIXEL02_1M
680 PIXEL12_C
681 PIXEL22_1D
682 }
683 else
684 {
685 PIXEL01_1
686 PIXEL02_5
687 PIXEL12_6
688 PIXEL22_2
689 }
690 PIXEL00_1M
691 PIXEL10_1
692 PIXEL11
693 PIXEL20_2
694 PIXEL21_1
695 break;
696 }
697 case 84:
698 case 85:
699 {
700 if (Diff(w[6], w[8]))
701 {
702 PIXEL02_1U
703 PIXEL12_C
704 PIXEL21_C
705 PIXEL22_1M
706 }
707 else
708 {
709 PIXEL02_2
710 PIXEL12_6
711 PIXEL21_1
712 PIXEL22_5
713 }
714 PIXEL00_2
715 PIXEL01_1
716 PIXEL10_1
717 PIXEL11
718 PIXEL20_1M
719 break;
720 }
721 case 112:
722 case 113:
723 {
724 if (Diff(w[6], w[8]))
725 {
726 PIXEL12_C
727 PIXEL20_1L
728 PIXEL21_C
729 PIXEL22_1M
730 }
731 else
732 {
733 PIXEL12_1
734 PIXEL20_2
735 PIXEL21_6
736 PIXEL22_5
737 }
738 PIXEL00_2
739 PIXEL01_1
740 PIXEL02_1M
741 PIXEL10_1
742 PIXEL11
743 break;
744 }
745 case 200:
746 case 204:
747 {
748 if (Diff(w[8], w[4]))
749 {
750 PIXEL10_C
751 PIXEL20_1M
752 PIXEL21_C
753 PIXEL22_1R
754 }
755 else
756 {
757 PIXEL10_1
758 PIXEL20_5
759 PIXEL21_6
760 PIXEL22_2
761 }
762 PIXEL00_1M
763 PIXEL01_1
764 PIXEL02_2
765 PIXEL11
766 PIXEL12_1
767 break;
768 }
769 case 73:
770 case 77:
771 {
772 if (Diff(w[8], w[4]))
773 {
774 PIXEL00_1U
775 PIXEL10_C
776 PIXEL20_1M
777 PIXEL21_C
778 }
779 else
780 {
781 PIXEL00_2
782 PIXEL10_6
783 PIXEL20_5
784 PIXEL21_1
785 }
786 PIXEL01_1
787 PIXEL02_2
788 PIXEL11
789 PIXEL12_1
790 PIXEL22_1M
791 break;
792 }
793 case 42:
794 case 170:
795 {
796 if (Diff(w[4], w[2]))
797 {
798 PIXEL00_1M
799 PIXEL01_C
800 PIXEL10_C
801 PIXEL20_1D
802 }
803 else
804 {
805 PIXEL00_5
806 PIXEL01_1
807 PIXEL10_6
808 PIXEL20_2
809 }
810 PIXEL02_1M
811 PIXEL11
812 PIXEL12_1
813 PIXEL21_1
814 PIXEL22_2
815 break;
816 }
817 case 14:
818 case 142:
819 {
820 if (Diff(w[4], w[2]))
821 {
822 PIXEL00_1M
823 PIXEL01_C
824 PIXEL02_1R
825 PIXEL10_C
826 }
827 else
828 {
829 PIXEL00_5
830 PIXEL01_6
831 PIXEL02_2
832 PIXEL10_1
833 }
834 PIXEL11
835 PIXEL12_1
836 PIXEL20_1M
837 PIXEL21_1
838 PIXEL22_2
839 break;
840 }
841 case 67:
842 {
843 PIXEL00_1L
844 PIXEL01_C
845 PIXEL02_1M
846 PIXEL10_1
847 PIXEL11
848 PIXEL12_1
849 PIXEL20_1M
850 PIXEL21_C
851 PIXEL22_1M
852 break;
853 }
854 case 70:
855 {
856 PIXEL00_1M
857 PIXEL01_C
858 PIXEL02_1R
859 PIXEL10_1
860 PIXEL11
861 PIXEL12_1
862 PIXEL20_1M
863 PIXEL21_C
864 PIXEL22_1M
865 break;
866 }
867 case 28:
868 {
869 PIXEL00_1M
870 PIXEL01_1
871 PIXEL02_1U
872 PIXEL10_C
873 PIXEL11
874 PIXEL12_C
875 PIXEL20_1M
876 PIXEL21_1
877 PIXEL22_1M
878 break;
879 }
880 case 152:
881 {
882 PIXEL00_1M
883 PIXEL01_1
884 PIXEL02_1M
885 PIXEL10_C
886 PIXEL11
887 PIXEL12_C
888 PIXEL20_1M
889 PIXEL21_1
890 PIXEL22_1D
891 break;
892 }
893 case 194:
894 {
895 PIXEL00_1M
896 PIXEL01_C
897 PIXEL02_1M
898 PIXEL10_1
899 PIXEL11
900 PIXEL12_1
901 PIXEL20_1M
902 PIXEL21_C
903 PIXEL22_1R
904 break;
905 }
906 case 98:
907 {
908 PIXEL00_1M
909 PIXEL01_C
910 PIXEL02_1M
911 PIXEL10_1
912 PIXEL11
913 PIXEL12_1
914 PIXEL20_1L
915 PIXEL21_C
916 PIXEL22_1M
917 break;
918 }
919 case 56:
920 {
921 PIXEL00_1M
922 PIXEL01_1
923 PIXEL02_1M
924 PIXEL10_C
925 PIXEL11
926 PIXEL12_C
927 PIXEL20_1D
928 PIXEL21_1
929 PIXEL22_1M
930 break;
931 }
932 case 25:
933 {
934 PIXEL00_1U
935 PIXEL01_1
936 PIXEL02_1M
937 PIXEL10_C
938 PIXEL11
939 PIXEL12_C
940 PIXEL20_1M
941 PIXEL21_1
942 PIXEL22_1M
943 break;
944 }
945 case 26:
946 case 31:
947 {
948 if (Diff(w[4], w[2]))
949 {
950 PIXEL00_C
951 PIXEL10_C
952 }
953 else
954 {
955 PIXEL00_4
956 PIXEL10_3
957 }
958 PIXEL01_C
959 if (Diff(w[2], w[6]))
960 {
961 PIXEL02_C
962 PIXEL12_C
963 }
964 else
965 {
966 PIXEL02_4
967 PIXEL12_3
968 }
969 PIXEL11
970 PIXEL20_1M
971 PIXEL21_1
972 PIXEL22_1M
973 break;
974 }
975 case 82:
976 case 214:
977 {
978 PIXEL00_1M
979 if (Diff(w[2], w[6]))
980 {
981 PIXEL01_C
982 PIXEL02_C
983 }
984 else
985 {
986 PIXEL01_3
987 PIXEL02_4
988 }
989 PIXEL10_1
990 PIXEL11
991 PIXEL12_C
992 PIXEL20_1M
993 if (Diff(w[6], w[8]))
994 {
995 PIXEL21_C
996 PIXEL22_C
997 }
998 else
999 {
1000 PIXEL21_3
1001 PIXEL22_4
1002 }
1003 break;
1004 }
1005 case 88:
1006 case 248:
1007 {
1008 PIXEL00_1M
1009 PIXEL01_1
1010 PIXEL02_1M
1011 PIXEL11
1012 if (Diff(w[8], w[4]))
1013 {
1014 PIXEL10_C
1015 PIXEL20_C
1016 }
1017 else
1018 {
1019 PIXEL10_3
1020 PIXEL20_4
1021 }
1022 PIXEL21_C
1023 if (Diff(w[6], w[8]))
1024 {
1025 PIXEL12_C
1026 PIXEL22_C
1027 }
1028 else
1029 {
1030 PIXEL12_3
1031 PIXEL22_4
1032 }
1033 break;
1034 }
1035 case 74:
1036 case 107:
1037 {
1038 if (Diff(w[4], w[2]))
1039 {
1040 PIXEL00_C
1041 PIXEL01_C
1042 }
1043 else
1044 {
1045 PIXEL00_4
1046 PIXEL01_3
1047 }
1048 PIXEL02_1M
1049 PIXEL10_C
1050 PIXEL11
1051 PIXEL12_1
1052 if (Diff(w[8], w[4]))
1053 {
1054 PIXEL20_C
1055 PIXEL21_C
1056 }
1057 else
1058 {
1059 PIXEL20_4
1060 PIXEL21_3
1061 }
1062 PIXEL22_1M
1063 break;
1064 }
1065 case 27:
1066 {
1067 if (Diff(w[4], w[2]))
1068 {
1069 PIXEL00_C
1070 PIXEL01_C
1071 PIXEL10_C
1072 }
1073 else
1074 {
1075 PIXEL00_4
1076 PIXEL01_3
1077 PIXEL10_3
1078 }
1079 PIXEL02_1M
1080 PIXEL11
1081 PIXEL12_C
1082 PIXEL20_1M
1083 PIXEL21_1
1084 PIXEL22_1M
1085 break;
1086 }
1087 case 86:
1088 {
1089 PIXEL00_1M
1090 if (Diff(w[2], w[6]))
1091 {
1092 PIXEL01_C
1093 PIXEL02_C
1094 PIXEL12_C
1095 }
1096 else
1097 {
1098 PIXEL01_3
1099 PIXEL02_4
1100 PIXEL12_3
1101 }
1102 PIXEL10_1
1103 PIXEL11
1104 PIXEL20_1M
1105 PIXEL21_C
1106 PIXEL22_1M
1107 break;
1108 }
1109 case 216:
1110 {
1111 PIXEL00_1M
1112 PIXEL01_1
1113 PIXEL02_1M
1114 PIXEL10_C
1115 PIXEL11
1116 PIXEL20_1M
1117 if (Diff(w[6], w[8]))
1118 {
1119 PIXEL12_C
1120 PIXEL21_C
1121 PIXEL22_C
1122 }
1123 else
1124 {
1125 PIXEL12_3
1126 PIXEL21_3
1127 PIXEL22_4
1128 }
1129 break;
1130 }
1131 case 106:
1132 {
1133 PIXEL00_1M
1134 PIXEL01_C
1135 PIXEL02_1M
1136 PIXEL11
1137 PIXEL12_1
1138 if (Diff(w[8], w[4]))
1139 {
1140 PIXEL10_C
1141 PIXEL20_C
1142 PIXEL21_C
1143 }
1144 else
1145 {
1146 PIXEL10_3
1147 PIXEL20_4
1148 PIXEL21_3
1149 }
1150 PIXEL22_1M
1151 break;
1152 }
1153 case 30:
1154 {
1155 PIXEL00_1M
1156 if (Diff(w[2], w[6]))
1157 {
1158 PIXEL01_C
1159 PIXEL02_C
1160 PIXEL12_C
1161 }
1162 else
1163 {
1164 PIXEL01_3
1165 PIXEL02_4
1166 PIXEL12_3
1167 }
1168 PIXEL10_C
1169 PIXEL11
1170 PIXEL20_1M
1171 PIXEL21_1
1172 PIXEL22_1M
1173 break;
1174 }
1175 case 210:
1176 {
1177 PIXEL00_1M
1178 PIXEL01_C
1179 PIXEL02_1M
1180 PIXEL10_1
1181 PIXEL11
1182 PIXEL20_1M
1183 if (Diff(w[6], w[8]))
1184 {
1185 PIXEL12_C
1186 PIXEL21_C
1187 PIXEL22_C
1188 }
1189 else
1190 {
1191 PIXEL12_3
1192 PIXEL21_3
1193 PIXEL22_4
1194 }
1195 break;
1196 }
1197 case 120:
1198 {
1199 PIXEL00_1M
1200 PIXEL01_1
1201 PIXEL02_1M
1202 PIXEL11
1203 PIXEL12_C
1204 if (Diff(w[8], w[4]))
1205 {
1206 PIXEL10_C
1207 PIXEL20_C
1208 PIXEL21_C
1209 }
1210 else
1211 {
1212 PIXEL10_3
1213 PIXEL20_4
1214 PIXEL21_3
1215 }
1216 PIXEL22_1M
1217 break;
1218 }
1219 case 75:
1220 {
1221 if (Diff(w[4], w[2]))
1222 {
1223 PIXEL00_C
1224 PIXEL01_C
1225 PIXEL10_C
1226 }
1227 else
1228 {
1229 PIXEL00_4
1230 PIXEL01_3
1231 PIXEL10_3
1232 }
1233 PIXEL02_1M
1234 PIXEL11
1235 PIXEL12_1
1236 PIXEL20_1M
1237 PIXEL21_C
1238 PIXEL22_1M
1239 break;
1240 }
1241 case 29:
1242 {
1243 PIXEL00_1U
1244 PIXEL01_1
1245 PIXEL02_1U
1246 PIXEL10_C
1247 PIXEL11
1248 PIXEL12_C
1249 PIXEL20_1M
1250 PIXEL21_1
1251 PIXEL22_1M
1252 break;
1253 }
1254 case 198:
1255 {
1256 PIXEL00_1M
1257 PIXEL01_C
1258 PIXEL02_1R
1259 PIXEL10_1
1260 PIXEL11
1261 PIXEL12_1
1262 PIXEL20_1M
1263 PIXEL21_C
1264 PIXEL22_1R
1265 break;
1266 }
1267 case 184:
1268 {
1269 PIXEL00_1M
1270 PIXEL01_1
1271 PIXEL02_1M
1272 PIXEL10_C
1273 PIXEL11
1274 PIXEL12_C
1275 PIXEL20_1D
1276 PIXEL21_1
1277 PIXEL22_1D
1278 break;
1279 }
1280 case 99:
1281 {
1282 PIXEL00_1L
1283 PIXEL01_C
1284 PIXEL02_1M
1285 PIXEL10_1
1286 PIXEL11
1287 PIXEL12_1
1288 PIXEL20_1L
1289 PIXEL21_C
1290 PIXEL22_1M
1291 break;
1292 }
1293 case 57:
1294 {
1295 PIXEL00_1U
1296 PIXEL01_1
1297 PIXEL02_1M
1298 PIXEL10_C
1299 PIXEL11
1300 PIXEL12_C
1301 PIXEL20_1D
1302 PIXEL21_1
1303 PIXEL22_1M
1304 break;
1305 }
1306 case 71:
1307 {
1308 PIXEL00_1L
1309 PIXEL01_C
1310 PIXEL02_1R
1311 PIXEL10_1
1312 PIXEL11
1313 PIXEL12_1
1314 PIXEL20_1M
1315 PIXEL21_C
1316 PIXEL22_1M
1317 break;
1318 }
1319 case 156:
1320 {
1321 PIXEL00_1M
1322 PIXEL01_1
1323 PIXEL02_1U
1324 PIXEL10_C
1325 PIXEL11
1326 PIXEL12_C
1327 PIXEL20_1M
1328 PIXEL21_1
1329 PIXEL22_1D
1330 break;
1331 }
1332 case 226:
1333 {
1334 PIXEL00_1M
1335 PIXEL01_C
1336 PIXEL02_1M
1337 PIXEL10_1
1338 PIXEL11
1339 PIXEL12_1
1340 PIXEL20_1L
1341 PIXEL21_C
1342 PIXEL22_1R
1343 break;
1344 }
1345 case 60:
1346 {
1347 PIXEL00_1M
1348 PIXEL01_1
1349 PIXEL02_1U
1350 PIXEL10_C
1351 PIXEL11
1352 PIXEL12_C
1353 PIXEL20_1D
1354 PIXEL21_1
1355 PIXEL22_1M
1356 break;
1357 }
1358 case 195:
1359 {
1360 PIXEL00_1L
1361 PIXEL01_C
1362 PIXEL02_1M
1363 PIXEL10_1
1364 PIXEL11
1365 PIXEL12_1
1366 PIXEL20_1M
1367 PIXEL21_C
1368 PIXEL22_1R
1369 break;
1370 }
1371 case 102:
1372 {
1373 PIXEL00_1M
1374 PIXEL01_C
1375 PIXEL02_1R
1376 PIXEL10_1
1377 PIXEL11
1378 PIXEL12_1
1379 PIXEL20_1L
1380 PIXEL21_C
1381 PIXEL22_1M
1382 break;
1383 }
1384 case 153:
1385 {
1386 PIXEL00_1U
1387 PIXEL01_1
1388 PIXEL02_1M
1389 PIXEL10_C
1390 PIXEL11
1391 PIXEL12_C
1392 PIXEL20_1M
1393 PIXEL21_1
1394 PIXEL22_1D
1395 break;
1396 }
1397 case 58:
1398 {
1399 if (Diff(w[4], w[2]))
1400 {
1401 PIXEL00_1M
1402 }
1403 else
1404 {
1405 PIXEL00_2
1406 }
1407 PIXEL01_C
1408 if (Diff(w[2], w[6]))
1409 {
1410 PIXEL02_1M
1411 }
1412 else
1413 {
1414 PIXEL02_2
1415 }
1416 PIXEL10_C
1417 PIXEL11
1418 PIXEL12_C
1419 PIXEL20_1D
1420 PIXEL21_1
1421 PIXEL22_1M
1422 break;
1423 }
1424 case 83:
1425 {
1426 PIXEL00_1L
1427 PIXEL01_C
1428 if (Diff(w[2], w[6]))
1429 {
1430 PIXEL02_1M
1431 }
1432 else
1433 {
1434 PIXEL02_2
1435 }
1436 PIXEL10_1
1437 PIXEL11
1438 PIXEL12_C
1439 PIXEL20_1M
1440 PIXEL21_C
1441 if (Diff(w[6], w[8]))
1442 {
1443 PIXEL22_1M
1444 }
1445 else
1446 {
1447 PIXEL22_2
1448 }
1449 break;
1450 }
1451 case 92:
1452 {
1453 PIXEL00_1M
1454 PIXEL01_1
1455 PIXEL02_1U
1456 PIXEL10_C
1457 PIXEL11
1458 PIXEL12_C
1459 if (Diff(w[8], w[4]))
1460 {
1461 PIXEL20_1M
1462 }
1463 else
1464 {
1465 PIXEL20_2
1466 }
1467 PIXEL21_C
1468 if (Diff(w[6], w[8]))
1469 {
1470 PIXEL22_1M
1471 }
1472 else
1473 {
1474 PIXEL22_2
1475 }
1476 break;
1477 }
1478 case 202:
1479 {
1480 if (Diff(w[4], w[2]))
1481 {
1482 PIXEL00_1M
1483 }
1484 else
1485 {
1486 PIXEL00_2
1487 }
1488 PIXEL01_C
1489 PIXEL02_1M
1490 PIXEL10_C
1491 PIXEL11
1492 PIXEL12_1
1493 if (Diff(w[8], w[4]))
1494 {
1495 PIXEL20_1M
1496 }
1497 else
1498 {
1499 PIXEL20_2
1500 }
1501 PIXEL21_C
1502 PIXEL22_1R
1503 break;
1504 }
1505 case 78:
1506 {
1507 if (Diff(w[4], w[2]))
1508 {
1509 PIXEL00_1M
1510 }
1511 else
1512 {
1513 PIXEL00_2
1514 }
1515 PIXEL01_C
1516 PIXEL02_1R
1517 PIXEL10_C
1518 PIXEL11
1519 PIXEL12_1
1520 if (Diff(w[8], w[4]))
1521 {
1522 PIXEL20_1M
1523 }
1524 else
1525 {
1526 PIXEL20_2
1527 }
1528 PIXEL21_C
1529 PIXEL22_1M
1530 break;
1531 }
1532 case 154:
1533 {
1534 if (Diff(w[4], w[2]))
1535 {
1536 PIXEL00_1M
1537 }
1538 else
1539 {
1540 PIXEL00_2
1541 }
1542 PIXEL01_C
1543 if (Diff(w[2], w[6]))
1544 {
1545 PIXEL02_1M
1546 }
1547 else
1548 {
1549 PIXEL02_2
1550 }
1551 PIXEL10_C
1552 PIXEL11
1553 PIXEL12_C
1554 PIXEL20_1M
1555 PIXEL21_1
1556 PIXEL22_1D
1557 break;
1558 }
1559 case 114:
1560 {
1561 PIXEL00_1M
1562 PIXEL01_C
1563 if (Diff(w[2], w[6]))
1564 {
1565 PIXEL02_1M
1566 }
1567 else
1568 {
1569 PIXEL02_2
1570 }
1571 PIXEL10_1
1572 PIXEL11
1573 PIXEL12_C
1574 PIXEL20_1L
1575 PIXEL21_C
1576 if (Diff(w[6], w[8]))
1577 {
1578 PIXEL22_1M
1579 }
1580 else
1581 {
1582 PIXEL22_2
1583 }
1584 break;
1585 }
1586 case 89:
1587 {
1588 PIXEL00_1U
1589 PIXEL01_1
1590 PIXEL02_1M
1591 PIXEL10_C
1592 PIXEL11
1593 PIXEL12_C
1594 if (Diff(w[8], w[4]))
1595 {
1596 PIXEL20_1M
1597 }
1598 else
1599 {
1600 PIXEL20_2
1601 }
1602 PIXEL21_C
1603 if (Diff(w[6], w[8]))
1604 {
1605 PIXEL22_1M
1606 }
1607 else
1608 {
1609 PIXEL22_2
1610 }
1611 break;
1612 }
1613 case 90:
1614 {
1615 if (Diff(w[4], w[2]))
1616 {
1617 PIXEL00_1M
1618 }
1619 else
1620 {
1621 PIXEL00_2
1622 }
1623 PIXEL01_C
1624 if (Diff(w[2], w[6]))
1625 {
1626 PIXEL02_1M
1627 }
1628 else
1629 {
1630 PIXEL02_2
1631 }
1632 PIXEL10_C
1633 PIXEL11
1634 PIXEL12_C
1635 if (Diff(w[8], w[4]))
1636 {
1637 PIXEL20_1M
1638 }
1639 else
1640 {
1641 PIXEL20_2
1642 }
1643 PIXEL21_C
1644 if (Diff(w[6], w[8]))
1645 {
1646 PIXEL22_1M
1647 }
1648 else
1649 {
1650 PIXEL22_2
1651 }
1652 break;
1653 }
1654 case 55:
1655 case 23:
1656 {
1657 if (Diff(w[2], w[6]))
1658 {
1659 PIXEL00_1L
1660 PIXEL01_C
1661 PIXEL02_C
1662 PIXEL12_C
1663 }
1664 else
1665 {
1666 PIXEL00_2
1667 PIXEL01_6
1668 PIXEL02_5
1669 PIXEL12_1
1670 }
1671 PIXEL10_1
1672 PIXEL11
1673 PIXEL20_2
1674 PIXEL21_1
1675 PIXEL22_1M
1676 break;
1677 }
1678 case 182:
1679 case 150:
1680 {
1681 if (Diff(w[2], w[6]))
1682 {
1683 PIXEL01_C
1684 PIXEL02_C
1685 PIXEL12_C
1686 PIXEL22_1D
1687 }
1688 else
1689 {
1690 PIXEL01_1
1691 PIXEL02_5
1692 PIXEL12_6
1693 PIXEL22_2
1694 }
1695 PIXEL00_1M
1696 PIXEL10_1
1697 PIXEL11
1698 PIXEL20_2
1699 PIXEL21_1
1700 break;
1701 }
1702 case 213:
1703 case 212:
1704 {
1705 if (Diff(w[6], w[8]))
1706 {
1707 PIXEL02_1U
1708 PIXEL12_C
1709 PIXEL21_C
1710 PIXEL22_C
1711 }
1712 else
1713 {
1714 PIXEL02_2
1715 PIXEL12_6
1716 PIXEL21_1
1717 PIXEL22_5
1718 }
1719 PIXEL00_2
1720 PIXEL01_1
1721 PIXEL10_1
1722 PIXEL11
1723 PIXEL20_1M
1724 break;
1725 }
1726 case 241:
1727 case 240:
1728 {
1729 if (Diff(w[6], w[8]))
1730 {
1731 PIXEL12_C
1732 PIXEL20_1L
1733 PIXEL21_C
1734 PIXEL22_C
1735 }
1736 else
1737 {
1738 PIXEL12_1
1739 PIXEL20_2
1740 PIXEL21_6
1741 PIXEL22_5
1742 }
1743 PIXEL00_2
1744 PIXEL01_1
1745 PIXEL02_1M
1746 PIXEL10_1
1747 PIXEL11
1748 break;
1749 }
1750 case 236:
1751 case 232:
1752 {
1753 if (Diff(w[8], w[4]))
1754 {
1755 PIXEL10_C
1756 PIXEL20_C
1757 PIXEL21_C
1758 PIXEL22_1R
1759 }
1760 else
1761 {
1762 PIXEL10_1
1763 PIXEL20_5
1764 PIXEL21_6
1765 PIXEL22_2
1766 }
1767 PIXEL00_1M
1768 PIXEL01_1
1769 PIXEL02_2
1770 PIXEL11
1771 PIXEL12_1
1772 break;
1773 }
1774 case 109:
1775 case 105:
1776 {
1777 if (Diff(w[8], w[4]))
1778 {
1779 PIXEL00_1U
1780 PIXEL10_C
1781 PIXEL20_C
1782 PIXEL21_C
1783 }
1784 else
1785 {
1786 PIXEL00_2
1787 PIXEL10_6
1788 PIXEL20_5
1789 PIXEL21_1
1790 }
1791 PIXEL01_1
1792 PIXEL02_2
1793 PIXEL11
1794 PIXEL12_1
1795 PIXEL22_1M
1796 break;
1797 }
1798 case 171:
1799 case 43:
1800 {
1801 if (Diff(w[4], w[2]))
1802 {
1803 PIXEL00_C
1804 PIXEL01_C
1805 PIXEL10_C
1806 PIXEL20_1D
1807 }
1808 else
1809 {
1810 PIXEL00_5
1811 PIXEL01_1
1812 PIXEL10_6
1813 PIXEL20_2
1814 }
1815 PIXEL02_1M
1816 PIXEL11
1817 PIXEL12_1
1818 PIXEL21_1
1819 PIXEL22_2
1820 break;
1821 }
1822 case 143:
1823 case 15:
1824 {
1825 if (Diff(w[4], w[2]))
1826 {
1827 PIXEL00_C
1828 PIXEL01_C
1829 PIXEL02_1R
1830 PIXEL10_C
1831 }
1832 else
1833 {
1834 PIXEL00_5
1835 PIXEL01_6
1836 PIXEL02_2
1837 PIXEL10_1
1838 }
1839 PIXEL11
1840 PIXEL12_1
1841 PIXEL20_1M
1842 PIXEL21_1
1843 PIXEL22_2
1844 break;
1845 }
1846 case 124:
1847 {
1848 PIXEL00_1M
1849 PIXEL01_1
1850 PIXEL02_1U
1851 PIXEL11
1852 PIXEL12_C
1853 if (Diff(w[8], w[4]))
1854 {
1855 PIXEL10_C
1856 PIXEL20_C
1857 PIXEL21_C
1858 }
1859 else
1860 {
1861 PIXEL10_3
1862 PIXEL20_4
1863 PIXEL21_3
1864 }
1865 PIXEL22_1M
1866 break;
1867 }
1868 case 203:
1869 {
1870 if (Diff(w[4], w[2]))
1871 {
1872 PIXEL00_C
1873 PIXEL01_C
1874 PIXEL10_C
1875 }
1876 else
1877 {
1878 PIXEL00_4
1879 PIXEL01_3
1880 PIXEL10_3
1881 }
1882 PIXEL02_1M
1883 PIXEL11
1884 PIXEL12_1
1885 PIXEL20_1M
1886 PIXEL21_C
1887 PIXEL22_1R
1888 break;
1889 }
1890 case 62:
1891 {
1892 PIXEL00_1M
1893 if (Diff(w[2], w[6]))
1894 {
1895 PIXEL01_C
1896 PIXEL02_C
1897 PIXEL12_C
1898 }
1899 else
1900 {
1901 PIXEL01_3
1902 PIXEL02_4
1903 PIXEL12_3
1904 }
1905 PIXEL10_C
1906 PIXEL11
1907 PIXEL20_1D
1908 PIXEL21_1
1909 PIXEL22_1M
1910 break;
1911 }
1912 case 211:
1913 {
1914 PIXEL00_1L
1915 PIXEL01_C
1916 PIXEL02_1M
1917 PIXEL10_1
1918 PIXEL11
1919 PIXEL20_1M
1920 if (Diff(w[6], w[8]))
1921 {
1922 PIXEL12_C
1923 PIXEL21_C
1924 PIXEL22_C
1925 }
1926 else
1927 {
1928 PIXEL12_3
1929 PIXEL21_3
1930 PIXEL22_4
1931 }
1932 break;
1933 }
1934 case 118:
1935 {
1936 PIXEL00_1M
1937 if (Diff(w[2], w[6]))
1938 {
1939 PIXEL01_C
1940 PIXEL02_C
1941 PIXEL12_C
1942 }
1943 else
1944 {
1945 PIXEL01_3
1946 PIXEL02_4
1947 PIXEL12_3
1948 }
1949 PIXEL10_1
1950 PIXEL11
1951 PIXEL20_1L
1952 PIXEL21_C
1953 PIXEL22_1M
1954 break;
1955 }
1956 case 217:
1957 {
1958 PIXEL00_1U
1959 PIXEL01_1
1960 PIXEL02_1M
1961 PIXEL10_C
1962 PIXEL11
1963 PIXEL20_1M
1964 if (Diff(w[6], w[8]))
1965 {
1966 PIXEL12_C
1967 PIXEL21_C
1968 PIXEL22_C
1969 }
1970 else
1971 {
1972 PIXEL12_3
1973 PIXEL21_3
1974 PIXEL22_4
1975 }
1976 break;
1977 }
1978 case 110:
1979 {
1980 PIXEL00_1M
1981 PIXEL01_C
1982 PIXEL02_1R
1983 PIXEL11
1984 PIXEL12_1
1985 if (Diff(w[8], w[4]))
1986 {
1987 PIXEL10_C
1988 PIXEL20_C
1989 PIXEL21_C
1990 }
1991 else
1992 {
1993 PIXEL10_3
1994 PIXEL20_4
1995 PIXEL21_3
1996 }
1997 PIXEL22_1M
1998 break;
1999 }
2000 case 155:
2001 {
2002 if (Diff(w[4], w[2]))
2003 {
2004 PIXEL00_C
2005 PIXEL01_C
2006 PIXEL10_C
2007 }
2008 else
2009 {
2010 PIXEL00_4
2011 PIXEL01_3
2012 PIXEL10_3
2013 }
2014 PIXEL02_1M
2015 PIXEL11
2016 PIXEL12_C
2017 PIXEL20_1M
2018 PIXEL21_1
2019 PIXEL22_1D
2020 break;
2021 }
2022 case 188:
2023 {
2024 PIXEL00_1M
2025 PIXEL01_1
2026 PIXEL02_1U
2027 PIXEL10_C
2028 PIXEL11
2029 PIXEL12_C
2030 PIXEL20_1D
2031 PIXEL21_1
2032 PIXEL22_1D
2033 break;
2034 }
2035 case 185:
2036 {
2037 PIXEL00_1U
2038 PIXEL01_1
2039 PIXEL02_1M
2040 PIXEL10_C
2041 PIXEL11
2042 PIXEL12_C
2043 PIXEL20_1D
2044 PIXEL21_1
2045 PIXEL22_1D
2046 break;
2047 }
2048 case 61:
2049 {
2050 PIXEL00_1U
2051 PIXEL01_1
2052 PIXEL02_1U
2053 PIXEL10_C
2054 PIXEL11
2055 PIXEL12_C
2056 PIXEL20_1D
2057 PIXEL21_1
2058 PIXEL22_1M
2059 break;
2060 }
2061 case 157:
2062 {
2063 PIXEL00_1U
2064 PIXEL01_1
2065 PIXEL02_1U
2066 PIXEL10_C
2067 PIXEL11
2068 PIXEL12_C
2069 PIXEL20_1M
2070 PIXEL21_1
2071 PIXEL22_1D
2072 break;
2073 }
2074 case 103:
2075 {
2076 PIXEL00_1L
2077 PIXEL01_C
2078 PIXEL02_1R
2079 PIXEL10_1
2080 PIXEL11
2081 PIXEL12_1
2082 PIXEL20_1L
2083 PIXEL21_C
2084 PIXEL22_1M
2085 break;
2086 }
2087 case 227:
2088 {
2089 PIXEL00_1L
2090 PIXEL01_C
2091 PIXEL02_1M
2092 PIXEL10_1
2093 PIXEL11
2094 PIXEL12_1
2095 PIXEL20_1L
2096 PIXEL21_C
2097 PIXEL22_1R
2098 break;
2099 }
2100 case 230:
2101 {
2102 PIXEL00_1M
2103 PIXEL01_C
2104 PIXEL02_1R
2105 PIXEL10_1
2106 PIXEL11
2107 PIXEL12_1
2108 PIXEL20_1L
2109 PIXEL21_C
2110 PIXEL22_1R
2111 break;
2112 }
2113 case 199:
2114 {
2115 PIXEL00_1L
2116 PIXEL01_C
2117 PIXEL02_1R
2118 PIXEL10_1
2119 PIXEL11
2120 PIXEL12_1
2121 PIXEL20_1M
2122 PIXEL21_C
2123 PIXEL22_1R
2124 break;
2125 }
2126 case 220:
2127 {
2128 PIXEL00_1M
2129 PIXEL01_1
2130 PIXEL02_1U
2131 PIXEL10_C
2132 PIXEL11
2133 if (Diff(w[8], w[4]))
2134 {
2135 PIXEL20_1M
2136 }
2137 else
2138 {
2139 PIXEL20_2
2140 }
2141 if (Diff(w[6], w[8]))
2142 {
2143 PIXEL12_C
2144 PIXEL21_C
2145 PIXEL22_C
2146 }
2147 else
2148 {
2149 PIXEL12_3
2150 PIXEL21_3
2151 PIXEL22_4
2152 }
2153 break;
2154 }
2155 case 158:
2156 {
2157 if (Diff(w[4], w[2]))
2158 {
2159 PIXEL00_1M
2160 }
2161 else
2162 {
2163 PIXEL00_2
2164 }
2165 if (Diff(w[2], w[6]))
2166 {
2167 PIXEL01_C
2168 PIXEL02_C
2169 PIXEL12_C
2170 }
2171 else
2172 {
2173 PIXEL01_3
2174 PIXEL02_4
2175 PIXEL12_3
2176 }
2177 PIXEL10_C
2178 PIXEL11
2179 PIXEL20_1M
2180 PIXEL21_1
2181 PIXEL22_1D
2182 break;
2183 }
2184 case 234:
2185 {
2186 if (Diff(w[4], w[2]))
2187 {
2188 PIXEL00_1M
2189 }
2190 else
2191 {
2192 PIXEL00_2
2193 }
2194 PIXEL01_C
2195 PIXEL02_1M
2196 PIXEL11
2197 PIXEL12_1
2198 if (Diff(w[8], w[4]))
2199 {
2200 PIXEL10_C
2201 PIXEL20_C
2202 PIXEL21_C
2203 }
2204 else
2205 {
2206 PIXEL10_3
2207 PIXEL20_4
2208 PIXEL21_3
2209 }
2210 PIXEL22_1R
2211 break;
2212 }
2213 case 242:
2214 {
2215 PIXEL00_1M
2216 PIXEL01_C
2217 if (Diff(w[2], w[6]))
2218 {
2219 PIXEL02_1M
2220 }
2221 else
2222 {
2223 PIXEL02_2
2224 }
2225 PIXEL10_1
2226 PIXEL11
2227 PIXEL20_1L
2228 if (Diff(w[6], w[8]))
2229 {
2230 PIXEL12_C
2231 PIXEL21_C
2232 PIXEL22_C
2233 }
2234 else
2235 {
2236 PIXEL12_3
2237 PIXEL21_3
2238 PIXEL22_4
2239 }
2240 break;
2241 }
2242 case 59:
2243 {
2244 if (Diff(w[4], w[2]))
2245 {
2246 PIXEL00_C
2247 PIXEL01_C
2248 PIXEL10_C
2249 }
2250 else
2251 {
2252 PIXEL00_4
2253 PIXEL01_3
2254 PIXEL10_3
2255 }
2256 if (Diff(w[2], w[6]))
2257 {
2258 PIXEL02_1M
2259 }
2260 else
2261 {
2262 PIXEL02_2
2263 }
2264 PIXEL11
2265 PIXEL12_C
2266 PIXEL20_1D
2267 PIXEL21_1
2268 PIXEL22_1M
2269 break;
2270 }
2271 case 121:
2272 {
2273 PIXEL00_1U
2274 PIXEL01_1
2275 PIXEL02_1M
2276 PIXEL11
2277 PIXEL12_C
2278 if (Diff(w[8], w[4]))
2279 {
2280 PIXEL10_C
2281 PIXEL20_C
2282 PIXEL21_C
2283 }
2284 else
2285 {
2286 PIXEL10_3
2287 PIXEL20_4
2288 PIXEL21_3
2289 }
2290 if (Diff(w[6], w[8]))
2291 {
2292 PIXEL22_1M
2293 }
2294 else
2295 {
2296 PIXEL22_2
2297 }
2298 break;
2299 }
2300 case 87:
2301 {
2302 PIXEL00_1L
2303 if (Diff(w[2], w[6]))
2304 {
2305 PIXEL01_C
2306 PIXEL02_C
2307 PIXEL12_C
2308 }
2309 else
2310 {
2311 PIXEL01_3
2312 PIXEL02_4
2313 PIXEL12_3
2314 }
2315 PIXEL10_1
2316 PIXEL11
2317 PIXEL20_1M
2318 PIXEL21_C
2319 if (Diff(w[6], w[8]))
2320 {
2321 PIXEL22_1M
2322 }
2323 else
2324 {
2325 PIXEL22_2
2326 }
2327 break;
2328 }
2329 case 79:
2330 {
2331 if (Diff(w[4], w[2]))
2332 {
2333 PIXEL00_C
2334 PIXEL01_C
2335 PIXEL10_C
2336 }
2337 else
2338 {
2339 PIXEL00_4
2340 PIXEL01_3
2341 PIXEL10_3
2342 }
2343 PIXEL02_1R
2344 PIXEL11
2345 PIXEL12_1
2346 if (Diff(w[8], w[4]))
2347 {
2348 PIXEL20_1M
2349 }
2350 else
2351 {
2352 PIXEL20_2
2353 }
2354 PIXEL21_C
2355 PIXEL22_1M
2356 break;
2357 }
2358 case 122:
2359 {
2360 if (Diff(w[4], w[2]))
2361 {
2362 PIXEL00_1M
2363 }
2364 else
2365 {
2366 PIXEL00_2
2367 }
2368 PIXEL01_C
2369 if (Diff(w[2], w[6]))
2370 {
2371 PIXEL02_1M
2372 }
2373 else
2374 {
2375 PIXEL02_2
2376 }
2377 PIXEL11
2378 PIXEL12_C
2379 if (Diff(w[8], w[4]))
2380 {
2381 PIXEL10_C
2382 PIXEL20_C
2383 PIXEL21_C
2384 }
2385 else
2386 {
2387 PIXEL10_3
2388 PIXEL20_4
2389 PIXEL21_3
2390 }
2391 if (Diff(w[6], w[8]))
2392 {
2393 PIXEL22_1M
2394 }
2395 else
2396 {
2397 PIXEL22_2
2398 }
2399 break;
2400 }
2401 case 94:
2402 {
2403 if (Diff(w[4], w[2]))
2404 {
2405 PIXEL00_1M
2406 }
2407 else
2408 {
2409 PIXEL00_2
2410 }
2411 if (Diff(w[2], w[6]))
2412 {
2413 PIXEL01_C
2414 PIXEL02_C
2415 PIXEL12_C
2416 }
2417 else
2418 {
2419 PIXEL01_3
2420 PIXEL02_4
2421 PIXEL12_3
2422 }
2423 PIXEL10_C
2424 PIXEL11
2425 if (Diff(w[8], w[4]))
2426 {
2427 PIXEL20_1M
2428 }
2429 else
2430 {
2431 PIXEL20_2
2432 }
2433 PIXEL21_C
2434 if (Diff(w[6], w[8]))
2435 {
2436 PIXEL22_1M
2437 }
2438 else
2439 {
2440 PIXEL22_2
2441 }
2442 break;
2443 }
2444 case 218:
2445 {
2446 if (Diff(w[4], w[2]))
2447 {
2448 PIXEL00_1M
2449 }
2450 else
2451 {
2452 PIXEL00_2
2453 }
2454 PIXEL01_C
2455 if (Diff(w[2], w[6]))
2456 {
2457 PIXEL02_1M
2458 }
2459 else
2460 {
2461 PIXEL02_2
2462 }
2463 PIXEL10_C
2464 PIXEL11
2465 if (Diff(w[8], w[4]))
2466 {
2467 PIXEL20_1M
2468 }
2469 else
2470 {
2471 PIXEL20_2
2472 }
2473 if (Diff(w[6], w[8]))
2474 {
2475 PIXEL12_C
2476 PIXEL21_C
2477 PIXEL22_C
2478 }
2479 else
2480 {
2481 PIXEL12_3
2482 PIXEL21_3
2483 PIXEL22_4
2484 }
2485 break;
2486 }
2487 case 91:
2488 {
2489 if (Diff(w[4], w[2]))
2490 {
2491 PIXEL00_C
2492 PIXEL01_C
2493 PIXEL10_C
2494 }
2495 else
2496 {
2497 PIXEL00_4
2498 PIXEL01_3
2499 PIXEL10_3
2500 }
2501 if (Diff(w[2], w[6]))
2502 {
2503 PIXEL02_1M
2504 }
2505 else
2506 {
2507 PIXEL02_2
2508 }
2509 PIXEL11
2510 PIXEL12_C
2511 if (Diff(w[8], w[4]))
2512 {
2513 PIXEL20_1M
2514 }
2515 else
2516 {
2517 PIXEL20_2
2518 }
2519 PIXEL21_C
2520 if (Diff(w[6], w[8]))
2521 {
2522 PIXEL22_1M
2523 }
2524 else
2525 {
2526 PIXEL22_2
2527 }
2528 break;
2529 }
2530 case 229:
2531 {
2532 PIXEL00_2
2533 PIXEL01_1
2534 PIXEL02_2
2535 PIXEL10_1
2536 PIXEL11
2537 PIXEL12_1
2538 PIXEL20_1L
2539 PIXEL21_C
2540 PIXEL22_1R
2541 break;
2542 }
2543 case 167:
2544 {
2545 PIXEL00_1L
2546 PIXEL01_C
2547 PIXEL02_1R
2548 PIXEL10_1
2549 PIXEL11
2550 PIXEL12_1
2551 PIXEL20_2
2552 PIXEL21_1
2553 PIXEL22_2
2554 break;
2555 }
2556 case 173:
2557 {
2558 PIXEL00_1U
2559 PIXEL01_1
2560 PIXEL02_2
2561 PIXEL10_C
2562 PIXEL11
2563 PIXEL12_1
2564 PIXEL20_1D
2565 PIXEL21_1
2566 PIXEL22_2
2567 break;
2568 }
2569 case 181:
2570 {
2571 PIXEL00_2
2572 PIXEL01_1
2573 PIXEL02_1U
2574 PIXEL10_1
2575 PIXEL11
2576 PIXEL12_C
2577 PIXEL20_2
2578 PIXEL21_1
2579 PIXEL22_1D
2580 break;
2581 }
2582 case 186:
2583 {
2584 if (Diff(w[4], w[2]))
2585 {
2586 PIXEL00_1M
2587 }
2588 else
2589 {
2590 PIXEL00_2
2591 }
2592 PIXEL01_C
2593 if (Diff(w[2], w[6]))
2594 {
2595 PIXEL02_1M
2596 }
2597 else
2598 {
2599 PIXEL02_2
2600 }
2601 PIXEL10_C
2602 PIXEL11
2603 PIXEL12_C
2604 PIXEL20_1D
2605 PIXEL21_1
2606 PIXEL22_1D
2607 break;
2608 }
2609 case 115:
2610 {
2611 PIXEL00_1L
2612 PIXEL01_C
2613 if (Diff(w[2], w[6]))
2614 {
2615 PIXEL02_1M
2616 }
2617 else
2618 {
2619 PIXEL02_2
2620 }
2621 PIXEL10_1
2622 PIXEL11
2623 PIXEL12_C
2624 PIXEL20_1L
2625 PIXEL21_C
2626 if (Diff(w[6], w[8]))
2627 {
2628 PIXEL22_1M
2629 }
2630 else
2631 {
2632 PIXEL22_2
2633 }
2634 break;
2635 }
2636 case 93:
2637 {
2638 PIXEL00_1U
2639 PIXEL01_1
2640 PIXEL02_1U
2641 PIXEL10_C
2642 PIXEL11
2643 PIXEL12_C
2644 if (Diff(w[8], w[4]))
2645 {
2646 PIXEL20_1M
2647 }
2648 else
2649 {
2650 PIXEL20_2
2651 }
2652 PIXEL21_C
2653 if (Diff(w[6], w[8]))
2654 {
2655 PIXEL22_1M
2656 }
2657 else
2658 {
2659 PIXEL22_2
2660 }
2661 break;
2662 }
2663 case 206:
2664 {
2665 if (Diff(w[4], w[2]))
2666 {
2667 PIXEL00_1M
2668 }
2669 else
2670 {
2671 PIXEL00_2
2672 }
2673 PIXEL01_C
2674 PIXEL02_1R
2675 PIXEL10_C
2676 PIXEL11
2677 PIXEL12_1
2678 if (Diff(w[8], w[4]))
2679 {
2680 PIXEL20_1M
2681 }
2682 else
2683 {
2684 PIXEL20_2
2685 }
2686 PIXEL21_C
2687 PIXEL22_1R
2688 break;
2689 }
2690 case 205:
2691 case 201:
2692 {
2693 PIXEL00_1U
2694 PIXEL01_1
2695 PIXEL02_2
2696 PIXEL10_C
2697 PIXEL11
2698 PIXEL12_1
2699 if (Diff(w[8], w[4]))
2700 {
2701 PIXEL20_1M
2702 }
2703 else
2704 {
2705 PIXEL20_2
2706 }
2707 PIXEL21_C
2708 PIXEL22_1R
2709 break;
2710 }
2711 case 174:
2712 case 46:
2713 {
2714 if (Diff(w[4], w[2]))
2715 {
2716 PIXEL00_1M
2717 }
2718 else
2719 {
2720 PIXEL00_2
2721 }
2722 PIXEL01_C
2723 PIXEL02_1R
2724 PIXEL10_C
2725 PIXEL11
2726 PIXEL12_1
2727 PIXEL20_1D
2728 PIXEL21_1
2729 PIXEL22_2
2730 break;
2731 }
2732 case 179:
2733 case 147:
2734 {
2735 PIXEL00_1L
2736 PIXEL01_C
2737 if (Diff(w[2], w[6]))
2738 {
2739 PIXEL02_1M
2740 }
2741 else
2742 {
2743 PIXEL02_2
2744 }
2745 PIXEL10_1
2746 PIXEL11
2747 PIXEL12_C
2748 PIXEL20_2
2749 PIXEL21_1
2750 PIXEL22_1D
2751 break;
2752 }
2753 case 117:
2754 case 116:
2755 {
2756 PIXEL00_2
2757 PIXEL01_1
2758 PIXEL02_1U
2759 PIXEL10_1
2760 PIXEL11
2761 PIXEL12_C
2762 PIXEL20_1L
2763 PIXEL21_C
2764 if (Diff(w[6], w[8]))
2765 {
2766 PIXEL22_1M
2767 }
2768 else
2769 {
2770 PIXEL22_2
2771 }
2772 break;
2773 }
2774 case 189:
2775 {
2776 PIXEL00_1U
2777 PIXEL01_1
2778 PIXEL02_1U
2779 PIXEL10_C
2780 PIXEL11
2781 PIXEL12_C
2782 PIXEL20_1D
2783 PIXEL21_1
2784 PIXEL22_1D
2785 break;
2786 }
2787 case 231:
2788 {
2789 PIXEL00_1L
2790 PIXEL01_C
2791 PIXEL02_1R
2792 PIXEL10_1
2793 PIXEL11
2794 PIXEL12_1
2795 PIXEL20_1L
2796 PIXEL21_C
2797 PIXEL22_1R
2798 break;
2799 }
2800 case 126:
2801 {
2802 PIXEL00_1M
2803 if (Diff(w[2], w[6]))
2804 {
2805 PIXEL01_C
2806 PIXEL02_C
2807 PIXEL12_C
2808 }
2809 else
2810 {
2811 PIXEL01_3
2812 PIXEL02_4
2813 PIXEL12_3
2814 }
2815 PIXEL11
2816 if (Diff(w[8], w[4]))
2817 {
2818 PIXEL10_C
2819 PIXEL20_C
2820 PIXEL21_C
2821 }
2822 else
2823 {
2824 PIXEL10_3
2825 PIXEL20_4
2826 PIXEL21_3
2827 }
2828 PIXEL22_1M
2829 break;
2830 }
2831 case 219:
2832 {
2833 if (Diff(w[4], w[2]))
2834 {
2835 PIXEL00_C
2836 PIXEL01_C
2837 PIXEL10_C
2838 }
2839 else
2840 {
2841 PIXEL00_4
2842 PIXEL01_3
2843 PIXEL10_3
2844 }
2845 PIXEL02_1M
2846 PIXEL11
2847 PIXEL20_1M
2848 if (Diff(w[6], w[8]))
2849 {
2850 PIXEL12_C
2851 PIXEL21_C
2852 PIXEL22_C
2853 }
2854 else
2855 {
2856 PIXEL12_3
2857 PIXEL21_3
2858 PIXEL22_4
2859 }
2860 break;
2861 }
2862 case 125:
2863 {
2864 if (Diff(w[8], w[4]))
2865 {
2866 PIXEL00_1U
2867 PIXEL10_C
2868 PIXEL20_C
2869 PIXEL21_C
2870 }
2871 else
2872 {
2873 PIXEL00_2
2874 PIXEL10_6
2875 PIXEL20_5
2876 PIXEL21_1
2877 }
2878 PIXEL01_1
2879 PIXEL02_1U
2880 PIXEL11
2881 PIXEL12_C
2882 PIXEL22_1M
2883 break;
2884 }
2885 case 221:
2886 {
2887 if (Diff(w[6], w[8]))
2888 {
2889 PIXEL02_1U
2890 PIXEL12_C
2891 PIXEL21_C
2892 PIXEL22_C
2893 }
2894 else
2895 {
2896 PIXEL02_2
2897 PIXEL12_6
2898 PIXEL21_1
2899 PIXEL22_5
2900 }
2901 PIXEL00_1U
2902 PIXEL01_1
2903 PIXEL10_C
2904 PIXEL11
2905 PIXEL20_1M
2906 break;
2907 }
2908 case 207:
2909 {
2910 if (Diff(w[4], w[2]))
2911 {
2912 PIXEL00_C
2913 PIXEL01_C
2914 PIXEL02_1R
2915 PIXEL10_C
2916 }
2917 else
2918 {
2919 PIXEL00_5
2920 PIXEL01_6
2921 PIXEL02_2
2922 PIXEL10_1
2923 }
2924 PIXEL11
2925 PIXEL12_1
2926 PIXEL20_1M
2927 PIXEL21_C
2928 PIXEL22_1R
2929 break;
2930 }
2931 case 238:
2932 {
2933 if (Diff(w[8], w[4]))
2934 {
2935 PIXEL10_C
2936 PIXEL20_C
2937 PIXEL21_C
2938 PIXEL22_1R
2939 }
2940 else
2941 {
2942 PIXEL10_1
2943 PIXEL20_5
2944 PIXEL21_6
2945 PIXEL22_2
2946 }
2947 PIXEL00_1M
2948 PIXEL01_C
2949 PIXEL02_1R
2950 PIXEL11
2951 PIXEL12_1
2952 break;
2953 }
2954 case 190:
2955 {
2956 if (Diff(w[2], w[6]))
2957 {
2958 PIXEL01_C
2959 PIXEL02_C
2960 PIXEL12_C
2961 PIXEL22_1D
2962 }
2963 else
2964 {
2965 PIXEL01_1
2966 PIXEL02_5
2967 PIXEL12_6
2968 PIXEL22_2
2969 }
2970 PIXEL00_1M
2971 PIXEL10_C
2972 PIXEL11
2973 PIXEL20_1D
2974 PIXEL21_1
2975 break;
2976 }
2977 case 187:
2978 {
2979 if (Diff(w[4], w[2]))
2980 {
2981 PIXEL00_C
2982 PIXEL01_C
2983 PIXEL10_C
2984 PIXEL20_1D
2985 }
2986 else
2987 {
2988 PIXEL00_5
2989 PIXEL01_1
2990 PIXEL10_6
2991 PIXEL20_2
2992 }
2993 PIXEL02_1M
2994 PIXEL11
2995 PIXEL12_C
2996 PIXEL21_1
2997 PIXEL22_1D
2998 break;
2999 }
3000 case 243:
3001 {
3002 if (Diff(w[6], w[8]))
3003 {
3004 PIXEL12_C
3005 PIXEL20_1L
3006 PIXEL21_C
3007 PIXEL22_C
3008 }
3009 else
3010 {
3011 PIXEL12_1
3012 PIXEL20_2
3013 PIXEL21_6
3014 PIXEL22_5
3015 }
3016 PIXEL00_1L
3017 PIXEL01_C
3018 PIXEL02_1M
3019 PIXEL10_1
3020 PIXEL11
3021 break;
3022 }
3023 case 119:
3024 {
3025 if (Diff(w[2], w[6]))
3026 {
3027 PIXEL00_1L
3028 PIXEL01_C
3029 PIXEL02_C
3030 PIXEL12_C
3031 }
3032 else
3033 {
3034 PIXEL00_2
3035 PIXEL01_6
3036 PIXEL02_5
3037 PIXEL12_1
3038 }
3039 PIXEL10_1
3040 PIXEL11
3041 PIXEL20_1L
3042 PIXEL21_C
3043 PIXEL22_1M
3044 break;
3045 }
3046 case 237:
3047 case 233:
3048 {
3049 PIXEL00_1U
3050 PIXEL01_1
3051 PIXEL02_2
3052 PIXEL10_C
3053 PIXEL11
3054 PIXEL12_1
3055 if (Diff(w[8], w[4]))
3056 {
3057 PIXEL20_C
3058 }
3059 else
3060 {
3061 PIXEL20_2
3062 }
3063 PIXEL21_C
3064 PIXEL22_1R
3065 break;
3066 }
3067 case 175:
3068 case 47:
3069 {
3070 if (Diff(w[4], w[2]))
3071 {
3072 PIXEL00_C
3073 }
3074 else
3075 {
3076 PIXEL00_2
3077 }
3078 PIXEL01_C
3079 PIXEL02_1R
3080 PIXEL10_C
3081 PIXEL11
3082 PIXEL12_1
3083 PIXEL20_1D
3084 PIXEL21_1
3085 PIXEL22_2
3086 break;
3087 }
3088 case 183:
3089 case 151:
3090 {
3091 PIXEL00_1L
3092 PIXEL01_C
3093 if (Diff(w[2], w[6]))
3094 {
3095 PIXEL02_C
3096 }
3097 else
3098 {
3099 PIXEL02_2
3100 }
3101 PIXEL10_1
3102 PIXEL11
3103 PIXEL12_C
3104 PIXEL20_2
3105 PIXEL21_1
3106 PIXEL22_1D
3107 break;
3108 }
3109 case 245:
3110 case 244:
3111 {
3112 PIXEL00_2
3113 PIXEL01_1
3114 PIXEL02_1U
3115 PIXEL10_1
3116 PIXEL11
3117 PIXEL12_C
3118 PIXEL20_1L
3119 PIXEL21_C
3120 if (Diff(w[6], w[8]))
3121 {
3122 PIXEL22_C
3123 }
3124 else
3125 {
3126 PIXEL22_2
3127 }
3128 break;
3129 }
3130 case 250:
3131 {
3132 PIXEL00_1M
3133 PIXEL01_C
3134 PIXEL02_1M
3135 PIXEL11
3136 if (Diff(w[8], w[4]))
3137 {
3138 PIXEL10_C
3139 PIXEL20_C
3140 }
3141 else
3142 {
3143 PIXEL10_3
3144 PIXEL20_4
3145 }
3146 PIXEL21_C
3147 if (Diff(w[6], w[8]))
3148 {
3149 PIXEL12_C
3150 PIXEL22_C
3151 }
3152 else
3153 {
3154 PIXEL12_3
3155 PIXEL22_4
3156 }
3157 break;
3158 }
3159 case 123:
3160 {
3161 if (Diff(w[4], w[2]))
3162 {
3163 PIXEL00_C
3164 PIXEL01_C
3165 }
3166 else
3167 {
3168 PIXEL00_4
3169 PIXEL01_3
3170 }
3171 PIXEL02_1M
3172 PIXEL10_C
3173 PIXEL11
3174 PIXEL12_C
3175 if (Diff(w[8], w[4]))
3176 {
3177 PIXEL20_C
3178 PIXEL21_C
3179 }
3180 else
3181 {
3182 PIXEL20_4
3183 PIXEL21_3
3184 }
3185 PIXEL22_1M
3186 break;
3187 }
3188 case 95:
3189 {
3190 if (Diff(w[4], w[2]))
3191 {
3192 PIXEL00_C
3193 PIXEL10_C
3194 }
3195 else
3196 {
3197 PIXEL00_4
3198 PIXEL10_3
3199 }
3200 PIXEL01_C
3201 if (Diff(w[2], w[6]))
3202 {
3203 PIXEL02_C
3204 PIXEL12_C
3205 }
3206 else
3207 {
3208 PIXEL02_4
3209 PIXEL12_3
3210 }
3211 PIXEL11
3212 PIXEL20_1M
3213 PIXEL21_C
3214 PIXEL22_1M
3215 break;
3216 }
3217 case 222:
3218 {
3219 PIXEL00_1M
3220 if (Diff(w[2], w[6]))
3221 {
3222 PIXEL01_C
3223 PIXEL02_C
3224 }
3225 else
3226 {
3227 PIXEL01_3
3228 PIXEL02_4
3229 }
3230 PIXEL10_C
3231 PIXEL11
3232 PIXEL12_C
3233 PIXEL20_1M
3234 if (Diff(w[6], w[8]))
3235 {
3236 PIXEL21_C
3237 PIXEL22_C
3238 }
3239 else
3240 {
3241 PIXEL21_3
3242 PIXEL22_4
3243 }
3244 break;
3245 }
3246 case 252:
3247 {
3248 PIXEL00_1M
3249 PIXEL01_1
3250 PIXEL02_1U
3251 PIXEL11
3252 PIXEL12_C
3253 if (Diff(w[8], w[4]))
3254 {
3255 PIXEL10_C
3256 PIXEL20_C
3257 }
3258 else
3259 {
3260 PIXEL10_3
3261 PIXEL20_4
3262 }
3263 PIXEL21_C
3264 if (Diff(w[6], w[8]))
3265 {
3266 PIXEL22_C
3267 }
3268 else
3269 {
3270 PIXEL22_2
3271 }
3272 break;
3273 }
3274 case 249:
3275 {
3276 PIXEL00_1U
3277 PIXEL01_1
3278 PIXEL02_1M
3279 PIXEL10_C
3280 PIXEL11
3281 if (Diff(w[8], w[4]))
3282 {
3283 PIXEL20_C
3284 }
3285 else
3286 {
3287 PIXEL20_2
3288 }
3289 PIXEL21_C
3290 if (Diff(w[6], w[8]))
3291 {
3292 PIXEL12_C
3293 PIXEL22_C
3294 }
3295 else
3296 {
3297 PIXEL12_3
3298 PIXEL22_4
3299 }
3300 break;
3301 }
3302 case 235:
3303 {
3304 if (Diff(w[4], w[2]))
3305 {
3306 PIXEL00_C
3307 PIXEL01_C
3308 }
3309 else
3310 {
3311 PIXEL00_4
3312 PIXEL01_3
3313 }
3314 PIXEL02_1M
3315 PIXEL10_C
3316 PIXEL11
3317 PIXEL12_1
3318 if (Diff(w[8], w[4]))
3319 {
3320 PIXEL20_C
3321 }
3322 else
3323 {
3324 PIXEL20_2
3325 }
3326 PIXEL21_C
3327 PIXEL22_1R
3328 break;
3329 }
3330 case 111:
3331 {
3332 if (Diff(w[4], w[2]))
3333 {
3334 PIXEL00_C
3335 }
3336 else
3337 {
3338 PIXEL00_2
3339 }
3340 PIXEL01_C
3341 PIXEL02_1R
3342 PIXEL10_C
3343 PIXEL11
3344 PIXEL12_1
3345 if (Diff(w[8], w[4]))
3346 {
3347 PIXEL20_C
3348 PIXEL21_C
3349 }
3350 else
3351 {
3352 PIXEL20_4
3353 PIXEL21_3
3354 }
3355 PIXEL22_1M
3356 break;
3357 }
3358 case 63:
3359 {
3360 if (Diff(w[4], w[2]))
3361 {
3362 PIXEL00_C
3363 }
3364 else
3365 {
3366 PIXEL00_2
3367 }
3368 PIXEL01_C
3369 if (Diff(w[2], w[6]))
3370 {
3371 PIXEL02_C
3372 PIXEL12_C
3373 }
3374 else
3375 {
3376 PIXEL02_4
3377 PIXEL12_3
3378 }
3379 PIXEL10_C
3380 PIXEL11
3381 PIXEL20_1D
3382 PIXEL21_1
3383 PIXEL22_1M
3384 break;
3385 }
3386 case 159:
3387 {
3388 if (Diff(w[4], w[2]))
3389 {
3390 PIXEL00_C
3391 PIXEL10_C
3392 }
3393 else
3394 {
3395 PIXEL00_4
3396 PIXEL10_3
3397 }
3398 PIXEL01_C
3399 if (Diff(w[2], w[6]))
3400 {
3401 PIXEL02_C
3402 }
3403 else
3404 {
3405 PIXEL02_2
3406 }
3407 PIXEL11
3408 PIXEL12_C
3409 PIXEL20_1M
3410 PIXEL21_1
3411 PIXEL22_1D
3412 break;
3413 }
3414 case 215:
3415 {
3416 PIXEL00_1L
3417 PIXEL01_C
3418 if (Diff(w[2], w[6]))
3419 {
3420 PIXEL02_C
3421 }
3422 else
3423 {
3424 PIXEL02_2
3425 }
3426 PIXEL10_1
3427 PIXEL11
3428 PIXEL12_C
3429 PIXEL20_1M
3430 if (Diff(w[6], w[8]))
3431 {
3432 PIXEL21_C
3433 PIXEL22_C
3434 }
3435 else
3436 {
3437 PIXEL21_3
3438 PIXEL22_4
3439 }
3440 break;
3441 }
3442 case 246:
3443 {
3444 PIXEL00_1M
3445 if (Diff(w[2], w[6]))
3446 {
3447 PIXEL01_C
3448 PIXEL02_C
3449 }
3450 else
3451 {
3452 PIXEL01_3
3453 PIXEL02_4
3454 }
3455 PIXEL10_1
3456 PIXEL11
3457 PIXEL12_C
3458 PIXEL20_1L
3459 PIXEL21_C
3460 if (Diff(w[6], w[8]))
3461 {
3462 PIXEL22_C
3463 }
3464 else
3465 {
3466 PIXEL22_2
3467 }
3468 break;
3469 }
3470 case 254:
3471 {
3472 PIXEL00_1M
3473 if (Diff(w[2], w[6]))
3474 {
3475 PIXEL01_C
3476 PIXEL02_C
3477 }
3478 else
3479 {
3480 PIXEL01_3
3481 PIXEL02_4
3482 }
3483 PIXEL11
3484 if (Diff(w[8], w[4]))
3485 {
3486 PIXEL10_C
3487 PIXEL20_C
3488 }
3489 else
3490 {
3491 PIXEL10_3
3492 PIXEL20_4
3493 }
3494 if (Diff(w[6], w[8]))
3495 {
3496 PIXEL12_C
3497 PIXEL21_C
3498 PIXEL22_C
3499 }
3500 else
3501 {
3502 PIXEL12_3
3503 PIXEL21_3
3504 PIXEL22_2
3505 }
3506 break;
3507 }
3508 case 253:
3509 {
3510 PIXEL00_1U
3511 PIXEL01_1
3512 PIXEL02_1U
3513 PIXEL10_C
3514 PIXEL11
3515 PIXEL12_C
3516 if (Diff(w[8], w[4]))
3517 {
3518 PIXEL20_C
3519 }
3520 else
3521 {
3522 PIXEL20_2
3523 }
3524 PIXEL21_C
3525 if (Diff(w[6], w[8]))
3526 {
3527 PIXEL22_C
3528 }
3529 else
3530 {
3531 PIXEL22_2
3532 }
3533 break;
3534 }
3535 case 251:
3536 {
3537 if (Diff(w[4], w[2]))
3538 {
3539 PIXEL00_C
3540 PIXEL01_C
3541 }
3542 else
3543 {
3544 PIXEL00_4
3545 PIXEL01_3
3546 }
3547 PIXEL02_1M
3548 PIXEL11
3549 if (Diff(w[8], w[4]))
3550 {
3551 PIXEL10_C
3552 PIXEL20_C
3553 PIXEL21_C
3554 }
3555 else
3556 {
3557 PIXEL10_3
3558 PIXEL20_2
3559 PIXEL21_3
3560 }
3561 if (Diff(w[6], w[8]))
3562 {
3563 PIXEL12_C
3564 PIXEL22_C
3565 }
3566 else
3567 {
3568 PIXEL12_3
3569 PIXEL22_4
3570 }
3571 break;
3572 }
3573 case 239:
3574 {
3575 if (Diff(w[4], w[2]))
3576 {
3577 PIXEL00_C
3578 }
3579 else
3580 {
3581 PIXEL00_2
3582 }
3583 PIXEL01_C
3584 PIXEL02_1R
3585 PIXEL10_C
3586 PIXEL11
3587 PIXEL12_1
3588 if (Diff(w[8], w[4]))
3589 {
3590 PIXEL20_C
3591 }
3592 else
3593 {
3594 PIXEL20_2
3595 }
3596 PIXEL21_C
3597 PIXEL22_1R
3598 break;
3599 }
3600 case 127:
3601 {
3602 if (Diff(w[4], w[2]))
3603 {
3604 PIXEL00_C
3605 PIXEL01_C
3606 PIXEL10_C
3607 }
3608 else
3609 {
3610 PIXEL00_2
3611 PIXEL01_3
3612 PIXEL10_3
3613 }
3614 if (Diff(w[2], w[6]))
3615 {
3616 PIXEL02_C
3617 PIXEL12_C
3618 }
3619 else
3620 {
3621 PIXEL02_4
3622 PIXEL12_3
3623 }
3624 PIXEL11
3625 if (Diff(w[8], w[4]))
3626 {
3627 PIXEL20_C
3628 PIXEL21_C
3629 }
3630 else
3631 {
3632 PIXEL20_4
3633 PIXEL21_3
3634 }
3635 PIXEL22_1M
3636 break;
3637 }
3638 case 191:
3639 {
3640 if (Diff(w[4], w[2]))
3641 {
3642 PIXEL00_C
3643 }
3644 else
3645 {
3646 PIXEL00_2
3647 }
3648 PIXEL01_C
3649 if (Diff(w[2], w[6]))
3650 {
3651 PIXEL02_C
3652 }
3653 else
3654 {
3655 PIXEL02_2
3656 }
3657 PIXEL10_C
3658 PIXEL11
3659 PIXEL12_C
3660 PIXEL20_1D
3661 PIXEL21_1
3662 PIXEL22_1D
3663 break;
3664 }
3665 case 223:
3666 {
3667 if (Diff(w[4], w[2]))
3668 {
3669 PIXEL00_C
3670 PIXEL10_C
3671 }
3672 else
3673 {
3674 PIXEL00_4
3675 PIXEL10_3
3676 }
3677 if (Diff(w[2], w[6]))
3678 {
3679 PIXEL01_C
3680 PIXEL02_C
3681 PIXEL12_C
3682 }
3683 else
3684 {
3685 PIXEL01_3
3686 PIXEL02_2
3687 PIXEL12_3
3688 }
3689 PIXEL11
3690 PIXEL20_1M
3691 if (Diff(w[6], w[8]))
3692 {
3693 PIXEL21_C
3694 PIXEL22_C
3695 }
3696 else
3697 {
3698 PIXEL21_3
3699 PIXEL22_4
3700 }
3701 break;
3702 }
3703 case 247:
3704 {
3705 PIXEL00_1L
3706 PIXEL01_C
3707 if (Diff(w[2], w[6]))
3708 {
3709 PIXEL02_C
3710 }
3711 else
3712 {
3713 PIXEL02_2
3714 }
3715 PIXEL10_1
3716 PIXEL11
3717 PIXEL12_C
3718 PIXEL20_1L
3719 PIXEL21_C
3720 if (Diff(w[6], w[8]))
3721 {
3722 PIXEL22_C
3723 }
3724 else
3725 {
3726 PIXEL22_2
3727 }
3728 break;
3729 }
3730 case 255:
3731 {
3732 if (Diff(w[4], w[2]))
3733 {
3734 PIXEL00_C
3735 }
3736 else
3737 {
3738 PIXEL00_2
3739 }
3740 PIXEL01_C
3741 if (Diff(w[2], w[6]))
3742 {
3743 PIXEL02_C
3744 }
3745 else
3746 {
3747 PIXEL02_2
3748 }
3749 PIXEL10_C
3750 PIXEL11
3751 PIXEL12_C
3752 if (Diff(w[8], w[4]))
3753 {
3754 PIXEL20_C
3755 }
3756 else
3757 {
3758 PIXEL20_2
3759 }
3760 PIXEL21_C
3761 if (Diff(w[6], w[8]))
3762 {
3763 PIXEL22_C
3764 }
3765 else
3766 {
3767 PIXEL22_2
3768 }
3769 break;
3770 }
3771 }
3772 sp++;
3773 dp += 3;
3774 }
3775
3776 sRowP += srb;
3777 sp = (uint32_t *) sRowP;
3778
3779 dRowP += drb * 3;
3780 dp = (uint32_t *) dRowP;
3781 }
3782 }
3783
hq3x_32(uint32_t * sp,uint32_t * dp,int Xres,int Yres)3784 HQX_API void HQX_CALLCONV hq3x_32( uint32_t * sp, uint32_t * dp, int Xres, int Yres )
3785 {
3786 uint32_t rowBytesL = Xres * 4;
3787 hq3x_32_rb(sp, rowBytesL, dp, rowBytesL * 3, Xres, Yres);
3788 }
3789