Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

alon_b_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-20-2015
07:48 AM

79 Views

Matrix Subtraction

Hey,

This is probably an obvious question..

I have an operation I'd like to optimize with intel.

currently the input and output are 8 bit matrices, and I'd like the output to be the subtraction of those 2 matrices.

It seems obvious to me that the output would have to be at least 16 bit..

what is the ipp function to do it? I'm looking around the ippmSub but can't seem to find it.

Thanks,

Alon

Link Copied

3 Replies

Gennady_F_Intel

Moderator

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-20-2015
11:34 PM

79 Views

pls look at the image processing functions: Subtracts pixel values of two images. - ippiSub_*.*

alon_b_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-21-2015
07:10 AM

79 Views

But as I said, Input bits and output bits are same count, how is overflow handled?

0-256 = -256

256-0 = 256.

you need 16 bits for 8 bit subtraction.

Igor_A_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-21-2015
07:19 AM

79 Views

Hi Alon,

IPP for integer data works with saturation - therefore for 0-256 you'll get 0. If you need precise result - yes, you are right, you should convert both sources to 16s (for example with ippiConvert_8u16s_CxR) and then use ippiSub for 16s data type.

regards, Igor

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

For more complete information about compiler optimizations, see our Optimization Notice.