Subversion Repositories Kolibri OS

Rev

Rev 328 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 328 Rev 378
Line 11... Line 11...
11
;   This program is distributed in the hope that it will be useful,
11
;   This program is distributed in the hope that it will be useful,
12
;   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
;   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
;   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
;   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
;   GNU General Public License for more details.
14
;   GNU General Public License for more details.
Line -... Line 15...
-
 
15
 
-
 
16
 
-
 
17
align 4
-
 
18
 
-
 
19
mix_list rq 32
15
 
20
 
16
align 4
21
align 4
17
proc new_mix stdcall, output:dword
22
proc new_mix stdcall, output:dword
18
           locals
-
 
19
             mixCounter  dd ?
-
 
20
             mixIndex  dd ?
-
 
21
             streamIndex dd ?
-
 
22
             inputCount  dd ?
23
           locals
23
             main_count  dd ?
-
 
24
             blockCount  dd ?
24
             main_count   rd 1
25
             mix_out  dd ?
25
             fpu_state    rb 528   ;512+16
Line -... Line 26...
-
 
26
           endl
26
           endl
27
 
27
 
-
 
28
           call prepare_playlist
28
           mov [main_count], 32
29
 
29
           call prepare_playlist
30
           cmp [play_count], 0
-
 
31
           je .exit
-
 
32
           call FpuSave
-
 
33
           mov [main_count], 32;
-
 
34
.l00:
-
 
35
           mov [mix_buff_map], 0x0000FFFF;
-
 
36
           xor eax, eax
-
 
37
           mov [mixCounter], eax
-
 
38
           mov [mixIndex],eax
-
 
39
           mov [streamIndex], eax;
-
 
40
           mov ebx, [play_count]
-
 
41
           mov [inputCount], ebx
-
 
42
.l0:
-
 
43
           mov ecx, 4
-
 
44
.l1:
-
 
45
           mov ebx, [streamIndex]
-
 
46
           mov esi, [play_list+ebx*4]
-
 
Line 47... Line 30...
47
           mov eax, [esi+STREAM.work_read]
30
           cmp [play_count], 0
48
           add [esi+STREAM.work_read], 512
31
           je .clear
49
 
-
 
50
           mov ebx, [mixIndex]
-
 
51
           mov [mix_input+ebx*4], eax
-
 
52
           inc [mixCounter]
-
 
53
           inc [mixIndex]
-
 
54
           inc [streamIndex]
-
 
55
           dec [inputCount]
-
 
56
           jz .m2
32
 
Line 57... Line 33...
57
 
33
           lea eax, [fpu_state+16]
-
 
34
           and eax, -16             ;must be 16b aligned
-
 
35
           call FpuSave
-
 
36
 
-
 
37
           call update_stream
58
           dec ecx
38
.mix:
Line 59... Line -...
59
           jnz .l1
-
 
60
 
39
           lea eax, [mix_list]
61
           cmp [mixCounter], 4
-
 
62
           jnz .m2
-
 
63
 
40
           call do_mix_list
64
           stdcall mix_4_1, [mix_input],[mix_input+4],[mix_input+8],[mix_input+12]
-
 
Line 65... Line -...
65
           sub [mixIndex],4
-
 
66
           mov ebx, [mixIndex]
-
 
67
           mov [mix_input+ebx*4], eax
-
 
68
           inc [mixIndex]
41
           test eax, eax
69
           mov [mixCounter], 0
-
 
70
 
42
           je .done
71
           cmp [inputCount], 0
-
 
72
           jnz .l0
-
 
73
.m2:
-
 
74
           cmp [mixIndex], 1
-
 
75
           jne @f
-
 
76
           stdcall copy_mem, [output], [mix_input]
-
 
77
           jmp .m3
43
 
78
@@:
-
 
79
           cmp [mixIndex], 2
-
 
80
           jne @f
-
 
81
           stdcall mix_2_1, [output], [mix_input], [mix_input+4]
-
 
82
           jmp .m3
-
 
83
@@:
-
 
84
           cmp [mixIndex], 3
-
 
85
           jne @f
44
  ;         cmp eax, 1
86
           stdcall mix_3_1, [output],[mix_input],[mix_input+4],[mix_input+8]
-
 
87
           jmp .m3
45
  ;         je .copy
88
@@:
46
 
89
           stdcall final_mix, [output],[mix_input],[mix_input+4],[mix_input+8], [mix_input+12]
47
           lea ebx, [mix_list]
90
.m3:
48
           stdcall mix_all, [output], ebx, eax
91
           add [output],512
49
@@:
92
 
50
           add [output], 512
93
           dec [main_count]
51
           dec [main_count]
94
           jnz .l00
52
           jnz .mix
-
 
53
.exit:
-
 
54
           lea eax, [fpu_state+16]
-
 
55
           and eax, -16
-
 
56
           call FpuRestore
-
 
57
           ret
-
 
58
.copy:
-
 
59
           lea eax, [mix_list]
95
 
60
           stdcall copy_mem, [output], [eax]
-
 
61
           jmp @B
-
 
62
.done:
-
 
63
           mov ecx, [main_count]
-
 
64
           shl ecx, 7     ;ecx*= 512/4
-
 
65
 
-
 
66
           mov edi, [output]
96
           call update_stream
67
           xor eax, eax
97
           emms
68
           cld
98
           call FpuRestore
69
           rep stosd
99
           ret
70
           jmp .exit
100
.exit:
71
.clear:
101
           mov edi, [output]
72
           mov edi, [output]
Line 118... Line 89...
118
           mov [stream_index], 0
89
           mov [stream_index], 0
119
.l1:
90
.l1:
120
           mov edx, [stream_index]
91
           mov edx, [stream_index]
121
           mov esi, [play_list+edx*4]
92
           mov esi, [play_list+edx*4]
Line 122... Line 93...
122
 
93
 
123
           mov eax, [esi+STREAM.work_read]
94
           mov eax, [esi+STREAM.out_rp]
124
           cmp eax, [esi+STREAM.work_top]
95
           cmp eax, [esi+STREAM.out_top]
125
           jb @f
96
           jb @f
126
           sub eax, 64*1024
97
           sub eax, 64*1024
127
@@:
98
@@:
Line 128... Line 99...
128
           mov [esi+STREAM.work_read], eax
99
           mov [esi+STREAM.out_rp], eax
129
 
100
 
Line 130... Line 101...
130
           cmp [esi+STREAM.format], PCM_2_16_48
101
           cmp word [esi+STREAM.format], PCM_2_16_48
-
 
102
           je .copy
Line 131... Line 103...
131
           je .copy
103
 
132
 
104
           cmp [esi+STREAM.out_count], 16384
Line 133... Line 105...
133
           sub [esi+STREAM.work_count], 16384
105
           ja .skip
134
 
106
 
135
           cmp [esi+STREAM.work_count], 32768
107
           test [esi+STREAM.format], PCM_RING
136
           ja @f
108
           jnz .ring
137
 
109
 
138
           stdcall refill, esi
110
           stdcall refill, esi
-
 
111
.skip:
-
 
112
           inc [stream_index]
-
 
113
           dec [play_count]
-
 
114
           jnz .l1
139
@@:
115
           ret
140
           inc [stream_index]
116
 
141
           dec [play_count]
117
.ring:
142
           jnz .l1
118
           stdcall refill_ring, esi
143
           ret
119
           jmp .skip
Line 144... Line 120...
144
.copy:
120
.copy:
145
           mov ebx, esi
121
           mov ebx, esi
146
           mov edi, [ebx+STREAM.work_write]
122
           mov edi, [ebx+STREAM.out_wp]
147
           cmp edi, [ebx+STREAM.work_top]
123
           cmp edi, [ebx+STREAM.out_top]
148
           jb @f
124
           jb @f
149
 
125
 
150
           sub edi, 64*1024
126
           sub edi, 64*1024
Line 151... Line 127...
151
           mov [ebx+STREAM.work_write], edi
127
           mov [ebx+STREAM.out_wp], edi
Line 152... Line 128...
152
@@:
128
@@:
153
           mov esi, [ebx+STREAM.curr_seg]
129
           mov esi, [ebx+STREAM.in_rp]
Line 154... Line 130...
154
           mov ecx, 16384/4
130
           mov ecx, 16384/4
155
           cld
-
 
156
           rep movsd
-
 
157
 
-
 
158
           mov [ebx+STREAM.work_write], edi
-
 
159
 
-
 
160
           cmp esi, [ebx+STREAM.lim_0]
131
           cld
161
           jb @f
132
           rep movsd
162
 
-
 
163
           mov esi, [ebx+STREAM.seg_0]
-
 
164
           mov eax, [ebx+STREAM.lim_0]
-
 
165
           xchg esi, [ebx+STREAM.seg_1]
-
 
Line 166... Line -...
166
           xchg eax, [ebx+STREAM.lim_1]
-
 
167
           mov [ebx+STREAM.seg_0], esi
-
 
168
           mov [ebx+STREAM.lim_0], eax
-
 
169
@@:
-
 
170
           mov [ebx+STREAM.curr_seg], esi
-
 
171
 
-
 
172
           xor ecx, ecx
-
 
173
           cmp esi, [ebx+STREAM.notify_off2]
-
 
174
           je @f
-
 
175
 
-
 
176
           mov ecx,0x8000
-
 
177
           cmp esi, [ebx+STREAM.notify_off1]
-
 
178
           je @f
-
 
179
 
-
 
180
           inc [stream_index]
-
 
181
           dec [play_count]
-
 
182
           jnz .l1
-
 
183
           ret
133
 
184
@@:
134
           mov [ebx+STREAM.out_wp], edi
185
           mov [ev_code], 0xFF000001
-
 
-
 
135
 
-
 
136
           cmp esi, [ebx+STREAM.in_top]
-
 
137
           jb @f
186
           mov [ev_offs], ecx
138
 
187
           mov eax, [ebx+STREAM.pid]
139
           sub esi, 0x10000
188
 
140
@@:
189
           lea edx, [ev_code]
141
           mov [ebx+STREAM.in_rp], esi
190
           push ebx
142
 
191
           stdcall SendEvent, eax, edx
143
           test eax, eax
192
           pop ebx
144
           jz .l_end
193
           test eax, eax
145
           mov eax, [ebx+STREAM.notify_event]
Line 194... Line 146...
194
           jnz .l_end
146
           mov ebx, [ebx+STREAM.notify_id]
195
 
147
           mov ecx, EVENT_WATCHED
196
           not eax
148
           xor edx, edx
197
           mov [ebx+STREAM.pid], eax      ;-1
-
 
198
.l_end:
149
           call RaiseEvent     ;eax, ebx, ecx, edx
199
           inc [stream_index]
150
.l_end:
200
           dec [play_count]
151
           inc [stream_index]
Line 201... Line 152...
201
           jnz .l1
152
           dec [play_count]
202
           ret
153
           jnz .l1
203
endp
154
           ret
204
 
155
endp
205
align 4
156
 
206
proc refill stdcall, str:dword
157
align 4
-
 
158
proc refill stdcall, str:dword
-
 
159
           locals
-
 
160
             r_size    rd 1
-
 
161
             event     rd 6
-
 
162
           endl
-
 
163
 
-
 
164
           mov ebx, [str]
-
 
165
           mov edi, [ebx+STREAM.out_wp]
-
 
166
           cmp edi, [ebx+STREAM.out_top]
-
 
167
           jb @F
207
           locals
168
           sub edi, 0x10000
-
 
169
           mov [ebx+STREAM.out_wp], edi
-
 
170
@@:
-
 
171
           mov eax, [ebx+STREAM.in_count]
-
 
172
           test eax, eax
-
 
173
           jz .done
-
 
174
 
-
 
175
           mov ecx, [ebx+STREAM.r_size]
-
 
176
           cmp eax, ecx
-
 
177
           jle @F
-
 
178
 
-
 
179
           mov eax, ecx
-
 
180
@@:
-
 
181
           mov ecx, eax
-
 
182
           cmp word [ebx+STREAM.format], PCM_1_16_8
-
 
183
           ja @F
208
             ev_code       dd ?  ;EVENT
184
 
209
             ev_offs       dd ?
185
           shr eax, 1                   ;two channles
Line 210... Line 186...
210
                           rd 4
186
@@:
211
           endl
187
           test [ebx+STREAM.format], 1  ;even formats mono
Line 212... Line 188...
212
 
188
           jz @F
Line 213... Line 189...
213
           mov ebx, [str]
189
 
214
           mov edi, [ebx+STREAM.work_write]
190
           shr eax, 1                   ;eax= samples
-
 
191
@@:
-
 
192
           shl eax, 15    ;eax*=32768 =r_end
-
 
193
 
-
 
194
           mov [r_size], ecx
-
 
195
 
-
 
196
           mov esi, [ebx+STREAM.in_rp]
Line 215... Line -...
215
           cmp edi, [ebx+STREAM.work_top]
-
 
216
           jb @F
-
 
217
           sub edi, 64*1024
197
           mov edi, [ebx+STREAM.out_wp]
218
           mov [ebx+STREAM.work_write], edi
198
 
Line -... Line 199...
-
 
199
           stdcall [ebx+STREAM.resample], edi, esi, \
-
 
200
           [ebx+STREAM.r_dt], ecx, eax
-
 
201
 
-
 
202
           mov ebx, [str]
-
 
203
 
-
 
204
           add [ebx+STREAM.out_count], eax;
-
 
205
           add [ebx+STREAM.out_wp], eax;
-
 
206
 
-
 
207
           mov eax, [ebx+STREAM.in_rp]
219
@@:
208
           mov ecx, [r_size]
-
 
209
           add eax, ecx
220
           mov esi, [ebx+STREAM.curr_seg]
210
           add [ebx+STREAM.in_free], ecx
-
 
211
           sub [ebx+STREAM.in_count], ecx
-
 
212
 
-
 
213
           cmp eax, [ebx+STREAM.in_top]
-
 
214
           jb @f
-
 
215
 
-
 
216
           sub eax, [ebx+STREAM.in_size]
-
 
217
@@:
-
 
218
           mov [ebx+STREAM.in_rp], eax
221
           mov edi, [ebx+STREAM.work_write]
219
 
-
 
220
.done:
-
 
221
           mov eax, [ebx+STREAM.notify_event]
222
 
222
           test eax, eax
-
 
223
           jz .exit
-
 
224
 
223
           stdcall [ebx+STREAM.resample], edi, esi, \
225
           mov ebx, [ebx+STREAM.notify_id]
-
 
226
           mov ecx, EVENT_WATCHED
-
 
227
           xor edx, edx
-
 
228
           call RaiseEvent   ;eax, ebx, ecx, edx
-
 
229
.exit:
-
 
230
           ret
-
 
231
endp
224
           [ebx+STREAM.r_dt],[ebx+STREAM.r_size],[ebx+STREAM.r_end]
232
 
Line 225... Line -...
225
 
-
 
226
           mov ebx, [str]
-
 
227
 
233
align 4
228
           add [ebx+STREAM.work_count], eax;
-
 
229
           add [ebx+STREAM.work_write], eax;
-
 
230
 
-
 
231
           mov eax, [ebx+STREAM.curr_seg]
234
proc refill_ring stdcall, str:dword
232
           add eax, [ebx+STREAM.r_size]
235
           locals
-
 
236
             event     rd 6
Line -... Line 237...
-
 
237
           endl
-
 
238
 
-
 
239
           mov ebx, [str]
-
 
240
           mov edi, [ebx+STREAM.out_wp]
-
 
241
           cmp edi, [ebx+STREAM.out_top]
-
 
242
           jb @F
-
 
243
           sub edi, 0x10000
-
 
244
           mov [ebx+STREAM.out_wp], edi
-
 
245
@@:
-
 
246
           mov ecx, [ebx+STREAM.r_size]
-
 
247
           mov eax, ecx
-
 
248
           cmp word [ebx+STREAM.format], PCM_1_16_8
-
 
249
           ja @F
-
 
250
 
-
 
251
           shr eax, 1                   ;two channles
-
 
252
@@:
-
 
253
           test [ebx+STREAM.format], 1  ;even formats mono
233
           cmp eax, [ebx+STREAM.lim_0]
254
           jz @F
-
 
255
 
-
 
256
           shr eax, 1                   ;eax= samples
-
 
257
@@:
234
           jb @f
258
           shl eax, 15    ;eax*=32768 =r_end
235
 
259
 
-
 
260
           mov esi, [ebx+STREAM.in_rp]
-
 
261
           mov edi, [ebx+STREAM.out_wp]
-
 
262
 
-
 
263
           stdcall [ebx+STREAM.resample], edi, esi, \
-
 
264
           [ebx+STREAM.r_dt], ecx, eax
-
 
265
 
-
 
266
           mov ebx, [str]
-
 
267
 
-
 
268
           add [ebx+STREAM.out_count], eax;
-
 
269
           add [ebx+STREAM.out_wp], eax;
-
 
270
 
-
 
271
           mov eax, [ebx+STREAM.in_rp]
-
 
272
           mov ecx, [ebx+STREAM.r_size]
Line 236... Line -...
236
           mov esi, [ebx+STREAM.seg_0]
-
 
237
           lea edi, [esi-128]
273
           add eax, ecx
238
           add esi, 0x7F80
-
 
239
           mov ecx, 128/4
-
 
240
           cld
-
 
241
           rep movsd
-
 
242
 
-
 
243
           mov eax, [ebx+STREAM.seg_0]
-
 
244
           mov ecx, [ebx+STREAM.lim_0]
-
 
245
           xchg eax, [ebx+STREAM.seg_1]
-
 
246
           xchg ecx, [ebx+STREAM.lim_1]
-
 
247
           mov [ebx+STREAM.seg_0], eax
-
 
248
           mov [ebx+STREAM.lim_0], ecx
-
 
249
@@:
274
           add [ebx+STREAM.in_free], ecx
-
 
275
           sub [ebx+STREAM.in_count], ecx
-
 
276
 
-
 
277
           cmp eax, [ebx+STREAM.in_top]
-
 
278
           jb @f
-
 
279
 
-
 
280
           sub eax, [ebx+STREAM.in_size]
-
 
281
@@:
-
 
282
           mov [ebx+STREAM.in_rp], eax
-
 
283
 
-
 
284
           sub eax, [ebx+STREAM.in_base]
-
 
285
           sub eax, 128
-
 
286
           lea edx, [event]
-
 
287
 
-
 
288
           mov dword [edx], RT_INP_EMPTY
-
 
289
           mov dword [edx+4], 0
-
 
290
           mov dword [edx+8], ebx
-
 
291
           mov dword [edx+12], eax
-
 
292
 
-
 
293
           mov eax, [ebx+STREAM.notify_event]
-
 
294
           test eax, eax
-
 
295
           jz .exit
-
 
296
 
-
 
297
           mov ebx, [ebx+STREAM.notify_id]
-
 
298
           xor ecx, ecx
-
 
299
           call RaiseEvent   ;eax, ebx, ecx, edx
-
 
300
.exit:
-
 
301
           ret
-
 
302
endp
-
 
303
 
250
           mov [ebx+STREAM.curr_seg], eax
304
align 4
-
 
305
proc mix_all stdcall, dest:dword, list:dword, count:dword
251
 
306
 
252
           xor ecx, ecx
307
           mov edi, [dest]
-
 
308
           mov ebx, 64
-
 
309
.mix:
-
 
310
           mov edx, [list]
-
 
311
           mov ecx, [count]
-
 
312
 
-
 
313
           mov eax, [edx]
253
           cmp eax, [ebx+STREAM.notify_off2]
314
           movq mm0, [eax]
-
 
315
           movd mm1, [edx+4]
-
 
316
           punpckldq mm1,mm1
-
 
317
           pmulhw mm0, mm1
-
 
318
           psllw  mm0, 1
-
 
319
 
254
           je @f
320
.mix_loop:
255
 
321
           add dword [edx], 8
Line 256... Line 322...
256
           mov ecx,0x8000
322
           add edx, 8
257
           cmp eax, [ebx+STREAM.notify_off1]
323
           dec ecx
Line 287... Line 353...
287
           mov edi, [dest]
353
           mov edi, [dest]
288
           mov edx, [src]
354
           mov edx, [src]
289
           sub edx, 32*2
355
           sub edx, 32*2
290
           mov eax, 16
356
           mov eax, 16
Line 291... Line 357...
291
 
357
 
292
align 16
358
align 4
293
.l1:
359
.l1:
294
           mov ecx, eax
360
           mov ecx, eax
295
           mov esi, eax
361
           mov esi, eax
296
           and ecx, 0x7FFF
362
           and ecx, 0x7FFF
Line 340... Line 406...
340
           mov edx, [src]
406
           mov edx, [src]
341
           sub edx, 32
407
           sub edx, 32
Line 342... Line 408...
342
 
408
 
Line 343... Line 409...
343
           mov esi, 16
409
           mov esi, 16
344
 
410
 
345
align 16
411
align 4
346
.l1:
412
.l1:
347
           mov ecx, esi
413
           mov ecx, esi
348
           mov eax, esi
414
           mov eax, esi
Line 411... Line 477...
411
           mov edi, [dest]
477
           mov edi, [dest]
412
           mov ebx, [r_dt]
478
           mov ebx, [r_dt]
413
           mov eax, 16
479
           mov eax, 16
414
           emms
480
           emms
Line 415... Line 481...
415
 
481
 
416
align 16
482
align 4
417
.l1:
483
.l1:
418
           mov ecx, eax
484
           mov ecx, eax
419
           mov esi, eax
485
           mov esi, eax
420
           and ecx, 0x7FFF
486
           and ecx, 0x7FFF
Line 464... Line 530...
464
           mov eax, 16
530
           mov eax, 16
465
           emms
531
           emms
466
           movq mm7,[mm80]
532
           movq mm7,[mm80]
467
           movq mm6,[mm_mask]
533
           movq mm6,[mm_mask]
Line 468... Line 534...
468
 
534
 
469
align 16
535
align 4
470
.l1:
536
.l1:
471
           mov ecx, eax
537
           mov ecx, eax
472
           mov esi, eax
538
           mov esi, eax
473
           and ecx, 0x7FFF
539
           and ecx, 0x7FFF
Line 838... Line 904...
838
 
904
 
839
           call alloc_mix_buff
905
           call alloc_mix_buff
840
           and eax, eax
906
           and eax, eax
Line -... Line 907...
-
 
907
           jz .err
-
 
908
 
841
           jz .err
909
           mov [output], eax
842
 
910
 
843
           mov edi, eax
911
           mov edi, eax
844
           mov eax, [str0]
912
           mov eax, [str0]
845
           mov ebx, [str1]
913
           mov ebx, [str1]
Line 937... Line 1005...
937
           dec ecx
1005
           dec ecx
938
           jnz @B
1006
           jnz @B
939
           ret
1007
           ret
940
endp
1008
endp
Line -... Line 1009...
-
 
1009
 
-
 
1010
if 0
-
 
1011
 
-
 
1012
align 4
-
 
1013
proc new_mix stdcall, output:dword
-
 
1014
           locals
-
 
1015
             mixCounter  dd ?
-
 
1016
             mixIndex  dd ?
-
 
1017
             streamIndex dd ?
-
 
1018
             inputCount  dd ?
-
 
1019
             main_count  dd ?
-
 
1020
             blockCount  dd ?
-
 
1021
             mix_out  dd ?
-
 
1022
           endl
-
 
1023
 
-
 
1024
           call prepare_playlist
-
 
1025
 
-
 
1026
           cmp [play_count], 0
-
 
1027
           je .exit
-
 
1028
           call FpuSave
-
 
1029
           mov [main_count], 32;
-
 
1030
.l00:
-
 
1031
           mov [mix_buff_map], 0x0000FFFF;
-
 
1032
           xor eax, eax
-
 
1033
           mov [mixCounter], eax
-
 
1034
           mov [mixIndex],eax
-
 
1035
           mov [streamIndex], eax;
-
 
1036
           mov ebx, [play_count]
-
 
1037
           mov [inputCount], ebx
-
 
1038
.l0:
-
 
1039
           mov ecx, 4
-
 
1040
.l1:
-
 
1041
           mov ebx, [streamIndex]
-
 
1042
           mov esi, [play_list+ebx*4]
-
 
1043
           mov eax, [esi+STREAM.work_read]
-
 
1044
           add [esi+STREAM.work_read], 512
-
 
1045
 
-
 
1046
           mov ebx, [mixIndex]
-
 
1047
           mov [mix_input+ebx*4], eax
-
 
1048
           inc [mixCounter]
-
 
1049
           inc [mixIndex]
-
 
1050
           inc [streamIndex]
-
 
1051
           dec [inputCount]
-
 
1052
           jz .m2
-
 
1053
 
-
 
1054
           dec ecx
-
 
1055
           jnz .l1
-
 
1056
 
-
 
1057
           cmp [mixCounter], 4
-
 
1058
           jnz .m2
-
 
1059
 
-
 
1060
           stdcall mix_4_1, [mix_input],[mix_input+4],[mix_input+8],[mix_input+12]
-
 
1061
           sub [mixIndex],4
-
 
1062
           mov ebx, [mixIndex]
-
 
1063
           mov [mix_input+ebx*4], eax
-
 
1064
           inc [mixIndex]
-
 
1065
           mov [mixCounter], 0
-
 
1066
 
-
 
1067
           cmp [inputCount], 0
-
 
1068
           jnz .l0
-
 
1069
.m2:
-
 
1070
           cmp [mixIndex], 1
-
 
1071
           jne @f
-
 
1072
           stdcall copy_mem, [output], [mix_input]
-
 
1073
           jmp .m3
-
 
1074
@@:
-
 
1075
           cmp [mixIndex], 2
-
 
1076
           jne @f
-
 
1077
           stdcall mix_2_1, [output], [mix_input], [mix_input+4]
-
 
1078
           jmp .m3
-
 
1079
@@:
-
 
1080
           cmp [mixIndex], 3
-
 
1081
           jne @f
-
 
1082
           stdcall mix_3_1, [output],[mix_input],[mix_input+4],[mix_input+8]
-
 
1083
           jmp .m3
-
 
1084
@@:
-
 
1085
           stdcall final_mix, [output],[mix_input],[mix_input+4],[mix_input+8], [mix_input+12]
-
 
1086
.m3:
-
 
1087
           add [output],512
-
 
1088
 
-
 
1089
           dec [main_count]
-
 
1090
           jnz .l00
-
 
1091
 
-
 
1092
           call update_stream
-
 
1093
           emms
-
 
1094
           call FpuRestore
-
 
1095
           ret
-
 
1096
.exit:
-
 
1097
           mov edi, [output]
-
 
1098
           mov ecx, 0x1000
-
 
1099
           xor eax, eax
-
 
1100
           cld
-
 
1101
           rep stosd
-
 
1102
           ret
-
 
1103
endp
-
 
1104