Browse Source

Tim Blechmann optimization patches.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2948 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.90
sletz 15 years ago
parent
commit
98a789ae4f
3 changed files with 26 additions and 7 deletions
  1. +22
    -1
      common/JackAudioPort.cpp
  2. +0
    -5
      common/JackPort.cpp
  3. +4
    -1
      common/JackPort.h

+ 22
- 1
common/JackAudioPort.cpp View File

@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/
@@ -101,7 +101,28 @@ static void AudioBufferMixdown(void* mixbuffer, void** src_buffers, int src_coun
void* buffer;

// Copy first buffer
#ifdef __SSE__
jack_nframes_t frames_group = nframes / 4;
jack_nframes_t remaining_frames = nframes % 4;

float * source = static_cast<float*>(src_buffers[0]);
float * target = static_cast<float*>(mixbuffer);

while (frames_group > 0)
{
__m128 vec = _mm_load_ps(source);
_mm_store_ps(target, vec);
source += 4;
target += 4;
--frames_group;
}

for (jack_nframes_t i = 0; i != remaining_frames; ++i)
target[i] = source[i];

#else
memcpy(mixbuffer, src_buffers[0], nframes * sizeof(float));
#endif

// Mix remaining buffers
for (int i = 1; i < src_count; ++i) {


+ 0
- 5
common/JackPort.cpp View File

@@ -77,11 +77,6 @@ void JackPort::Release()
fAlias2[0] = '\0';
}

bool JackPort::IsUsed() const
{
return fInUse;
}

float* JackPort::GetBuffer()
{
return fBuffer;


+ 4
- 1
common/JackPort.h View File

@@ -58,7 +58,10 @@ class SERVER_EXPORT JackPort

MEM_ALIGN(float fBuffer[BUFFER_SIZE_MAX], 64); // 16 bytes alignment for vector code, 64 bytes better for cache loads/stores

bool IsUsed() const;
bool IsUsed() const
{
return fInUse;
}

// RT
void ClearBuffer(jack_nframes_t frames);


Loading…
Cancel
Save