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