Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interleave / Deinterleave Arrays



Rustam Muginov wrote:

Do you mean the conversion of:
{a0, a1, a2, a3...}
{b0, b1, b2, b3...}
into the {a0, b0, a1, b1,...} and back, then you probably should check pack/unpack/merge operations


http://developer.apple.com/hardware/ve/instructions/vec_unpackh.html
http://developer.apple.com/hardware/ve/instructions/vec_unpackl.html
http://developer.apple.com/hardware/ve/instructions/vec_mergeh.html
http://developer.apple.com/hardware/ve/instructions/vec_mergel.html


Not exactly.

Here is an example

float src[] = { 13.f, 22.f, 45.f, 3.f, 6.f, 8.f, 7.f, 1.f, 2.f)
Let's say this is an audio data array with 3 channels
so I would like to deinterleave this array into 3 other C arrays.

Results:
float *dst1 which contains 13.f, 3.f and 7.f
float *dst2 which contains 22.f, 6.f and 1.f
float *dst3 which contains 45.f, 8.f and 2.f

For interleaving, it takes dst1, dst2 and dst3 and generate an array equivalent to src given a number of "channels".

So it's not on a vector basis but on a whole array.

Thanks,

--
Olivier Tristan
Ultimate Sound Bank

_______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/perfoptimization-dev/email@hidden

This email sent to email@hidden
References: 
 >Interleave / Deinterleave Arrays (From: Olivier Tristan <email@hidden>)
 >Re: Interleave / Deinterleave Arrays (From: Rustam Muginov <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.