Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 113255
Collapse All | Expand All

(-)xine-lib-1.1.1-old/src/libw32dll/wine/module.c (-8 / +4 lines)
Lines 38-45 Link Here
38
38
39
#ifdef EMU_QTX_API
39
#ifdef EMU_QTX_API
40
#include "wrapper.h"
40
#include "wrapper.h"
41
static int report_func(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags);
41
int report_func(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags);
42
static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags);
42
int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags);
43
#endif
43
#endif
44
44
45
//#undef TRACE
45
//#undef TRACE
Lines 533-540 HMODULE WINAPI LoadLibraryExA(LPCSTR lib Link Here
533
	    printf ("wine/module: QuickTime.qts patched!!! old entry=%p\n",ptr[0]);
533
	    printf ("wine/module: QuickTime.qts patched!!! old entry=%p\n",ptr[0]);
534
534
535
#ifdef EMU_QTX_API
535
#ifdef EMU_QTX_API
536
	    report_entry = report_func;
537
	    report_ret   = report_func_ret;
538
	    wrapper_target=ptr[0];
536
	    wrapper_target=ptr[0];
539
	    ptr[0]=wrapper;
537
	    ptr[0]=wrapper;
540
#endif
538
#endif
Lines 697-703 static int dump_component(char* name,int Link Here
697
static u_int32_t ret_array[4096];
695
static u_int32_t ret_array[4096];
698
static int ret_i=0;
696
static int ret_i=0;
699
697
700
static int report_func(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags)
698
int report_func(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags)
701
{
699
{
702
#ifdef DEBUG_QTX_API
700
#ifdef DEBUG_QTX_API
703
  int i;
701
  int i;
Lines 896-902 static int report_func(void *stack_base, Link Here
896
    return 0;
894
    return 0;
897
}
895
}
898
896
899
static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags)
897
int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags)
900
{
898
{
901
#ifdef DEBUG_QTX_API
899
#ifdef DEBUG_QTX_API
902
  int i;
900
  int i;
Lines 1011-1018 FARPROC MODULE_GetProcAddress( Link Here
1011
//      || !strcmp(function,"_CallComponent")
1009
//      || !strcmp(function,"_CallComponent")
1012
      ){
1010
      ){
1013
	fprintf(stderr,"theQuickTimeDispatcher caught -> %p\n",retproc);
1011
	fprintf(stderr,"theQuickTimeDispatcher caught -> %p\n",retproc);
1014
      report_entry = report_func;
1015
      report_ret   = report_func_ret;
1016
      wrapper_target=(void *)retproc;
1012
      wrapper_target=(void *)retproc;
1017
      retproc=(void *)wrapper;
1013
      retproc=(void *)wrapper;
1018
    }
1014
    }
(-)xine-lib-1.1.1-old/src/libw32dll/wine/stubs.s (+3 lines)
Lines 33-35 exp_EH_prolog: Link Here
33
	leal  12(%esp), %ebp
33
	leal  12(%esp), %ebp
34
	pushl %eax
34
	pushl %eax
35
	ret
35
	ret
36
37
.section .note.GNU-stack,"",@progbits
38
(-)xine-lib-1.1.1-old/src/libw32dll/wine/wrapper.S (-17 / +35 lines)
Lines 1-17 Link Here
1
.section .data
1
.section .data
2
.globl caller_return
3
caller_return:
2
caller_return:
4
	.long 0
3
	.long 0
5
.globl report_entry
6
report_entry:
7
	.long null_call
8
.globl report_ret
9
report_ret:	
10
	.long null_call
11
.global wrapper_target
4
.global wrapper_target
12
wrapper_target:	
5
wrapper_target:	
13
	.long null_call
6
	.long null_call
14
7
8
#undef __i686 /* gcc define gets in our way */
9
	.section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
10
.globl __i686.get_pc_thunk.bx
11
	.hidden	__i686.get_pc_thunk.bx
12
	.type	__i686.get_pc_thunk.bx,@function
13
__i686.get_pc_thunk.bx:
14
	movl (%esp), %ebx
15
	ret
16
15
.section .text
17
.section .text
16
.globl null_call
18
.globl null_call
17
	.type null_call, @function
19
	.type null_call, @function
Lines 22-67 null_call: Link Here
22
	.type wrapper, @function
24
	.type wrapper, @function
23
	.balign 16,0x90
25
	.balign 16,0x90
24
wrapper:
26
wrapper:
27
	pushl $0
25
	pusha			# store registers (EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI) 
28
	pusha			# store registers (EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI) 
26
	pushf			# store flags
29
	pushf			# store flags
27
	
30
	
28
	push %ebp		# set up a stack frame 
31
	push %ebp		# set up a stack frame 
29
	movl %esp, %ebp
32
	movl %esp, %ebp
30
33
34
	call __i686.get_pc_thunk.bx
35
	addl $_GLOBAL_OFFSET_TABLE_, %ebx
36
31
	leal 4(%ebp), %eax	# push flags addr
37
	leal 4(%ebp), %eax	# push flags addr
32
	push %eax
38
	push %eax
33
	leal 8(%ebp), %eax	# push registers addr
39
	leal 8(%ebp), %eax	# push registers addr
34
	push %eax
40
	push %eax
35
	
41
	
36
	leal 40(%ebp), %edx	
42
	leal 44(%ebp), %edx	
37
	movl (%ebp), %eax
43
	movl (%ebp), %eax
38
	subl %edx, %eax
44
	subl %edx, %eax
39
	push %eax
45
	push %eax
40
	push %edx
46
	push %edx
41
	
47
	
42
	call *report_entry	# report entry
48
	call report_func@PLT	# report entry
43
	
49
	
44
	test %eax, %eax
50
	test %eax, %eax
45
	jnz .Ldone
51
	jnz .Ldone
46
52
53
	movl 44(%ebp), %eax	# switch return addresses
54
	movl %eax, caller_return@GOTOFF(%ebx)
55
	leal .Lwrapper_return@GOTOFF(%ebx), %eax
56
	movl %eax, 40(%ebp)
57
58
	movl wrapper_target@GOTOFF(%ebx), %eax
59
	mov %eax, 40(%ebp)	# wrapper_target should return at .Lwrapper_return
60
47
	leave			# restore %esp, %ebp
61
	leave			# restore %esp, %ebp
48
	popf			# restore flags
62
	popf			# restore flags
49
	popa			# restore registers
63
	popa			# restore registers
50
	
64
51
	popl caller_return	# switch return addresses
65
	ret			# fake 'return' to wrapper_target actually
52
	pushl $.Lwrapper_return 
53
	
54
	jmp *wrapper_target	# wrapper_target should return at .Lwrapper_return
55
66
56
	.balign 16, 0x90
67
	.balign 16, 0x90
57
.Lwrapper_return:	
68
.Lwrapper_return:	
58
	pushl caller_return	# restore the original return address
69
	pushl $0
59
	pusha			# more for reference sake here
70
	pusha			# more for reference sake here
60
	pushf
71
	pushf
61
	
72
	
62
	push %ebp		# set up a stack frame
73
	push %ebp		# set up a stack frame
63
	movl %esp, %ebp
74
	movl %esp, %ebp
64
75
76
	call __i686.get_pc_thunk.bx
77
	addl $_GLOBAL_OFFSET_TABLE_, %ebx
78
	movl caller_return@GOTOFF(%ebx), %eax
79
	movl %eax, 40(%ebp)	# restore the original return address
80
65
	leal 4(%ebp), %eax	# push flags addr
81
	leal 4(%ebp), %eax	# push flags addr
66
	push %eax
82
	push %eax
67
	leal 8(%ebp), %eax	# push registers addr
83
	leal 8(%ebp), %eax	# push registers addr
Lines 73-83 wrapper: Link Here
73
	push %eax
89
	push %eax
74
	push %edx
90
	push %edx
75
91
76
	call *report_ret	# report the return information (same args)
92
	call report_func_ret@PLT# report the return information (same args)
77
.Ldone:	
93
.Ldone:	
78
94
79
	leave
95
	leave
80
	popf
96
	popf
81
	popa
97
	popa
82
	ret
98
	ret
83
	
99
100
.section .note.GNU-stack,"",@progbits
101
(-)xine-lib-1.1.1-old/src/libw32dll/wine/wrapper.h (-4 lines)
Lines 11-20 typedef struct { Link Here
11
  u_int32_t edi, esi, ebp, esp, ebx, edx, ecx, eax;
11
  u_int32_t edi, esi, ebp, esp, ebx, edx, ecx, eax;
12
} reg386_t;
12
} reg386_t;
13
13
14
typedef int (*wrapper_func_t)(void *stack_base, int stack_size, reg386_t *reg,  u_int32_t *flags);
15
16
extern wrapper_func_t report_entry, report_ret;
17
18
extern void (*wrapper_target)(void);
14
extern void (*wrapper_target)(void);
19
15
20
extern int wrapper(void);
16
extern int wrapper(void);
(-)xine-lib-1.1.1-old/src/post/deinterlace/plugins/greedy2frame_template.c (-14 / +14 lines)
Lines 183-189 static void DeinterlaceGreedy2Frame_MMX( Link Here
183
        * See above for a description of the algorithm.
183
        * See above for a description of the algorithm.
184
	*/
184
	*/
185
            ".align 8 \n\t"
185
            ".align 8 \n\t"
186
            "movq "MANGLE(Mask)", %%mm6			\n\t"
186
            "movq %4, %%mm6			\n\t"
187
187
188
            "movq %0, %%mm1			\n\t"     // T1
188
            "movq %0, %%mm1			\n\t"     // T1
189
            "movq %1, %%mm0			\n\t"     // M1
189
            "movq %1, %%mm0			\n\t"     // M1
Lines 191-197 static void DeinterlaceGreedy2Frame_MMX( Link Here
191
            "movq %3, %%mm2			\n\t"     // M0
191
            "movq %3, %%mm2			\n\t"     // M0
192
            : /* no output */
192
            : /* no output */
193
            : "m" (*T1), "m" (*M1), 
193
            : "m" (*T1), "m" (*M1), 
194
              "m" (*B1), "m" (*M0) );
194
              "m" (*B1), "m" (*M0), "m" (Mask) );
195
          
195
          
196
196
197
          asm volatile(
197
          asm volatile(
Lines 248-257 static void DeinterlaceGreedy2Frame_MMX( Link Here
248
#endif
248
#endif
249
249
250
            /* if |M1-M0| > Threshold we want dword worth of twos */
250
            /* if |M1-M0| > Threshold we want dword worth of twos */
251
            "pcmpgtb "MANGLE(qwGreedyTwoFrameThreshold)", %%mm4			\n\t"
251
            "pcmpgtb %3, %%mm4			\n\t"
252
            "pand    "MANGLE(Mask)", %%mm4 	\n\t" /* get rid of sign bit */
252
            "pand    %4, %%mm4			\n\t" /* get rid of sign bit */
253
            "pcmpgtd "MANGLE(DwordOne)", %%mm4 	\n\t" /* do we want to bob */
253
            "pcmpgtd %5, %%mm4			\n\t" /* do we want to bob */
254
            "pandn   "MANGLE(DwordTwo)", %%mm4	\n\t"
254
            "pandn   %6, %%mm4			\n\t"
255
255
256
            "movq    %1, %%mm2			\n\t" /* mm2 = T0 */
256
            "movq    %1, %%mm2			\n\t" /* mm2 = T0 */
257
257
Lines 264-274 static void DeinterlaceGreedy2Frame_MMX( Link Here
264
            "pand    %%mm6, %%mm5			\n\t"
264
            "pand    %%mm6, %%mm5			\n\t"
265
265
266
            /* if |T1-T0| > Threshold we want dword worth of ones */
266
            /* if |T1-T0| > Threshold we want dword worth of ones */
267
            "pcmpgtb "MANGLE(qwGreedyTwoFrameThreshold)", %%mm5	      	\n\t"
267
            "pcmpgtb %3, %%mm5			\n\t"
268
            "pand    %%mm6, %%mm5		\n\t" /* get rid of sign bit */
268
            "pand    %%mm6, %%mm5		\n\t" /* get rid of sign bit */
269
269
270
            "pcmpgtd "MANGLE(DwordOne)", %%mm5			\n\t" 
270
            "pcmpgtd %5, %%mm5			\n\t" 
271
            "pandn   "MANGLE(DwordOne)", %%mm5			\n\t"
271
            "pandn   %5, %%mm5			\n\t"
272
            "paddd   %%mm5, %%mm4			\n\t"
272
            "paddd   %%mm5, %%mm4			\n\t"
273
273
274
            "movq    %2, %%mm2			\n\t"     /* B0 */
274
            "movq    %2, %%mm2			\n\t"     /* B0 */
Lines 282-294 static void DeinterlaceGreedy2Frame_MMX( Link Here
282
            "pand    %%mm6, %%mm5			\n\t"
282
            "pand    %%mm6, %%mm5			\n\t"
283
283
284
            /* if |B1-B0| > Threshold we want dword worth of ones */
284
            /* if |B1-B0| > Threshold we want dword worth of ones */
285
            "pcmpgtb "MANGLE(qwGreedyTwoFrameThreshold)", %%mm5		\n\t"
285
            "pcmpgtb %3, %%mm5		\n\t"
286
            "pand    %%mm6, %%mm5	\n\t"     /* get rid of any sign bit */
286
            "pand    %%mm6, %%mm5	\n\t"     /* get rid of any sign bit */
287
            "pcmpgtd "MANGLE(DwordOne)", %%mm5			\n\t"
287
            "pcmpgtd %5, %%mm5			\n\t"
288
            "pandn   "MANGLE(DwordOne)", %%mm5			\n\t"
288
            "pandn   %5, %%mm5			\n\t"
289
            "paddd   %%mm5, %%mm4			\n\t"
289
            "paddd   %%mm5, %%mm4			\n\t"
290
290
291
            "pcmpgtd "MANGLE(DwordTwo)", %%mm4			\n\t"
291
            "pcmpgtd %6, %%mm4			\n\t"
292
292
293
/* debugging feature
293
/* debugging feature
294
 * output the value of mm4 at this point which is pink where we will weave
294
 * output the value of mm4 at this point which is pink where we will weave
Lines 314-320 static void DeinterlaceGreedy2Frame_MMX( Link Here
314
#endif
314
#endif
315
315
316
          : "=m" (*Dest2)
316
          : "=m" (*Dest2)
317
          : "m" (*T0), "m" (*B0) );
317
          : "m" (*T0), "m" (*B0), "m" (qwGreedyTwoFrameThreshold), "m" (Mask), "m" (DwordOne), "m" (DwordTwo) );
318
318
319
          /* Advance to the next set of pixels. */
319
          /* Advance to the next set of pixels. */
320
          T1 += 8;
320
          T1 += 8;
(-)xine-lib-1.1.1-old/src/post/deinterlace/plugins/greedyh.asm (-30 / +36 lines)
Lines 43-49 static void FUNCT_NAME(uint8_t *output, Link Here
43
43
44
    int Line;
44
    int Line;
45
    long LoopCtr;
45
    long LoopCtr;
46
    long oldbx;
47
    unsigned int Pitch = stride*2;
46
    unsigned int Pitch = stride*2;
48
    int FieldHeight = height / 2;
47
    int FieldHeight = height / 2;
49
48
Lines 52-57 static void FUNCT_NAME(uint8_t *output, Link Here
52
    unsigned char* L3;					// ptr to Line3
51
    unsigned char* L3;					// ptr to Line3
53
52
54
    unsigned char* L2P;					// ptr to prev Line2
53
    unsigned char* L2P;					// ptr to prev Line2
54
    unsigned char* temp;
55
    unsigned char* Dest = output;
55
    unsigned char* Dest = output;
56
56
57
    int64_t LastAvg=0;			//interp value from left qword
57
    int64_t LastAvg=0;			//interp value from left qword
Lines 121-145 static void FUNCT_NAME(uint8_t *output, Link Here
121
#define asmLastAvg      "%0"
121
#define asmLastAvg      "%0"
122
#define asmL1           "%1"
122
#define asmL1           "%1"
123
#define asmL3           "%2"
123
#define asmL3           "%2"
124
#define asmL2P          "%3"
124
#define asmtemp         "%3"
125
#define asmL2           "%4"
125
#define asmL2           "%4"
126
#define asmDest         "%5"
126
#define asmDest         "%5"
127
#define asmLoopCtr      "%6"
127
#define asmLoopCtr      "%6"
128
#define asmoldbx        "%7"
129
#endif
128
#endif
130
129
131
        // For ease of reading, the comments below assume that we're operating on an odd
130
        // For ease of reading, the comments below assume that we're operating on an odd
132
        // field (i.e., that InfoIsOdd is true).  Assume the obvious for even lines..
131
        // field (i.e., that InfoIsOdd is true).  Assume the obvious for even lines..
132
        temp = L2P;
133
        __asm__ __volatile__
133
        __asm__ __volatile__
134
            (
134
            (
135
             // save ebx (-fPIC)
136
	     MOVX" %%"XBX", "asmoldbx"\n\t"
137
138
             MOVX"  "asmL1",          %%"XAX"\n\t"
135
             MOVX"  "asmL1",          %%"XAX"\n\t"
139
             LEAX"  8(%%"XAX"),     %%"XBX"\n\t"    // next qword needed by DJR
136
             LEAX"  8(%%"XAX"),     %%"XDX"\n\t"    // next qword needed by DJR
140
             MOVX"  "asmL3",          %%"XCX"\n\t"
137
             MOVX"  "asmL3",          %%"XCX"\n\t"
141
             SUBX"  %%"XAX",        %%"XCX"\n\t"    // carry L3 addr as an offset
138
             SUBX"  %%"XAX",        %%"XCX"\n\t"    // carry L3 addr as an offset
142
             MOVX"  "asmL2P",         %%"XDX"\n\t"
143
             MOVX"  "asmL2",          %%"XSI"\n\t"
139
             MOVX"  "asmL2",          %%"XSI"\n\t"
144
             MOVX"  "asmDest",        %%"XDI"\n\t"    // DL1 if Odd or DL2 if Even
140
             MOVX"  "asmDest",        %%"XDI"\n\t"    // DL1 if Odd or DL2 if Even
145
141
Lines 148-158 static void FUNCT_NAME(uint8_t *output, Link Here
148
144
149
             "movq  (%%"XSI"),      %%mm0\n\t"      // L2 - the newest weave pixel value
145
             "movq  (%%"XSI"),      %%mm0\n\t"      // L2 - the newest weave pixel value
150
             "movq  (%%"XAX"),      %%mm1\n\t"      // L1 - the top pixel
146
             "movq  (%%"XAX"),      %%mm1\n\t"      // L1 - the top pixel
147
             PUSHX" %%"XDX              "\n\t"
148
             MOVX"  "asmtemp",    %%"XDX"\n\t"
151
             "movq  (%%"XDX"),      %%mm2\n\t"      // L2P - the prev weave pixel
149
             "movq  (%%"XDX"),      %%mm2\n\t"      // L2P - the prev weave pixel
150
             POPX" %%"XDX               "\n\t"
152
             "movq  (%%"XAX", %%"XCX"), %%mm3\n\t"  // L3, next odd row
151
             "movq  (%%"XAX", %%"XCX"), %%mm3\n\t"  // L3, next odd row
153
             "movq  %%mm1,          %%mm6\n\t"      // L1 - get simple single pixel interp
152
             "movq  %%mm1,          %%mm6\n\t"      // L1 - get simple single pixel interp
154
             //	pavgb   mm6, mm3                    // use macro below
153
             //	pavgb   mm6, mm3                    // use macro below
155
             V_PAVGB ("%%mm6", "%%mm3", "%%mm4", MANGLE(ShiftMask))
154
             V_PAVGB ("%%mm6", "%%mm3", "%%mm4", "%8")
156
155
157
             // DJR - Diagonal Jaggie Reduction
156
             // DJR - Diagonal Jaggie Reduction
158
             // In the event that we are going to use an average (Bob) pixel we do not want a jagged
157
             // In the event that we are going to use an average (Bob) pixel we do not want a jagged
Lines 166-189 static void FUNCT_NAME(uint8_t *output, Link Here
166
             "psllq $16,            %%mm7\n\t"      // left justify 3 pixels
165
             "psllq $16,            %%mm7\n\t"      // left justify 3 pixels
167
             "por   %%mm7,          %%mm4\n\t"      // and combine
166
             "por   %%mm7,          %%mm4\n\t"      // and combine
168
167
169
             "movq  (%%"XBX"),      %%mm5\n\t"      // next horiz qword from L1
168
             "movq  (%%"XDX"),      %%mm5\n\t"      // next horiz qword from L1
170
             //			pavgb   mm5, qword ptr[ebx+ecx] // next horiz qword from L3, use macro below
169
             //			pavgb   mm5, qword ptr[ebx+ecx] // next horiz qword from L3, use macro below
171
             V_PAVGB ("%%mm5", "(%%"XBX",%%"XCX")", "%%mm7", MANGLE(ShiftMask))
170
             V_PAVGB ("%%mm5", "(%%"XDX",%%"XCX")", "%%mm7", "%8")
172
             "psllq $48,            %%mm5\n\t"      // left just 1 pixel
171
             "psllq $48,            %%mm5\n\t"      // left just 1 pixel
173
             "movq  %%mm6,          %%mm7\n\t"      // another copy of simple bob pixel
172
             "movq  %%mm6,          %%mm7\n\t"      // another copy of simple bob pixel
174
             "psrlq $16,            %%mm7\n\t"      // right just 3 pixels
173
             "psrlq $16,            %%mm7\n\t"      // right just 3 pixels
175
             "por   %%mm7,          %%mm5\n\t"      // combine
174
             "por   %%mm7,          %%mm5\n\t"      // combine
176
             //			pavgb	mm4, mm5			// avg of forward and prev by 1 pixel, use macro
175
             //			pavgb	mm4, mm5			// avg of forward and prev by 1 pixel, use macro
177
             V_PAVGB ("%%mm4", "%%mm5", "%%mm5", MANGLE(ShiftMask))   // mm5 gets modified if MMX
176
             V_PAVGB ("%%mm4", "%%mm5", "%%mm5", "%8")   // mm5 gets modified if MMX
178
             //			pavgb	mm6, mm4			// avg of center and surround interp vals, use macro
177
             //			pavgb	mm6, mm4			// avg of center and surround interp vals, use macro
179
             V_PAVGB ("%%mm6", "%%mm4", "%%mm7", MANGLE(ShiftMask))
178
             V_PAVGB ("%%mm6", "%%mm4", "%%mm7", "%8")
180
179
181
             // Don't do any more averaging than needed for mmx. It hurts performance and causes rounding errors.
180
             // Don't do any more averaging than needed for mmx. It hurts performance and causes rounding errors.
182
#ifndef IS_MMX
181
#ifndef IS_MMX
183
             //          pavgb	mm4, mm6			// 1/4 center, 3/4 adjacent
182
             //          pavgb	mm4, mm6			// 1/4 center, 3/4 adjacent
184
             V_PAVGB ("%%mm4", "%%mm6", "%%mm7", MANGLE(ShiftMask))
183
             V_PAVGB ("%%mm4", "%%mm6", "%%mm7", "%8")
185
             //    		pavgb	mm6, mm4			// 3/8 center, 5/8 adjacent
184
             //    		pavgb	mm6, mm4			// 3/8 center, 5/8 adjacent
186
             V_PAVGB ("%%mm6", "%%mm4", "%%mm7", MANGLE(ShiftMask))
185
             V_PAVGB ("%%mm6", "%%mm4", "%%mm7", "%8")
187
#endif
186
#endif
188
187
189
             // get abs value of possible L2 comb
188
             // get abs value of possible L2 comb
Lines 236-299 static void FUNCT_NAME(uint8_t *output, Link Here
236
             // pminub	mm5, mm3                    // now = Min(L1,L3), use macro
235
             // pminub	mm5, mm3                    // now = Min(L1,L3), use macro
237
             V_PMINUB ("%%mm5", "%%mm3", "%%mm7")
236
             V_PMINUB ("%%mm5", "%%mm3", "%%mm7")
238
             // allow the value to be above the high or below the low by amt of MaxComb
237
             // allow the value to be above the high or below the low by amt of MaxComb
239
             "psubusb "MANGLE(MaxComb)", %%mm5\n\t"      // lower min by diff
238
             "psubusb %9,           %%mm5\n\t"      // lower min by diff
240
             "paddusb "MANGLE(MaxComb)", %%mm2\n\t"      // increase max by diff
239
             "paddusb %9,           %%mm2\n\t"      // increase max by diff
241
             // pmaxub	mm4, mm5                    // now = Max(best,Min(L1,L3) use macro
240
             // pmaxub	mm4, mm5                    // now = Max(best,Min(L1,L3) use macro
242
             V_PMAXUB ("%%mm4", "%%mm5")
241
             V_PMAXUB ("%%mm4", "%%mm5")
243
             // pminub	mm4, mm2                    // now = Min( Max(best, Min(L1,L3), L2 )=L2 clipped
242
             // pminub	mm4, mm2                    // now = Min( Max(best, Min(L1,L3), L2 )=L2 clipped
244
             V_PMINUB ("%%mm4", "%%mm2", "%%mm7")
243
             V_PMINUB ("%%mm4", "%%mm2", "%%mm7")
245
244
246
             // Blend weave pixel with bob pixel, depending on motion val in mm0
245
             // Blend weave pixel with bob pixel, depending on motion val in mm0
247
             "psubusb "MANGLE(MotionThreshold)", %%mm0\n\t"// test Threshold, clear chroma change >>>??
246
             "psubusb %10,          %%mm0\n\t"// test Threshold, clear chroma change >>>??
248
             "pmullw  "MANGLE(MotionSense)", %%mm0\n\t"    // mul by user factor, keep low 16 bits
247
             "pmullw  %11,          %%mm0\n\t"    // mul by user factor, keep low 16 bits
249
             "movq   "MANGLE(QW256)", %%mm7\n\t"
248
             "movq    %12,          %%mm7\n\t"
250
#ifdef IS_SSE
249
#ifdef IS_SSE
251
             "pminsw  %%mm7,        %%mm0\n\t"      // max = 256
250
             "pminsw  %%mm7,        %%mm0\n\t"      // max = 256
252
#else
251
#else
253
             "paddusw "MANGLE(QW256B)", %%mm0\n\t"      // add, may sat at fff..
252
             "paddusw %13,          %%mm0\n\t"      // add, may sat at fff..
254
             "psubusw "MANGLE(QW256B)", %%mm0\n\t"      // now = Min(L1,256)
253
             "psubusw %13,          %%mm0\n\t"      // now = Min(L1,256)
255
#endif
254
#endif
256
             "psubusw %%mm0,        %%mm7\n\t"      // so the 2 sum to 256, weighted avg
255
             "psubusw %%mm0,        %%mm7\n\t"      // so the 2 sum to 256, weighted avg
257
             "movq    %%mm4,        %%mm2\n\t"      // save weave chroma info before trashing
256
             "movq    %%mm4,        %%mm2\n\t"      // save weave chroma info before trashing
258
             "pand   "MANGLE(YMask)", %%mm4\n\t"      // keep only luma from calc'd value
257
             "pand    %14,          %%mm4\n\t"      // keep only luma from calc'd value
259
             "pmullw  %%mm7,        %%mm4\n\t"      // use more weave for less motion
258
             "pmullw  %%mm7,        %%mm4\n\t"      // use more weave for less motion
260
             "pand   "MANGLE(YMask)", %%mm6\n\t"      // keep only luma from calc'd value
259
             "pand    %14,          %%mm6\n\t"      // keep only luma from calc'd value
261
             "pmullw  %%mm0,        %%mm6\n\t"      // use more bob for large motion
260
             "pmullw  %%mm0,        %%mm6\n\t"      // use more bob for large motion
262
             "paddusw %%mm6,        %%mm4\n\t"      // combine
261
             "paddusw %%mm6,        %%mm4\n\t"      // combine
263
             "psrlw   $8,           %%mm4\n\t"      // div by 256 to get weighted avg
262
             "psrlw   $8,           %%mm4\n\t"      // div by 256 to get weighted avg
264
263
265
             // chroma comes from weave pixel
264
             // chroma comes from weave pixel
266
             "pand   "MANGLE(UVMask)", %%mm2\n\t"      // keep chroma
265
             "pand    %15,          %%mm2\n\t"      // keep chroma
267
             "por     %%mm4,        %%mm2\n\t"      // and combine
266
             "por     %%mm4,        %%mm2\n\t"      // and combine
268
267
269
             V_MOVNTQ ("(%%"XDI")", "%%mm2")        // move in our clipped best, use macro
268
             V_MOVNTQ ("(%%"XDI")", "%%mm2")        // move in our clipped best, use macro
270
269
271
             // bump ptrs and loop
270
             // bump ptrs and loop
272
             LEAX"    8(%%"XAX"),   %%"XAX"\n\t"
271
             LEAX"    8(%%"XAX"),   %%"XAX"\n\t"
273
             LEAX"    8(%%"XBX"),   %%"XBX"\n\t"
274
             LEAX"    8(%%"XDX"),   %%"XDX"\n\t"
272
             LEAX"    8(%%"XDX"),   %%"XDX"\n\t"
273
             ADDX"    $8,         "asmtemp"\n\t"
275
             LEAX"    8(%%"XDI"),   %%"XDI"\n\t"
274
             LEAX"    8(%%"XDI"),   %%"XDI"\n\t"
276
             LEAX"    8(%%"XSI"),   %%"XSI"\n\t"
275
             LEAX"    8(%%"XSI"),   %%"XSI"\n\t"
277
             DECX"    "asmLoopCtr"\n\t"
276
             DECX"    "asmLoopCtr"\n\t"
278
             "jg      1b\n\t"                       // loop if not to last line
277
             "jg      1b\n\t"                       // loop if not to last line
279
                                                    // note P-III default assumes backward branches taken
278
                                                    // note P-III default assumes backward branches taken
280
             "jl      1f\n\t"                       // done
279
             "jl      1f\n\t"                       // done
281
             MOVX"    %%"XAX",      %%"XBX"\n\t"  // sharpness lookahead 1 byte only, be wrong on 1
280
             MOVX"    %%"XAX",      %%"XDX"\n\t"  // sharpness lookahead 1 byte only, be wrong on 1
282
             "jmp     1b\n\t"
281
             "jmp     1b\n\t"
283
282
284
             "1:\n\t"
283
             "1:\n\t"
285
	     MOVX" "asmoldbx", %%"XBX"\n\t"
286
284
287
             : /* no outputs */
285
             : /* no outputs */
288
286
289
             : "m"(LastAvg),
287
             : "m"(LastAvg),
290
               "m"(L1),
288
               "m"(L1),
291
               "m"(L3),
289
               "m"(L3),
292
               "m"(L2P),
290
               "m"(temp),
293
               "m"(L2),
291
               "m"(L2),
294
               "m"(Dest),
292
               "m"(Dest),
295
               "m"(LoopCtr),
293
               "m"(LoopCtr),
296
               "m"(oldbx)
294
               "m"(temp),
295
               "m"(ShiftMask),
296
               "m"(MaxComb),
297
               "m"(MotionThreshold),
298
               "m"(MotionSense),
299
               "m"(QW256),
300
               "m"(QW256B),
301
               "m"(YMask),
302
               "m"(UVMask)
297
303
298
             : XAX, XCX, XDX, XSI, XDI,
304
             : XAX, XCX, XDX, XSI, XDI,
299
#ifdef ARCH_X86
305
#ifdef ARCH_X86
(-)xine-lib-1.1.1-old/src/post/deinterlace/plugins/tomsmocomp/SearchLoop0A.inc (-2 / +2 lines)
Lines 7-15 Link Here
7
// up by a little, and adjust later
7
// up by a little, and adjust later
8
8
9
#ifdef IS_SSE2
9
#ifdef IS_SSE2
10
		"paddusb "MANGLE(ONES)", %%xmm7\n\t"				// bias toward no motion
10
		"paddusb "_ONES", %%xmm7\n\t"				// bias toward no motion
11
#else
11
#else
12
		"paddusb "MANGLE(ONES)", %%mm7\n\t" 				// bias toward no motion
12
		"paddusb "_ONES", %%mm7\n\t" 				// bias toward no motion
13
#endif
13
#endif
14
14
15
        MERGE4PIXavg("(%%"XDI", %%"XCX")", "(%%"XSI", %%"XCX")")  // center, in old and new
15
        MERGE4PIXavg("(%%"XDI", %%"XCX")", "(%%"XSI", %%"XCX")")  // center, in old and new
(-)xine-lib-1.1.1-old/src/post/deinterlace/plugins/tomsmocomp/SearchLoopBottom.inc (-21 / +32 lines)
Lines 18-24 Link Here
18
            // Use the best weave if diffs less than 10 as that
18
            // Use the best weave if diffs less than 10 as that
19
            // means the image is still or moving cleanly
19
            // means the image is still or moving cleanly
20
            // if there is motion we will clip which will catch anything
20
            // if there is motion we will clip which will catch anything
21
            "psubusb "MANGLE(FOURS)", %%mm7\n\t"          // sets bits to zero if weave diff < 4
21
            "psubusb "_FOURS", %%mm7\n\t"          // sets bits to zero if weave diff < 4
22
            "pxor    %%mm0, %%mm0\n\t"
22
            "pxor    %%mm0, %%mm0\n\t"
23
            "pcmpeqb %%mm0, %%mm7\n\t"            // all ff where weave better, else 00
23
            "pcmpeqb %%mm0, %%mm7\n\t"            // all ff where weave better, else 00
24
            "pcmpeqb %%mm7, %%mm0\n\t"            // all ff where bob better, else 00
24
            "pcmpeqb %%mm7, %%mm0\n\t"            // all ff where bob better, else 00
Lines 28-37 Link Here
28
#else
28
#else
29
            // Use the better of bob or weave
29
            // Use the better of bob or weave
30
            //      pminub  mm4, TENS           // the most we care about
30
            //      pminub  mm4, TENS           // the most we care about
31
            V_PMINUB ("%%mm4", MANGLE(TENS), "%%mm0")   // the most we care about
31
            V_PMINUB ("%%mm4", _TENS, "%%mm0")   // the most we care about
32
            
32
            
33
            "psubusb %%mm4, %%mm7\n\t"            // foregive that much from weave est?
33
            "psubusb %%mm4, %%mm7\n\t"            // foregive that much from weave est?
34
            "psubusb "MANGLE(FOURS)", %%mm7\n\t"       // bias it a bit toward weave
34
            "psubusb "_FOURS", %%mm7\n\t"       // bias it a bit toward weave
35
            "pxor    %%mm0, %%mm0\n\t"
35
            "pxor    %%mm0, %%mm0\n\t"
36
            "pcmpeqb %%mm0, %%mm7\n\t"            // all ff where weave better, else 00
36
            "pcmpeqb %%mm0, %%mm7\n\t"            // all ff where weave better, else 00
37
            "pcmpeqb %%mm7, %%mm0\n\t"            // all ff where bob better, else 00
37
            "pcmpeqb %%mm7, %%mm0\n\t"            // all ff where bob better, else 00
Lines 42-50 Link Here
42
            
42
            
43
            
43
            
44
                //      pminub  mm0, Max_Vals       // but clip to catch the stray error
44
                //      pminub  mm0, Max_Vals       // but clip to catch the stray error
45
//                V_PMINUB ("%%mm0", MANGLE(Max_Vals), "%%mm1") // but clip to catch the stray error
45
//                V_PMINUB ("%%mm0", _Max_Vals, "%%mm1") // but clip to catch the stray error
46
                //      pmaxub  mm0, Min_Vals
46
                //      pmaxub  mm0, Min_Vals
47
//                V_PMAXUB ("%%mm0", MANGLE(Min_Vals))
47
//                V_PMAXUB ("%%mm0", _Min_Vals)
48
                
48
                
49
#endif
49
#endif
50
50
Lines 53-80 Link Here
53
                
53
                
54
#ifdef USE_VERTICAL_FILTER
54
#ifdef USE_VERTICAL_FILTER
55
            "movq    %%mm0, %%mm1\n\t"
55
            "movq    %%mm0, %%mm1\n\t"
56
            //      pavgb   mm0, qword ptr["XBX"]
56
            //      pavgb   mm0, qword ptr["XDX"]
57
            V_PAVGB ("%%mm0", "(%%"XBX")", "%%mm2", MANGLE(ShiftMask))
57
            V_PAVGB ("%%mm0", "(%%"XDX")", "%%mm2", _ShiftMask)
58
            //      movntq  qword ptr["XAX"+"XDX"], mm0
58
            //      movntq  qword ptr["XAX"+"olddx"], mm0
59
            V_MOVNTQ ("(%"XAX", %%"XDX")", "%%mm0")
59
            ADDX"   "_olddx", %%"XAX"\n\t"
60
            //      pavgb   mm1, qword ptr["XBX"+"XCX"]
60
            V_MOVNTQ ("(%%"XAX")", "%%mm0")
61
            V_PAVGB ("%%mm1", "(%%"XBX", %%"XCX")", "%%mm2", MANGLE(ShiftMask))
61
            //      pavgb   mm1, qword ptr["XDX"+"XCX"]
62
            "addq   "_dst_pitchw", %%"XBX
62
            V_PAVGB ("%%mm1", "(%%"XDX", %%"XCX")", "%%mm2", _ShiftMask)
63
            //      movntq  qword ptr["XAX"+"XDX"], mm1
63
            "addq   "_dst_pitchw", %%"XDX
64
            V_MOVNTQ ("(%%"XAX", %%"XDX")", "%%mm1")
64
            //      movntq  qword ptr["XAX"+"olddx"], mm1
65
            V_MOVNTQ ("(%%"XAX")", "%%mm1")
65
#else
66
#else
66
                
67
                
67
            //      movntq  qword ptr["XAX"+"XDX"], mm0
68
            //      movntq  qword ptr["XAX"+"olddx"], mm0
68
                V_MOVNTQ ("(%%"XAX", %%"XDX")", "%%mm0")
69
            ADDX"   "_olddx", %%"XAX"\n\t"
70
            V_MOVNTQ ("(%%"XAX")", "%%mm0")
69
#endif
71
#endif
70
                
72
                
71
           LEAX"    8(%%"XDX"), %%"XDX"\n\t"       // bump offset pointer
73
           ADDX"    $8, "_olddx"\n\t"       // bump offset pointer
72
           CMPX"    "_Last8", %%"XDX"\n\t"       // done with line?
74
           MOVX"    "_olddx", %%"XAX"\n\t"
75
           CMPX"    "_Last8", %%"XAX"\n\t"       // done with line?
73
           "jb      1b\n\t"                    // y
76
           "jb      1b\n\t"                    // y
74
#endif
77
#endif
75
78
76
           MOVX" "_oldbx", %%"XBX"\n\t"
77
78
        : /* no outputs */
79
        : /* no outputs */
79
80
80
        : "m"(pBob),
81
        : "m"(pBob),
Lines 85-91 Link Here
85
          "m"(pSrc),
86
          "m"(pSrc),
86
          "m"(pSrcP),
87
          "m"(pSrcP),
87
          "m"(pBobP),
88
          "m"(pBobP),
88
          "m"(oldbx)
89
          "m"(olddx),
90
          "m"(UVMask),
91
          "m"(ShiftMask),
92
          "m"(FOURS),
93
          "m"(TENS),
94
          "m"(Max_Vals),
95
          "m"(Min_Vals),
96
          "m"(YMask),
97
          "m"(Max_Mov),
98
          "m"(ONES),
99
          "m"(DiffThres)
89
100
90
        : XAX, XCX, XDX, XSI, XDI,
101
        : XAX, XCX, XDX, XSI, XDI,
91
#ifdef ARCH_X86
102
#ifdef ARCH_X86
(-)xine-lib-1.1.1-old/src/post/deinterlace/plugins/tomsmocomp/SearchLoopTop.inc (-28 / +36 lines)
Lines 66-72 long dst_pitchw = dst_pitch; // local s Link Here
66
#define _pSrc       "%5"
66
#define _pSrc       "%5"
67
#define _pSrcP      "%6"
67
#define _pSrcP      "%6"
68
#define _pBobP      "%7"
68
#define _pBobP      "%7"
69
#define _oldbx      "%8"
69
#define _olddx      "%8"
70
#define _UVMask     "%9"
71
#define _ShiftMask  "%10"
72
#define _FOURS      "%11"
73
#define _TENS       "%12"
74
#define _Max_Vals   "%13"
75
#define _Min_Vals   "%14"
76
#define _YMask      "%15"
77
#define _Max_Mov    "%16"
78
#define _ONES       "%17"
79
#define _DiffThres  "%18"
70
#endif
80
#endif
71
81
72
	for (y=1; y < FldHeight-1; y++)
82
	for (y=1; y < FldHeight-1; y++)
Lines 77-151 long dst_pitchw = dst_pitch; // local s Link Here
77
             // Loop general reg usage
87
             // Loop general reg usage
78
             //
88
             //
79
             // XAX - pBobP, then pDest 
89
             // XAX - pBobP, then pDest 
80
             // XBX - pBob
90
             // XDX - pBob
81
             // XCX - src_pitch2
91
             // XCX - src_pitch2
82
             // XDX - current offset
92
             // _olddx - current offset
83
             // XDI - prev weave pixels, 1 line up
93
             // XDI - prev weave pixels, 1 line up
84
             // XSI - next weave pixels, 1 line up
94
             // XSI - next weave pixels, 1 line up
85
95
86
             // Save "XBX" (-fPIC)
87
	     MOVX" %%"XBX", "_oldbx"\n\t"
88
             
89
#ifdef IS_SSE2
96
#ifdef IS_SSE2
90
             
97
             
91
             // sse2 code deleted for now
98
             // sse2 code deleted for now
92
99
93
#else
100
#else
94
             // simple bob first 8 bytes
101
             // simple bob first 8 bytes
95
             MOVX"	"_pBob",        %%"XBX"\n\t"
102
             MOVX"	"_pBob",        %%"XDX"\n\t"
96
             MOVX"	"_src_pitch2",  %%"XCX"\n\t"
103
             MOVX"	"_src_pitch2",  %%"XCX"\n\t"
97
104
98
#ifdef USE_VERTICAL_FILTER
105
#ifdef USE_VERTICAL_FILTER
99
             "movq	    (%%"XBX"),        %%mm0\n\t"
106
             "movq	    (%%"XDX"),        %%mm0\n\t"
100
             "movq	    (%%"XBX", %%"XCX"), %%mm1\n\t" //, qword ptr["XBX"+"XCX"]
107
             "movq	    (%%"XDX", %%"XCX"), %%mm1\n\t" //, qword ptr["XDX"+"XCX"]
101
             "movq	    %%mm0,          %%mm2\n\t"
108
             "movq	    %%mm0,          %%mm2\n\t"
102
             V_PAVGB ("%%mm2", "%%mm1", "%%mm3", MANGLE(ShiftMask))		// halfway between
109
             V_PAVGB ("%%mm2", "%%mm1", "%%mm3", _ShiftMask)		// halfway between
103
             V_PAVGB ("%%mm0", "%%mm2", "%%mm3", MANGLE(ShiftMask))		// 1/4 way
110
             V_PAVGB ("%%mm0", "%%mm2", "%%mm3", _ShiftMask)		// 1/4 way
104
             V_PAVGB ("%%mm1", "%%mm2", "%%mm3", MANGLE(ShiftMask))		// 3/4 way
111
             V_PAVGB ("%%mm1", "%%mm2", "%%mm3", _ShiftMask)		// 3/4 way
105
             MOVX"		"_pDest",       %%"XDI"\n\t"
112
             MOVX"		"_pDest",       %%"XDI"\n\t"
106
             MOVX"		"_dst_pitchw",  %%"XAX"\n\t"
113
             MOVX"		"_dst_pitchw",  %%"XAX"\n\t"
107
             V_MOVNTQ	("(%%"XDI")", "%%mm0")
114
             V_MOVNTQ	("(%%"XDI")", "%%mm0")
108
             V_MOVNTQ	("(%%"XDI", %%"XAX")", "%%mm1") // qword ptr["XDI"+"XAX"], mm1
115
             V_MOVNTQ	("(%%"XDI", %%"XAX")", "%%mm1") // qword ptr["XDI"+"XAX"], mm1
109
116
110
             // simple bob last 8 bytes
117
             // simple bob last 8 bytes
111
             MOVX"		"_Last8", %%"XDX"\n\t"
118
             MOVX"		"_Last8", %%"XSI"\n\t"
112
             LEAX"		(%%"XBX", %%"XDX"), %%"XSI"\n\t"  // ["XBX"+"XDX"]
119
             ADDX"		%%"XDX", %%"XSI"\n\t"  // ["XDX"+"olddx"]
113
             "movq	    (%%"XSI"), %%mm0\n\t"
120
             "movq	    (%%"XSI"), %%mm0\n\t"
114
             "movq	    (%%"XSI", %%"XCX"), %%mm1\n\t"    // qword ptr["XSI"+"XCX"]
121
             "movq	    (%%"XSI", %%"XCX"), %%mm1\n\t"    // qword ptr["XSI"+"XCX"]
115
             "movq	    %%mm0, %%mm2\n\t"
122
             "movq	    %%mm0, %%mm2\n\t"
116
             V_PAVGB ("%%mm2", "%%mm1", "%%mm3", MANGLE(ShiftMask))		// halfway between
123
             V_PAVGB ("%%mm2", "%%mm1", "%%mm3", _ShiftMask)		// halfway between
117
             V_PAVGB ("%%mm0", "%%mm2", "%%mm3", MANGLE(ShiftMask))		// 1/4 way
124
             V_PAVGB ("%%mm0", "%%mm2", "%%mm3", _ShiftMask)		// 1/4 way
118
             V_PAVGB ("%%mm1", "%%mm2", "%%mm3", MANGLE(ShiftMask))		// 3/4 way
125
             V_PAVGB ("%%mm1", "%%mm2", "%%mm3", _ShiftMask)		// 3/4 way
119
             ADDX"		%%"XDX", %%"XDI"\n\t"						// last 8 bytes of dest
126
             ADDX"		"_olddx", %%"XDI"\n\t"						// last 8 bytes of dest
120
             V_MOVNTQ	("%%"XDI"", "%%mm0")
127
             V_MOVNTQ	("%%"XDI"", "%%mm0")
121
             V_MOVNTQ	("(%%"XDI", %%"XAX")", "%%mm1") // qword ptr["XDI"+"XAX"], mm1)
128
             V_MOVNTQ	("(%%"XDI", %%"XAX")", "%%mm1") // qword ptr["XDI"+"XAX"], mm1)
122
129
123
#else
130
#else
124
             "movq	(%%"XBX"), %%mm0\n\t"
131
             "movq	(%%"XDX"), %%mm0\n\t"
125
             //		pavgb	mm0, qword ptr["XBX"+"XCX"]
132
             //		pavgb	mm0, qword ptr["XDX"+"XCX"]
126
             V_PAVGB ("%%mm0", "(%%"XBX", %%"XCX")", "%%mm2", MANGLE(ShiftMask)) // qword ptr["XBX"+"XCX"], mm2, ShiftMask)
133
             V_PAVGB ("%%mm0", "(%%"XDX", %%"XCX")", "%%mm2", _ShiftMask) // qword ptr["XDX"+"XCX"], mm2, ShiftMask)
127
             MOVX"		"_pDest", %%"XDI"\n\t"
134
             MOVX"		"_pDest", %%"XDI"\n\t"
128
             V_MOVNTQ	("(%%"XDI")", "%%mm0")
135
             V_MOVNTQ	("(%%"XDI")", "%%mm0")
129
136
130
             // simple bob last 8 bytes
137
             // simple bob last 8 bytes
131
             MOVX"		"_Last8", %%"XDX"\n\t"
138
             MOVX"		"_Last8", %%"XSI"\n\t"
132
             LEAX"		(%%"XBX", %%"XDX"), %%"XSI"\n\t" //"XSI", ["XBX"+"XDX"]
139
             ADDX"		%%"XDX", %%"XSI"\n\t" //"XSI", ["XDX"+"olddx"]
133
             "movq	    (%%"XSI"), %%mm0\n\t"
140
             "movq	    (%%"XSI"), %%mm0\n\t"
134
             //		pavgb	mm0, qword ptr["XSI"+"XCX"]
141
             //		pavgb	mm0, qword ptr["XSI"+"XCX"]
135
             V_PAVGB	("%%mm0", "(%%"XSI", %%"XCX")", "%%mm2", MANGLE(ShiftMask)) // qword ptr["XSI"+"XCX"], mm2, ShiftMask)
142
             V_PAVGB	("%%mm0", "(%%"XSI", %%"XCX")", "%%mm2", _ShiftMask) // qword ptr["XSI"+"XCX"], mm2, ShiftMask)
136
             V_MOVNTQ	("(%%"XDI", %%"XDX")", "%%mm0") // qword ptr["XDI"+"XDX"], mm0)
143
             ADDX"		"_olddx", %%"XDI"\n\t"
144
             V_MOVNTQ	("(%%"XDI")", "%%mm0") // qword ptr["XDI"+"olddx"], mm0)
137
#endif
145
#endif
138
             // now loop and get the middle qwords
146
             // now loop and get the middle qwords
139
             MOVX"		"_pSrc", %%"XSI"\n\t"
147
             MOVX"		"_pSrc", %%"XSI"\n\t"
140
             MOVX"		"_pSrcP", %%"XDI"\n\t"
148
             MOVX"		"_pSrcP", %%"XDI"\n\t"
141
             MOVX"		$8, %%"XDX"\n\t"				// curr offset longo all lines
149
             MOVX"		$8, "_olddx"\n\t"				// curr offset longo all lines
142
150
143
             "1:\n\t"	
151
             "1:\n\t"	
144
             MOVX"		"_pBobP", %%"XAX"\n\t"
152
             MOVX"		"_pBobP", %%"XAX"\n\t"
145
             ADDX"		$8, %%"XDI"\n\t"
153
             ADDX"		$8, %%"XDI"\n\t"
146
             ADDX"		$8, %%"XSI"\n\t"
154
             ADDX"		$8, %%"XSI"\n\t"
147
             ADDX"		$8, %%"XBX"\n\t"
155
             ADDX"		$8, %%"XDX"\n\t"
148
             ADDX"		%%"XDX", %%"XAX"\n\t"
156
             ADDX"		"_olddx", %%"XAX"\n\t"
149
157
150
#ifdef USE_STRANGE_BOB
158
#ifdef USE_STRANGE_BOB
151
#include "StrangeBob.inc"
159
#include "StrangeBob.inc"
(-)xine-lib-1.1.1-old/src/post/deinterlace/plugins/tomsmocomp/StrangeBob.inc (-40 / +40 lines)
Lines 31-52 Link Here
31
        "pxor %%mm6, %%mm6\n\t"
31
        "pxor %%mm6, %%mm6\n\t"
32
        "pxor %%mm7, %%mm7\n\t"
32
        "pxor %%mm7, %%mm7\n\t"
33
33
34
		"movq    -2(%%"XBX"), %%mm0\n\t"		// value a from top left		
34
		"movq    -2(%%"XDX"), %%mm0\n\t"		// value a from top left		
35
		"movq    -4(%%"XBX", %%"XCX"), %%mm1\n\t"	// value m from bottom right			
35
		"movq    -4(%%"XDX", %%"XCX"), %%mm1\n\t"	// value m from bottom right			
36
        
36
        
37
		"movq	%%mm0, %%mm3\n\t"
37
		"movq	%%mm0, %%mm3\n\t"
38
		"psubusb	%%mm1, %%mm3\n\t"
38
		"psubusb	%%mm1, %%mm3\n\t"
39
		"psubusb %%mm0, %%mm1\n\t"
39
		"psubusb %%mm0, %%mm1\n\t"
40
		"por		%%mm1, %%mm3\n\t"					// abs(a,m)
40
		"por		%%mm1, %%mm3\n\t"					// abs(a,m)
41
41
42
		"psubusb "MANGLE(DiffThres)", %%mm3\n\t"		// nonzero where abs(a,m) > Thres else 0
42
		"psubusb "_DiffThres", %%mm3\n\t"		// nonzero where abs(a,m) > Thres else 0
43
		"pxor	%%mm4, %%mm4\n\t"
43
		"pxor	%%mm4, %%mm4\n\t"
44
		"pcmpeqb %%mm4, %%mm3\n\t"			// now ff where abs(a,m) < Thres, else 00	
44
		"pcmpeqb %%mm4, %%mm3\n\t"			// now ff where abs(a,m) < Thres, else 00	
45
		"pcmpeqb	%%mm3, %%mm4\n\t"			// here ff where abs(a,m) > Thres, else 00
45
		"pcmpeqb	%%mm3, %%mm4\n\t"			// here ff where abs(a,m) > Thres, else 00
46
46
47
47
48
		"movq    -4(%%"XBX"), %%mm0\n\t"		// value j
48
		"movq    -4(%%"XDX"), %%mm0\n\t"		// value j
49
		"movq    4(%%"XBX", %%"XCX"), %%mm1\n\t"	// value n
49
		"movq    4(%%"XDX", %%"XCX"), %%mm1\n\t"	// value n
50
		"movq	%%mm0, %%mm2\n\t"					
50
		"movq	%%mm0, %%mm2\n\t"					
51
		"pavgb	%%mm1, %%mm2\n\t"					// avg(j,n)
51
		"pavgb	%%mm1, %%mm2\n\t"					// avg(j,n)
52
        "movq	%%mm0, %%mm3\n\t"
52
        "movq	%%mm0, %%mm3\n\t"
Lines 55-61 Link Here
55
		"por		%%mm1, %%mm0\n\t"					// abs(j,n)
55
		"por		%%mm1, %%mm0\n\t"					// abs(j,n)
56
56
57
        "movq    %%mm0, %%mm1\n\t"
57
        "movq    %%mm0, %%mm1\n\t"
58
		"psubusb "MANGLE(DiffThres)", %%mm1\n\t"		// nonzero where abs(j,n) > Thres else 0
58
		"psubusb "_DiffThres", %%mm1\n\t"		// nonzero where abs(j,n) > Thres else 0
59
		"pxor	%%mm3, %%mm3\n\t"
59
		"pxor	%%mm3, %%mm3\n\t"
60
		"pcmpeqb %%mm3, %%mm1\n\t"			// now ff where abs(j,n) < Thres, else 00	
60
		"pcmpeqb %%mm3, %%mm1\n\t"			// now ff where abs(j,n) < Thres, else 00	
61
61
Lines 75-105 Link Here
75
        "por     %%mm0, %%mm7\n\t"
75
        "por     %%mm0, %%mm7\n\t"
76
        
76
        
77
        // k & m
77
        // k & m
78
		"movq    2(%%"XBX"), %%mm0\n\t"		// value c from top left		
78
		"movq    2(%%"XDX"), %%mm0\n\t"		// value c from top left		
79
		"movq    4(%%"XBX", %%"XCX"), %%mm1\n\t"	// value n from bottom right			
79
		"movq    4(%%"XDX", %%"XCX"), %%mm1\n\t"	// value n from bottom right			
80
80
81
		"movq	%%mm0, %%mm3\n\t"
81
		"movq	%%mm0, %%mm3\n\t"
82
		"psubusb	%%mm1, %%mm3\n\t"
82
		"psubusb	%%mm1, %%mm3\n\t"
83
		"psubusb %%mm0, %%mm1\n\t"
83
		"psubusb %%mm0, %%mm1\n\t"
84
		"por		%%mm1, %%mm3\n\t"					// abs(c,n)
84
		"por		%%mm1, %%mm3\n\t"					// abs(c,n)
85
85
86
		"psubusb "MANGLE(DiffThres)", %%mm3\n\t"		// nonzero where abs(c,n) > Thres else 0
86
		"psubusb "_DiffThres", %%mm3\n\t"		// nonzero where abs(c,n) > Thres else 0
87
		"pxor	%%mm4, %%mm4\n\t"
87
		"pxor	%%mm4, %%mm4\n\t"
88
		"pcmpeqb %%mm4, %%mm3\n\t"			// now ff where abs(c,n) < Thres, else 00	
88
		"pcmpeqb %%mm4, %%mm3\n\t"			// now ff where abs(c,n) < Thres, else 00	
89
		"pcmpeqb	%%mm3, %%mm4\n\t"			// here ff where abs(c,n) > Thres, else 00
89
		"pcmpeqb	%%mm3, %%mm4\n\t"			// here ff where abs(c,n) > Thres, else 00
90
90
91
91
92
		"movq    4(%%"XBX"), %%mm0\n\t"		// value k
92
		"movq    4(%%"XDX"), %%mm0\n\t"		// value k
93
		"movq    -4(%%"XBX", %%"XCX"), %%mm1\n\t"	// value m
93
		"movq    -4(%%"XDX", %%"XCX"), %%mm1\n\t"	// value m
94
		"movq	%%mm0, %%mm2\n\t"					
94
		"movq	%%mm0, %%mm2\n\t"					
95
		V_PAVGB ("%%mm2", "%%mm1", "%%mm3", MANGLE(ShiftMask))	// avg(k,m)
95
		V_PAVGB ("%%mm2", "%%mm1", "%%mm3", _ShiftMask)	// avg(k,m)
96
        "movq	%%mm0, %%mm3\n\t"
96
        "movq	%%mm0, %%mm3\n\t"
97
		"psubusb	%%mm1, %%mm0\n\t"
97
		"psubusb	%%mm1, %%mm0\n\t"
98
		"psubusb %%mm3, %%mm1\n\t"
98
		"psubusb %%mm3, %%mm1\n\t"
99
		"por		%%mm1, %%mm0\n\t"					// abs(k,m)
99
		"por		%%mm1, %%mm0\n\t"					// abs(k,m)
100
100
101
        "movq    %%mm0, %%mm1\n\t"
101
        "movq    %%mm0, %%mm1\n\t"
102
		"psubusb "MANGLE(DiffThres)", %%mm1\n\t"		// nonzero where abs(k,m) > Thres else 0
102
		"psubusb "_DiffThres", %%mm1\n\t"		// nonzero where abs(k,m) > Thres else 0
103
		"pxor	%%mm3, %%mm3\n\t"
103
		"pxor	%%mm3, %%mm3\n\t"
104
		"pcmpeqb %%mm3, %%mm1\n\t"			// now ff where abs(k,m) < Thres, else 00	
104
		"pcmpeqb %%mm3, %%mm1\n\t"			// now ff where abs(k,m) < Thres, else 00	
105
105
Lines 120-149 Link Here
120
120
121
121
122
        // c & d
122
        // c & d
123
		"movq    (%%"XBX"), %%mm0\n\t"		// value b from top left		
123
		"movq    (%%"XDX"), %%mm0\n\t"		// value b from top left		
124
		"movq    2(%%"XBX", %%"XCX"), %%mm1\n\t"	// value f from bottom right			
124
		"movq    2(%%"XDX", %%"XCX"), %%mm1\n\t"	// value f from bottom right			
125
125
126
		"movq	%%mm0, %%mm3\n\t"
126
		"movq	%%mm0, %%mm3\n\t"
127
		"psubusb	%%mm1, %%mm3\n\t"
127
		"psubusb	%%mm1, %%mm3\n\t"
128
		"psubusb %%mm0, %%mm1\n\t"
128
		"psubusb %%mm0, %%mm1\n\t"
129
		"por		%%mm1, %%mm3\n\t"					// abs(b,f)
129
		"por		%%mm1, %%mm3\n\t"					// abs(b,f)
130
130
131
		"psubusb "MANGLE(DiffThres)", %%mm3\n\t"		// nonzero where abs(b,f) > Thres else 0
131
		"psubusb "_DiffThres", %%mm3\n\t"		// nonzero where abs(b,f) > Thres else 0
132
		"pxor	%%mm4, %%mm4\n\t"
132
		"pxor	%%mm4, %%mm4\n\t"
133
		"pcmpeqb %%mm4, %%mm3\n\t"			// now ff where abs(b,f) < Thres, else 00	
133
		"pcmpeqb %%mm4, %%mm3\n\t"			// now ff where abs(b,f) < Thres, else 00	
134
		"pcmpeqb	%%mm3, %%mm4\n\t"			// here ff where abs(b,f) > Thres, else 00
134
		"pcmpeqb	%%mm3, %%mm4\n\t"			// here ff where abs(b,f) > Thres, else 00
135
135
136
		"movq    2(%%"XBX"), %%mm0\n\t"		// value c
136
		"movq    2(%%"XDX"), %%mm0\n\t"		// value c
137
		"movq    -2(%%"XBX", %%"XCX"), %%mm1\n\t"	// value d
137
		"movq    -2(%%"XDX", %%"XCX"), %%mm1\n\t"	// value d
138
		"movq	%%mm0, %%mm2\n\t"					
138
		"movq	%%mm0, %%mm2\n\t"					
139
		V_PAVGB ("%%mm2", "%%mm1", "%%mm3", MANGLE(ShiftMask))	// avg(c,d)
139
		V_PAVGB ("%%mm2", "%%mm1", "%%mm3", _ShiftMask)	// avg(c,d)
140
        "movq	%%mm0, %%mm3\n\t"
140
        "movq	%%mm0, %%mm3\n\t"
141
		"psubusb	%%mm1, %%mm0\n\t"
141
		"psubusb	%%mm1, %%mm0\n\t"
142
		"psubusb %%mm3, %%mm1\n\t"
142
		"psubusb %%mm3, %%mm1\n\t"
143
		"por		%%mm1, %%mm0\n\t"					// abs(c,d)
143
		"por		%%mm1, %%mm0\n\t"					// abs(c,d)
144
144
145
        "movq    %%mm0, %%mm1\n\t"
145
        "movq    %%mm0, %%mm1\n\t"
146
		"psubusb "MANGLE(DiffThres)", %%mm1\n\t"		// nonzero where abs(c,d) > Thres else 0
146
		"psubusb "_DiffThres", %%mm1\n\t"		// nonzero where abs(c,d) > Thres else 0
147
		"pxor	%%mm3, %%mm3\n\t"
147
		"pxor	%%mm3, %%mm3\n\t"
148
        "pcmpeqb %%mm3, %%mm1\n\t"			// now ff where abs(c,d) < Thres, else 00	
148
        "pcmpeqb %%mm3, %%mm1\n\t"			// now ff where abs(c,d) < Thres, else 00	
149
149
Lines 163-192 Link Here
163
        "por     %%mm0, %%mm7\n\t"
163
        "por     %%mm0, %%mm7\n\t"
164
164
165
        // a & f
165
        // a & f
166
		"movq    (%%"XBX"), %%mm0\n\t"		// value b from top left		
166
		"movq    (%%"XDX"), %%mm0\n\t"		// value b from top left		
167
		"movq    -2(%%"XBX", %%"XCX"), %%mm1\n\t"	// value d from bottom right			
167
		"movq    -2(%%"XDX", %%"XCX"), %%mm1\n\t"	// value d from bottom right			
168
168
169
		"movq	%%mm0, %%mm3\n\t"
169
		"movq	%%mm0, %%mm3\n\t"
170
		"psubusb	%%mm1, %%mm3\n\t"
170
		"psubusb	%%mm1, %%mm3\n\t"
171
		"psubusb %%mm0, %%mm1\n\t"
171
		"psubusb %%mm0, %%mm1\n\t"
172
		"por		%%mm1, %%mm3\n\t"					// abs(b,d)
172
		"por		%%mm1, %%mm3\n\t"					// abs(b,d)
173
173
174
		"psubusb "MANGLE(DiffThres)", %%mm3\n\t"	// nonzero where abs(b,d) > Thres else 0
174
		"psubusb "_DiffThres", %%mm3\n\t"	// nonzero where abs(b,d) > Thres else 0
175
		"pxor	%%mm4, %%mm4\n\t"
175
		"pxor	%%mm4, %%mm4\n\t"
176
		"pcmpeqb %%mm4, %%mm3\n\t"			// now ff where abs(b,d) < Thres, else 00	
176
		"pcmpeqb %%mm4, %%mm3\n\t"			// now ff where abs(b,d) < Thres, else 00	
177
		"pcmpeqb	%%mm3, %%mm4\n\t"			// here ff where abs(b,d) > Thres, else 00
177
		"pcmpeqb	%%mm3, %%mm4\n\t"			// here ff where abs(b,d) > Thres, else 00
178
178
179
		"movq    -2(%%"XBX"), %%mm0\n\t"		// value a
179
		"movq    -2(%%"XDX"), %%mm0\n\t"		// value a
180
		"movq    2(%%"XBX", %%"XCX"), %%mm1\n\t"	// value f
180
		"movq    2(%%"XDX", %%"XCX"), %%mm1\n\t"	// value f
181
		"movq	%%mm0, %%mm2\n\t"					
181
		"movq	%%mm0, %%mm2\n\t"					
182
		V_PAVGB ("%%mm2", "%%mm1", "%%mm3", MANGLE(ShiftMask))	// avg(a,f)
182
		V_PAVGB ("%%mm2", "%%mm1", "%%mm3", _ShiftMask)	// avg(a,f)
183
        "movq	%%mm0, %%mm3\n\t"
183
        "movq	%%mm0, %%mm3\n\t"
184
        "psubusb	%%mm1, %%mm0\n\t"
184
        "psubusb	%%mm1, %%mm0\n\t"
185
		"psubusb %%mm3, %%mm1\n\t"
185
		"psubusb %%mm3, %%mm1\n\t"
186
		"por		%%mm1, %%mm0\n\t"					// abs(a,f)
186
		"por		%%mm1, %%mm0\n\t"					// abs(a,f)
187
187
188
        "movq    %%mm0, %%mm1\n\t"
188
        "movq    %%mm0, %%mm1\n\t"
189
		"psubusb "MANGLE(DiffThres)", %%mm1\n\t"		// nonzero where abs(a,f) > Thres else 0
189
		"psubusb "_DiffThres", %%mm1\n\t"		// nonzero where abs(a,f) > Thres else 0
190
		"pxor	%%mm3, %%mm3\n\t"
190
		"pxor	%%mm3, %%mm3\n\t"
191
		"pcmpeqb %%mm3, %%mm1\n\t"			// now ff where abs(a,f) < Thres, else 00	
191
		"pcmpeqb %%mm3, %%mm1\n\t"			// now ff where abs(a,f) < Thres, else 00	
192
192
Lines 205-226 Link Here
205
        "por     %%mm2, %%mm6\n\t"
205
        "por     %%mm2, %%mm6\n\t"
206
        "por     %%mm0, %%mm7\n\t"
206
        "por     %%mm0, %%mm7\n\t"
207
           
207
           
208
 		"pand	"MANGLE(YMask)", %%mm5\n\t"		// mask out chroma from here
208
 		"pand	"_YMask", %%mm5\n\t"		// mask out chroma from here
209
 		"pand	"MANGLE(YMask)", %%mm6\n\t"			// mask out chroma from here
209
 		"pand	"_YMask", %%mm6\n\t"			// mask out chroma from here
210
 		"pand	"MANGLE(YMask)", %%mm7\n\t"			// mask out chroma from here
210
 		"pand	"_YMask", %%mm7\n\t"			// mask out chroma from here
211
211
212
		// b,e
212
		// b,e
213
		"movq    (%%"XBX"), %%mm0\n\t"		// value b from top 		
213
		"movq    (%%"XDX"), %%mm0\n\t"		// value b from top 		
214
		"movq    (%%"XBX", %%"XCX"), %%mm1\n\t"	// value e from bottom 
214
		"movq    (%%"XDX", %%"XCX"), %%mm1\n\t"	// value e from bottom 
215
		"movq	%%mm0, %%mm2\n\t"					
215
		"movq	%%mm0, %%mm2\n\t"					
216
		V_PAVGB ("%%mm2", "%%mm1", "%%mm3", MANGLE(ShiftMask))	// avg(b,e)
216
		V_PAVGB ("%%mm2", "%%mm1", "%%mm3", _ShiftMask)	// avg(b,e)
217
        "movq	%%mm0, %%mm3\n\t"
217
        "movq	%%mm0, %%mm3\n\t"
218
        "psubusb	%%mm1, %%mm0\n\t"
218
        "psubusb	%%mm1, %%mm0\n\t"
219
		"psubusb %%mm3, %%mm1\n\t"
219
		"psubusb %%mm3, %%mm1\n\t"
220
		"por		%%mm1, %%mm0\n\t"					// abs(b,e)
220
		"por		%%mm1, %%mm0\n\t"					// abs(b,e)
221
221
222
        "movq    %%mm0, %%mm1\n\t"
222
        "movq    %%mm0, %%mm1\n\t"
223
		"psubusb "MANGLE(DiffThres)", %%mm1\n\t"		// nonzero where abs(b,e) > Thres else 0
223
		"psubusb "_DiffThres", %%mm1\n\t"		// nonzero where abs(b,e) > Thres else 0
224
		"pxor	%%mm3, %%mm3\n\t"
224
		"pxor	%%mm3, %%mm3\n\t"
225
		"pcmpeqb %%mm3, %%mm1\n\t"		// now ff where abs(b,e) < Thres, else 00	
225
		"pcmpeqb %%mm3, %%mm1\n\t"		// now ff where abs(b,e) < Thres, else 00	
226
226
Lines 238-245 Link Here
238
        "por     %%mm0, %%mm7\n\t"
238
        "por     %%mm0, %%mm7\n\t"
239
239
240
		// bob in any leftovers
240
		// bob in any leftovers
241
		"movq    (%%"XBX"), %%mm0\n\t"		// value b from top 		
241
		"movq    (%%"XDX"), %%mm0\n\t"		// value b from top 		
242
		"movq    (%%"XBX", %%"XCX"), %%mm1\n\t"	// value e from bottom 
242
		"movq    (%%"XDX", %%"XCX"), %%mm1\n\t"	// value e from bottom 
243
243
244
244
245
// We will also calc here the max/min values to later limit comb
245
// We will also calc here the max/min values to later limit comb
Lines 271-277 Link Here
271
		"por		%%mm2, %%mm3\n\t"			// abs diff
271
		"por		%%mm2, %%mm3\n\t"			// abs diff
272
//		pmaxub  %%mm3, %%mm4			// top or bottom pixel moved most
272
//		pmaxub  %%mm3, %%mm4			// top or bottom pixel moved most
273
		V_PMAXUB ("%%mm3", "%%mm4")			// top or bottom pixel moved most
273
		V_PMAXUB ("%%mm3", "%%mm4")			// top or bottom pixel moved most
274
		"psubusb "MANGLE(DiffThres)", %%mm3\n\t"		// moved more than allowed? or goes to 0?
274
		"psubusb "_DiffThres", %%mm3\n\t"		// moved more than allowed? or goes to 0?
275
		"pxor	%%mm4, %%mm4\n\t"
275
		"pxor	%%mm4, %%mm4\n\t"
276
		"pcmpeqb %%mm4, %%mm3\n\t"			// now ff where low motion, else high motion
276
		"pcmpeqb %%mm4, %%mm3\n\t"			// now ff where low motion, else high motion
277
		
277
		
Lines 283-301 Link Here
283
		V_PMAXUB ("%%mm6", "%%mm2")
283
		V_PMAXUB ("%%mm6", "%%mm2")
284
284
285
        "psubusb %%mm3, %%mm2\n\t"			// maybe decrease it to 0000.. if no surround motion
285
        "psubusb %%mm3, %%mm2\n\t"			// maybe decrease it to 0000.. if no surround motion
286
//		"movq	%%mm2, "MANGLE(Min_Vals)"\n\t"
286
//		"movq	%%mm2, "_Min_Vals"\n\t"
287
287
288
		"movq	%%mm0, %%mm2\n\t"
288
		"movq	%%mm0, %%mm2\n\t"
289
		V_PMAXUB ("%%mm2", "%%mm1")
289
		V_PMAXUB ("%%mm2", "%%mm1")
290
//		pminub	%%mm6, %%mm2			// clip our current results so far to be below this
290
//		pminub	%%mm6, %%mm2			// clip our current results so far to be below this
291
		V_PMINUB ("%%mm6", "%%mm2", "%%mm4")
291
		V_PMINUB ("%%mm6", "%%mm2", "%%mm4")
292
        "paddusb %%mm3, %%mm2\n\t"			// maybe increase it to ffffff if no surround motion
292
        "paddusb %%mm3, %%mm2\n\t"			// maybe increase it to ffffff if no surround motion
293
//		"movq	%%mm2, "MANGLE(Max_Vals)"\n\t"
293
//		"movq	%%mm2, "_Max_Vals"\n\t"
294
#endif
294
#endif
295
			
295
			
296
		"movq	%%mm0, %%mm2\n\t"						
296
		"movq	%%mm0, %%mm2\n\t"						
297
//		pavgb	%%mm2, %%mm1					// avg(b,e)
297
//		pavgb	%%mm2, %%mm1					// avg(b,e)
298
		V_PAVGB ("%%mm2", "%%mm1", "%%mm3", MANGLE(ShiftMask))	// avg(b,e)
298
		V_PAVGB ("%%mm2", "%%mm1", "%%mm3", _ShiftMask)	// avg(b,e)
299
				
299
				
300
        "movq	%%mm0, %%mm3\n\t"
300
        "movq	%%mm0, %%mm3\n\t"
301
		"psubusb	%%mm1, %%mm3\n\t"
301
		"psubusb	%%mm1, %%mm3\n\t"
(-)xine-lib-1.1.1-old/src/post/deinterlace/plugins/tomsmocomp/TomsMoCompAll.inc (-3 / +3 lines)
Lines 33-40 static const int64_t __attribute__((__us Link Here
33
static const int64_t __attribute__((__used__)) FOURS     = 0x0404040404040404ull;
33
static const int64_t __attribute__((__used__)) FOURS     = 0x0404040404040404ull;
34
static const int64_t __attribute__((__used__)) ONES      = 0x0101010101010101ull;
34
static const int64_t __attribute__((__used__)) ONES      = 0x0101010101010101ull;
35
static const int64_t __attribute__((__used__)) ShiftMask = 0xfefffefffefffeffull;
35
static const int64_t __attribute__((__used__)) ShiftMask = 0xfefffefffefffeffull;
36
//static int64_t Min_Vals  = 0x0000000000000000ull;
36
static int64_t Min_Vals  = 0x0000000000000000ull;
37
//static int64_t Max_Vals  = 0x0000000000000000ull;
37
static int64_t Max_Vals  = 0x0000000000000000ull;
38
#endif
38
#endif
39
39
40
#ifndef TopFirst
40
#ifndef TopFirst
Lines 69-75 static void FUNCT_NAME(uint8_t *output, Link Here
69
    int rowsize;
69
    int rowsize;
70
    int FldHeight;
70
    int FldHeight;
71
    int stride = (width*2);
71
    int stride = (width*2);
72
    long oldbx;
72
    long olddx;
73
73
74
74
75
    src_pitch = stride*2;
75
    src_pitch = stride*2;
(-)xine-lib-1.1.1-old/src/post/deinterlace/plugins/tomsmocomp/WierdBob.inc (-20 / +20 lines)
Lines 14-35 Link Here
14
		// selected for the	smallest of abs(a,f), abs(c,d), or abs(b,e), etc.
14
		// selected for the	smallest of abs(a,f), abs(c,d), or abs(b,e), etc.
15
15
16
		// a,f
16
		// a,f
17
		"movq    -2(%%"XBX"), %%mm0\n\t"		// value a from top left		
17
		"movq    -2(%%"XDX"), %%mm0\n\t"		// value a from top left		
18
		"movq    2(%%"XBX", %%"XCX"), %%mm1\n\t"	// value f from bottom right			
18
		"movq    2(%%"XDX", %%"XCX"), %%mm1\n\t"	// value f from bottom right			
19
		"movq	%%mm0, %%mm6\n\t"					
19
		"movq	%%mm0, %%mm6\n\t"					
20
//		pavgb	%%mm6, %%mm1					// avg(a,f), also best so far
20
//		pavgb	%%mm6, %%mm1					// avg(a,f), also best so far
21
		V_PAVGB ("%%mm6", "%%mm1", "%%mm7", MANGLE(ShiftMask))	// avg(a,f), also best so far
21
		V_PAVGB ("%%mm6", "%%mm1", "%%mm7", _ShiftMask)	// avg(a,f), also best so far
22
        "movq	%%mm0, %%mm7\n\t"
22
        "movq	%%mm0, %%mm7\n\t"
23
		"psubusb	 %%mm1, %%mm7\n\t"
23
		"psubusb	 %%mm1, %%mm7\n\t"
24
		"psubusb %%mm0, %%mm1\n\t"
24
		"psubusb %%mm0, %%mm1\n\t"
25
		"por		%%mm1, %%mm7\n\t"					// abs diff, also best so far
25
		"por		%%mm1, %%mm7\n\t"					// abs diff, also best so far
26
26
27
		// c,d
27
		// c,d
28
		"movq    2(%%"XBX"), %%mm0\n\t"		// value a from top left		
28
		"movq    2(%%"XDX"), %%mm0\n\t"		// value a from top left		
29
		"movq    -2(%%"XBX", %%"XCX"), %%mm1\n\t"	// value f from bottom right			
29
		"movq    -2(%%"XDX", %%"XCX"), %%mm1\n\t"	// value f from bottom right			
30
		"movq	%%mm0, %%mm2\n\t"						
30
		"movq	%%mm0, %%mm2\n\t"						
31
//		pavgb	%%mm2, %%mm1					// avg(c,d)
31
//		pavgb	%%mm2, %%mm1					// avg(c,d)
32
		V_PAVGB ("%%mm2", "%%mm1", "%%mm3", MANGLE(ShiftMask))	// avg(c,d)
32
		V_PAVGB ("%%mm2", "%%mm1", "%%mm3", _ShiftMask)	// avg(c,d)
33
        "movq	%%mm0, %%mm3\n\t"
33
        "movq	%%mm0, %%mm3\n\t"
34
		"psubusb	%%mm1, %%mm3\n\t"
34
		"psubusb	%%mm1, %%mm3\n\t"
35
		"psubusb %%mm0, %%mm1\n\t"
35
		"psubusb %%mm0, %%mm1\n\t"
Lines 49-63 Link Here
49
49
50
		"por		%%mm2, %%mm6\n\t"			// and merge new & old vals keeping best
50
		"por		%%mm2, %%mm6\n\t"			// and merge new & old vals keeping best
51
		"por		%%mm1, %%mm7\n\t"
51
		"por		%%mm1, %%mm7\n\t"
52
		"por		"MANGLE(UVMask)", %%mm7\n\t"			// but we know chroma is worthless so far
52
		"por		"_UVMask", %%mm7\n\t"			// but we know chroma is worthless so far
53
		"pand	"MANGLE(YMask)", %%mm5\n\t"			// mask out chroma from here also
53
		"pand	"_YMask", %%mm5\n\t"			// mask out chroma from here also
54
54
55
		// j,n
55
		// j,n
56
		"movq    -4(%%"XBX"), %%mm0\n\t"		// value j from top left		
56
		"movq    -4(%%"XDX"), %%mm0\n\t"		// value j from top left		
57
		"movq    4(%%"XBX", %%"XCX"), %%mm1\n\t"	// value n from bottom right			
57
		"movq    4(%%"XDX", %%"XCX"), %%mm1\n\t"	// value n from bottom right			
58
		"movq	%%mm0, %%mm2\n\t"						
58
		"movq	%%mm0, %%mm2\n\t"						
59
//		pavgb	%%mm2, %%mm1					// avg(j,n)
59
//		pavgb	%%mm2, %%mm1					// avg(j,n)
60
		V_PAVGB ("%%mm2", "%%mm1", "%%mm3", MANGLE(ShiftMask))	// avg(j,n)
60
		V_PAVGB ("%%mm2", "%%mm1", "%%mm3", _ShiftMask)	// avg(j,n)
61
        "movq	%%mm0, %%mm3\n\t"
61
        "movq	%%mm0, %%mm3\n\t"
62
		"psubusb	%%mm1, %%mm3\n\t"
62
		"psubusb	%%mm1, %%mm3\n\t"
63
		"psubusb %%mm0, %%mm1\n\t"
63
		"psubusb %%mm0, %%mm1\n\t"
Lines 79-89 Link Here
79
		"por		%%mm1, %%mm7\n\t"			// "
79
		"por		%%mm1, %%mm7\n\t"			// "
80
80
81
		// k, m
81
		// k, m
82
		"movq    4(%%"XBX"), %%mm0\n\t"		// value k from top right		
82
		"movq    4(%%"XDX"), %%mm0\n\t"		// value k from top right		
83
		"movq    -4(%%"XBX", %%"XCX"), %%mm1\n\t"	// value n from bottom left			
83
		"movq    -4(%%"XDX", %%"XCX"), %%mm1\n\t"	// value n from bottom left			
84
		"movq	%%mm0, %%mm4\n\t"						
84
		"movq	%%mm0, %%mm4\n\t"						
85
//		pavgb	%%mm4, %%mm1					// avg(k,m)
85
//		pavgb	%%mm4, %%mm1					// avg(k,m)
86
		V_PAVGB ("%%mm4", "%%mm1", "%%mm3", MANGLE(ShiftMask))	// avg(k,m)
86
		V_PAVGB ("%%mm4", "%%mm1", "%%mm3", _ShiftMask)	// avg(k,m)
87
87
88
        "movq	%%mm0, %%mm3\n\t"
88
        "movq	%%mm0, %%mm3\n\t"
89
		"psubusb	%%mm1, %%mm3\n\t"
89
		"psubusb	%%mm1, %%mm3\n\t"
Lines 108-115 Link Here
108
		"por		%%mm1, %%mm7\n\t"			// "
108
		"por		%%mm1, %%mm7\n\t"			// "
109
109
110
		// b,e
110
		// b,e
111
		"movq    (%%"XBX"), %%mm0\n\t"		// value b from top 		
111
		"movq    (%%"XDX"), %%mm0\n\t"		// value b from top 		
112
		"movq    (%%"XBX", %%"XCX"), %%mm1\n\t"	// value e from bottom 
112
		"movq    (%%"XDX", %%"XCX"), %%mm1\n\t"	// value e from bottom 
113
113
114
// We will also calc here the max/min values to later limit comb
114
// We will also calc here the max/min values to later limit comb
115
// so the max excursion will not exceed the Max_Comb constant
115
// so the max excursion will not exceed the Max_Comb constant
Lines 140-146 Link Here
140
		"por		%%mm2, %%mm3\n\t"			// abs diff
140
		"por		%%mm2, %%mm3\n\t"			// abs diff
141
//		pmaxub  %%mm3, %%mm4			// top or bottom pixel moved most
141
//		pmaxub  %%mm3, %%mm4			// top or bottom pixel moved most
142
		V_PMAXUB ("%%mm3", "%%mm4")			// top or bottom pixel moved most
142
		V_PMAXUB ("%%mm3", "%%mm4")			// top or bottom pixel moved most
143
		"psubusb "MANGLE(Max_Mov)", %%mm3\n\t"		// moved more than allowed? or goes to 0?
143
		"psubusb "_Max_Mov", %%mm3\n\t"		// moved more than allowed? or goes to 0?
144
		"pxor	%%mm4, %%mm4\n\t"
144
		"pxor	%%mm4, %%mm4\n\t"
145
		"pcmpeqb %%mm4, %%mm3\n\t"			// now ff where low motion, else high motion
145
		"pcmpeqb %%mm4, %%mm3\n\t"			// now ff where low motion, else high motion
146
		
146
		
Lines 152-170 Link Here
152
		V_PMAXUB ("%%mm6", "%%mm2")
152
		V_PMAXUB ("%%mm6", "%%mm2")
153
153
154
		"psubusb %%mm3, %%mm2\n\t"			// maybe decrease it to 0000.. if no surround motion
154
		"psubusb %%mm3, %%mm2\n\t"			// maybe decrease it to 0000.. if no surround motion
155
//		"movq	%%mm2, "MANGLE(Min_Vals)"\n\t"
155
//		"movq	%%mm2, "_Min_Vals"\n\t"
156
156
157
		"movq	%%mm0, %%mm2\n\t"
157
		"movq	%%mm0, %%mm2\n\t"
158
		V_PMAXUB ("%%mm2", "%%mm1")
158
		V_PMAXUB ("%%mm2", "%%mm1")
159
//		pminub	%%mm6, %%mm2			// clip our current results so far to be below this
159
//		pminub	%%mm6, %%mm2			// clip our current results so far to be below this
160
		V_PMINUB ("%%mm6", "%%mm2", "%%mm4")
160
		V_PMINUB ("%%mm6", "%%mm2", "%%mm4")
161
        "paddusb %%mm3, %%mm2\n\t"			// maybe increase it to ffffff if no surround motion
161
        "paddusb %%mm3, %%mm2\n\t"			// maybe increase it to ffffff if no surround motion
162
//		"movq	%%mm2, "MANGLE(Max_Vals)"\n\t"
162
//		"movq	%%mm2, "_Max_Vals"\n\t"
163
#endif
163
#endif
164
        
164
        
165
		"movq	%%mm0, %%mm2\n\t"						
165
		"movq	%%mm0, %%mm2\n\t"						
166
//		pavgb	%%mm2, %%mm1					// avg(b,e)
166
//		pavgb	%%mm2, %%mm1					// avg(b,e)
167
		V_PAVGB ("%%mm2", "%%mm1", "%%mm3", MANGLE(ShiftMask))	// avg(b,e)
167
		V_PAVGB ("%%mm2", "%%mm1", "%%mm3", _ShiftMask)	// avg(b,e)
168
				
168
				
169
        "movq	%%mm0, %%mm3\n\t"
169
        "movq	%%mm0, %%mm3\n\t"
170
		"psubusb	%%mm1, %%mm3\n\t"
170
		"psubusb	%%mm1, %%mm3\n\t"
(-)xine-lib-1.1.1-old/src/post/deinterlace/plugins/tomsmocomp/tomsmocompmacros.h (-6 / +6 lines)
Lines 114-120 Link Here
114
    "por     %%xmm0,      %%xmm5\n\t"      /* and merge new & old vals */                \
114
    "por     %%xmm0,      %%xmm5\n\t"      /* and merge new & old vals */                \
115
    "por     %%xmm2,      %%xmm7\n\t"
115
    "por     %%xmm2,      %%xmm7\n\t"
116
116
117
#define RESET_CHROMA "por "MANGLE(UVMask)", %%xmm7\n\t"
117
#define RESET_CHROMA "por "_UVMask", %%xmm7\n\t"
118
118
119
#else // ifdef IS_SSE2
119
#else // ifdef IS_SSE2
120
120
Lines 126-132 Link Here
126
    "psubusb %%mm1,      %%mm2\n\t"                                                     \
126
    "psubusb %%mm1,      %%mm2\n\t"                                                     \
127
    "psubusb %%mm0,      %%mm3\n\t"                                                     \
127
    "psubusb %%mm0,      %%mm3\n\t"                                                     \
128
    "por     %%mm3,      %%mm2\n\t"                                                     \
128
    "por     %%mm3,      %%mm2\n\t"                                                     \
129
    V_PAVGB ("%%mm0", "%%mm1", "%%mm3", MANGLE(ShiftMask)) /* avg of 2 pixels */               \
129
    V_PAVGB ("%%mm0", "%%mm1", "%%mm3", _ShiftMask) /* avg of 2 pixels */               \
130
    "movq    %%mm2,      %%mm3\n\t"       /* another copy of our our weights */         \
130
    "movq    %%mm2,      %%mm3\n\t"       /* another copy of our our weights */         \
131
    "pxor    %%mm1,      %%mm1\n\t"                                                     \
131
    "pxor    %%mm1,      %%mm1\n\t"                                                     \
132
    "psubusb %%mm7,      %%mm3\n\t"       /* nonzero where old weights lower, else 0 */ \
132
    "psubusb %%mm7,      %%mm3\n\t"       /* nonzero where old weights lower, else 0 */ \
Lines 144-157 Link Here
144
    "movq    "PADDR2A",   %%mm1\n\t"      /* our pixel2 value */                        \
144
    "movq    "PADDR2A",   %%mm1\n\t"      /* our pixel2 value */                        \
145
    "movq    "PADDR1B",   %%mm2\n\t"      /* our 4 pixels */                            \
145
    "movq    "PADDR1B",   %%mm2\n\t"      /* our 4 pixels */                            \
146
    "movq    "PADDR2B",   %%mm3\n\t"      /* our pixel2 value */                        \
146
    "movq    "PADDR2B",   %%mm3\n\t"      /* our pixel2 value */                        \
147
    V_PAVGB("%%mm0", "%%mm2", "%%mm2", MANGLE(ShiftMask))                                      \
147
    V_PAVGB("%%mm0", "%%mm2", "%%mm2", _ShiftMask)                                      \
148
    V_PAVGB("%%mm1", "%%mm3", "%%mm3", MANGLE(ShiftMask))                                      \
148
    V_PAVGB("%%mm1", "%%mm3", "%%mm3", _ShiftMask)                                      \
149
    "movq    %%mm0,       %%mm2\n\t"      /* another copy of our pixel1 value */        \
149
    "movq    %%mm0,       %%mm2\n\t"      /* another copy of our pixel1 value */        \
150
    "movq    %%mm1,       %%mm3\n\t"      /* another copy of our pixel1 value */        \
150
    "movq    %%mm1,       %%mm3\n\t"      /* another copy of our pixel1 value */        \
151
    "psubusb %%mm1,       %%mm2\n\t"                                                    \
151
    "psubusb %%mm1,       %%mm2\n\t"                                                    \
152
    "psubusb %%mm0,       %%mm3\n\t"                                                    \
152
    "psubusb %%mm0,       %%mm3\n\t"                                                    \
153
    "por     %%mm3,       %%mm2\n\t"                                                    \
153
    "por     %%mm3,       %%mm2\n\t"                                                    \
154
    V_PAVGB("%%mm0", "%%mm1", "%%mm3", MANGLE(ShiftMask))   /* avg of 2 pixels */              \
154
    V_PAVGB("%%mm0", "%%mm1", "%%mm3", _ShiftMask)   /* avg of 2 pixels */              \
155
    "movq    %%mm2,       %%mm3\n\t"      /* another copy of our our weights */         \
155
    "movq    %%mm2,       %%mm3\n\t"      /* another copy of our our weights */         \
156
    "pxor    %%mm1,       %%mm1\n\t"                                                    \
156
    "pxor    %%mm1,       %%mm1\n\t"                                                    \
157
    "psubusb %%mm7,       %%mm3\n\t"      /* nonzero where old weights lower, else 0 */ \
157
    "psubusb %%mm7,       %%mm3\n\t"      /* nonzero where old weights lower, else 0 */ \
Lines 164-170 Link Here
164
    "por     %%mm0,       %%mm5\n\t"      /* and merge new & old vals */                \
164
    "por     %%mm0,       %%mm5\n\t"      /* and merge new & old vals */                \
165
    "por     %%mm2,       %%mm7\n\t"
165
    "por     %%mm2,       %%mm7\n\t"
166
166
167
#define RESET_CHROMA "por "MANGLE(UVMask)", %%mm7\n\t"
167
#define RESET_CHROMA "por "_UVMask", %%mm7\n\t"
168
168
169
#endif
169
#endif
170
170

Return to bug 113255