Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: basic math operations to very large arrays
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: basic math operations to very large arrays




On Nov 1, 2006, at 7:54 PM, Bruce Johnson wrote:

Draggin up old threads is good...

I ask this question because I am having success using vImage in the
Accelerate.Framework.

The very large arrays of which I speak are merely image data in
memory.  I need to take one image and subtract it from another.
(imageDataA[i] - imageDataB[i] = imageDataC[c])
right now I just do it via indirection (pointers) in a for loop.  The
images are in the range of 8 megapixels so the calculations are in the
millions per image (time many images)

Unfortunately this simple subtraction problem is as complicated as it
gets for this one part of the app.

The data comes to me from a camera as an imageData array. (unsigned
char)  To use vDSP (as I understand) I would have to "vectorize" the
imageData array and then perform my simple math operation and then
translate it back into unsigned char.

For floating point images, you can probably use vDSP_vsub(). If the rowBytes parameter is the same for both images (and is divisible by four) you can just use vDSP_vsub for the whole image. If the rowBytes are different, you'll need to call it once per scanline.


Ian
_______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: basic math operations to very large arrays (From: Ian Ollmann <email@hidden>)
 >Re: basic math operations to very large arrays (From: "Bruce Johnson" <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.