If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Stereo width control
5 posts
• Page 1 of 1
Stereo width control
Hi all,
A simple stereo width control using DSP.
- blatantleesly
- Posts: 21
- Joined: Wed May 20, 2015 2:46 pm
Re: Stereo width control
Thank you, I'll make use of it.
To all asm-gurus: Is this already as fast as possible, or could one of you optimize the asm code?
To all asm-gurus: Is this already as fast as possible, or could one of you optimize the asm code?
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2692
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: Stereo width control
there is a minor bug in the code:
The signs should be swapped, because mid=left+right and side=left-right => left=mid+side
here is ASM optimized version of the code:
the CPU savings will be minuscule though - the code is only using + - * which are very CPU cheap and those few intermediate variables don't make much difference.
- Code: Select all
out1 = mid - side;
out2 = mid + side;
The signs should be swapped, because mid=left+right and side=left-right => left=mid+side
here is ASM optimized version of the code:
- Code: Select all
streamin in1;
streamin in2;
streamin width;
streamout out1;
streamout out2;
float x=0.5;
movaps xmm0,width;
mulps xmm0,x;
movaps xmm0,in1;
movaps xmm1,in2;
movaps xmm2,xmm0;
addps xmm0,xmm1;
subps xmm2,xmm1;
movaps xmm3,x;
mulps xmm0,xmm3;
mulps xmm2,xmm3;
mulps xmm2,width;
movaps xmm1,xmm0;
addps xmm0,xmm2;
subps xmm1,xmm2;
movaps out1,xmm0;
movaps out2,xmm1;
the CPU savings will be minuscule though - the code is only using + - * which are very CPU cheap and those few intermediate variables don't make much difference.
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: Stereo width control
Will test it later, but wanted to already thank you.
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2692
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: Stereo width control
Hi,
From theory side, can't this code be optimized by SSE, meaning by packing L+R into a single SSE, then processing SSE(0) and SSE(1), and then unpacking?
Or is that true only if running the same exact processing on both Left and Right inputs, which is not the case here?
From theory side, can't this code be optimized by SSE, meaning by packing L+R into a single SSE, then processing SSE(0) and SSE(1), and then unpacking?
Or is that true only if running the same exact processing on both Left and Right inputs, which is not the case here?
- Rocko
- Posts: 186
- Joined: Tue May 15, 2012 12:42 pm
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 14 guests