It is currently Sat Mar 06, 2021 3:16 am

All times are UTC + 1 hour

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: More speed up, How to write? 2 loops + 1 flag
PostPosted: Mon Aug 06, 2012 12:30 am 
User avatar

Joined: Mon Jan 12, 2004 11:40 pm
Posts: 779
Location: Okazaki, JAPAN

Today, I abandon My music software to shareware. coz, alone...
I want to more optimize follows code. EndThread flg need.
and I want to use ! FASM code.

I don't know protect for purebasic inter variable.

My music software completed making. Just hi-end sounds impression.
overtook "Foobar2000", "Fidelia advance", "AIMP", and other software.
But weak point is heavy process.

Bug head Ver1.752 execute binary ... php?id=262

Procedure LPF2048(*buffer_audio_ptr, *lpf_table_ptr, *out_buffer_ptr)
  ; Thanks "Wilbert in Netherlands"
  !MOV Ecx, [p.p_lpf_table_ptr]
  !MOV Edx, [p.p_buffer_audio_ptr]
  !SUB Edx, 8184
  !PXOR xmm2, xmm2
  !MOV Eax, 2047
  !align 4
  !movq xmm0, [Ecx] ; sinc
  !movlhps xmm0, xmm0
  !cvtps2pd xmm1, [Edx] ; L + R
  !mulpd xmm1, xmm0
  !ADDPD xmm2, xmm1
  !ADD Ecx, 8
  !ADD Edx, 8
  !DEC Eax
  !JNZ InterLoop
  !cvtpd2ps xmm2, xmm2
  !MOV Edx, [p.p_out_buffer_ptr]
  !movq [Edx], xmm2

;/ I want to follow code, more optimize.
Procedure LowPathFilter()
  Shared EndThread.b
  For pos=0 To length Step 8
    LPF2048(*in+pos+8192*2, *lpf_table2048, *out+pos)
    If EndThread
;/ END

Procedure Main()
  Shared EndThread.b = 0
  Protected Thread.l
  Thread.l = CreateThread(@LowPathFilter(),0)
  While IsThread(Thread) : Delay(1) : Wend

Thank you

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye