1;hq2x filter
2;16bpp output
3;----------------------------------------------------------
4;Copyright (C) 2003 MaxSt ( maxst@hiend3d.com )
5;
6;This program is free software; you can redistribute it and/or
7;modify it under the terms of the GNU General Public License
8;as published by the Free Software Foundation; either
9;version 2 of the License, or (at your option) any later
10;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., 675 Mass Ave, Cambridge, MA 02139, USA.
20
21%include "macros.mac"
22
23EXTSYM LUT16to32
24EXTSYM RGBtoYUV
25
26SECTION .bss
27linesleft resd 1
28xcounter  resd 1
29cross     resd 1
30nextline  resd 1
31prevline  resd 1
32w1        resd 1
33w2        resd 1
34w3        resd 1
35w4        resd 1
36w5        resd 1
37w6        resd 1
38w7        resd 1
39w8        resd 1
40w9        resd 1
41
42SECTION .data
43
44reg_blank    dd  0,0
45const3       dd  0x00030003,0x00000003
46const5       dd  0x00050005,0x00000005
47const6       dd  0x00060006,0x00000006
48const14      dd  0x000E000E,0x0000000E
49threshold    dd  0x00300706,0x00000000
50zerolowbits  dd  0xF7DEF7DE
51moduloSrc    dd  0
52moduloDst    dd  0
53
54SECTION .text
55
56%macro TestDiff 2
57    xor     ecx,ecx
58    mov     edx,[%1]
59    cmp     edx,[%2]
60    je      %%fin
61    mov     ecx,[RGBtoYUV]
62    movd    mm1,[ecx+edx*4]
63    movq    mm5,mm1
64    mov     edx,[%2]
65    movd    mm2,[ecx+edx*4]
66    psubusb mm1,mm2
67    psubusb mm2,mm5
68    por     mm1,mm2
69    psubusb mm1,[threshold]
70    movd    ecx,mm1
71%%fin:
72%endmacro
73
74%macro DiffOrNot 4
75   TestDiff %1,%2
76   test ecx,ecx
77   jz   %%same
78   %3
79   jmp %%fin
80%%same:
81   %4
82%%fin
83%endmacro
84
85%macro DiffOrNot 6
86   TestDiff %1,%2
87   test ecx,ecx
88   jz   %%same
89   %3
90   %4
91   jmp %%fin
92%%same:
93   %5
94   %6
95%%fin
96%endmacro
97
98%macro DiffOrNot 8
99   TestDiff %1,%2
100   test ecx,ecx
101   jz   %%same
102   %3
103   %4
104   %5
105   jmp %%fin
106%%same:
107   %6
108   %7
109   %8
110%%fin
111%endmacro
112
113%macro DiffOrNot 10
114   TestDiff %1,%2
115   test ecx,ecx
116   jz %%same
117   %3
118   %4
119   %5
120   %6
121   jmp %%fin
122%%same:
123   %7
124   %8
125   %9
126   %10
127%%fin
128%endmacro
129
130%macro Interp1 3
131    mov edx,%2
132    mov ecx,%3
133    cmp edx,ecx
134    je  %%fin
135    and edx,[zerolowbits]
136    and ecx,[zerolowbits]
137    add ecx,edx
138    shr ecx,1
139    add ecx,0x0821
140    and ecx,[zerolowbits]
141    add edx,ecx
142    shr edx,1
143%%fin
144    mov %1,dx
145%endmacro
146
147%macro Interp2 4
148    mov edx,%3
149    mov ecx,%4
150    cmp edx,ecx
151    je  %%fin1
152    and edx,[zerolowbits]
153    and ecx,[zerolowbits]
154    add ecx,edx
155    shr ecx,1
156    add ecx,0x0821
157%%fin1
158    mov edx,%2
159    cmp edx,ecx
160    je  %%fin2
161    and ecx,[zerolowbits]
162    and edx,[zerolowbits]
163    add edx,ecx
164    shr edx,1
165%%fin2
166    mov %1,dx
167%endmacro
168
169%macro Interp5 3
170    mov edx,%2
171    mov ecx,%3
172    cmp edx,ecx
173    je  %%fin
174    and edx,[zerolowbits]
175    and ecx,[zerolowbits]
176    add edx,ecx
177    shr edx,1
178%%fin
179    mov %1,dx
180%endmacro
181
182%macro Interp6 3
183    mov        ecx, [LUT16to32]
184    movd       mm1, [ecx+eax*4]
185    mov        edx, %2
186    movd       mm2, [ecx+edx*4]
187    mov        edx, %3
188    movd       mm3, [ecx+edx*4]
189    punpcklbw  mm1, [reg_blank]
190    punpcklbw  mm2, [reg_blank]
191    punpcklbw  mm3, [reg_blank]
192    pmullw     mm1, [const5]
193    psllw      mm2, 1
194    paddw      mm1, mm3
195    paddw      mm1, mm2
196    psrlw      mm1, 5
197    packuswb   mm1, [reg_blank]
198    movd       edx, mm1
199    shl        dl,  2
200    shr        edx, 1
201    shl        dx,  3
202    shr        edx, 5
203    mov        %1,  dx
204%endmacro
205
206%macro Interp7 3
207    mov        ecx, [LUT16to32]
208    movd       mm1, [ecx+eax*4]
209    mov        edx, %2
210    movd       mm2, [ecx+edx*4]
211    mov        edx, %3
212    movd       mm3, [ecx+edx*4]
213    punpcklbw  mm1, [reg_blank]
214    punpcklbw  mm2, [reg_blank]
215    punpcklbw  mm3, [reg_blank]
216    pmullw     mm1, [const6]
217    paddw      mm2, mm3
218    paddw      mm1, mm2
219    psrlw      mm1, 5
220    packuswb   mm1, [reg_blank]
221    movd       edx, mm1
222    shl        dl,  2
223    shr        edx, 1
224    shl        dx,  3
225    shr        edx, 5
226    mov        %1,  dx
227%endmacro
228
229%macro Interp9 3
230    mov        ecx, [LUT16to32]
231    movd       mm1, [ecx+eax*4]
232    mov        edx, %2
233    movd       mm2, [ecx+edx*4]
234    mov        edx, %3
235    movd       mm3, [ecx+edx*4]
236    punpcklbw  mm1, [reg_blank]
237    punpcklbw  mm2, [reg_blank]
238    punpcklbw  mm3, [reg_blank]
239    psllw      mm1, 1
240    paddw      mm2, mm3
241    pmullw     mm2, [const3]
242    paddw      mm1, mm2
243    psrlw      mm1, 5
244    packuswb   mm1, [reg_blank]
245    movd       edx, mm1
246    shl        dl,  2
247    shr        edx, 1
248    shl        dx,  3
249    shr        edx, 5
250    mov        %1,  dx
251%endmacro
252
253%macro Interp10 3
254    mov        ecx, [LUT16to32]
255    movd       mm1, [ecx+eax*4]
256    mov        edx, %2
257    movd       mm2, [ecx+edx*4]
258    mov        edx, %3
259    movd       mm3, [ecx+edx*4]
260    punpcklbw  mm1, [reg_blank]
261    punpcklbw  mm2, [reg_blank]
262    punpcklbw  mm3, [reg_blank]
263    pmullw     mm1, [const14]
264    paddw      mm2, mm3
265    paddw      mm1, mm2
266    psrlw      mm1, 6
267    packuswb   mm1, [reg_blank]
268    movd       edx, mm1
269    shl        dl,  2
270    shr        edx, 1
271    shl        dx,  3
272    shr        edx, 5
273    mov        %1,  dx
274%endmacro
275
276%macro PIXEL00_0 0
277    mov [edi],ax
278%endmacro
279
280%macro PIXEL00_10 0
281    Interp1 [edi],eax,[w1]
282%endmacro
283
284%macro PIXEL00_11 0
285    Interp1 [edi],eax,[w4]
286%endmacro
287
288%macro PIXEL00_12 0
289    Interp1 [edi],eax,[w2]
290%endmacro
291
292%macro PIXEL00_20 0
293    Interp2 [edi],eax,[w4],[w2]
294%endmacro
295
296%macro PIXEL00_21 0
297    Interp2 [edi],eax,[w1],[w2]
298%endmacro
299
300%macro PIXEL00_22 0
301    Interp2 [edi],eax,[w1],[w4]
302%endmacro
303
304%macro PIXEL00_60 0
305    Interp6 [edi],[w2],[w4]
306%endmacro
307
308%macro PIXEL00_61 0
309    Interp6 [edi],[w4],[w2]
310%endmacro
311
312%macro PIXEL00_70 0
313    Interp7 [edi],[w4],[w2]
314%endmacro
315
316%macro PIXEL00_90 0
317    Interp9 [edi],[w4],[w2]
318%endmacro
319
320%macro PIXEL00_100 0
321    Interp10 [edi],[w4],[w2]
322%endmacro
323
324%macro PIXEL01_0 0
325    mov [edi+2],ax
326%endmacro
327
328%macro PIXEL01_10 0
329    Interp1 [edi+2],eax,[w3]
330%endmacro
331
332%macro PIXEL01_11 0
333    Interp1 [edi+2],eax,[w2]
334%endmacro
335
336%macro PIXEL01_12 0
337    Interp1 [edi+2],eax,[w6]
338%endmacro
339
340%macro PIXEL01_20 0
341    Interp2 [edi+2],eax,[w2],[w6]
342%endmacro
343
344%macro PIXEL01_21 0
345    Interp2 [edi+2],eax,[w3],[w6]
346%endmacro
347
348%macro PIXEL01_22 0
349    Interp2 [edi+2],eax,[w3],[w2]
350%endmacro
351
352%macro PIXEL01_60 0
353    Interp6 [edi+2],[w6],[w2]
354%endmacro
355
356%macro PIXEL01_61 0
357    Interp6 [edi+2],[w2],[w6]
358%endmacro
359
360%macro PIXEL01_70 0
361    Interp7 [edi+2],[w2],[w6]
362%endmacro
363
364%macro PIXEL01_90 0
365    Interp9 [edi+2],[w2],[w6]
366%endmacro
367
368%macro PIXEL01_100 0
369    Interp10 [edi+2],[w2],[w6]
370%endmacro
371
372%macro PIXEL10_0 0
373    mov [edi+ebx],ax
374%endmacro
375
376%macro PIXEL10_10 0
377    Interp1 [edi+ebx],eax,[w7]
378%endmacro
379
380%macro PIXEL10_11 0
381    Interp1 [edi+ebx],eax,[w8]
382%endmacro
383
384%macro PIXEL10_12 0
385    Interp1 [edi+ebx],eax,[w4]
386%endmacro
387
388%macro PIXEL10_20 0
389    Interp2 [edi+ebx],eax,[w8],[w4]
390%endmacro
391
392%macro PIXEL10_21 0
393    Interp2 [edi+ebx],eax,[w7],[w4]
394%endmacro
395
396%macro PIXEL10_22 0
397    Interp2 [edi+ebx],eax,[w7],[w8]
398%endmacro
399
400%macro PIXEL10_60 0
401    Interp6 [edi+ebx],[w4],[w8]
402%endmacro
403
404%macro PIXEL10_61 0
405    Interp6 [edi+ebx],[w8],[w4]
406%endmacro
407
408%macro PIXEL10_70 0
409    Interp7 [edi+ebx],[w8],[w4]
410%endmacro
411
412%macro PIXEL10_90 0
413    Interp9 [edi+ebx],[w8],[w4]
414%endmacro
415
416%macro PIXEL10_100 0
417    Interp10 [edi+ebx],[w8],[w4]
418%endmacro
419
420%macro PIXEL11_0 0
421    mov [edi+ebx+2],ax
422%endmacro
423
424%macro PIXEL11_10 0
425    Interp1 [edi+ebx+2],eax,[w9]
426%endmacro
427
428%macro PIXEL11_11 0
429    Interp1 [edi+ebx+2],eax,[w6]
430%endmacro
431
432%macro PIXEL11_12 0
433    Interp1 [edi+ebx+2],eax,[w8]
434%endmacro
435
436%macro PIXEL11_20 0
437    Interp2 [edi+ebx+2],eax,[w6],[w8]
438%endmacro
439
440%macro PIXEL11_21 0
441    Interp2 [edi+ebx+2],eax,[w9],[w8]
442%endmacro
443
444%macro PIXEL11_22 0
445    Interp2 [edi+ebx+2],eax,[w9],[w6]
446%endmacro
447
448%macro PIXEL11_60 0
449    Interp6 [edi+ebx+2],[w8],[w6]
450%endmacro
451
452%macro PIXEL11_61 0
453    Interp6 [edi+ebx+2],[w6],[w8]
454%endmacro
455
456%macro PIXEL11_70 0
457    Interp7 [edi+ebx+2],[w6],[w8]
458%endmacro
459
460%macro PIXEL11_90 0
461    Interp9 [edi+ebx+2],[w6],[w8]
462%endmacro
463
464%macro PIXEL11_100 0
465    Interp10 [edi+ebx+2],[w6],[w8]
466%endmacro
467
468inbuffer     equ 8
469outbuffer    equ 12
470Xres         equ 16
471Yres         equ 20
472srcPitch     equ 24
473dstPitch     equ 28
474
475NEWSYM Hq2x16MMX
476    push ebp
477    mov ebp,esp
478    pushad
479
480    mov     esi,[ebp+inbuffer]
481    mov     edi,[ebp+outbuffer]
482    mov     edx,[ebp+Yres]
483    mov     [linesleft],edx
484    mov     ecx,[ebp+Xres]
485    shl     ecx,1
486    mov     ebx,[ebp+dstPitch]
487    mov     dword[moduloDst],ebx
488    sub     dword[moduloDst],ecx
489    shl     dword[moduloDst],1
490    mov     ebx,[ebp+srcPitch]
491    mov     dword[nextline],ebx
492    mov     dword[moduloSrc],ebx
493    sub     dword[moduloSrc],ecx
494    neg     ebx
495    mov     dword[prevline],ebx
496.loopy
497    mov     ecx,[ebp+Xres]
498    mov     dword[xcounter],ecx
499.loopx
500    mov     ebx,[prevline]
501    movq    mm5,[esi+ebx-2]
502    movq    mm6,[esi-2]
503    mov     ebx,[nextline]
504    movq    mm7,[esi+ebx-2]
505    movd    eax,mm5
506    movzx   edx,ax
507    mov     [w1],edx
508    shr     eax,16
509    mov     [w2],eax
510    psrlq   mm5,32
511    movd    eax,mm5
512    movzx   edx,ax
513    mov     [w3],edx
514    movd    eax,mm6
515    movzx   edx,ax
516    mov     [w4],edx
517    shr     eax,16
518    mov     [w5],eax
519    psrlq   mm6,32
520    movd    eax,mm6
521    movzx   edx,ax
522    mov     [w6],edx
523    movd    eax,mm7
524    movzx   edx,ax
525    mov     [w7],edx
526    shr     eax,16
527    mov     [w8],eax
528    psrlq   mm7,32
529    movd    eax,mm7
530    movzx   edx,ax
531    mov     [w9],edx
532.flags
533    mov     ebx,[RGBtoYUV]
534    mov     eax,[w5]
535    xor     ecx,ecx
536    movd    mm5,[ebx+eax*4]
537    mov     dword[cross],0
538
539    mov     edx,[w2]
540    cmp     eax,edx
541    je      .noflag2
542    or      dword[cross],1
543    movq    mm1,mm5
544    movd    mm2,[ebx+edx*4]
545    psubusb mm1,mm2
546    psubusb mm2,mm5
547    por     mm1,mm2
548    psubusb mm1,[threshold]
549    movd    edx,mm1
550    test    edx,edx
551    jz      .noflag2
552    or      ecx,2
553.noflag2
554    mov     edx,[w4]
555    cmp     eax,edx
556    je      .noflag4
557    or      dword[cross],2
558    movq    mm1,mm5
559    movd    mm2,[ebx+edx*4]
560    psubusb mm1,mm2
561    psubusb mm2,mm5
562    por     mm1,mm2
563    psubusb mm1,[threshold]
564    movd    edx,mm1
565    test    edx,edx
566    jz      .noflag4
567    or      ecx,8
568.noflag4
569    mov     edx,[w6]
570    cmp     eax,edx
571    je      .noflag6
572    or      dword[cross],4
573    movq    mm1,mm5
574    movd    mm2,[ebx+edx*4]
575    psubusb mm1,mm2
576    psubusb mm2,mm5
577    por     mm1,mm2
578    psubusb mm1,[threshold]
579    movd    edx,mm1
580    test    edx,edx
581    jz      .noflag6
582    or      ecx,16
583.noflag6
584    mov     edx,[w8]
585    cmp     eax,edx
586    je      .noflag8
587    or      dword[cross],8
588    movq    mm1,mm5
589    movd    mm2,[ebx+edx*4]
590    psubusb mm1,mm2
591    psubusb mm2,mm5
592    por     mm1,mm2
593    psubusb mm1,[threshold]
594    movd    edx,mm1
595    test    edx,edx
596    jz      .noflag8
597    or      ecx,64
598.noflag8
599    test    ecx,ecx
600    jnz     .testflag1
601    mov     ecx,[cross]
602    mov     ebx,[ebp+dstPitch]
603    jmp     [FuncTable2+ecx*4]
604.testflag1
605    mov     edx,[w1]
606    cmp     eax,edx
607    je      .noflag1
608    movq    mm1,mm5
609    movd    mm2,[ebx+edx*4]
610    psubusb mm1,mm2
611    psubusb mm2,mm5
612    por     mm1,mm2
613    psubusb mm1,[threshold]
614    movd    edx,mm1
615    test    edx,edx
616    jz      .noflag1
617    or      ecx,1
618.noflag1
619    mov     edx,[w3]
620    cmp     eax,edx
621    je      .noflag3
622    movq    mm1,mm5
623    movd    mm2,[ebx+edx*4]
624    psubusb mm1,mm2
625    psubusb mm2,mm5
626    por     mm1,mm2
627    psubusb mm1,[threshold]
628    movd    edx,mm1
629    test    edx,edx
630    jz      .noflag3
631    or      ecx,4
632.noflag3
633    mov     edx,[w7]
634    cmp     eax,edx
635    je      .noflag7
636    movq    mm1,mm5
637    movd    mm2,[ebx+edx*4]
638    psubusb mm1,mm2
639    psubusb mm2,mm5
640    por     mm1,mm2
641    psubusb mm1,[threshold]
642    movd    edx,mm1
643    test    edx,edx
644    jz      .noflag7
645    or      ecx,32
646.noflag7
647    mov     edx,[w9]
648    cmp     eax,edx
649    je      .noflag9
650    movq    mm1,mm5
651    movd    mm2,[ebx+edx*4]
652    psubusb mm1,mm2
653    psubusb mm2,mm5
654    por     mm1,mm2
655    psubusb mm1,[threshold]
656    movd    edx,mm1
657    test    edx,edx
658    jz      .noflag9
659    or      ecx,128
660.noflag9
661    mov  ebx,[ebp+dstPitch]
662    jmp  [FuncTable+ecx*4]
663
664..@flag0
665..@flag1
666..@flag4
667..@flag32
668..@flag128
669..@flag5
670..@flag132
671..@flag160
672..@flag33
673..@flag129
674..@flag36
675..@flag133
676..@flag164
677..@flag161
678..@flag37
679..@flag165
680    PIXEL00_20
681    PIXEL01_20
682    PIXEL10_20
683    PIXEL11_20
684    jmp .loopx_end
685..@flag2
686..@flag34
687..@flag130
688..@flag162
689    PIXEL00_22
690    PIXEL01_21
691    PIXEL10_20
692    PIXEL11_20
693    jmp .loopx_end
694..@flag16
695..@flag17
696..@flag48
697..@flag49
698    PIXEL00_20
699    PIXEL01_22
700    PIXEL10_20
701    PIXEL11_21
702    jmp .loopx_end
703..@flag64
704..@flag65
705..@flag68
706..@flag69
707    PIXEL00_20
708    PIXEL01_20
709    PIXEL10_21
710    PIXEL11_22
711    jmp .loopx_end
712..@flag8
713..@flag12
714..@flag136
715..@flag140
716    PIXEL00_21
717    PIXEL01_20
718    PIXEL10_22
719    PIXEL11_20
720    jmp .loopx_end
721..@flag3
722..@flag35
723..@flag131
724..@flag163
725    PIXEL00_11
726    PIXEL01_21
727    PIXEL10_20
728    PIXEL11_20
729    jmp .loopx_end
730..@flag6
731..@flag38
732..@flag134
733..@flag166
734    PIXEL00_22
735    PIXEL01_12
736    PIXEL10_20
737    PIXEL11_20
738    jmp .loopx_end
739..@flag20
740..@flag21
741..@flag52
742..@flag53
743    PIXEL00_20
744    PIXEL01_11
745    PIXEL10_20
746    PIXEL11_21
747    jmp .loopx_end
748..@flag144
749..@flag145
750..@flag176
751..@flag177
752    PIXEL00_20
753    PIXEL01_22
754    PIXEL10_20
755    PIXEL11_12
756    jmp .loopx_end
757..@flag192
758..@flag193
759..@flag196
760..@flag197
761    PIXEL00_20
762    PIXEL01_20
763    PIXEL10_21
764    PIXEL11_11
765    jmp .loopx_end
766..@flag96
767..@flag97
768..@flag100
769..@flag101
770    PIXEL00_20
771    PIXEL01_20
772    PIXEL10_12
773    PIXEL11_22
774    jmp .loopx_end
775..@flag40
776..@flag44
777..@flag168
778..@flag172
779    PIXEL00_21
780    PIXEL01_20
781    PIXEL10_11
782    PIXEL11_20
783    jmp .loopx_end
784..@flag9
785..@flag13
786..@flag137
787..@flag141
788    PIXEL00_12
789    PIXEL01_20
790    PIXEL10_22
791    PIXEL11_20
792    jmp .loopx_end
793..@flag18
794..@flag50
795    PIXEL00_22
796    DiffOrNot w2,w6,PIXEL01_10,PIXEL01_20
797    PIXEL10_20
798    PIXEL11_21
799    jmp .loopx_end
800..@flag80
801..@flag81
802    PIXEL00_20
803    PIXEL01_22
804    PIXEL10_21
805    DiffOrNot w6,w8,PIXEL11_10,PIXEL11_20
806    jmp .loopx_end
807..@flag72
808..@flag76
809    PIXEL00_21
810    PIXEL01_20
811    DiffOrNot w8,w4,PIXEL10_10,PIXEL10_20
812    PIXEL11_22
813    jmp .loopx_end
814..@flag10
815..@flag138
816    DiffOrNot w4,w2,PIXEL00_10,PIXEL00_20
817    PIXEL01_21
818    PIXEL10_22
819    PIXEL11_20
820    jmp .loopx_end
821..@flag66
822    PIXEL00_22
823    PIXEL01_21
824    PIXEL10_21
825    PIXEL11_22
826    jmp .loopx_end
827..@flag24
828    PIXEL00_21
829    PIXEL01_22
830    PIXEL10_22
831    PIXEL11_21
832    jmp .loopx_end
833..@flag7
834..@flag39
835..@flag135
836    PIXEL00_11
837    PIXEL01_12
838    PIXEL10_20
839    PIXEL11_20
840    jmp .loopx_end
841..@flag148
842..@flag149
843..@flag180
844    PIXEL00_20
845    PIXEL01_11
846    PIXEL10_20
847    PIXEL11_12
848    jmp .loopx_end
849..@flag224
850..@flag228
851..@flag225
852    PIXEL00_20
853    PIXEL01_20
854    PIXEL10_12
855    PIXEL11_11
856    jmp .loopx_end
857..@flag41
858..@flag169
859..@flag45
860    PIXEL00_12
861    PIXEL01_20
862    PIXEL10_11
863    PIXEL11_20
864    jmp .loopx_end
865..@flag22
866..@flag54
867    PIXEL00_22
868    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20
869    PIXEL10_20
870    PIXEL11_21
871    jmp .loopx_end
872..@flag208
873..@flag209
874    PIXEL00_20
875    PIXEL01_22
876    PIXEL10_21
877    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20
878    jmp .loopx_end
879..@flag104
880..@flag108
881    PIXEL00_21
882    PIXEL01_20
883    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20
884    PIXEL11_22
885    jmp .loopx_end
886..@flag11
887..@flag139
888    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20
889    PIXEL01_21
890    PIXEL10_22
891    PIXEL11_20
892    jmp .loopx_end
893..@flag19
894..@flag51
895    DiffOrNot w2,w6,PIXEL00_11,PIXEL01_10,PIXEL00_60,PIXEL01_90
896    PIXEL10_20
897    PIXEL11_21
898    jmp .loopx_end
899..@flag146
900..@flag178
901    PIXEL00_22
902    DiffOrNot w2,w6,PIXEL01_10,PIXEL11_12,PIXEL01_90,PIXEL11_61
903    PIXEL10_20
904    jmp .loopx_end
905..@flag84
906..@flag85
907    PIXEL00_20
908    DiffOrNot w6,w8,PIXEL01_11,PIXEL11_10,PIXEL01_60,PIXEL11_90
909    PIXEL10_21
910    jmp .loopx_end
911..@flag112
912..@flag113
913    PIXEL00_20
914    PIXEL01_22
915    DiffOrNot w6,w8,PIXEL10_12,PIXEL11_10,PIXEL10_61,PIXEL11_90
916    jmp .loopx_end
917..@flag200
918..@flag204
919    PIXEL00_21
920    PIXEL01_20
921    DiffOrNot w8,w4,PIXEL10_10,PIXEL11_11,PIXEL10_90,PIXEL11_60
922    jmp .loopx_end
923..@flag73
924..@flag77
925    DiffOrNot w8,w4,PIXEL00_12,PIXEL10_10,PIXEL00_61,PIXEL10_90
926    PIXEL01_20
927    PIXEL11_22
928    jmp .loopx_end
929..@flag42
930..@flag170
931    DiffOrNot w4,w2,PIXEL00_10,PIXEL10_11,PIXEL00_90,PIXEL10_60
932    PIXEL01_21
933    PIXEL11_20
934    jmp .loopx_end
935..@flag14
936..@flag142
937    DiffOrNot w4,w2,PIXEL00_10,PIXEL01_12,PIXEL00_90,PIXEL01_61
938    PIXEL10_22
939    PIXEL11_20
940    jmp .loopx_end
941..@flag67
942    PIXEL00_11
943    PIXEL01_21
944    PIXEL10_21
945    PIXEL11_22
946    jmp .loopx_end
947..@flag70
948    PIXEL00_22
949    PIXEL01_12
950    PIXEL10_21
951    PIXEL11_22
952    jmp .loopx_end
953..@flag28
954    PIXEL00_21
955    PIXEL01_11
956    PIXEL10_22
957    PIXEL11_21
958    jmp .loopx_end
959..@flag152
960    PIXEL00_21
961    PIXEL01_22
962    PIXEL10_22
963    PIXEL11_12
964    jmp .loopx_end
965..@flag194
966    PIXEL00_22
967    PIXEL01_21
968    PIXEL10_21
969    PIXEL11_11
970    jmp .loopx_end
971..@flag98
972    PIXEL00_22
973    PIXEL01_21
974    PIXEL10_12
975    PIXEL11_22
976    jmp .loopx_end
977..@flag56
978    PIXEL00_21
979    PIXEL01_22
980    PIXEL10_11
981    PIXEL11_21
982    jmp .loopx_end
983..@flag25
984    PIXEL00_12
985    PIXEL01_22
986    PIXEL10_22
987    PIXEL11_21
988    jmp .loopx_end
989..@flag26
990..@flag31
991    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20
992    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20
993    PIXEL10_22
994    PIXEL11_21
995    jmp .loopx_end
996..@flag82
997..@flag214
998    PIXEL00_22
999    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20
1000    PIXEL10_21
1001    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20
1002    jmp .loopx_end
1003..@flag88
1004..@flag248
1005    PIXEL00_21
1006    PIXEL01_22
1007    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20
1008    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20
1009    jmp .loopx_end
1010..@flag74
1011..@flag107
1012    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20
1013    PIXEL01_21
1014    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20
1015    PIXEL11_22
1016    jmp .loopx_end
1017..@flag27
1018    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20
1019    PIXEL01_10
1020    PIXEL10_22
1021    PIXEL11_21
1022    jmp .loopx_end
1023..@flag86
1024    PIXEL00_22
1025    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20
1026    PIXEL10_21
1027    PIXEL11_10
1028    jmp .loopx_end
1029..@flag216
1030    PIXEL00_21
1031    PIXEL01_22
1032    PIXEL10_10
1033    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20
1034    jmp .loopx_end
1035..@flag106
1036    PIXEL00_10
1037    PIXEL01_21
1038    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20
1039    PIXEL11_22
1040    jmp .loopx_end
1041..@flag30
1042    PIXEL00_10
1043    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20
1044    PIXEL10_22
1045    PIXEL11_21
1046    jmp .loopx_end
1047..@flag210
1048    PIXEL00_22
1049    PIXEL01_10
1050    PIXEL10_21
1051    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20
1052    jmp .loopx_end
1053..@flag120
1054    PIXEL00_21
1055    PIXEL01_22
1056    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20
1057    PIXEL11_10
1058    jmp .loopx_end
1059..@flag75
1060    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20
1061    PIXEL01_21
1062    PIXEL10_10
1063    PIXEL11_22
1064    jmp .loopx_end
1065..@flag29
1066    PIXEL00_12
1067    PIXEL01_11
1068    PIXEL10_22
1069    PIXEL11_21
1070    jmp .loopx_end
1071..@flag198
1072    PIXEL00_22
1073    PIXEL01_12
1074    PIXEL10_21
1075    PIXEL11_11
1076    jmp .loopx_end
1077..@flag184
1078    PIXEL00_21
1079    PIXEL01_22
1080    PIXEL10_11
1081    PIXEL11_12
1082    jmp .loopx_end
1083..@flag99
1084    PIXEL00_11
1085    PIXEL01_21
1086    PIXEL10_12
1087    PIXEL11_22
1088    jmp .loopx_end
1089..@flag57
1090    PIXEL00_12
1091    PIXEL01_22
1092    PIXEL10_11
1093    PIXEL11_21
1094    jmp .loopx_end
1095..@flag71
1096    PIXEL00_11
1097    PIXEL01_12
1098    PIXEL10_21
1099    PIXEL11_22
1100    jmp .loopx_end
1101..@flag156
1102    PIXEL00_21
1103    PIXEL01_11
1104    PIXEL10_22
1105    PIXEL11_12
1106    jmp .loopx_end
1107..@flag226
1108    PIXEL00_22
1109    PIXEL01_21
1110    PIXEL10_12
1111    PIXEL11_11
1112    jmp .loopx_end
1113..@flag60
1114    PIXEL00_21
1115    PIXEL01_11
1116    PIXEL10_11
1117    PIXEL11_21
1118    jmp .loopx_end
1119..@flag195
1120    PIXEL00_11
1121    PIXEL01_21
1122    PIXEL10_21
1123    PIXEL11_11
1124    jmp .loopx_end
1125..@flag102
1126    PIXEL00_22
1127    PIXEL01_12
1128    PIXEL10_12
1129    PIXEL11_22
1130    jmp .loopx_end
1131..@flag153
1132    PIXEL00_12
1133    PIXEL01_22
1134    PIXEL10_22
1135    PIXEL11_12
1136    jmp .loopx_end
1137..@flag58
1138    DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70
1139    DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70
1140    PIXEL10_11
1141    PIXEL11_21
1142    jmp .loopx_end
1143..@flag83
1144    PIXEL00_11
1145    DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70
1146    PIXEL10_21
1147    DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70
1148    jmp .loopx_end
1149..@flag92
1150    PIXEL00_21
1151    PIXEL01_11
1152    DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70
1153    DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70
1154    jmp .loopx_end
1155..@flag202
1156    DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70
1157    PIXEL01_21
1158    DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70
1159    PIXEL11_11
1160    jmp .loopx_end
1161..@flag78
1162    DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70
1163    PIXEL01_12
1164    DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70
1165    PIXEL11_22
1166    jmp .loopx_end
1167..@flag154
1168    DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70
1169    DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70
1170    PIXEL10_22
1171    PIXEL11_12
1172    jmp .loopx_end
1173..@flag114
1174    PIXEL00_22
1175    DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70
1176    PIXEL10_12
1177    DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70
1178    jmp .loopx_end
1179..@flag89
1180    PIXEL00_12
1181    PIXEL01_22
1182    DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70
1183    DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70
1184    jmp .loopx_end
1185..@flag90
1186    DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70
1187    DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70
1188    DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70
1189    DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70
1190    jmp .loopx_end
1191..@flag55
1192..@flag23
1193    DiffOrNot w2,w6,PIXEL00_11,PIXEL01_0,PIXEL00_60,PIXEL01_90
1194    PIXEL10_20
1195    PIXEL11_21
1196    jmp .loopx_end
1197..@flag182
1198..@flag150
1199    PIXEL00_22
1200    DiffOrNot w2,w6,PIXEL01_0,PIXEL11_12,PIXEL01_90,PIXEL11_61
1201    PIXEL10_20
1202    jmp .loopx_end
1203..@flag213
1204..@flag212
1205    PIXEL00_20
1206    DiffOrNot w6,w8,PIXEL01_11,PIXEL11_0,PIXEL01_60,PIXEL11_90
1207    PIXEL10_21
1208    jmp .loopx_end
1209..@flag241
1210..@flag240
1211    PIXEL00_20
1212    PIXEL01_22
1213    DiffOrNot w6,w8,PIXEL10_12,PIXEL11_0,PIXEL10_61,PIXEL11_90
1214    jmp .loopx_end
1215..@flag236
1216..@flag232
1217    PIXEL00_21
1218    PIXEL01_20
1219    DiffOrNot w8,w4,PIXEL10_0,PIXEL11_11,PIXEL10_90,PIXEL11_60
1220    jmp .loopx_end
1221..@flag109
1222..@flag105
1223    DiffOrNot w8,w4,PIXEL00_12,PIXEL10_0,PIXEL00_61,PIXEL10_90
1224    PIXEL01_20
1225    PIXEL11_22
1226    jmp .loopx_end
1227..@flag171
1228..@flag43
1229    DiffOrNot w4,w2,PIXEL00_0,PIXEL10_11,PIXEL00_90,PIXEL10_60
1230    PIXEL01_21
1231    PIXEL11_20
1232    jmp .loopx_end
1233..@flag143
1234..@flag15
1235    DiffOrNot w4,w2,PIXEL00_0,PIXEL01_12,PIXEL00_90,PIXEL01_61
1236    PIXEL10_22
1237    PIXEL11_20
1238    jmp .loopx_end
1239..@flag124
1240    PIXEL00_21
1241    PIXEL01_11
1242    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20
1243    PIXEL11_10
1244    jmp .loopx_end
1245..@flag203
1246    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20
1247    PIXEL01_21
1248    PIXEL10_10
1249    PIXEL11_11
1250    jmp .loopx_end
1251..@flag62
1252    PIXEL00_10
1253    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20
1254    PIXEL10_11
1255    PIXEL11_21
1256    jmp .loopx_end
1257..@flag211
1258    PIXEL00_11
1259    PIXEL01_10
1260    PIXEL10_21
1261    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20
1262    jmp .loopx_end
1263..@flag118
1264    PIXEL00_22
1265    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20
1266    PIXEL10_12
1267    PIXEL11_10
1268    jmp .loopx_end
1269..@flag217
1270    PIXEL00_12
1271    PIXEL01_22
1272    PIXEL10_10
1273    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20
1274    jmp .loopx_end
1275..@flag110
1276    PIXEL00_10
1277    PIXEL01_12
1278    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20
1279    PIXEL11_22
1280    jmp .loopx_end
1281..@flag155
1282    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20
1283    PIXEL01_10
1284    PIXEL10_22
1285    PIXEL11_12
1286    jmp .loopx_end
1287..@flag188
1288    PIXEL00_21
1289    PIXEL01_11
1290    PIXEL10_11
1291    PIXEL11_12
1292    jmp .loopx_end
1293..@flag185
1294    PIXEL00_12
1295    PIXEL01_22
1296    PIXEL10_11
1297    PIXEL11_12
1298    jmp .loopx_end
1299..@flag61
1300    PIXEL00_12
1301    PIXEL01_11
1302    PIXEL10_11
1303    PIXEL11_21
1304    jmp .loopx_end
1305..@flag157
1306    PIXEL00_12
1307    PIXEL01_11
1308    PIXEL10_22
1309    PIXEL11_12
1310    jmp .loopx_end
1311..@flag103
1312    PIXEL00_11
1313    PIXEL01_12
1314    PIXEL10_12
1315    PIXEL11_22
1316    jmp .loopx_end
1317..@flag227
1318    PIXEL00_11
1319    PIXEL01_21
1320    PIXEL10_12
1321    PIXEL11_11
1322    jmp .loopx_end
1323..@flag230
1324    PIXEL00_22
1325    PIXEL01_12
1326    PIXEL10_12
1327    PIXEL11_11
1328    jmp .loopx_end
1329..@flag199
1330    PIXEL00_11
1331    PIXEL01_12
1332    PIXEL10_21
1333    PIXEL11_11
1334    jmp .loopx_end
1335..@flag220
1336    PIXEL00_21
1337    PIXEL01_11
1338    DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70
1339    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20
1340    jmp .loopx_end
1341..@flag158
1342    DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70
1343    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20
1344    PIXEL10_22
1345    PIXEL11_12
1346    jmp .loopx_end
1347..@flag234
1348    DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70
1349    PIXEL01_21
1350    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20
1351    PIXEL11_11
1352    jmp .loopx_end
1353..@flag242
1354    PIXEL00_22
1355    DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70
1356    PIXEL10_12
1357    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20
1358    jmp .loopx_end
1359..@flag59
1360    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20
1361    DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70
1362    PIXEL10_11
1363    PIXEL11_21
1364    jmp .loopx_end
1365..@flag121
1366    PIXEL00_12
1367    PIXEL01_22
1368    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20
1369    DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70
1370    jmp .loopx_end
1371..@flag87
1372    PIXEL00_11
1373    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20
1374    PIXEL10_21
1375    DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70
1376    jmp .loopx_end
1377..@flag79
1378    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20
1379    PIXEL01_12
1380    DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70
1381    PIXEL11_22
1382    jmp .loopx_end
1383..@flag122
1384    DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70
1385    DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70
1386    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20
1387    DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70
1388    jmp .loopx_end
1389..@flag94
1390    DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70
1391    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20
1392    DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70
1393    DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70
1394    jmp .loopx_end
1395..@flag218
1396    DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70
1397    DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70
1398    DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70
1399    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20
1400    jmp .loopx_end
1401..@flag91
1402    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20
1403    DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70
1404    DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70
1405    DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70
1406    jmp .loopx_end
1407..@flag229
1408    PIXEL00_20
1409    PIXEL01_20
1410    PIXEL10_12
1411    PIXEL11_11
1412    jmp .loopx_end
1413..@flag167
1414    PIXEL00_11
1415    PIXEL01_12
1416    PIXEL10_20
1417    PIXEL11_20
1418    jmp .loopx_end
1419..@flag173
1420    PIXEL00_12
1421    PIXEL01_20
1422    PIXEL10_11
1423    PIXEL11_20
1424    jmp .loopx_end
1425..@flag181
1426    PIXEL00_20
1427    PIXEL01_11
1428    PIXEL10_20
1429    PIXEL11_12
1430    jmp .loopx_end
1431..@flag186
1432    DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70
1433    DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70
1434    PIXEL10_11
1435    PIXEL11_12
1436    jmp .loopx_end
1437..@flag115
1438    PIXEL00_11
1439    DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70
1440    PIXEL10_12
1441    DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70
1442    jmp .loopx_end
1443..@flag93
1444    PIXEL00_12
1445    PIXEL01_11
1446    DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70
1447    DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70
1448    jmp .loopx_end
1449..@flag206
1450    DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70
1451    PIXEL01_12
1452    DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70
1453    PIXEL11_11
1454    jmp .loopx_end
1455..@flag205
1456..@flag201
1457    PIXEL00_12
1458    PIXEL01_20
1459    DiffOrNot w8,w4,PIXEL10_10,PIXEL10_70
1460    PIXEL11_11
1461    jmp .loopx_end
1462..@flag174
1463..@flag46
1464    DiffOrNot w4,w2,PIXEL00_10,PIXEL00_70
1465    PIXEL01_12
1466    PIXEL10_11
1467    PIXEL11_20
1468    jmp .loopx_end
1469..@flag179
1470..@flag147
1471    PIXEL00_11
1472    DiffOrNot w2,w6,PIXEL01_10,PIXEL01_70
1473    PIXEL10_20
1474    PIXEL11_12
1475    jmp .loopx_end
1476..@flag117
1477..@flag116
1478    PIXEL00_20
1479    PIXEL01_11
1480    PIXEL10_12
1481    DiffOrNot w6,w8,PIXEL11_10,PIXEL11_70
1482    jmp .loopx_end
1483..@flag189
1484    PIXEL00_12
1485    PIXEL01_11
1486    PIXEL10_11
1487    PIXEL11_12
1488    jmp .loopx_end
1489..@flag231
1490    PIXEL00_11
1491    PIXEL01_12
1492    PIXEL10_12
1493    PIXEL11_11
1494    jmp .loopx_end
1495..@flag126
1496    PIXEL00_10
1497    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20
1498    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20
1499    PIXEL11_10
1500    jmp .loopx_end
1501..@flag219
1502    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20
1503    PIXEL01_10
1504    PIXEL10_10
1505    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20
1506    jmp .loopx_end
1507..@flag125
1508    DiffOrNot w8,w4,PIXEL00_12,PIXEL10_0,PIXEL00_61,PIXEL10_90
1509    PIXEL01_11
1510    PIXEL11_10
1511    jmp .loopx_end
1512..@flag221
1513    PIXEL00_12
1514    DiffOrNot w6,w8,PIXEL01_11,PIXEL11_0,PIXEL01_60,PIXEL11_90
1515    PIXEL10_10
1516    jmp .loopx_end
1517..@flag207
1518    DiffOrNot w4,w2,PIXEL00_0,PIXEL01_12,PIXEL00_90,PIXEL01_61
1519    PIXEL10_10
1520    PIXEL11_11
1521    jmp .loopx_end
1522..@flag238
1523    PIXEL00_10
1524    PIXEL01_12
1525    DiffOrNot w8,w4,PIXEL10_0,PIXEL11_11,PIXEL10_90,PIXEL11_60
1526    jmp .loopx_end
1527..@flag190
1528    PIXEL00_10
1529    DiffOrNot w2,w6,PIXEL01_0,PIXEL11_12,PIXEL01_90,PIXEL11_61
1530    PIXEL10_11
1531    jmp .loopx_end
1532..@flag187
1533    DiffOrNot w4,w2,PIXEL00_0,PIXEL10_11,PIXEL00_90,PIXEL10_60
1534    PIXEL01_10
1535    PIXEL11_12
1536    jmp .loopx_end
1537..@flag243
1538    PIXEL00_11
1539    PIXEL01_10
1540    DiffOrNot w6,w8,PIXEL10_12,PIXEL11_0,PIXEL10_61,PIXEL11_90
1541    jmp .loopx_end
1542..@flag119
1543    DiffOrNot w2,w6,PIXEL00_11,PIXEL01_0,PIXEL00_60,PIXEL01_90
1544    PIXEL10_12
1545    PIXEL11_10
1546    jmp .loopx_end
1547..@flag237
1548..@flag233
1549    PIXEL00_12
1550    PIXEL01_20
1551    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_100
1552    PIXEL11_11
1553    jmp .loopx_end
1554..@flag175
1555..@flag47
1556    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_100
1557    PIXEL01_12
1558    PIXEL10_11
1559    PIXEL11_20
1560    jmp .loopx_end
1561..@flag183
1562..@flag151
1563    PIXEL00_11
1564    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_100
1565    PIXEL10_20
1566    PIXEL11_12
1567    jmp .loopx_end
1568..@flag245
1569..@flag244
1570    PIXEL00_20
1571    PIXEL01_11
1572    PIXEL10_12
1573    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_100
1574    jmp .loopx_end
1575..@flag250
1576    PIXEL00_10
1577    PIXEL01_10
1578    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20
1579    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20
1580    jmp .loopx_end
1581..@flag123
1582    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20
1583    PIXEL01_10
1584    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20
1585    PIXEL11_10
1586    jmp .loopx_end
1587..@flag95
1588    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20
1589    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20
1590    PIXEL10_10
1591    PIXEL11_10
1592    jmp .loopx_end
1593..@flag222
1594    PIXEL00_10
1595    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20
1596    PIXEL10_10
1597    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20
1598    jmp .loopx_end
1599..@flag252
1600    PIXEL00_21
1601    PIXEL01_11
1602    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20
1603    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_100
1604    jmp .loopx_end
1605..@flag249
1606    PIXEL00_12
1607    PIXEL01_22
1608    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_100
1609    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20
1610    jmp .loopx_end
1611..@flag235
1612    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20
1613    PIXEL01_21
1614    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_100
1615    PIXEL11_11
1616    jmp .loopx_end
1617..@flag111
1618    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_100
1619    PIXEL01_12
1620    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20
1621    PIXEL11_22
1622    jmp .loopx_end
1623..@flag63
1624    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_100
1625    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20
1626    PIXEL10_11
1627    PIXEL11_21
1628    jmp .loopx_end
1629..@flag159
1630    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20
1631    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_100
1632    PIXEL10_22
1633    PIXEL11_12
1634    jmp .loopx_end
1635..@flag215
1636    PIXEL00_11
1637    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_100
1638    PIXEL10_21
1639    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20
1640    jmp .loopx_end
1641..@flag246
1642    PIXEL00_22
1643    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20
1644    PIXEL10_12
1645    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_100
1646    jmp .loopx_end
1647..@flag254
1648    PIXEL00_10
1649    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20
1650    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20
1651    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_100
1652    jmp .loopx_end
1653..@flag253
1654    PIXEL00_12
1655    PIXEL01_11
1656    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_100
1657    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_100
1658    jmp .loopx_end
1659..@flag251
1660    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20
1661    PIXEL01_10
1662    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_100
1663    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20
1664    jmp .loopx_end
1665..@flag239
1666    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_100
1667    PIXEL01_12
1668    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_100
1669    PIXEL11_11
1670    jmp .loopx_end
1671..@flag127
1672    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_100
1673    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_20
1674    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_20
1675    PIXEL11_10
1676    jmp .loopx_end
1677..@flag191
1678    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_100
1679    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_100
1680    PIXEL10_11
1681    PIXEL11_12
1682    jmp .loopx_end
1683..@flag223
1684    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_20
1685    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_100
1686    PIXEL10_10
1687    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_20
1688    jmp .loopx_end
1689..@flag247
1690    PIXEL00_11
1691    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_100
1692    PIXEL10_12
1693    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_100
1694    jmp .loopx_end
1695..@flag255
1696    DiffOrNot w4,w2,PIXEL00_0,PIXEL00_100
1697    DiffOrNot w2,w6,PIXEL01_0,PIXEL01_100
1698    DiffOrNot w8,w4,PIXEL10_0,PIXEL10_100
1699    DiffOrNot w6,w8,PIXEL11_0,PIXEL11_100
1700    jmp .loopx_end
1701
1702
1703..@cross0
1704    mov     edx,eax
1705    shl     eax,16
1706    or      eax,edx
1707    mov     [edi],eax
1708    mov     [edi+ebx],eax
1709    jmp     .loopx_end
1710..@cross1
1711    mov     edx,eax
1712    shl     eax,16
1713    or      eax,edx
1714    mov     ecx,[w2]
1715    and     edx,[zerolowbits]
1716    and     ecx,[zerolowbits]
1717    add     ecx,edx
1718    shr     ecx,1
1719    add     ecx,0x0821
1720    and     ecx,[zerolowbits]
1721    add     edx,ecx
1722    shr     edx,1
1723    mov     ecx,edx
1724    shl     edx,16
1725    or      edx,ecx
1726    mov     [edi],edx
1727    mov     [edi+ebx],eax
1728    jmp     .loopx_end
1729..@cross2
1730    shl     eax,16
1731    mov     ecx,[w4]
1732    and     edx,[zerolowbits]
1733    and     ecx,[zerolowbits]
1734    add     ecx,edx
1735    shr     ecx,1
1736    add     ecx,0x0821
1737    and     ecx,[zerolowbits]
1738    add     edx,ecx
1739    shr     edx,1
1740    or      eax,edx
1741    mov     [edi],eax
1742    mov     [edi+ebx],eax
1743    jmp     .loopx_end
1744..@cross4
1745    mov     ecx,[w6]
1746    and     edx,[zerolowbits]
1747    and     ecx,[zerolowbits]
1748    add     ecx,edx
1749    shr     ecx,1
1750    add     ecx,0x0821
1751    and     ecx,[zerolowbits]
1752    add     edx,ecx
1753    shr     edx,1
1754    shl     edx,16
1755    or      eax,edx
1756    mov     [edi],eax
1757    mov     [edi+ebx],eax
1758    jmp     .loopx_end
1759..@cross8
1760    mov     edx,eax
1761    shl     eax,16
1762    or      eax,edx
1763    mov     ecx,[w8]
1764    and     edx,[zerolowbits]
1765    and     ecx,[zerolowbits]
1766    add     ecx,edx
1767    shr     ecx,1
1768    add     ecx,0x0821
1769    and     ecx,[zerolowbits]
1770    add     edx,ecx
1771    shr     edx,1
1772    mov     ecx,edx
1773    shl     edx,16
1774    or      edx,ecx
1775    mov     [edi],eax
1776    mov     [edi+ebx],edx
1777    jmp     .loopx_end
1778
1779.loopx_end
1780    add     esi,2
1781    add     edi,4
1782    dec     dword[xcounter]
1783    jz      .nexty
1784    jmp     .loopx
1785.nexty
1786    add     esi,dword[moduloSrc]
1787    add     edi,dword[moduloDst]
1788    dec     dword[linesleft]
1789    jz      .fin
1790    mov     ebx,[ebp+srcPitch]
1791    mov     dword[nextline],ebx
1792    neg     ebx
1793    mov     dword[prevline],ebx
1794    jmp     .loopy
1795.fin
1796    emms
1797    popad
1798    mov esp,ebp
1799    pop ebp
1800    ret
1801
1802SECTION .data
1803FuncTable
1804    dd ..@flag0, ..@flag1, ..@flag2, ..@flag3, ..@flag4, ..@flag5, ..@flag6, ..@flag7
1805    dd ..@flag8, ..@flag9, ..@flag10, ..@flag11, ..@flag12, ..@flag13, ..@flag14, ..@flag15
1806    dd ..@flag16, ..@flag17, ..@flag18, ..@flag19, ..@flag20, ..@flag21, ..@flag22, ..@flag23
1807    dd ..@flag24, ..@flag25, ..@flag26, ..@flag27, ..@flag28, ..@flag29, ..@flag30, ..@flag31
1808    dd ..@flag32, ..@flag33, ..@flag34, ..@flag35, ..@flag36, ..@flag37, ..@flag38, ..@flag39
1809    dd ..@flag40, ..@flag41, ..@flag42, ..@flag43, ..@flag44, ..@flag45, ..@flag46, ..@flag47
1810    dd ..@flag48, ..@flag49, ..@flag50, ..@flag51, ..@flag52, ..@flag53, ..@flag54, ..@flag55
1811    dd ..@flag56, ..@flag57, ..@flag58, ..@flag59, ..@flag60, ..@flag61, ..@flag62, ..@flag63
1812    dd ..@flag64, ..@flag65, ..@flag66, ..@flag67, ..@flag68, ..@flag69, ..@flag70, ..@flag71
1813    dd ..@flag72, ..@flag73, ..@flag74, ..@flag75, ..@flag76, ..@flag77, ..@flag78, ..@flag79
1814    dd ..@flag80, ..@flag81, ..@flag82, ..@flag83, ..@flag84, ..@flag85, ..@flag86, ..@flag87
1815    dd ..@flag88, ..@flag89, ..@flag90, ..@flag91, ..@flag92, ..@flag93, ..@flag94, ..@flag95
1816    dd ..@flag96, ..@flag97, ..@flag98, ..@flag99, ..@flag100, ..@flag101, ..@flag102, ..@flag103
1817    dd ..@flag104, ..@flag105, ..@flag106, ..@flag107, ..@flag108, ..@flag109, ..@flag110, ..@flag111
1818    dd ..@flag112, ..@flag113, ..@flag114, ..@flag115, ..@flag116, ..@flag117, ..@flag118, ..@flag119
1819    dd ..@flag120, ..@flag121, ..@flag122, ..@flag123, ..@flag124, ..@flag125, ..@flag126, ..@flag127
1820    dd ..@flag128, ..@flag129, ..@flag130, ..@flag131, ..@flag132, ..@flag133, ..@flag134, ..@flag135
1821    dd ..@flag136, ..@flag137, ..@flag138, ..@flag139, ..@flag140, ..@flag141, ..@flag142, ..@flag143
1822    dd ..@flag144, ..@flag145, ..@flag146, ..@flag147, ..@flag148, ..@flag149, ..@flag150, ..@flag151
1823    dd ..@flag152, ..@flag153, ..@flag154, ..@flag155, ..@flag156, ..@flag157, ..@flag158, ..@flag159
1824    dd ..@flag160, ..@flag161, ..@flag162, ..@flag163, ..@flag164, ..@flag165, ..@flag166, ..@flag167
1825    dd ..@flag168, ..@flag169, ..@flag170, ..@flag171, ..@flag172, ..@flag173, ..@flag174, ..@flag175
1826    dd ..@flag176, ..@flag177, ..@flag178, ..@flag179, ..@flag180, ..@flag181, ..@flag182, ..@flag183
1827    dd ..@flag184, ..@flag185, ..@flag186, ..@flag187, ..@flag188, ..@flag189, ..@flag190, ..@flag191
1828    dd ..@flag192, ..@flag193, ..@flag194, ..@flag195, ..@flag196, ..@flag197, ..@flag198, ..@flag199
1829    dd ..@flag200, ..@flag201, ..@flag202, ..@flag203, ..@flag204, ..@flag205, ..@flag206, ..@flag207
1830    dd ..@flag208, ..@flag209, ..@flag210, ..@flag211, ..@flag212, ..@flag213, ..@flag214, ..@flag215
1831    dd ..@flag216, ..@flag217, ..@flag218, ..@flag219, ..@flag220, ..@flag221, ..@flag222, ..@flag223
1832    dd ..@flag224, ..@flag225, ..@flag226, ..@flag227, ..@flag228, ..@flag229, ..@flag230, ..@flag231
1833    dd ..@flag232, ..@flag233, ..@flag234, ..@flag235, ..@flag236, ..@flag237, ..@flag238, ..@flag239
1834    dd ..@flag240, ..@flag241, ..@flag242, ..@flag243, ..@flag244, ..@flag245, ..@flag246, ..@flag247
1835    dd ..@flag248, ..@flag249, ..@flag250, ..@flag251, ..@flag252, ..@flag253, ..@flag254, ..@flag255
1836
1837FuncTable2
1838    dd ..@cross0, ..@cross1, ..@cross2, ..@flag0,
1839    dd ..@cross4, ..@flag0,  ..@flag0,  ..@flag0,
1840    dd ..@cross8, ..@flag0,  ..@flag0,  ..@flag0,
1841    dd ..@flag0,  ..@flag0,  ..@flag0,  ..@flag0
1842