17.08.2013 Views

AMD Performance Library User's Manual - AMD Developer Central

AMD Performance Library User's Manual - AMD Developer Central

AMD Performance Library User's Manual - AMD Developer Central

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>AMD</strong>64 Architecture<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong><br />

User’s <strong>Manual</strong><br />

Version 1.0<br />

Copyright © 2006, 2007 Advanced Micro Devices, Inc.<br />

All rights reserved.<br />

Publication#: 40535


Publication # 40535 February 2007<br />

Trademarks, Copyright, and Disclaimers<br />

<strong>AMD</strong>, the <strong>AMD</strong> Arrow logo, and combinations thereof, and the <strong>AMD</strong>64 logo are trademarks of Advanced Micro Devices, Inc.<br />

Copyright © 2006, 2007 Advanced Micro Devices, Inc. All rights reserved.<br />

The contents of this document are provided in connection with Advanced Micro Devices, Inc. (“<strong>AMD</strong>”) products. <strong>AMD</strong> makes no<br />

representations or warranties with respect to the accuracy or completeness of the contents of this publication and reserves the right to<br />

make changes to specifications and product descriptions at any time without notice. The information contained herein may be of a<br />

preliminary or advance nature and is subject to change without notice. No license, whether express, implied, arising by estoppel, or<br />

otherwise, to any intellectual property rights are granted by this publication. Except as set forth in <strong>AMD</strong>’s Standard Terms and<br />

Conditions of Sale, <strong>AMD</strong> assumes no liability whatsoever, and disclaims any express or implied warranty, relating to its products<br />

including, but not limited to, the implied warranty of merchantability, fitness for a particular purpose, or infringement of any<br />

intellectual property right.<br />

<strong>AMD</strong>'s products are not designed, intended, authorized or warranted for use as components in systems intended for surgical implant<br />

into the body, or in other applications intended to support or sustain life, or in any other application in which the failure of <strong>AMD</strong>'s<br />

product could create a situation where personal injury, death, or severe property or environmental damage may occur. <strong>AMD</strong> reserves<br />

the right to discontinue or make changes to its products at any time without notice.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 2 Trademarks, Copyright, and Disclaimers


Publication # 40535 February 2007<br />

License Agreement<br />

This software and any related documentation (the "Materials") are the confidential proprietary information of <strong>AMD</strong>.<br />

Your use of the Materials in any manner indicates your compliance with the following terms and conditions. If you do not agree to<br />

these terms and conditions, do not use the Materials.<br />

Unless otherwise provided in a separate software agreement specifically licensing the Materials, the Materials are provided in<br />

confidence and may only be used for internal evaluation. Notwithstanding the foregoing, the Materials may not be used for production<br />

software, distributed, modified, or reproduced in whole or in part by any means.<br />

LIMITATION OF LIABILITY: THE MATERIALS ARE PROVIDED "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND,<br />

INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, TITLE, FITNESS FOR ANY PARTICULAR<br />

PURPOSE, OR WARRANTIES ARISING FORM CONDUCT, COURSE OF DEALING, OR USAGE OF TRADE. IN NO EVENT SHALL <strong>AMD</strong> OR ITS<br />

LICENSORS BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS,<br />

BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OF OR INABILITY TO USE THE MATERIALS, EVEN<br />

IF <strong>AMD</strong> HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. BECAUSE SOME JURISDICTIONS PROHIBIT THE EXCLUSION<br />

OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES, AND NOTWITHSTANDING THE FAILURE OF<br />

ESSENTIAL PURPOSE OF ANY REMEDY, THE ABOVE LIMITATION MAY NOT APPLY TO YOU.<br />

<strong>AMD</strong> does not assume any responsibility for any errors which may appear in the Materials nor any responsibility to support or update<br />

the Materials. <strong>AMD</strong> retains the right to modify the Materials at any time, without notice, and is not obligated to provide such modified<br />

Materials to you.<br />

U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED RIGHTS." Use, duplication, or disclosure by<br />

the Government is subject to the restrictions as set forth in FAR 52.227-14 and DFAR 252.227-7013, et seq., or its successor. Use of<br />

the Materials by the Government constitutes acknowledgement of <strong>AMD</strong>'s proprietary rights in them.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 3 License Agreement


Publication # 40535 February 2007<br />

Table Of Contents<br />

Introduction to the APL .................................................................................................................... 14<br />

About This <strong>Manual</strong> ..........................................................................................................................................................14<br />

Data Types......................................................................................................................................................................15<br />

Return Value Glossary ....................................................................................................................................................15<br />

Processing Operators .....................................................................................................................................................17<br />

References......................................................................................................................................................................17<br />

Base <strong>Library</strong>...................................................................................................................................... 18<br />

Introduction ...................................................................................................................................................................18<br />

Organization...................................................................................................................................................................18<br />

Basic Concepts................................................................................................................................................................19<br />

Data Structures ............................................................................................................................................................19<br />

Enumerators ................................................................................................................................................................19<br />

Parameter Glossary.......................................................................................................................................................19<br />

<strong>Library</strong> Version ...............................................................................................................................................................20<br />

GetLibVersion...............................................................................................................................................................20<br />

Core Functions................................................................................................................................................................21<br />

GetStatusString ............................................................................................................................................................21<br />

GetCpuType .................................................................................................................................................................21<br />

GetCpuClocks ...............................................................................................................................................................21<br />

StaticInit .....................................................................................................................................................................22<br />

StaticInitCpu ................................................................................................................................................................22<br />

SetNumThreads ............................................................................................................................................................23<br />

GetNumThreads............................................................................................................................................................23<br />

Malloc .........................................................................................................................................................................23<br />

Free............................................................................................................................................................................24<br />

GetInitType..................................................................................................................................................................24<br />

BaseData.....................................................................................................................................................................24<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 4 Table of Contents


Publication # 40535 February 2007<br />

Signal Processing <strong>Library</strong> ................................................................................................................. 25<br />

Introduction ...................................................................................................................................................................25<br />

Organization ................................................................................................................................................................25<br />

Basic Concepts................................................................................................................................................................26<br />

Parameter Glossary.......................................................................................................................................................26<br />

<strong>Library</strong> Version ...............................................................................................................................................................28<br />

GetLibVersion...............................................................................................................................................................28<br />

Essential Vector Functions..............................................................................................................................................29<br />

Add.............................................................................................................................................................................30<br />

AddC...........................................................................................................................................................................32<br />

Sub.............................................................................................................................................................................34<br />

SubC...........................................................................................................................................................................36<br />

SubCRev .....................................................................................................................................................................38<br />

AddProduct ..................................................................................................................................................................40<br />

And.............................................................................................................................................................................41<br />

Or...............................................................................................................................................................................42<br />

Xor .............................................................................................................................................................................43<br />

AndC...........................................................................................................................................................................44<br />

OrC.............................................................................................................................................................................45<br />

XorC ...........................................................................................................................................................................46<br />

Not .............................................................................................................................................................................47<br />

LShiftC ........................................................................................................................................................................48<br />

RShiftC........................................................................................................................................................................49<br />

Mul .............................................................................................................................................................................50<br />

MulC ...........................................................................................................................................................................52<br />

Abs.............................................................................................................................................................................54<br />

Sqrt ............................................................................................................................................................................55<br />

Sqr .............................................................................................................................................................................57<br />

Div .............................................................................................................................................................................58<br />

DivC ...........................................................................................................................................................................60<br />

DivCRev ......................................................................................................................................................................61<br />

Cubrt ..........................................................................................................................................................................62<br />

Exp.............................................................................................................................................................................63<br />

Ln...............................................................................................................................................................................64<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 5 Table of Contents


Publication # 40535 February 2007<br />

10Log10 ......................................................................................................................................................................65<br />

Arctan .........................................................................................................................................................................66<br />

Threshold_LTVal ...........................................................................................................................................................67<br />

Threshold_GTVal...........................................................................................................................................................68<br />

Threshold_LTValGTVal ...................................................................................................................................................69<br />

Threshold_LT ...............................................................................................................................................................71<br />

Threshold_GT...............................................................................................................................................................72<br />

Threshold ....................................................................................................................................................................73<br />

Threshold_LTInv ...........................................................................................................................................................74<br />

Magnitude....................................................................................................................................................................75<br />

Convert .......................................................................................................................................................................76<br />

Max ............................................................................................................................................................................78<br />

MaxIndx ......................................................................................................................................................................79<br />

MaxAbs .......................................................................................................................................................................80<br />

MaxAbsIndx .................................................................................................................................................................81<br />

Min .............................................................................................................................................................................82<br />

MinIndx.......................................................................................................................................................................83<br />

MinAbs ........................................................................................................................................................................84<br />

MinAbsIndx..................................................................................................................................................................85<br />

MinMax .......................................................................................................................................................................86<br />

MinMaxIndx .................................................................................................................................................................87<br />

Norm_Inf.....................................................................................................................................................................88<br />

Norm_L1 .....................................................................................................................................................................89<br />

Norm_L2 .....................................................................................................................................................................90<br />

NormDiff_Inf ................................................................................................................................................................91<br />

NormDiff_L1.................................................................................................................................................................92<br />

NormDiff_L2.................................................................................................................................................................93<br />

Mean...........................................................................................................................................................................94<br />

MaxEvery.....................................................................................................................................................................95<br />

MinEvery .....................................................................................................................................................................96<br />

DotProd.......................................................................................................................................................................97<br />

Sum............................................................................................................................................................................99<br />

StdDev...................................................................................................................................................................... 100<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 6 Table of Contents


Publication # 40535 February 2007<br />

Fixed Accuracy Arithmetic Functions ............................................................................................................................101<br />

Inv ........................................................................................................................................................................... 102<br />

Div ........................................................................................................................................................................... 103<br />

Sqrt .......................................................................................................................................................................... 104<br />

InvSqrt...................................................................................................................................................................... 105<br />

Cbrt .......................................................................................................................................................................... 106<br />

InvCbrt ..................................................................................................................................................................... 107<br />

Pow .......................................................................................................................................................................... 108<br />

Powx......................................................................................................................................................................... 109<br />

Exp........................................................................................................................................................................... 110<br />

Ln............................................................................................................................................................................. 111<br />

Log10 ....................................................................................................................................................................... 112<br />

Vector Initialization Functions......................................................................................................................................113<br />

Copy ......................................................................................................................................................................... 114<br />

Move......................................................................................................................................................................... 115<br />

Set ........................................................................................................................................................................... 116<br />

Zero.......................................................................................................................................................................... 117<br />

Transform Functions.....................................................................................................................................................118<br />

ConjPack ................................................................................................................................................................... 119<br />

ConjPerm................................................................................................................................................................... 120<br />

ConjCcs..................................................................................................................................................................... 121<br />

MulPack..................................................................................................................................................................... 122<br />

MulPerm .................................................................................................................................................................... 123<br />

MulPackConj .............................................................................................................................................................. 124<br />

FFTInitAlloc ................................................................................................................................................................ 125<br />

FFTFree ..................................................................................................................................................................... 126<br />

FFTInit ...................................................................................................................................................................... 127<br />

FFTGetSize................................................................................................................................................................. 129<br />

FFTGetBufSize ............................................................................................................................................................ 130<br />

FFTFwd_CToC............................................................................................................................................................. 131<br />

FFTInv_CToC.............................................................................................................................................................. 133<br />

FFTFwd_RToCCS......................................................................................................................................................... 135<br />

FFTFwd_RToPack ........................................................................................................................................................ 137<br />

FFTFwd_RToPerm ....................................................................................................................................................... 138<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 7 Table of Contents


Publication # 40535 February 2007<br />

FFTInv_CCSToR.......................................................................................................................................................... 139<br />

FFTInv_PackToR ......................................................................................................................................................... 140<br />

FFTInv_PermToR ........................................................................................................................................................ 141<br />

Image Processing <strong>Library</strong> ............................................................................................................... 142<br />

Introduction .................................................................................................................................................................142<br />

Organization .............................................................................................................................................................. 142<br />

Basic Concepts..............................................................................................................................................................142<br />

Data Structures .......................................................................................................................................................... 143<br />

Enumerators .............................................................................................................................................................. 143<br />

Color Channel Buffers .................................................................................................................................................. 143<br />

Color Plane Buffers...................................................................................................................................................... 143<br />

Regions of Interest...................................................................................................................................................... 144<br />

Image Masking ........................................................................................................................................................... 144<br />

Borders in Image Functions .......................................................................................................................................... 145<br />

Parameter Glossary..................................................................................................................................................... 148<br />

<strong>Library</strong> Version .............................................................................................................................................................154<br />

GetLibVersion............................................................................................................................................................. 154<br />

Support Functions ........................................................................................................................................................155<br />

Malloc ....................................................................................................................................................................... 156<br />

Free.......................................................................................................................................................................... 158<br />

Image Data Exchange and Initialization Functions.......................................................................................................159<br />

Convert ..................................................................................................................................................................... 160<br />

Copy ......................................................................................................................................................................... 162<br />

Swap ........................................................................................................................................................................ 165<br />

Set ........................................................................................................................................................................... 167<br />

Scale......................................................................................................................................................................... 169<br />

Arithmetic and Logic Functions.....................................................................................................................................171<br />

Abs........................................................................................................................................................................... 172<br />

AbsDiff ...................................................................................................................................................................... 174<br />

AbsDiffC .................................................................................................................................................................... 175<br />

Add........................................................................................................................................................................... 176<br />

AddC......................................................................................................................................................................... 179<br />

AddProduct ................................................................................................................................................................ 182<br />

AddSquare................................................................................................................................................................. 184<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 8 Table of Contents


Publication # 40535 February 2007<br />

AddWeighted.............................................................................................................................................................. 185<br />

Div ........................................................................................................................................................................... 187<br />

DivC ......................................................................................................................................................................... 190<br />

Exp........................................................................................................................................................................... 192<br />

Ln............................................................................................................................................................................. 193<br />

Mul ........................................................................................................................................................................... 194<br />

MulC ......................................................................................................................................................................... 197<br />

MulScale.................................................................................................................................................................... 200<br />

MulCScale.................................................................................................................................................................. 202<br />

Sqr ........................................................................................................................................................................... 204<br />

Sqrt .......................................................................................................................................................................... 206<br />

Sub........................................................................................................................................................................... 208<br />

SubC......................................................................................................................................................................... 211<br />

And........................................................................................................................................................................... 214<br />

AndC......................................................................................................................................................................... 216<br />

Comp ........................................................................................................................................................................ 218<br />

Not ........................................................................................................................................................................... 219<br />

Or............................................................................................................................................................................. 220<br />

OrC........................................................................................................................................................................... 222<br />

LShiftC ...................................................................................................................................................................... 224<br />

RShiftC...................................................................................................................................................................... 226<br />

Xor ........................................................................................................................................................................... 228<br />

XorC ......................................................................................................................................................................... 230<br />

Color Model Conversion Functions ................................................................................................................................232<br />

RGBToYUV ................................................................................................................................................................. 233<br />

YUVToRGB ................................................................................................................................................................. 234<br />

RGBToYUV422............................................................................................................................................................ 235<br />

YUV422ToRGB............................................................................................................................................................ 237<br />

RGBToYUV420............................................................................................................................................................ 239<br />

YUV420ToRGB............................................................................................................................................................ 241<br />

YUV420ToBGR............................................................................................................................................................ 243<br />

YUV420ToRGB* .......................................................................................................................................................... 244<br />

YUV420ToBGR* .......................................................................................................................................................... 246<br />

RGBToYCbCr .............................................................................................................................................................. 248<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 9 Table of Contents


Publication # 40535 February 2007<br />

YCbCrToRGB .............................................................................................................................................................. 249<br />

YCbCrToRGB*............................................................................................................................................................. 250<br />

YCbCrToBGR* ............................................................................................................................................................ 252<br />

RGBToYCbCr422 ......................................................................................................................................................... 254<br />

YCbCr422ToRGB ......................................................................................................................................................... 255<br />

RGBToCbYCr422* ....................................................................................................................................................... 256<br />

CbYCr422ToRGB ......................................................................................................................................................... 257<br />

BGRToCbYCr422 ......................................................................................................................................................... 258<br />

CbYCr422ToBGR ......................................................................................................................................................... 259<br />

YCbCr422ToRGB* ....................................................................................................................................................... 260<br />

YCbCr422ToBGR* ....................................................................................................................................................... 262<br />

RGBToYCbCr420 ......................................................................................................................................................... 264<br />

BGRToYCbCr420 ......................................................................................................................................................... 265<br />

YCbCr420ToRGB ......................................................................................................................................................... 266<br />

YCbCr420ToRGB* ....................................................................................................................................................... 267<br />

YCbCr420ToBGR ......................................................................................................................................................... 269<br />

YCbCr420ToBGR* ....................................................................................................................................................... 270<br />

YCbCr411ToBGR ......................................................................................................................................................... 272<br />

RGBToXYZ ................................................................................................................................................................. 273<br />

XYZToRGB ................................................................................................................................................................. 275<br />

RGBToLUV ................................................................................................................................................................. 277<br />

LUVToRGB ................................................................................................................................................................. 280<br />

BGRToLab.................................................................................................................................................................. 282<br />

LabToBGR.................................................................................................................................................................. 284<br />

RGBToYCC ................................................................................................................................................................. 286<br />

YCCToRGB ................................................................................................................................................................. 288<br />

RGBToHLS ................................................................................................................................................................. 290<br />

HLSToRGB ................................................................................................................................................................. 292<br />

BGRToHLS ................................................................................................................................................................. 295<br />

HLSToBGR ................................................................................................................................................................. 297<br />

RGBToHSV................................................................................................................................................................. 300<br />

HSVToRGB................................................................................................................................................................. 302<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 10 Table of Contents


Publication # 40535 February 2007<br />

Threshold and Compare Functions................................................................................................................................304<br />

Threshold .................................................................................................................................................................. 305<br />

Threshold_GT............................................................................................................................................................. 307<br />

Threshold_LT ............................................................................................................................................................. 309<br />

Threshold_Val ............................................................................................................................................................ 311<br />

Threshold_GTVal......................................................................................................................................................... 313<br />

Threshold_LTVal ......................................................................................................................................................... 315<br />

Threshold_LTValGTVal ................................................................................................................................................. 317<br />

Compare ................................................................................................................................................................... 319<br />

CompareC.................................................................................................................................................................. 321<br />

CompareEqualEps ....................................................................................................................................................... 323<br />

CompareEqualEpsC ..................................................................................................................................................... 324<br />

Geometric Transform Functions....................................................................................................................................325<br />

Resize ....................................................................................................................................................................... 326<br />

ResizeCenter .............................................................................................................................................................. 328<br />

GetResizeFract ........................................................................................................................................................... 330<br />

ResizeShift................................................................................................................................................................. 331<br />

ResizeSqrPixelGetBufSize ............................................................................................................................................. 333<br />

ResizeSqrPixel ............................................................................................................................................................ 334<br />

ResizeYUV422 ............................................................................................................................................................ 337<br />

Mirror........................................................................................................................................................................ 338<br />

Remap ...................................................................................................................................................................... 340<br />

Rotate....................................................................................................................................................................... 342<br />

GetRotateShift............................................................................................................................................................ 344<br />

AddRotateShift ........................................................................................................................................................... 345<br />

GetRotateQuad........................................................................................................................................................... 346<br />

GetRotateBound ......................................................................................................................................................... 347<br />

RotateCenter.............................................................................................................................................................. 348<br />

Shear........................................................................................................................................................................ 350<br />

GetShearQuad............................................................................................................................................................ 353<br />

GetShearBound .......................................................................................................................................................... 354<br />

WarpAffine................................................................................................................................................................. 355<br />

WarpAffineBack .......................................................................................................................................................... 357<br />

WarpAffineQuad.......................................................................................................................................................... 359<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 11 Table of Contents


Publication # 40535 February 2007<br />

GetAffineQuad ............................................................................................................................................................ 361<br />

GetAffineBound .......................................................................................................................................................... 362<br />

GetAffineTransform ..................................................................................................................................................... 363<br />

WarpPerspective ......................................................................................................................................................... 364<br />

WarpPerspectiveBack .................................................................................................................................................. 366<br />

WarpPerspectiveQuad.................................................................................................................................................. 368<br />

GetPerspectiveQuad .................................................................................................................................................... 370<br />

GetPerspectiveBound................................................................................................................................................... 371<br />

GetPerspectiveTransform ............................................................................................................................................. 372<br />

WarpBilinear .............................................................................................................................................................. 373<br />

WarpBilinearBack........................................................................................................................................................ 375<br />

WarpBilinearQuad ....................................................................................................................................................... 377<br />

GetBilinearQuad ......................................................................................................................................................... 379<br />

GetBilinearBound ........................................................................................................................................................ 380<br />

GetBilinearTransform................................................................................................................................................... 381<br />

Digital Filter Functions .................................................................................................................................................382<br />

Sharpen .................................................................................................................................................................... 383<br />

FilterBox.................................................................................................................................................................... 384<br />

FilterBoxInplace.......................................................................................................................................................... 386<br />

FilterMin .................................................................................................................................................................... 387<br />

FilterMax ................................................................................................................................................................... 389<br />

SumWindowRow ......................................................................................................................................................... 391<br />

SumWindow............................................................................................................................................................... 392<br />

FilterMedian ............................................................................................................................................................... 393<br />

FilterMedianHoriz ........................................................................................................................................................ 395<br />

FilterMedianVert ......................................................................................................................................................... 397<br />

FilterMedianCross........................................................................................................................................................ 399<br />

FilterMedianColor ........................................................................................................................................................ 401<br />

Filter ......................................................................................................................................................................... 403<br />

Filter32f .................................................................................................................................................................... 405<br />

FilterColumn .............................................................................................................................................................. 407<br />

FilterColumn32f .......................................................................................................................................................... 409<br />

FilterRow ................................................................................................................................................................... 411<br />

FilterRow32f............................................................................................................................................................... 413<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 12 Table of Contents


Publication # 40535 February 2007<br />

FilterPrewittHoriz ........................................................................................................................................................ 415<br />

FiltePrewittVert........................................................................................................................................................... 416<br />

FilterScharrHoriz ......................................................................................................................................................... 417<br />

FilterScharrVert .......................................................................................................................................................... 418<br />

FilterSobelHoriz .......................................................................................................................................................... 419<br />

FilterSobelVert............................................................................................................................................................ 421<br />

FilterSobelHorizSecond ................................................................................................................................................ 423<br />

FilterSobelVertSecond.................................................................................................................................................. 424<br />

FilterSobelCross.......................................................................................................................................................... 425<br />

FilterRobertsDown....................................................................................................................................................... 426<br />

FilterRobertsUp........................................................................................................................................................... 427<br />

FilterLaplace............................................................................................................................................................... 428<br />

FilterGauss................................................................................................................................................................. 430<br />

FilterHipass ................................................................................................................................................................ 432<br />

FilterLowpass ............................................................................................................................................................. 434<br />

Video Coding Functions ................................................................................................................................................436<br />

GetDiff ...................................................................................................................................................................... 437<br />

SqrDiff ...................................................................................................................................................................... 439<br />

VarMean .................................................................................................................................................................... 440<br />

VarMeanDiff ............................................................................................................................................................... 441<br />

Variance16X16 ........................................................................................................................................................... 442<br />

EdgesDetect............................................................................................................................................................... 443<br />

SAD .......................................................................................................................................................................... 444<br />

SumsDiff ................................................................................................................................................................... 445<br />

MC............................................................................................................................................................................ 446<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 13 Table of Contents


Publication # 40535 February 2007<br />

Introduction to the APL<br />

The <strong>AMD</strong> Programming <strong>Library</strong> (APL) is a collection of highly-optimized functions for use in a variety of programming domains. All<br />

implementations of the libraries provide C and C++ programmers ANSI C style interfaces.<br />

The APL consists of three library modules:<br />

• The Base library consists of functions essential for primary tasks such as memory allocation and functions that manage the<br />

performance of other library functions.<br />

• The Signal Processing library consists of primitives that perform signal processing.<br />

• The Image Processing library consists of image and video processing functions.<br />

APL functions are geared to yield maximum performance on the x86 and the <strong>AMD</strong>64 hardware architectures. Current implementations<br />

exploit single instruction multiple data (SIMD) instructions. Specifically, the streaming SIMD extensions (SSE1, SSE2) are used to<br />

optimize for speed. Programmers can concentrate on task functionality because the APL handles performance. Many of the functions<br />

are threaded internally; the programmer has the flexibility of controlling the number of threads and of turning off threading. As the<br />

architecture is extended and new instructions are added, new code-paths that take advantage of the extensions will be added to the<br />

APL, without changing the programming interface and existing functionality.<br />

About This <strong>Manual</strong><br />

This manual describes each of the APL functions in detail. Each APL release includes a complete version of the manual that is unique to<br />

the release. The version number of the manual is the same as the APL version number.<br />

As new groups of functions are added in subsequent releases of the APL, new chapters are added to the manual.<br />

The manual is written for experienced software developers. To understand the functional descriptions, a developer must have a<br />

working knowledge of application-specific terminology and techniques, and must be reasonably proficient in the C programming<br />

language.<br />

The manual consists of sections that cover each library module. Each section contains introductory material and chapters that describe<br />

groups of functions that perform operations of the same kind. Within the chapters, each functional description, or block, consists of a<br />

Function Name followed by a short description, a Synopsis of the function syntax, a list of function Parameters, a detailed<br />

Description of the function, and a list of Return Values. The Basic Concepts chapters in each section provide information related to<br />

the functions in the section.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 14 Introduction to the APL


Publication # 40535 February 2007<br />

Data Types<br />

All APL function definitions use the following data types.<br />

Apl8s 8-bit signed integer<br />

Apl8u 8-bit unsigned integer<br />

Apl16s 16-bit signed integer<br />

Apl16u 16-bit unsigned integer<br />

Apl16sc 16-bit signed complex number<br />

Apl32s 32-bit signed integer<br />

Apl32u 32-bit unsigned integer<br />

Apl32f 32-bit floating-point number<br />

Apl32sc 32-bit signed complex number<br />

Apl32fc 32-bit floating-point complex number<br />

Apl64s 64-bit signed integer<br />

Apl64u 64-bit unsigned integer<br />

Apl64f 64-bit floating-point number<br />

Apl64sc 64-bit signed complex number<br />

Apl64fc 64-bit floating-point complex number<br />

Return Value Glossary<br />

All APL functions return an enumerated integer value (AplStatus) that precisely reports the result of execution. The following table<br />

defines all possible return values. Refer to the individual function listing for detailed information.<br />

aplStsAnchorErr The anchor is located out of the mask.<br />

aplStsChannelOrderErr The given destination order is not valid (contains values other than 0,1,2).<br />

aplStsCoeffErr The coefficient values have errors.<br />

aplStsContextMatchErr The specification structure does not match the function or is invalid.<br />

aplStsCpuMismatch The specified CPU type cannot be assigned.<br />

aplStsDivisorErr The divisor is zero.<br />

aplStsDomain Argument out of function domain warning status code.<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsEpsValErr Eps is a negative value.<br />

aplStsFftFlagErr The flag value is incorrect.<br />

aplStsFftOrderErr The specified order is out of bounds.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 15 Introduction to the APL


Publication # 40535 February 2007<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsLnNegArg Negative input buffer element warning status code.<br />

aplStsLnZeroArg Zero-valued input buffer element warning status code.<br />

aplStsMaskErr The mask size is invalid.<br />

aplStsMaskSizeErr The mask has an invalid value.<br />

aplStsMemAllocErr The function failed to allocate memory.<br />

aplStsMirrorFlipErr The mirror flip value is invalid.<br />

aplStsNoErr No error detected.<br />

aplStsNotEvenStepErr One of the step values for a floating point images is not divisible by four.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsNumChannelErr The number of channels is incorrect.<br />

aplStsOverflow Overflow in operation warning status code.<br />

aplStsQuadErr<br />

The source or destination quadrangle degenerates into a triangle, line, or points; or the destination quadrangle<br />

has conflicted vertex coordinates.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsResizeFactorErr The resize factor is less than or equal to zero.<br />

aplStsResizeNoOperationErr A destination image dimension is less than one pixel.<br />

aplStsSingularity Singularity in operation warning status code.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsThresholdErr The less-than threshold is greater than the greater-than threshold.<br />

aplStsUnderflow Underflow in operation warning status code.<br />

aplStsWrongIntersectQuad The quadrangle does not intersect the source or destination image (no operation is performed).<br />

aplStsWrongIntersectROI The ROI does not intersect the source or destination image (no operation is performed).<br />

aplStsZeroMaskValuesErr All mask values are equal to zero.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 16 Introduction to the APL


Publication # 40535 February 2007<br />

Processing Operators<br />

APL function definitions use the following notation to indicate specific operations.<br />

I Function operates in-place (source and destination locations are the same)<br />

R Function operates on an ROI (iterative, used only in the Image Processing <strong>Library</strong>)<br />

M Function performs a masking operation<br />

Sfs Function performs a scaled integer calculation<br />

References<br />

<strong>AMD</strong>64 Architecture Programmers <strong>Manual</strong>:<br />

Volume 1, Application Programming, Order Number 24592<br />

Volume 2, System Programming, Order Number 24593<br />

Volume 3, General-Purpose and System Instructions, Order Number 24594<br />

Volume 4, 128-Bit Media Instructions, Order Number 26568<br />

Volume 5, 64-Bit Media and x87 Floating-Point Instructions, Order Number 26569<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 17 Introduction to the APL


Publication # 40535 February 2007<br />

Base <strong>Library</strong><br />

Introduction<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> (APL) base library functions perform essential support and initialization tasks.<br />

This section of the manual describes each of the functions in detail.<br />

Organization<br />

Two introductory chapters are followed by chapters that describe groups of functions related by purpose.<br />

• This Introduction provides a brief summary of the section.<br />

• Basic Concepts provides an overview of the information contained in the functional descriptions.<br />

• <strong>Library</strong> Version describes the APL function that provides library version information.<br />

• Core Functions describes the status string, CPU type, CPU clocking, CPU initialization, threading control, and memory<br />

allocation functions.<br />

Within the chapters, each functional description consists of a Function Name followed by a short description, a Synopsis of the<br />

function syntax, a list of function Parameters, a detailed Description of the function, and a list of Return Values.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 18 Base <strong>Library</strong>


Publication # 40535 February 2007<br />

Basic Concepts<br />

Base library functional descriptions include the following types of information.<br />

Data Structures<br />

Base library function definitions use the following data structures.<br />

Apl<strong>Library</strong>Version Version information of library.<br />

AplRoundMode Mode of rounding in data type conversion.<br />

AplWinType Type of window for generating FIR filter coefficients.<br />

Enumerators<br />

Base library function definitions use the following enumerators.<br />

AplBool Type of Boolean values.<br />

AplCmpOp Type of comparison operation.<br />

AplCpuType Type of CPU with presence of streaming SIMD extensions.<br />

AplHintAlgorithm Hint to favor speed or accuracy.<br />

Parameter Glossary<br />

Base library function definitions use the following parameters.<br />

StsCode Specifies the status code used by the AplStatus function.<br />

cpu Specifies a CPU type.<br />

length Specifies a number of bytes to be allocated.<br />

numThr Specifies the maximum number of threads that can be used by any APL function.<br />

ptr Pointer to memory buffer<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 19 Base <strong>Library</strong>


Publication # 40535 February 2007<br />

<strong>Library</strong> Version<br />

This chapter describes the APL function that provides library version information.<br />

GetLibVersion<br />

<strong>Library</strong> version<br />

Synopsis<br />

const Apl<strong>Library</strong>Version* aplGetLibVersion ( );<br />

Description<br />

This function returns a pointer to the Apl<strong>Library</strong>Version structure that contains APL <strong>Library</strong> version information.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 20 Base <strong>Library</strong>


Publication # 40535 February 2007<br />

Core Functions<br />

This chapter describes the status string, CPU type, CPU clocking, CPU initialization, threading control, and memory allocation functions.<br />

GetStatusString<br />

Get status message string<br />

Synopsis<br />

const char * aplGetStatusString ( AplStatus StsCode );<br />

Parameters<br />

StsCode Specifies the status code used by the AplStatus function.<br />

Description<br />

This functions returns a string that describes the meaning of any AplStatus enumerated integer.<br />

GetCpuType<br />

Get CPU Type<br />

Synopsis<br />

AplCpuType aplGetCpuType ( );<br />

Description<br />

This function returns the level of SSE support that is present. It can be used to identify the CPU type.<br />

GetCpuClocks<br />

Get CPU clock cycles<br />

Synopsis<br />

Apl64u aplGetCpuClocks ( );<br />

Description<br />

This function returns the number of CPU clock cycles elapsed since CPU power on. A code segment can be timed by invoking the<br />

function at two different points, then subtracting the first return value from the second return value.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 21 Base <strong>Library</strong>


Publication # 40535 February 2007<br />

StaticInit<br />

Initialize to an appropriate CPU type<br />

Synopsis<br />

AplStatus aplStaticInit ( );<br />

Description<br />

This function initializes the APL internal dispatcher to use the most appropriate CPU type.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

StaticInitCpu<br />

Initialize to a specified CPU type<br />

Synopsis<br />

AplStatus aplStaticInitCpu ( AplCpuType cpu );<br />

Parameters<br />

cpu Specifies a CPU type.<br />

Description<br />

This function initializes the APL internal dispatcher to use a specified CPU type.<br />

Return Values<br />

aplStsCpuMismatch The specified CPU type cannot be assigned.<br />

aplStsNoErr No error detected.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 22 Base <strong>Library</strong>


Publication # 40535 February 2007<br />

SetNumThreads<br />

Set number of threads<br />

Synopsis<br />

AplStatus aplSetNumThreads ( unsigned int numThr );<br />

Parameters<br />

numThr Specifies the maximum number of threads that can be used by any APL function.<br />

Description<br />

This function defines the maximum number of threads that can be used by any APL function. Set numThr to 1 to turn threading off.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

GetNumThreads<br />

Get number of threads<br />

Synopsis<br />

Apl32u aplGetNumThreads ( );<br />

Description<br />

This function returns the maximum number of threads that can be used by any APL function.<br />

Malloc<br />

Allocate memory<br />

Synopsis<br />

void * aplMalloc ( int length );<br />

Parameters<br />

length Specifies a number of bytes to be allocated.<br />

Description<br />

This function allocates a memory buffer of length bytes and returns a pointer to it.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 23 Base <strong>Library</strong>


Publication # 40535 February 2007<br />

Free<br />

Free memory<br />

Synopsis<br />

void aplFree ( void * ptr );<br />

Parameters<br />

ptr Pointer to a memory buffer.<br />

Description<br />

This function frees the memory buffer pointed to by ptr.<br />

GetInitType<br />

GetInitType<br />

Synopsis<br />

int aplGetInitType ( );<br />

Description<br />

This function is for APL internal use.<br />

BaseData<br />

BaseData<br />

Synopsis<br />

void * aplBaseData ( );<br />

Description<br />

This function is for APL internal use.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 24 Base <strong>Library</strong>


Publication # 40535 February 2007<br />

Signal Processing <strong>Library</strong><br />

Introduction<br />

The <strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> (APL) signal processing functions perform a number of functions related to signal processing. This<br />

section of the manual describes each of the signal processing functions in detail.<br />

Organization<br />

Two introductory chapters are followed by chapters that describe groups of functions related by purpose.<br />

• This Introduction provides a brief summary of the section.<br />

• Basic Concepts provides an overview of the information contained in the functional descriptions.<br />

• <strong>Library</strong> Version describes the APL function that returns the library version.<br />

• Essential Vector Functions describes functions that perform vector calculations.<br />

• Fixed Accuracy Arithmetic Functions describes functions that perform arithmetic operations at a chosen level of accuracy.<br />

• Vector Initialization Functions describes functions that perform vector initialization tasks.<br />

• Transform Functions describes functions that perform frequency and time domain transformation.<br />

Within the chapters, each functional description consists of a Function Name followed by a short description, a Synopsis of the<br />

function syntax, a list of function Parameters, a detailed Description of the function, and a list of Return Values.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 25 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Basic Concepts<br />

APL functional descriptions include the following types of information.<br />

Parameter Glossary<br />

Signal library function definitions use the following parameters.<br />

flag Specifies the FFT division type. It is enumerated in aplBase.h.<br />

hint Hints whether to choose a fast or accurate computation algorithm.<br />

len Specifies the number of elements in a buffer.<br />

lenDst Specifies the number of elements in a destination vector.<br />

length Specifies the number of elements in a vector.<br />

level Specifies a threshold level.<br />

levelGT Specifies a threshold level for greater-than comparison.<br />

levelLT Specifies a threshold level for less-than comparison.<br />

order Order of an FFT signal. The length of the signal is 2^order.<br />

pBufInit Pointer to memory required for FFT initialization.<br />

pBuffer Pointer to the FFT work buffer.<br />

pDp Pointer to the destination buffer that contains the dot product of the source buffers.<br />

pDst Pointer to a destination buffer.<br />

pDst1 Pointer to destination buffer one.<br />

pDst2 Pointer to destination buffer two.<br />

pDstIm Pointer to a destination buffer that contains the imaginary component values of an output signal.<br />

pDstRe Pointer to a destination buffer that contains the real component values of an output signal.<br />

pFFTSpec Pointer to the FFT specification structure.<br />

pIndx Pointer to the destination buffer that contains the index of the maximum or minimum value in the source buffer.<br />

pMax Pointer to the destination buffer that contains the maximum value in the source buffer.<br />

pMaxAbs Pointer to the destination buffer that contains the maximum absolute value in the source buffer.<br />

pMaxIndx Pointer to the destination buffer that contains the index of the maximum value in the source vector.<br />

pMean Pointer to the destination buffer that contains the mean of the values in the source buffer.<br />

pMemSpec Pointer to memory where the FFT specification structure is initialized.<br />

pMin Pointer to a destination buffer that contains the minimum value in the source buffer.<br />

pMinAbs Pointer to a destination buffer that contains the minimum absolute value in the source buffer.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 26 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

pMinIndx Pointer to a destination buffer that contains the index of the minimum value in the source buffer.<br />

pNorm<br />

Pointer to a destination buffer that contains the NormC, NormL1, or NormL2 of the values in the source buffer, depending on the<br />

function call.<br />

pSize Pointer to the size of the FFT work buffer used by the FFTFwd and FFTInv functions.<br />

pSizeBuf Pointer to the size of the FFT work buffer used by the FFTFwd and FFTInv functions.<br />

pSizeInit Pointer to the size of the BufInit buffer used by the FFTInit function.<br />

pSizeSpec Pointer to the size of the MemSpec buffer used by the FFTInit function.<br />

pSrc Pointer to a source buffer.<br />

pSrc1 Pointer to source buffer one.<br />

pSrc2 Pointer to source buffer two.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

pSrcDstIm Pointer to a source/destination buffer that contains the imaginary components of input and output signals.<br />

pSrcDstRe Pointer to a source/destination buffer that contains the real components of input and output signals.<br />

pSrcIm Pointer to a source buffer that contains the imaginary component values of an input signal.<br />

pSrcRe Pointer to a source buffer that contains the real component values of an input signal.<br />

pStdDev Pointer to the destination buffer that contains the standard deviation of the values in the source buffer.<br />

pSum Pointer to the destination buffer that contains the sum of all the elements in the source buffer.<br />

ppFFTSpec Double pointer to the FFT specification structure.<br />

relOp Constant that indicates which relational operation to perform.<br />

rndMode Constant that indicates which rounding mode to use when converting from a scalar to an integer.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

val Specified value.<br />

value Specified value.<br />

valueGT Specifies a value to set when a greater-than comparison evaluates as true.<br />

valueLT Specifies a value to set a less-than comparison evaluates as true.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 27 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

<strong>Library</strong> Version<br />

This chapter describes the APL function that provides library version information.<br />

GetLibVersion<br />

Get library version<br />

Synopsis<br />

const Apl<strong>Library</strong>Version* aplsGetLibVersion ( );<br />

const Apl<strong>Library</strong>Version* aplacGetLibVersion ( );<br />

const Apl<strong>Library</strong>Version* aplchGetLibVersion ( );<br />

const Apl<strong>Library</strong>Version* apldcGetLibVersion ( );<br />

const Apl<strong>Library</strong>Version* aplscGetLibVersion ( );<br />

const Apl<strong>Library</strong>Version* aplsrGetLibVersion ( );<br />

const Apl<strong>Library</strong>Version* aplvmGetLibVersion ( );<br />

Description<br />

This function returns a pointer to the Apl<strong>Library</strong>Version structure that contains APL <strong>Library</strong> version information.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 28 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Essential Vector Functions<br />

This chapter describes functions that perform vector calculations.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 29 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Add<br />

Add<br />

Synopsis<br />

AplStatus aplsAdd_32u ( const Apl32u* pSrc1 , const Apl32u* pSrc2 , Apl32u* pDst , int len );<br />

AplStatus aplsAdd_32f ( const Apl32f* pSrc1 , const Apl32f* pSrc2 , Apl32f* pDst , int len );<br />

AplStatus aplsAdd_64f ( const Apl64f* pSrc1 , const Apl64f* pSrc2 , Apl64f* pDst , int len );<br />

AplStatus aplsAdd_32fc ( const Apl32fc* pSrc1 , const Apl32fc* pSrc2 , Apl32fc* pDst , int len );<br />

AplStatus aplsAdd_64fc ( const Apl64fc* pSrc1 , const Apl64fc* pSrc2 , Apl64fc* pDst , int len );<br />

AplStatus aplsAdd_8u16u ( const Apl8u* pSrc1 , const Apl8u* pSrc2 , Apl16u* pDst , int len );<br />

AplStatus aplsAdd_16s32f ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , Apl32f* pDst , int len );<br />

AplStatus aplsAdd_16s_I ( const Apl16s* pSrc , Apl16s* pSrcDst , int len );<br />

AplStatus aplsAdd_32f_I ( const Apl32f* pSrc , Apl32f* pSrcDst , int len );<br />

AplStatus aplsAdd_64f_I ( const Apl64f* pSrc , Apl64f* pSrcDst , int len );<br />

AplStatus aplsAdd_32fc_I ( const Apl32fc* pSrc , Apl32fc* pSrcDst , int len );<br />

AplStatus aplsAdd_64fc_I ( const Apl64fc* pSrc , Apl64fc* pSrcDst , int len );<br />

AplStatus aplsAdd_16s32s_I ( const Apl16s* pSrc , Apl32s* pSrcDst , int len );<br />

AplStatus aplsAdd_8u_Sfs ( const Apl8u* pSrc1 , const Apl8u* pSrc2 , Apl8u* pDst , int len , int scaleFactor );<br />

AplStatus aplsAdd_16s_Sfs ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsAdd_32s_Sfs ( const Apl32s* pSrc1 , const Apl32s* pSrc2 , Apl32s* pDst , int len , int scaleFactor );<br />

AplStatus aplsAdd_16sc_Sfs ( const Apl16sc* pSrc1 , const Apl16sc* pSrc2 , Apl16sc* pDst , int len , int scaleFactor );<br />

AplStatus aplsAdd_32sc_Sfs ( const Apl32sc* pSrc1 , const Apl32sc* pSrc2 , Apl32sc* pDst , int len , int scaleFactor );<br />

AplStatus aplsAdd_8u_ISfs ( const Apl8u* pSrc , Apl8u* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsAdd_16s_ISfs ( const Apl16s* pSrc , Apl16s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsAdd_32s_ISfs ( const Apl32s* pSrc , Apl32s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsAdd_16sc_ISfs ( const Apl16sc* pSrc , Apl16sc* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsAdd_32sc_ISfs ( const Apl32sc* pSrc , Apl32sc* pSrcDst , int len , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrc1 Pointer to source buffer one.<br />

pSrc2 Pointer to source buffer two.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 30 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through vector elements in two source buffers and add the data in buffer 2 to the data in buffer 1. The sum can<br />

be written to a destination buffer or written back to the source buffer. The 8-bit unsigned, 16-bit signed, 16-bit signed complex, and<br />

32-bit signed complex versions perform an integer scaling operation before writing the results. Other versions add signed and<br />

unsigned integers and write 32-bit floating point results.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 31 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AddC<br />

Add constant<br />

Synopsis<br />

AplStatus aplsAddC_32f ( const Apl32f* pSrc , Apl32f val , Apl32f* pDst , int len );<br />

AplStatus aplsAddC_64f ( const Apl64f* pSrc , Apl64f val , Apl64f* pDst , int len );<br />

AplStatus aplsAddC_32fc ( const Apl32fc* pSrc , Apl32fc val , Apl32fc* pDst , int len );<br />

AplStatus aplsAddC_64fc ( const Apl64fc* pSrc , Apl64fc val , Apl64fc* pDst , int len );<br />

AplStatus aplsAddC_16s_I ( Apl16s val , Apl16s* pSrcDst , int len );<br />

AplStatus aplsAddC_32f_I ( Apl32f val , Apl32f* pSrcDst , int len );<br />

AplStatus aplsAddC_64f_I ( Apl64f val , Apl64f* pSrcDst , int len );<br />

AplStatus aplsAddC_32fc_I ( Apl32fc val , Apl32fc* pSrcDst , int len );<br />

AplStatus aplsAddC_64fc_I ( Apl64fc val , Apl64fc* pSrcDst , int len );<br />

AplStatus aplsAddC_8u_Sfs ( const Apl8u* pSrc , Apl8u val , Apl8u* pDst , int len , int scaleFactor );<br />

AplStatus aplsAddC_16s_Sfs ( const Apl16s* pSrc , Apl16s val , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsAddC_32s_Sfs ( const Apl32s* pSrc , Apl32s val , Apl32s* pDst , int len , int scaleFactor );<br />

AplStatus aplsAddC_16sc_Sfs ( const Apl16sc* pSrc , Apl16sc val , Apl16sc* pDst , int len , int scaleFactor );<br />

AplStatus aplsAddC_32sc_Sfs ( const Apl32sc* pSrc , Apl32sc val , Apl32sc* pDst , int len , int scaleFactor );<br />

AplStatus aplsAddC_8u_ISfs ( Apl8u val , Apl8u* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsAddC_16s_ISfs ( Apl16s val , Apl16s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsAddC_32s_ISfs ( Apl32s val , Apl32s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsAddC_16sc_ISfs ( Apl16sc val , Apl16sc* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsAddC_32sc_ISfs ( Apl32sc val , Apl32sc* pSrcDst , int len , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

val Specified value.<br />

Description<br />

These functions step through vector elements in a source buffer and add a specified constant value to the source data. The sum can be<br />

written to a destination buffer or written back to the source buffer. The 8-bit unsigned, 16-bit signed, 16-bit signed complex, and 32bit<br />

signed complex versions of the functions perform an integer scaling operation before writing the results.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 32 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 33 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Sub<br />

Subtract<br />

Synopsis<br />

AplStatus aplsSub_16s ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , Apl16s* pDst , int len );<br />

AplStatus aplsSub_32f ( const Apl32f* pSrc1 , const Apl32f* pSrc2 , Apl32f* pDst , int len );<br />

AplStatus aplsSub_64f ( const Apl64f* pSrc1 , const Apl64f* pSrc2 , Apl64f* pDst , int len );<br />

AplStatus aplsSub_32fc ( const Apl32fc* pSrc1 , const Apl32fc* pSrc2 , Apl32fc* pDst , int len );<br />

AplStatus aplsSub_64fc ( const Apl64fc* pSrc1 , const Apl64fc* pSrc2 , Apl64fc* pDst , int len );<br />

AplStatus aplsSub_16s32f ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , Apl32f* pDst , int len );<br />

AplStatus aplsSub_16s_I ( const Apl16s* pSrc , Apl16s* pSrcDst , int len );<br />

AplStatus aplsSub_32f_I ( const Apl32f* pSrc , Apl32f* pSrcDst , int len );<br />

AplStatus aplsSub_64f_I ( const Apl64f* pSrc , Apl64f* pSrcDst , int len );<br />

AplStatus aplsSub_32fc_I ( const Apl32fc* pSrc , Apl32fc* pSrcDst , int len );<br />

AplStatus aplsSub_64fc_I ( const Apl64fc* pSrc , Apl64fc* pSrcDst , int len );<br />

AplStatus aplsSub_8u_Sfs ( const Apl8u* pSrc1 , const Apl8u* pSrc2 , Apl8u* pDst , int len , int scaleFactor );<br />

AplStatus aplsSub_16s_Sfs ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsSub_32s_Sfs ( const Apl32s* pSrc1 , const Apl32s* pSrc2 , Apl32s* pDst , int len , int scaleFactor );<br />

AplStatus aplsSub_16sc_Sfs ( const Apl16sc* pSrc1 , const Apl16sc* pSrc2 , Apl16sc* pDst , int len , int scaleFactor );<br />

AplStatus aplsSub_32sc_Sfs ( const Apl32sc* pSrc1 , const Apl32sc* pSrc2 , Apl32sc* pDst , int len , int scaleFactor );<br />

AplStatus aplsSub_8u_ISfs ( const Apl8u* pSrc , Apl8u* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSub_16s_ISfs ( const Apl16s* pSrc , Apl16s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSub_32s_ISfs ( const Apl32s* pSrc , Apl32s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSub_16sc_ISfs ( const Apl16sc* pSrc , Apl16sc* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSub_32sc_ISfs ( const Apl32sc* pSrc , Apl32sc* pSrcDst , int len , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrc1 Pointer to source buffer one.<br />

pSrc2 Pointer to source buffer two.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 34 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through vector elements in two source buffers and subtract the data in buffer 1 from the data in buffer 2. The<br />

difference can be written to a destination buffer or written back to the source buffer. The 8-bit unsigned, 16-bit signed, 16-bit signed<br />

complex, and 32-bit signed complex versions perform an integer scaling operation before writing the results.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 35 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

SubC<br />

Subtract a constant<br />

Synopsis<br />

AplStatus aplsSubC_32f ( const Apl32f* pSrc , Apl32f val , Apl32f* pDst , int len );<br />

AplStatus aplsSubC_32fc ( const Apl32fc* pSrc , Apl32fc val , Apl32fc* pDst , int len );<br />

AplStatus aplsSubC_64f ( const Apl64f* pSrc , Apl64f val , Apl64f* pDst , int len );<br />

AplStatus aplsSubC_64fc ( const Apl64fc* pSrc , Apl64fc val , Apl64fc* pDst , int len );<br />

AplStatus aplsSubC_16s_I ( Apl16s val , Apl16s* pSrcDst , int len );<br />

AplStatus aplsSubC_32f_I ( Apl32f val , Apl32f* pSrcDst , int len );<br />

AplStatus aplsSubC_64f_I ( Apl64f val , Apl64f* pSrcDst , int len );<br />

AplStatus aplsSubC_32fc_I ( Apl32fc val , Apl32fc* pSrcDst , int len );<br />

AplStatus aplsSubC_64fc_I ( Apl64fc val , Apl64fc* pSrcDst , int len );<br />

AplStatus aplsSubC_8u_Sfs ( const Apl8u* pSrc , Apl8u val , Apl8u* pDst , int len , int scaleFactor );<br />

AplStatus aplsSubC_16s_Sfs ( const Apl16s* pSrc , Apl16s val , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsSubC_32s_Sfs ( const Apl32s* pSrc , Apl32s val , Apl32s* pDst , int len , int scaleFactor );<br />

AplStatus aplsSubC_16sc_Sfs ( const Apl16sc* pSrc , Apl16sc val , Apl16sc* pDst , int len , int scaleFactor );<br />

AplStatus aplsSubC_32sc_Sfs ( const Apl32sc* pSrc , Apl32sc val , Apl32sc* pDst , int len , int scaleFactor );<br />

AplStatus aplsSubC_8u_ISfs ( Apl8u val , Apl8u* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSubC_16s_ISfs ( Apl16s val , Apl16s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSubC_32s_ISfs ( Apl32s val , Apl32s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSubC_16sc_ISfs ( Apl16sc val , Apl16sc* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSubC_32sc_ISfs ( Apl32sc val , Apl32sc* pSrcDst , int len , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

val Specified value.<br />

Description<br />

These functions step through vector elements in a source buffer and subtract a specified constant value from the source data. The<br />

difference can be written to a destination buffer or written back to the source buffer. The 8-bit unsigned, 16-bit signed, 16-bit signed<br />

complex, and 32-bit signed complex versions perform an integer scaling operation before writing the results.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 36 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 37 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

SubCRev<br />

Subtract from a constant<br />

Synopsis<br />

AplStatus aplsSubCRev_32f ( const Apl32f* pSrc , Apl32f val , Apl32f* pDst , int len );<br />

AplStatus aplsSubCRev_64f ( const Apl64f* pSrc , Apl64f val , Apl64f* pDst , int len );<br />

AplStatus aplsSubCRev_32fc ( const Apl32fc* pSrc , Apl32fc val , Apl32fc* pDst , int len );<br />

AplStatus aplsSubCRev_64fc ( const Apl64fc* pSrc , Apl64fc val , Apl64fc* pDst , int len );<br />

AplStatus aplsSubCRev_32f_I ( Apl32f val , Apl32f* pSrcDst , int len );<br />

AplStatus aplsSubCRev_64f_I ( Apl64f val , Apl64f* pSrcDst , int len );<br />

AplStatus aplsSubCRev_32fc_I ( Apl32fc val , Apl32fc* pSrcDst , int len );<br />

AplStatus aplsSubCRev_64fc_I ( Apl64fc val , Apl64fc* pSrcDst , int len );<br />

AplStatus aplsSubCRev_8u_Sfs ( const Apl8u* pSrc , Apl8u val , Apl8u* pDst , int len , int scaleFactor );<br />

AplStatus aplsSubCRev_16s_Sfs ( const Apl16s* pSrc , Apl16s val , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsSubCRev_32s_Sfs ( const Apl32s* pSrc , Apl32s val , Apl32s* pDst , int len , int scaleFactor );<br />

AplStatus aplsSubCRev_16sc_Sfs ( const Apl16sc* pSrc , Apl16sc val , Apl16sc* pDst , int len , int scaleFactor );<br />

AplStatus aplsSubCRev_32sc_Sfs ( const Apl32sc* pSrc , Apl32sc val , Apl32sc* pDst , int len , int scaleFactor );<br />

AplStatus aplsSubCRev_8u_ISfs ( Apl8u val , Apl8u* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSubCRev_16s_ISfs ( Apl16s val , Apl16s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSubCRev_32s_ISfs ( Apl32s val , Apl32s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSubCRev_16sc_ISfs ( Apl16sc val , Apl16sc* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSubCRev_32sc_ISfs ( Apl32sc val , Apl32sc* pSrcDst , int len , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

val Specified value.<br />

Description<br />

These functions step through vector elements in a source buffer and subtract source data from a specified constant value. The<br />

difference can be written to a destination buffer or written back to the source buffer. The 8-bit unsigned, 16-bit signed, 16-bit signed<br />

complex, and 32-bit signed complex versions perform an integer scaling operation before writing the results.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 38 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 39 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AddProduct<br />

Add product<br />

Synopsis<br />

AplStatus aplsAddProduct_32f ( const Apl32f* pSrc1 , const Apl32f* pSrc2 , Apl32f* pSrcDst , int len );<br />

AplStatus aplsAddProduct_64f ( const Apl64f* pSrc1 , const Apl64f* pSrc2 , Apl64f* pSrcDst , int len );<br />

AplStatus aplsAddProduct_32fc ( const Apl32fc* pSrc1 , const Apl32fc* pSrc2 , Apl32fc* pSrcDst , int len );<br />

AplStatus aplsAddProduct_64fc ( const Apl64fc* pSrc1 , const Apl64fc* pSrc2 , Apl64fc* pSrcDst , int len );<br />

AplStatus aplsAddProduct_16s_Sfs ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , Apl16s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsAddProduct_32s_Sfs ( const Apl32s* pSrc1 , const Apl32s* pSrc2 , Apl32s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsAddProduct_16s32s_Sfs ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , Apl32s* pSrcDst , int len , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pSrc1 Pointer to source buffer one.<br />

pSrc2 Pointer to source buffer two.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through vector elements in two source buffers, add the product of the data in buffer 1 and the data in buffer 2 to<br />

the data in buffer 1, and write the sum back to the source buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 40 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

And<br />

AND<br />

Synopsis<br />

AplStatus aplsAnd_8u ( const Apl8u* pSrc1 , const Apl8u* pSrc2 , Apl8u* pDst , int len );<br />

AplStatus aplsAnd_16u ( const Apl16u* pSrc1 , const Apl16u* pSrc2 , Apl16u* pDst , int len );<br />

AplStatus aplsAnd_32u ( const Apl32u* pSrc1 , const Apl32u* pSrc2 , Apl32u* pDst , int len );<br />

AplStatus aplsAnd_8u_I ( const Apl8u* pSrc , Apl8u* pSrcDst , int len );<br />

AplStatus aplsAnd_16u_I ( const Apl16u* pSrc , Apl16u* pSrcDst , int len );<br />

AplStatus aplsAnd_32u_I ( const Apl32u* pSrc , Apl32u* pSrcDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrc1 Pointer to source buffer one.<br />

pSrc2 Pointer to source buffer two.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

Description<br />

These functions step through vector elements in two source buffers and perform a bitwise logical AND of the data in buffer 1 and the<br />

data in buffer 2. The results can be written to a destination buffer or written back to the source buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 41 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Or<br />

Or<br />

Synopsis<br />

AplStatus aplsOr_8u ( const Apl8u* pSrc1 , const Apl8u* pSrc2 , Apl8u* pDst , int len );<br />

AplStatus aplsOr_16u ( const Apl16u* pSrc1 , const Apl16u* pSrc2 , Apl16u* pDst , int len );<br />

AplStatus aplsOr_32u ( const Apl32u* pSrc1 , const Apl32u* pSrc2 , Apl32u* pDst , int len );<br />

AplStatus aplsOr_8u_I ( const Apl8u* pSrc , Apl8u* pSrcDst , int len );<br />

AplStatus aplsOr_16u_I ( const Apl16u* pSrc , Apl16u* pSrcDst , int len );<br />

AplStatus aplsOr_32u_I ( const Apl32u* pSrc , Apl32u* pSrcDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrc1 Pointer to source buffer one.<br />

pSrc2 Pointer to source buffer two.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

Description<br />

These functions step through vector elements in two source buffers and perform a bitwise logical Or( ) of the data in buffer 1 and the<br />

data in buffer 2. The results can be written to a destination buffer or written back to the source buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 42 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Xor<br />

Xor<br />

Synopsis<br />

AplStatus aplsXor_8u ( const Apl8u* pSrc1 , const Apl8u* pSrc2 , Apl8u* pDst , int len );<br />

AplStatus aplsXor_16u ( const Apl16u* pSrc1 , const Apl16u* pSrc2 , Apl16u* pDst , int len );<br />

AplStatus aplsXor_32u ( const Apl32u* pSrc1 , const Apl32u* pSrc2 , Apl32u* pDst , int len );<br />

AplStatus aplsXor_8u_I ( const Apl8u* pSrc , Apl8u* pSrcDst , int len );<br />

AplStatus aplsXor_16u_I ( const Apl16u* pSrc , Apl16u* pSrcDst , int len );<br />

AplStatus aplsXor_32u_I ( const Apl32u* pSrc , Apl32u* pSrcDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrc1 Pointer to source buffer one.<br />

pSrc2 Pointer to source buffer two.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

Description<br />

These functions step through vector elements in two source buffers and perform a bitwise logical Xor( ) of the data in buffer 1 and the<br />

data in buffer 2. The results can be written to a destination buffer or written back to the source buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 43 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AndC<br />

AND with constant<br />

Synopsis<br />

AplStatus aplsAndC_8u ( const Apl8u* pSrc , Apl8u val , Apl8u* pDst , int len );<br />

AplStatus aplsAndC_16u ( const Apl16u* pSrc , Apl16u val , Apl16u* pDst , int len );<br />

AplStatus aplsAndC_32u ( const Apl32u* pSrc , Apl32u val , Apl32u* pDst , int len );<br />

AplStatus aplsAndC_8u_I ( Apl8u val , Apl8u* pSrcDst , int len );<br />

AplStatus aplsAndC_16u_I ( Apl16u val , Apl16u* pSrcDst , int len );<br />

AplStatus aplsAndC_32u_I ( Apl32u val , Apl32u* pSrcDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

val Specified value.<br />

Description<br />

These functions step through vector elements in a source buffer and perform a bitwise logical AND of the source data and a specified<br />

constant. The results can be written to a destination buffer or written back to the source buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 44 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

OrC<br />

OR with constant<br />

Synopsis<br />

AplStatus aplsOrC_8u ( const Apl8u* pSrc , Apl8u val , Apl8u* pDst , int len );<br />

AplStatus aplsOrC_16u ( const Apl16u* pSrc , Apl16u val , Apl16u* pDst , int len );<br />

AplStatus aplsOrC_32u ( const Apl32u* pSrc , Apl32u val , Apl32u* pDst , int len );<br />

AplStatus aplsOrC_8u_I ( Apl8u val , Apl8u* pSrcDst , int len );<br />

AplStatus aplsOrC_16u_I ( Apl16u val , Apl16u* pSrcDst , int len );<br />

AplStatus aplsOrC_32u_I ( Apl32u val , Apl32u* pSrcDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

val Specified value.<br />

Description<br />

These functions step through vector elements in a source buffer and perform a bitwise logical OR of the source data and a specified<br />

constant. The results can be written to a destination buffer or written back to the source buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 45 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

XorC<br />

Xor with constant<br />

Synopsis<br />

AplStatus aplsXorC_8u ( const Apl8u* pSrc , Apl8u val , Apl8u* pDst , int len );<br />

AplStatus aplsXorC_16u ( const Apl16u* pSrc , Apl16u val , Apl16u* pDst , int len );<br />

AplStatus aplsXorC_32u ( const Apl32u* pSrc , Apl32u val , Apl32u* pDst , int len );<br />

AplStatus aplsXorC_8u_I ( Apl8u val , Apl8u* pSrcDst , int len );<br />

AplStatus aplsXorC_16u_I ( Apl16u val , Apl16u* pSrcDst , int len );<br />

AplStatus aplsXorC_32u_I ( Apl32u val , Apl32u* pSrcDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

val Specified value.<br />

Description<br />

These functions step through vector elements in a source buffer and perform a bitwise logical Xor( ) of the source data and a specified<br />

constant. The results can be written to a destination buffer or written back to the source buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 46 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Not<br />

Not<br />

Synopsis<br />

AplStatus aplsNot_8u ( const Apl8u* pSrc , Apl8u* pDst , int len );<br />

AplStatus aplsNot_16u ( const Apl16u* pSrc , Apl16u* pDst , int len );<br />

AplStatus aplsNot_32u ( const Apl32u* pSrc , Apl32u* pDst , int len );<br />

AplStatus aplsNot_8u_I ( Apl8u* pSrcDst , int len );<br />

AplStatus aplsNot_16u_I ( Apl16u* pSrcDst , int len );<br />

AplStatus aplsNot_32u_I ( Apl32u* pSrcDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

Description<br />

These functions step through vector elements in two source buffers and perform a bitwise logical Not( ) of the data in buffer 1 and the<br />

data in buffer 2. The results can be written to a destination buffer or written back to the source buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 47 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

LShiftC<br />

Left shift by a constant value<br />

Synopsis<br />

AplStatus aplsLShiftC_8u ( const Apl8u* pSrc , int val , Apl8u* pDst , int len );<br />

AplStatus aplsLShiftC_16s ( const Apl16s* pSrc , int val , Apl16s* pDst , int len );<br />

AplStatus aplsLShiftC_16u ( const Apl16u* pSrc , int val , Apl16u* pDst , int len );<br />

AplStatus aplsLShiftC_32s ( const Apl32s* pSrc , int val , Apl32s* pDst , int len );<br />

AplStatus aplsLShiftC_8u_I ( int val , Apl8u* pSrcDst , int len );<br />

AplStatus aplsLShiftC_16u_I ( int val , Apl16u* pSrcDst , int len );<br />

AplStatus aplsLShiftC_16s_I ( int val , Apl16s* pSrcDst , int len );<br />

AplStatus aplsLShiftC_32s_I ( int val , Apl32s* pSrcDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

val Specified value.<br />

Description<br />

These functions step through vector elements in a source buffer and shift the bits of the source data a specified number of bit positions<br />

to the left. The results can be written to a destination buffer or written back to the source buffer. Left-shifting is equivalent to<br />

multiplying by 2 to the constant power.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 48 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

RShiftC<br />

Right shift by a constant value<br />

Synopsis<br />

AplStatus aplsRShiftC_8u ( const Apl8u* pSrc , int val , Apl8u* pDst , int len );<br />

AplStatus aplsRShiftC_16s ( const Apl16s* pSrc , int val , Apl16s* pDst , int len );<br />

AplStatus aplsRShiftC_16u ( const Apl16u* pSrc , int val , Apl16u* pDst , int len );<br />

AplStatus aplsRShiftC_32s ( const Apl32s* pSrc , int val , Apl32s* pDst , int len );<br />

AplStatus aplsRShiftC_8u_I ( int val , Apl8u* pSrcDst , int len );<br />

AplStatus aplsRShiftC_16u_I ( int val , Apl16u* pSrcDst , int len );<br />

AplStatus aplsRShiftC_16s_I ( int val , Apl16s* pSrcDst , int len );<br />

AplStatus aplsRShiftC_32s_I ( int val , Apl32s* pSrcDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

val Specified value.<br />

Description<br />

These functions step through vector elements in a source buffer and shift the bits of the source data a specified number of bit positions<br />

to the right. The results can be written to a destination buffer or written back to the source buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 49 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Mul<br />

Multiply<br />

Synopsis<br />

AplStatus aplsMul_16s ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , Apl16s * pDst , int len );<br />

AplStatus aplsMul_32f ( const Apl32f* pSrc1 , const Apl32f* pSrc2 , Apl32f * pDst , int len );<br />

AplStatus aplsMul_64f ( const Apl64f* pSrc1 , const Apl64f* pSrc2 , Apl64f * pDst , int len );<br />

AplStatus aplsMul_32fc ( const Apl32fc* pSrc1 , const Apl32fc* pSrc2 , Apl32fc * pDst , int len );<br />

AplStatus aplsMul_64fc ( const Apl64fc* pSrc1 , const Apl64fc* pSrc2 , Apl64fc * pDst , int len );<br />

AplStatus aplsMul_8u16u ( const Apl8u* pSrc1 , const Apl8u* pSrc2 , Apl16u * pDst , int len );<br />

AplStatus aplsMul_16s32f ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , Apl32f * pDst , int len );<br />

AplStatus aplsMul_16s_I ( const Apl16s* pSrc , Apl16s* pSrcDst , int len );<br />

AplStatus aplsMul_32f_I ( const Apl32f* pSrc , Apl32f* pSrcDst , int len );<br />

AplStatus aplsMul_64f_I ( const Apl64f* pSrc , Apl64f* pSrcDst , int len );<br />

AplStatus aplsMul_32fc_I ( const Apl32fc* pSrc , Apl32fc* pSrcDst , int len );<br />

AplStatus aplsMul_64fc_I ( const Apl64fc* pSrc , Apl64fc* pSrcDst , int len );<br />

AplStatus aplsMul_8u_Sfs ( const Apl8u* pSrc1 , const Apl8u* pSrc2 , Apl8u* pDst , int len , int scaleFactor );<br />

AplStatus aplsMul_16s_Sfs ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsMul_32s_Sfs ( const Apl32s* pSrc1 , const Apl32s* pSrc2 , Apl32s* pDst , int len , int scaleFactor );<br />

AplStatus aplsMul_16sc_Sfs ( const Apl16sc* pSrc1 , const Apl16sc* pSrc2 , Apl16sc * pDst , int len , int scaleFactor );<br />

AplStatus aplsMul_32sc_Sfs ( const Apl32sc* pSrc1 , const Apl32sc* pSrc2 , Apl32sc * pDst , int len , int scaleFactor );<br />

AplStatus aplsMul_16u16s_Sfs ( const Apl16u* pSrc1 , const Apl16s* pSrc2 , Apl16s * pDst , int len , int scaleFactor );<br />

AplStatus aplsMul_16s32s_Sfs ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , Apl32s * pDst , int len , int scaleFactor );<br />

AplStatus aplsMul_32s32sc_Sfs ( const Apl32s* pSrc1 , const Apl32sc* pSrc2 , Apl32sc * pDst , int len , int scaleFactor );<br />

AplStatus aplsMul_8u_ISfs ( const Apl8u* pSrc , Apl8u* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsMul_16s_ISfs ( const Apl16s* pSrc , Apl16s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsMul_32s_ISfs ( const Apl32s* pSrc , Apl32s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsMul_16sc_ISfs ( const Apl16sc* pSrc , Apl16sc* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsMul_32sc_ISfs ( const Apl32sc* pSrc , Apl32sc* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsMul_32s32sc_ISfs ( const Apl32s* pSrc , Apl32sc* pSrcDst , int len , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrc1 Pointer to source buffer one.<br />

pSrc2 Pointer to source buffer two.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 50 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through vector elements in two source buffers and multiply the data in buffer 1 by the data in buffer 2. The<br />

product can be written to a destination buffer or written back to the source buffer. The 8-bit unsigned, 16-bit signed, 16-bit signed<br />

complex, and 32-bit signed complex versions perform an integer scaling operation before writing the results.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 51 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

MulC<br />

Multiply by a constant<br />

Synopsis<br />

AplStatus aplsMulC_32f ( const Apl32f* pSrc , Apl32f val , Apl32f* pDst , int len );<br />

AplStatus aplsMulC_64f ( const Apl64f* pSrc , Apl64f val , Apl64f* pDst , int len );<br />

AplStatus aplsMulC_32fc ( const Apl32fc* pSrc , Apl32fc val , Apl32fc* pDst , int len );<br />

AplStatus aplsMulC_64fc ( const Apl64fc* pSrc , Apl64fc val , Apl64fc* pDst , int len );<br />

AplStatus aplsMulC_16s_I ( Apl16s val , Apl16s* pSrcDst , int len );<br />

AplStatus aplsMulC_32f_I ( Apl32f val , Apl32f* pSrcDst , int len );<br />

AplStatus aplsMulC_64f_I ( Apl64f val , Apl64f* pSrcDst , int len );<br />

AplStatus aplsMulC_32fc_I ( Apl32fc val , Apl32fc* pSrcDst , int len );<br />

AplStatus aplsMulC_64fc_I ( Apl64fc val , Apl64fc* pSrcDst , int len );<br />

AplStatus aplsMulC_8u_Sfs ( const Apl8u* pSrc , Apl8u val , Apl8u* pDst , int len , int scaleFactor );<br />

AplStatus aplsMulC_16s_Sfs ( const Apl16s* pSrc , Apl16s val , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsMulC_32s_Sfs ( const Apl32s* pSrc , Apl32s val , Apl32s* pDst , int len , int scaleFactor );<br />

AplStatus aplsMulC_16sc_Sfs ( const Apl16sc* pSrc , Apl16sc val , Apl16sc* pDst , int len , int scaleFactor );<br />

AplStatus aplsMulC_32sc_Sfs ( const Apl32sc* pSrc , Apl32sc val , Apl32sc* pDst , int len , int scaleFactor );<br />

AplStatus aplsMulC_8u_ISfs ( Apl8u val , Apl8u* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsMulC_16s_ISfs ( Apl16s val , Apl16s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsMulC_32s_ISfs ( Apl32s val , Apl32s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsMulC_16sc_ISfs ( Apl16sc val , Apl16sc* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsMulC_32sc_ISfs ( Apl32sc val , Apl32sc* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsMulC_32f16s_Sfs ( const Apl32f* pSrc , Apl32f val , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsMulC_Low_32f16s ( const Apl32f* pSrc , Apl32f val , Apl16s* pDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

val Specified value.<br />

Description<br />

These functions step through vector elements in a source buffer and multiply the source data by a specified constant value. The<br />

product can be written to a destination buffer or written back to the source buffer. The 8-bit unsigned, 16-bit signed, 16-bit signed<br />

complex, and 32-bit signed complex versions perform an integer scaling operation before writing the results.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 52 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 53 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Abs<br />

Get absolute value<br />

Synopsis<br />

AplStatus aplsAbs_16s ( const Apl16s* pSrc , Apl16s* pDst , int len );<br />

AplStatus aplsAbs_32s ( const Apl32s* pSrc , Apl32s* pDst , int len );<br />

AplStatus aplsAbs_32f ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsAbs_64f ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsAbs_16s_I ( Apl16s* pSrcDst , int len );<br />

AplStatus aplsAbs_32s_I ( Apl32s* pSrcDst , int len );<br />

AplStatus aplsAbs_32f_I ( Apl32f* pSrcDst , int len );<br />

AplStatus aplsAbs_64f_I ( Apl64f* pSrcDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

Description<br />

These functions step through vector elements in a source buffer and calculate the absolute value of the source data. The results can be<br />

written to a destination buffer or written back to the source buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 54 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Sqrt<br />

Square root<br />

Synopsis<br />

AplStatus aplsSqrt_32f ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsSqrt_64f ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsSqrt_32f_I ( Apl32f* pSrcDst , int len );<br />

AplStatus aplsSqrt_64f_I ( Apl64f* pSrcDst , int len );<br />

AplStatus aplsSqrt_8u_Sfs ( const Apl8u* pSrc , Apl8u* pDst , int len , int scaleFactor );<br />

AplStatus aplsSqrt_16s_Sfs ( const Apl16s* pSrc , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsSqrt_16u_Sfs ( const Apl16u* pSrc , Apl16u* pDst , int len , int scaleFactor );<br />

AplStatus aplsSqrt_8u_ISfs ( Apl8u* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSqrt_16s_ISfs ( Apl16s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSqrt_16u_ISfs ( Apl16u* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSqr_32f ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsSqr_64f ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsSqr_32f_I ( Apl32f* pSrcDst , int len );<br />

AplStatus aplsSqr_64f_I ( Apl64f* pSrcDst , int len );<br />

AplStatus aplsSqrt_32s16s_Sfs ( const Apl32s* pSrc , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsSqrt_64s16s_Sfs ( const Apl64s* pSrc , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsSqrt_32fc ( const Apl32fc* pSrc , Apl32fc* pDst , int len );<br />

AplStatus aplsSqrt_64fc ( const Apl64fc* pSrc , Apl64fc* pDst , int len );<br />

AplStatus aplsSqrt_32fc_I ( Apl32fc* pSrcDst , int len );<br />

AplStatus aplsSqrt_64fc_I ( Apl64fc* pSrcDst , int len );<br />

AplStatus aplsSqrt_16sc_ISfs ( Apl16sc* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSqrt_16sc_Sfs ( const Apl16sc* pSrc , Apl16sc* pDst , int len , int scaleFactor );<br />

AplStatus aplsSqrt_64s_Sfs ( const Apl64s* pSrc , Apl64s* pDst , int len , int scaleFactor );<br />

AplStatus aplsSqrt_64s_ISfs ( Apl64s* pSrcDst , int len , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 55 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through vector elements in a source buffer and calculate the square root of the source data. Results can be<br />

written to a destination buffer or written back to the source buffer. The 8-bit unsigned, 16-bit unsigned, and 16-bit signed versions<br />

perform an integer scaling operation before writing the results.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 56 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Sqr<br />

Square<br />

Synopsis<br />

AplStatus aplsSqr_8u_Sfs ( const Apl8u* pSrc , Apl8u* pDst , int len , int scaleFactor );<br />

AplStatus aplsSqr_16s_Sfs ( const Apl16s* pSrc , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsSqr_16u_Sfs ( const Apl16u* pSrc , Apl16u* pDst , int len , int scaleFactor );<br />

AplStatus aplsSqr_8u_ISfs ( Apl8u* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSqr_16s_ISfs ( Apl16s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSqr_16u_ISfs ( Apl16u* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsSqr_32fc ( const Apl32fc* pSrc , Apl32fc* pDst , int len );<br />

AplStatus aplsSqr_64fc ( const Apl64fc* pSrc , Apl64fc* pDst , int len );<br />

AplStatus aplsSqr_32fc_I ( Apl32fc* pSrcDst , int len );<br />

AplStatus aplsSqr_64fc_I ( Apl64fc* pSrcDst , int len );<br />

AplStatus aplsSqr_16sc_Sfs ( const Apl16sc* pSrc , Apl16sc* pDst , int len , int scaleFactor );<br />

AplStatus aplsSqr_16sc_ISfs ( Apl16sc* pSrcDst , int len , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through vector elements in a source buffer and calculate the square of the source data. Results can be written to<br />

a destination buffer or written back to the source buffer. The 8-bit unsigned, 16-bit unsigned, and 16-bit signed versions perform an<br />

integer scaling operation before writing the results.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 57 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Div<br />

Divide<br />

Synopsis<br />

AplStatus aplsDiv_32f ( const Apl32f* pSrc1 , const Apl32f* pSrc2 , Apl32f* pDst , int len );<br />

AplStatus aplsDiv_64f ( const Apl64f* pSrc1 , const Apl64f* pSrc2 , Apl64f* pDst , int len );<br />

AplStatus aplsDiv_32fc ( const Apl32fc* pSrc1 , const Apl32fc* pSrc2 , Apl32fc* pDst , int len );<br />

AplStatus aplsDiv_64fc ( const Apl64fc* pSrc1 , const Apl64fc* pSrc2 , Apl64fc* pDst , int len );<br />

AplStatus aplsDiv_32f_I ( const Apl32f* pSrc , Apl32f* pSrcDst , int len );<br />

AplStatus aplsDiv_64f_I ( const Apl64f* pSrc , Apl64f* pSrcDst , int len );<br />

AplStatus aplsDiv_32fc_I ( const Apl32fc* pSrc , Apl32fc* pSrcDst , int len );<br />

AplStatus aplsDiv_64fc_I ( const Apl64fc* pSrc , Apl64fc* pSrcDst , int len );<br />

AplStatus aplsDiv_8u_Sfs ( const Apl8u* pSrc1 , const Apl8u* pSrc2 , Apl8u* pDst , int len , int scaleFactor );<br />

AplStatus aplsDiv_16s_Sfs ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsDiv_32s_Sfs ( const Apl32s* pSrc1 , const Apl32s* pSrc2 , Apl32s* pDst , int len , int scaleFactor );<br />

AplStatus aplsDiv_16sc_Sfs ( const Apl16sc* pSrc1 , const Apl16sc* pSrc2 , Apl16sc* pDst , int len , int scaleFactor );<br />

AplStatus aplsDiv_32s16s_Sfs ( const Apl16s* pSrc1 , const Apl32s* pSrc2 , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsDiv_8u_ISfs ( const Apl8u* pSrc , Apl8u* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsDiv_16s_ISfs ( const Apl16s* pSrc , Apl16s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsDiv_16sc_ISfs ( const Apl16sc* pSrc , Apl16sc* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsDiv_32s_ISfs ( const Apl32s* pSrc , Apl32s* pSrcDst , int len , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrc1 Pointer to source buffer one.<br />

pSrc2 Pointer to source buffer two.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through vector elements in two source buffers and divide the data in buffer 1 by the data in buffer 2. The<br />

quotient can be written to a destination buffer or written back to the source buffer. The 8-bit unsigned, 16-bit signed, 16-bit signed<br />

complex, and 32-bit signed complex versions perform an integer scaling operation before writing the results.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 58 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 59 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

DivC<br />

Divide by a constant<br />

Synopsis<br />

AplStatus aplsDivC_32f ( const Apl32f* pSrc , Apl32f val , Apl32f* pDst , int len );<br />

AplStatus aplsDivC_64f ( const Apl64f* pSrc , Apl64f val , Apl64f* pDst , int len );<br />

AplStatus aplsDivC_32fc ( const Apl32fc* pSrc , Apl32fc val , Apl32fc* pDst , int len );<br />

AplStatus aplsDivC_64fc ( const Apl64fc* pSrc , Apl64fc val , Apl64fc* pDst , int len );<br />

AplStatus aplsDivC_32f_I ( Apl32f val , Apl32f* pSrcDst , int len );<br />

AplStatus aplsDivC_64f_I ( Apl64f val , Apl64f* pSrcDst , int len );<br />

AplStatus aplsDivC_32fc_I ( Apl32fc val , Apl32fc* pSrcDst , int len );<br />

AplStatus aplsDivC_64fc_I ( Apl64fc val , Apl64fc* pSrcDst , int len );<br />

AplStatus aplsDivC_8u_Sfs ( const Apl8u* pSrc , Apl8u val , Apl8u* pDst , int len , int scaleFactor );<br />

AplStatus aplsDivC_16s_Sfs ( const Apl16s* pSrc , Apl16s val , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsDivC_16sc_Sfs ( const Apl16sc* pSrc , Apl16sc val , Apl16sc* pDst , int len , int scaleFactor );<br />

AplStatus aplsDivC_8u_ISfs ( Apl8u val , Apl8u* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsDivC_16s_ISfs ( Apl16s val , Apl16s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsDivC_16sc_ISfs ( Apl16sc val , Apl16sc* pSrcDst , int len , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

val Specified value.<br />

Description<br />

These functions step through vector elements in a source buffer and divide the source data by a constant value. The quotient can be<br />

written to a destination buffer or written back to the source buffer. The 8-bit unsigned, 16-bit signed, 16-bit signed complex, and 32bit<br />

signed complex versions perform an integer scaling operation before writing the results.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 60 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

DivCRev<br />

Divide a constant<br />

Synopsis<br />

AplStatus aplsDivCRev_16u ( const Apl16u* pSrc , Apl16u val , Apl16u* pDst , int len );<br />

AplStatus aplsDivCRev_32f ( const Apl32f* pSrc , Apl32f val , Apl32f* pDst , int len );<br />

AplStatus aplsDivCRev_16u_I ( Apl16u val , Apl16u* pSrcDst , int len );<br />

AplStatus aplsDivCRev_32f_I ( Apl32f val , Apl32f* pSrcDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

val Specified value.<br />

Description<br />

These functions step through vector elements in a source buffer and divide a constant value by the source data. The quotient can be<br />

written to a destination buffer or written back to the source buffer. The 8-bit unsigned, 16-bit signed, 16-bit signed complex, and 32bit<br />

signed complex versions perform an integer scaling operation before writing the results.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 61 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Cubrt<br />

Cube root<br />

Synopsis<br />

AplStatus aplsCubrt_32f ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsCubrt_32s16s_Sfs ( const Apl32s* pSrc , Apl16s* pDst , int len , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through vector elements in a source buffer, calculate the cube root of each element, and write the result to a<br />

destination buffer. The 32-bit signed version of the functions perform an integer scaling operation before writing the results.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 62 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Exp<br />

Raise base e to a specified power<br />

Synopsis<br />

AplStatus aplsExp_32f ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsExp_64f ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsExp_32f64f ( const Apl32f* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsExp_32f_I ( Apl32f* pSrcDst , int len );<br />

AplStatus aplsExp_64f_I ( Apl64f* pSrcDst , int len );<br />

AplStatus aplsExp_16s_Sfs ( const Apl16s* pSrc , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsExp_32s_Sfs ( const Apl32s* pSrc , Apl32s* pDst , int len , int scaleFactor );<br />

AplStatus aplsExp_64s_Sfs ( const Apl64s* pSrc , Apl64s* pDst , int len , int scaleFactor );<br />

AplStatus aplsExp_16s_ISfs ( Apl16s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsExp_32s_ISfs ( Apl32s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsExp_64s_ISfs ( Apl64s* pSrcDst , int len , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through vector elements in a source buffer and calculate e to the power specified by each element. Results can be<br />

written to a destination buffer or written back to the source buffer. The 16-bit and 32-bit signed versions perform an integer scaling<br />

operation before writing the results. These functions are the inverses of the Ln functions.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 63 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Ln<br />

Natural logarithm<br />

Synopsis<br />

AplStatus aplsLn_32f ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsLn_64f ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsLn_64f32f ( const Apl64f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsLn_32f_I ( Apl32f* pSrcDst , int len );<br />

AplStatus aplsLn_64f_I ( Apl64f* pSrcDst , int len );<br />

AplStatus aplsLn_16s_Sfs ( const Apl16s* pSrc , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsLn_32s_Sfs ( const Apl32s* pSrc , Apl32s* pDst , int len , int scaleFactor );<br />

AplStatus aplsLn_32s16s_Sfs ( const Apl32s* pSrc , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsLn_16s_ISfs ( Apl16s* pSrcDst , int len , int scaleFactor );<br />

AplStatus aplsLn_32s_ISfs ( Apl32s* pSrcDst , int len , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through vector elements in a source buffer and calculate the natural logarithm of each element. Results can be<br />

written to a destination buffer or written back to the source buffer. The 16-bit and 32-bit signed versions perform an integer scaling<br />

operation before writing the results.<br />

Return Values<br />

aplStsLnNegArg Negative input buffer element warning status code.<br />

aplStsLnZeroArg Zero-valued input buffer element warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 64 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

10Log10<br />

Ten times log to the base 10<br />

Synopsis<br />

AplStatus apls10Log10_32s_Sfs ( const Apl32s* pSrc , Apl32s* pDst , int len , int scaleFactor );<br />

AplStatus apls10Log10_32s_ISfs ( Apl32s* pSrcDst , int len , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through a source buffer and calculate ten times the common logarithm of each element. The results are integer<br />

scaled, then written to a destination buffer. This function is particularly useful for calculating logarithmic scale values, such as decibels.<br />

Return Values<br />

aplStsLnNegArg Negative input buffer element warning status code.<br />

aplStsLnZeroArg Zero-valued input buffer element warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 65 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Arctan<br />

Arc Tangent<br />

Synopsis<br />

AplStatus aplsArctan_32f ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsArctan_64f ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsArctan_32f_I ( Apl32f* pSrcDst , int len );<br />

AplStatus aplsArctan_64f_I ( Apl64f* pSrcDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

Description<br />

These functions step through a source buffer and calculate the inverse tangent of each element. Results can be written to a destination<br />

buffer or written back to the source buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 66 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Threshold_LTVal<br />

Compare to a threshold, replace with specified value (Less Than)<br />

Synopsis<br />

AplStatus aplsThreshold_LTVal_16s ( const Apl16s* pSrc , Apl16s* pDst , int len , Apl16s level , Apl16s value );<br />

AplStatus aplsThreshold_LTVal_32f ( const Apl32f* pSrc , Apl32f* pDst , int len , Apl32f level , Apl32f value );<br />

AplStatus aplsThreshold_LTVal_64f ( const Apl64f* pSrc , Apl64f* pDst , int len , Apl64f level , Apl64f value );<br />

AplStatus aplsThreshold_LTVal_16sc ( const Apl16sc* pSrc , Apl16sc* pDst , int len , Apl16s level , Apl16sc value );<br />

AplStatus aplsThreshold_LTVal_32fc ( const Apl32fc* pSrc , Apl32fc* pDst , int len , Apl32f level , Apl32fc value );<br />

AplStatus aplsThreshold_LTVal_64fc ( const Apl64fc* pSrc , Apl64fc* pDst , int len , Apl64f level , Apl64fc value );<br />

AplStatus aplsThreshold_LTVal_16s_I ( Apl16s* pSrcDst , int len , Apl16s level , Apl16s value );<br />

AplStatus aplsThreshold_LTVal_32f_I ( Apl32f* pSrcDst , int len , Apl32f level , Apl32f value );<br />

AplStatus aplsThreshold_LTVal_64f_I ( Apl64f* pSrcDst , int len , Apl64f level , Apl64f value );<br />

AplStatus aplsThreshold_LTVal_16sc_I ( Apl16sc* pSrcDst , int len , Apl16s level , Apl16sc value );<br />

AplStatus aplsThreshold_LTVal_32fc_I ( Apl32fc* pSrcDst , int len , Apl32f level , Apl32fc value );<br />

AplStatus aplsThreshold_LTVal_64fc_I ( Apl64fc* pSrcDst , int len , Apl64f level , Apl64fc value );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

level Specifies a threshold level.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

value Specified value.<br />

Description<br />

These functions step through vector elements in a source buffer and compare source data to a specified threshold value. When the<br />

source data is less than the threshold value, the output data is set to a specified value. When the source data is more than or equal to<br />

the threshold value, the output data is set to the same value as the source data. Output data can be written to a destination buffer or<br />

back to the same buffer for in-place operation.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 67 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Threshold_GTVal<br />

Compare to a threshold, replace with specified value (Greater Than)<br />

Synopsis<br />

AplStatus aplsThreshold_GTVal_16s ( const Apl16s* pSrc , Apl16s* pDst , int len , Apl16s level , Apl16s value );<br />

AplStatus aplsThreshold_GTVal_32f ( const Apl32f* pSrc , Apl32f* pDst , int len , Apl32f level , Apl32f value );<br />

AplStatus aplsThreshold_GTVal_64f ( const Apl64f* pSrc , Apl64f* pDst , int len , Apl64f level , Apl64f value );<br />

AplStatus aplsThreshold_GTVal_16sc ( const Apl16sc* pSrc , Apl16sc* pDst , int len , Apl16s level , Apl16sc value );<br />

AplStatus aplsThreshold_GTVal_32fc ( const Apl32fc* pSrc , Apl32fc* pDst , int len , Apl32f level , Apl32fc value );<br />

AplStatus aplsThreshold_GTVal_64fc ( const Apl64fc* pSrc , Apl64fc* pDst , int len , Apl64f level , Apl64fc value );<br />

AplStatus aplsThreshold_GTVal_16s_I ( Apl16s* pSrcDst , int len , Apl16s level , Apl16s value );<br />

AplStatus aplsThreshold_GTVal_32f_I ( Apl32f* pSrcDst , int len , Apl32f level , Apl32f value );<br />

AplStatus aplsThreshold_GTVal_64f_I ( Apl64f* pSrcDst , int len , Apl64f level , Apl64f value );<br />

AplStatus aplsThreshold_GTVal_16sc_I ( Apl16sc* pSrcDst , int len , Apl16s level , Apl16sc value );<br />

AplStatus aplsThreshold_GTVal_32fc_I ( Apl32fc* pSrcDst , int len , Apl32f level , Apl32fc value );<br />

AplStatus aplsThreshold_GTVal_64fc_I ( Apl64fc* pSrcDst , int len , Apl64f level , Apl64fc value );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

level Specifies a threshold level.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

value Specified value.<br />

Description<br />

These functions step through vector elements in a source buffer and compare source data to a specified threshold value. When the<br />

source data is greater than the threshold value, the output data is set to a specified value. When the source data is less than or equal<br />

to the threshold value, the output data is set to the same value as the source data. Output data can be written to a destination buffer<br />

or back to the same buffer for in-place operation.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 68 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Threshold_LTValGTVal<br />

Compare to double threshold, replace with specified value (Less Than/Greater Than)<br />

Synopsis<br />

AplStatus aplsThreshold_LTValGTVal_16s ( const Apl16s* pSrc , Apl16s* pDst , int len , Apl16s levelLT , Apl16s valueLT , Apl16s levelGT ,<br />

Apl16s valueGT );<br />

AplStatus aplsThreshold_LTValGTVal_32s ( const Apl32s* pSrc , Apl32s* pDst , int len , Apl32s levelLT , Apl32s valueLT , Apl32s levelGT ,<br />

Apl32s valueGT );<br />

AplStatus aplsThreshold_LTValGTVal_32f ( const Apl32f* pSrc , Apl32f* pDst , int len , Apl32f levelLT , Apl32f valueLT , Apl32f levelGT ,<br />

Apl32f valueGT );<br />

AplStatus aplsThreshold_LTValGTVal_64f ( const Apl64f* pSrc , Apl64f* pDst , int len , Apl64f levelLT , Apl64f valueLT , Apl64f levelGT ,<br />

Apl64f valueGT );<br />

AplStatus aplsThreshold_LTValGTVal_16s_I ( Apl16s* pSrcDst , int len , Apl16s levelLT , Apl16s valueLT , Apl16s levelGT , Apl16s valueGT<br />

);<br />

AplStatus aplsThreshold_LTValGTVal_32s_I ( Apl32s* pSrcDst , int len , Apl32s levelLT , Apl32s valueLT , Apl32s levelGT , Apl32s valueGT<br />

);<br />

AplStatus aplsThreshold_LTValGTVal_32f_I ( Apl32f* pSrcDst , int len , Apl32f levelLT , Apl32f valueLT , Apl32f levelGT , Apl32f valueGT );<br />

AplStatus aplsThreshold_LTValGTVal_64f_I ( Apl64f* pSrcDst , int len , Apl64f levelLT , Apl64f valueLT , Apl64f levelGT , Apl64f valueGT );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

levelGT Specifies a threshold level for greater-than comparison.<br />

levelLT Specifies a threshold level for less-than comparison.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

valueGT Specifies a value to set when a greater-than comparison evaluates as true.<br />

valueLT Specifies a value to set a less-than comparison evaluates as true.<br />

Description<br />

These functions step through vector elements in a source buffer and compare source data to two specified threshold values. The value<br />

of thresholdLT must be less than the value of thresholdGT. When the source data is less than the value specified by thresholdLT, the<br />

output data is set to the value specified by valueLT. When the source data is greater than the value specified by thresholdGT, the<br />

output data is set to the value specified by valueLT. When the source data is within the range defined by thresholdLT and thresholdGT,<br />

the output data is set to same value as the source data. Output data can be written to a destination buffer or back to the same buffer<br />

for in-place operation.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 69 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsThresholdErr The less-than threshold is greater than the greater-than threshold.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 70 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Threshold_LT<br />

Compare to a threshold, replace with threshold value (Less Than)<br />

Synopsis<br />

AplStatus aplsThreshold_LT_16s ( const Apl16s* pSrc , Apl16s* pDst , int len , Apl16s level );<br />

AplStatus aplsThreshold_LT_32s ( const Apl32s* pSrc , Apl32s* pDst , int len , Apl32s level );<br />

AplStatus aplsThreshold_LT_32f ( const Apl32f* pSrc , Apl32f* pDst , int len , Apl32f level );<br />

AplStatus aplsThreshold_LT_64f ( const Apl64f* pSrc , Apl64f* pDst , int len , Apl64f level );<br />

AplStatus aplsThreshold_LT_32fc ( const Apl32fc* pSrc , Apl32fc* pDst , int len , Apl32f level );<br />

AplStatus aplsThreshold_LT_64fc ( const Apl64fc* pSrc , Apl64fc* pDst , int len , Apl64f level );<br />

AplStatus aplsThreshold_LT_16sc ( const Apl16sc* pSrc , Apl16sc* pDst , int len , Apl16s level );<br />

AplStatus aplsThreshold_LT_16s_I ( Apl16s* pSrcDst , int len , Apl16s level );<br />

AplStatus aplsThreshold_LT_32s_I ( Apl32s* pSrcDst , int len , Apl32s level );<br />

AplStatus aplsThreshold_LT_32f_I ( Apl32f* pSrcDst , int len , Apl32f level );<br />

AplStatus aplsThreshold_LT_64f_I ( Apl64f* pSrcDst , int len , Apl64f level );<br />

AplStatus aplsThreshold_LT_32fc_I ( Apl32fc* pSrcDst , int len , Apl32f level );<br />

AplStatus aplsThreshold_LT_64fc_I ( Apl64fc* pSrcDst , int len , Apl64f level );<br />

AplStatus aplsThreshold_LT_16sc_I ( Apl16sc* pSrcDst , int len , Apl16s level );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

level Specifies a threshold level.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

Description<br />

These functions step through vector elements in a source buffer and compare source data to a specified threshold value. When the<br />

source data is less than the threshold value, the output data is set to the threshold value. When the source data is more than or equal<br />

to the threshold value, the output data is set to the same value as the source data. Output data can be written to a destination buffer<br />

or back to the same buffer for in-place operation.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 71 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Threshold_GT<br />

Compare to a threshold, replace with threshold value (Greater Than)<br />

Synopsis<br />

AplStatus aplsThreshold_GT_16s ( const Apl16s* pSrc , Apl16s* pDst , int len , Apl16s level );<br />

AplStatus aplsThreshold_GT_32s ( const Apl32s* pSrc , Apl32s* pDst , int len , Apl32s level );<br />

AplStatus aplsThreshold_GT_32f ( const Apl32f* pSrc , Apl32f* pDst , int len , Apl32f level );<br />

AplStatus aplsThreshold_GT_64f ( const Apl64f* pSrc , Apl64f* pDst , int len , Apl64f level );<br />

AplStatus aplsThreshold_GT_32fc ( const Apl32fc* pSrc , Apl32fc* pDst , int len , Apl32f level );<br />

AplStatus aplsThreshold_GT_64fc ( const Apl64fc* pSrc , Apl64fc* pDst , int len , Apl64f level );<br />

AplStatus aplsThreshold_GT_16sc ( const Apl16sc* pSrc , Apl16sc* pDst , int len , Apl16s level );<br />

AplStatus aplsThreshold_GT_16s_I ( Apl16s* pSrcDst , int len , Apl16s level );<br />

AplStatus aplsThreshold_GT_32s_I ( Apl32s* pSrcDst , int len , Apl32s level );<br />

AplStatus aplsThreshold_GT_32f_I ( Apl32f* pSrcDst , int len , Apl32f level );<br />

AplStatus aplsThreshold_GT_64f_I ( Apl64f* pSrcDst , int len , Apl64f level );<br />

AplStatus aplsThreshold_GT_32fc_I ( Apl32fc* pSrcDst , int len , Apl32f level );<br />

AplStatus aplsThreshold_GT_64fc_I ( Apl64fc* pSrcDst , int len , Apl64f level );<br />

AplStatus aplsThreshold_GT_16sc_I ( Apl16sc* pSrcDst , int len , Apl16s level );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

level Specifies a threshold level.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

Description<br />

These functions step through vector elements in a source buffer and compare source data to a specified threshold value. When the<br />

source data is greater than the threshold value, the output data is set to the threshold value. When the source data is less than or<br />

equal to the threshold value, the output data is set to the same value as the source data. Output data can be written to a destination<br />

buffer or back to the same buffer for in-place operation.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 72 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Threshold<br />

Compare to a threshold, replace with threshold value (General)<br />

Synopsis<br />

AplStatus aplsThreshold_16s ( const Apl16s* pSrc , Apl16s* pDst , int len , Apl16s level , AplCmpOp relOp );<br />

AplStatus aplsThreshold_32f ( const Apl32f* pSrc , Apl32f* pDst , int len , Apl32f level , AplCmpOp relOp );<br />

AplStatus aplsThreshold_64f ( const Apl64f* pSrc , Apl64f* pDst , int len , Apl64f level , AplCmpOp relOp );<br />

AplStatus aplsThreshold_32fc ( const Apl32fc* pSrc , Apl32fc* pDst , int len , Apl32f level , AplCmpOp relOp );<br />

AplStatus aplsThreshold_64fc ( const Apl64fc* pSrc , Apl64fc* pDst , int len , Apl64f level , AplCmpOp relOp );<br />

AplStatus aplsThreshold_16sc ( const Apl16sc* pSrc , Apl16sc* pDst , int len , Apl16s level , AplCmpOp relOp );<br />

AplStatus aplsThreshold_16s_I ( Apl16s* pSrcDst , int len , Apl16s level , AplCmpOp relOp );<br />

AplStatus aplsThreshold_32f_I ( Apl32f* pSrcDst , int len , Apl32f level , AplCmpOp relOp );<br />

AplStatus aplsThreshold_64f_I ( Apl64f* pSrcDst , int len , Apl64f level , AplCmpOp relOp );<br />

AplStatus aplsThreshold_32fc_I ( Apl32fc* pSrcDst , int len , Apl32f level , AplCmpOp relOp );<br />

AplStatus aplsThreshold_64fc_I ( Apl64fc* pSrcDst , int len , Apl64f level , AplCmpOp relOp );<br />

AplStatus aplsThreshold_16sc_I ( Apl16sc* pSrcDst , int len , Apl16s level , AplCmpOp relOp );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

level Specifies a threshold level.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

relOp Constant that indicates which relational operation to perform.<br />

Description<br />

These functions step through vector elements in a source buffer and compare the source data to a specified threshold value using a<br />

specified compare operation. The compare operation can be "less than", "less than or equal", "equal", "greater than or equal" or<br />

"greater than". When the comparison evaluates as true, the output data is set to the threshold value. When the comparison evaluates<br />

as false, the output data is set to the same value as the source data. Output data can be written to a destination buffer or back to the<br />

same buffer for in-place operation.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 73 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Threshold_LTInv<br />

Compare to a threshold, replace with threshold value (Less Than), invert vector<br />

Synopsis<br />

AplStatus aplsThreshold_LTInv_32f ( const Apl32f* pSrc , Apl32f* pDst , int len , Apl32f level );<br />

AplStatus aplsThreshold_LTInv_64f ( const Apl64f* pSrc , Apl64f* pDst , int len , Apl64f level );<br />

AplStatus aplsThreshold_LTInv_32fc ( const Apl32fc* pSrc , Apl32fc* pDst , int len , Apl32f level );<br />

AplStatus aplsThreshold_LTInv_64fc ( const Apl64fc* pSrc , Apl64fc* pDst , int len , Apl64f level );<br />

AplStatus aplsThreshold_LTInv_32f_I ( Apl32f* pSrcDst , int len , Apl32f level );<br />

AplStatus aplsThreshold_LTInv_64f_I ( Apl64f* pSrcDst , int len , Apl64f level );<br />

AplStatus aplsThreshold_LTInv_32fc_I ( Apl32fc* pSrcDst , int len , Apl32f level );<br />

AplStatus aplsThreshold_LTInv_64fc_I ( Apl64fc* pSrcDst , int len , Apl64f level );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

level Specifies a threshold level.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

Description<br />

These functions step through vector elements in a source buffer and compare source data to a specified threshold value. When the<br />

source data is less than the threshold value, the output data is set to the threshold value and inverted. When the source data is more<br />

than or equal to the threshold value, the output data is set to the same value as the source data and inverted Output data can be<br />

written to a destination buffer or back to the same buffer for in-place operation.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 74 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Magnitude<br />

Complex vector magnitude<br />

Synopsis<br />

AplStatus aplsMagnitude_32f ( const Apl32f* pSrcRe , const Apl32f* pSrcIm , Apl32f* pDst , int len );<br />

AplStatus aplsMagnitude_64f ( const Apl64f* pSrcRe , const Apl64f* pSrcIm , Apl64f* pDst , int len );<br />

AplStatus aplsMagnitude_32fc ( const Apl32fc* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsMagnitude_64fc ( const Apl64fc* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsMagnitude_16s32f ( const Apl16s* pSrcRe , const Apl16s* pSrcIm , Apl32f* pDst , int len );<br />

AplStatus aplsMagnitude_16sc32f ( const Apl16sc* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsMagnitude_16s_Sfs ( const Apl16s* pSrcRe , const Apl16s* pSrcIm , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsMagnitude_16sc_Sfs ( const Apl16sc* pSrc , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsMagnitude_32sc_Sfs ( const Apl32sc* pSrc , Apl32s* pDst , int len , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcIm Pointer to a source buffer that contains the imaginary component values of an input signal.<br />

pSrcRe Pointer to a source buffer that contains the real component values of an input signal.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through elements of a complex vector, calculate the magnitude of each element, and write the result to a<br />

destination. There are versions of the function that operate on one source buffer containing a complex vector and versions that<br />

operate on two source buffers containing real and imaginary component values. There are single-vector 16-bit signed complex and<br />

single-vector 32-bit signed complex versions that perform integer scaling before writing the results. A length parameter specifies the<br />

number of elements in the vector.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 75 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Convert<br />

Convert vector data from one type to another<br />

Synopsis<br />

AplStatus aplsConvert_8s16s ( const Apl8s* pSrc , Apl16s* pDst , int len );<br />

AplStatus aplsConvert_8s32f ( const Apl8s* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsConvert_8u32f ( const Apl8u* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsConvert_16s32s ( const Apl16s* pSrc , Apl32s* pDst , int len );<br />

AplStatus aplsConvert_16s32f ( const Apl16s* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsConvert_16u32f ( const Apl16u* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsConvert_32s16s ( const Apl32s* pSrc , Apl16s* pDst , int len );<br />

AplStatus aplsConvert_32s32f ( const Apl32s* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsConvert_32s64f ( const Apl32s* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsConvert_32f64f ( const Apl32f* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsConvert_64f32f ( const Apl64f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsConvert_16s32f_Sfs ( const Apl16s* pSrc , Apl32f* pDst , int len , int scaleFactor );<br />

AplStatus aplsConvert_16s64f_Sfs ( const Apl16s* pSrc , Apl64f* pDst , int len , int scaleFactor );<br />

AplStatus aplsConvert_32s16s_Sfs ( const Apl32s* pSrc , Apl16s* pDst , int len , int scaleFactor );<br />

AplStatus aplsConvert_32s32f_Sfs ( const Apl32s* pSrc , Apl32f* pDst , int len , int scaleFactor );<br />

AplStatus aplsConvert_32s64f_Sfs ( const Apl32s* pSrc , Apl64f* pDst , int len , int scaleFactor );<br />

AplStatus aplsConvert_32f8s_Sfs ( const Apl32f* pSrc , Apl8s* pDst , int len , AplRoundMode rndMode , int scaleFactor );<br />

AplStatus aplsConvert_32f8u_Sfs ( const Apl32f* pSrc , Apl8u* pDst , int len , AplRoundMode rndMode , int scaleFactor );<br />

AplStatus aplsConvert_32f16s_Sfs ( const Apl32f* pSrc , Apl16s* pDst , int len , AplRoundMode rndMode , int scaleFactor );<br />

AplStatus aplsConvert_32f16u_Sfs ( const Apl32f* pSrc , Apl16u* pDst , int len , AplRoundMode rndMode , int scaleFactor );<br />

AplStatus aplsConvert_32f32s_Sfs ( const Apl32f* pSrc , Apl32s* pDst , int len , AplRoundMode rndMode , int scaleFactor );<br />

AplStatus aplsConvert_64s32s_Sfs ( const Apl64s* pSrc , Apl32s* pDst , int len , AplRoundMode rndMode , int scaleFactor );<br />

AplStatus aplsConvert_64f32s_Sfs ( const Apl64f* pSrc , Apl32s* pDst , int len , AplRoundMode rndMode , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

rndMode Constant that indicates which rounding mode to use when converting from a scalar to an integer.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 76 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through vector elements in a source buffer, convert the source data to another data type, and write the<br />

converted data to a destination buffer. There are versions of the 16-bit signed-to-floating-point, 32-bit signed-to-floating-point, and<br />

32-bit signed to 16-bit signed functions that perform an integer scaling operation on the results. There are floating-point versions of<br />

the functions that also take a rounding mode argument. Values can be truncated toward zero or rounded to the nearest integer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 77 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Max<br />

Maximum<br />

Synopsis<br />

AplStatus aplsMax_16s ( const Apl16s* pSrc , int len , Apl16s* pMax );<br />

AplStatus aplsMax_32s ( const Apl32s* pSrc , int len , Apl32s* pMax );<br />

AplStatus aplsMax_32f ( const Apl32f* pSrc , int len , Apl32f* pMax );<br />

AplStatus aplsMax_64f ( const Apl64f* pSrc , int len , Apl64f* pMax );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pMax Pointer to the destination buffer that contains the maximum value in the source buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions step through vector elements in a source buffer, find the maximum value, and write the value to a location specified<br />

by a pointer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 78 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

MaxIndx<br />

Maximum with index<br />

Synopsis<br />

AplStatus aplsMaxIndx_16s ( const Apl16s* pSrc , int len , Apl16s* pMax , int* pIndx );<br />

AplStatus aplsMaxIndx_32s ( const Apl32s* pSrc , int len , Apl32s* pMax , int* pIndx );<br />

AplStatus aplsMaxIndx_32f ( const Apl32f* pSrc , int len , Apl32f* pMax , int* pIndx );<br />

AplStatus aplsMaxIndx_64f ( const Apl64f* pSrc , int len , Apl64f* pMax , int* pIndx );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pIndx Pointer to the destination buffer that contains the index of the maximum or minimum value in the source buffer.<br />

pMax Pointer to the destination buffer that contains the maximum value in the source buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions step through vector elements in a source buffer, find the maximum value and its index. The maximum value is written<br />

to a maximum value buffer and the index is written to a location specified by a pointer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 79 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

MaxAbs<br />

Maximum absolute value<br />

Synopsis<br />

AplStatus aplsMaxAbs_16s ( const Apl16s* pSrc , int len , Apl16s* pMaxAbs );<br />

AplStatus aplsMaxAbs_32s ( const Apl32s* pSrc , int len , Apl32s* pMaxAbs );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pMaxAbs Pointer to the destination buffer that contains the maximum absolute value in the source buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions step through vector elements in a source buffer, find the maximum absolute value, and write the value to a location<br />

specified by a pointer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 80 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

MaxAbsIndx<br />

Maximum absolute value with index<br />

Synopsis<br />

AplStatus aplsMaxAbsIndx_16s ( const Apl16s* pSrc , int len , Apl16s* pMaxAbs , int* pIndx );<br />

AplStatus aplsMaxAbsIndx_32s ( const Apl32s* pSrc , int len , Apl32s* pMaxAbs , int* pIndx );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pIndx Pointer to the destination buffer that contains the index of the maximum or minimum value in the source buffer.<br />

pMaxAbs Pointer to the destination buffer that contains the maximum absolute value in the source buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions step through vector elements in a source buffer, find the maximum absolute value and its index. The maximum<br />

absolute value and the index are written to locations specified by pointers.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 81 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Min<br />

Minimum<br />

Synopsis<br />

AplStatus aplsMin_16s ( const Apl16s* pSrc , int len , Apl16s* pMin );<br />

AplStatus aplsMin_32s ( const Apl32s* pSrc , int len , Apl32s* pMin );<br />

AplStatus aplsMin_32f ( const Apl32f* pSrc , int len , Apl32f* pMin );<br />

AplStatus aplsMin_64f ( const Apl64f* pSrc , int len , Apl64f* pMin );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pMin Pointer to the destination buffer that contains the minimum value in the source buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions step through vector elements in a source buffer, find the minimum value, and write the value to a location specified by<br />

a pointer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 82 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

MinIndx<br />

Minimum with index<br />

Synopsis<br />

AplStatus aplsMinIndx_16s ( const Apl16s* pSrc , int len , Apl16s* pMin , int* pIndx );<br />

AplStatus aplsMinIndx_32s ( const Apl32s* pSrc , int len , Apl32s* pMin , int* pIndx );<br />

AplStatus aplsMinIndx_32f ( const Apl32f* pSrc , int len , Apl32f* pMin , int* pIndx );<br />

AplStatus aplsMinIndx_64f ( const Apl64f* pSrc , int len , Apl64f* pMin , int* pIndx );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pIndx Pointer to the destination buffer that contains the index of the maximum or minimum value in the source buffer.<br />

pMin Pointer to the destination buffer that contains the minimum value in the source buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions step through vector elements in a source buffer, find the minimum value and its index. The minimum value and the<br />

index are written to locations specified by pointers.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 83 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

MinAbs<br />

Minimum absolute value<br />

Synopsis<br />

AplStatus aplsMinAbs_16s ( const Apl16s* pSrc , int len , Apl16s* pMinAbs );<br />

AplStatus aplsMinAbs_32s ( const Apl32s* pSrc , int len , Apl32s* pMinAbs );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pMinAbs Pointer to the destination buffer that contains the minimum absolute value in the source buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions step through vector elements in a source buffer, find the minimum absolute value, and write the value to a location<br />

specified by a pointer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 84 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

MinAbsIndx<br />

Minimum absolute value with index<br />

Synopsis<br />

AplStatus aplsMinAbsIndx_16s ( const Apl16s* pSrc , int len , Apl16s* pMinAbs , int* pIndx );<br />

AplStatus aplsMinAbsIndx_32s ( const Apl32s* pSrc , int len , Apl32s* pMinAbs , int* pIndx );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pIndx Pointer to the destination buffer that contains the index of the maximum or minimum value in the source buffer.<br />

pMinAbs Pointer to the destination buffer that contains the minimum absolute value in the source buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions step through vector elements in a source buffer, find the minimum absolute value and its index. The minimum<br />

absolute value and the index are written to locations specified by pointers.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 85 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

MinMax<br />

Minimum and maximum<br />

Synopsis<br />

AplStatus aplsMinMax_8u ( const Apl8u* pSrc , int len , Apl8u* pMin , Apl8u* pMax );<br />

AplStatus aplsMinMax_16u ( const Apl16u* pSrc , int len , Apl16u* pMin , Apl16u* pMax );<br />

AplStatus aplsMinMax_16s ( const Apl16s* pSrc , int len , Apl16s* pMin , Apl16s* pMax );<br />

AplStatus aplsMinMax_32u ( const Apl32u* pSrc , int len , Apl32u* pMin , Apl32u* pMax );<br />

AplStatus aplsMinMax_32s ( const Apl32s* pSrc , int len , Apl32s* pMin , Apl32s* pMax );<br />

AplStatus aplsMinMax_32f ( const Apl32f* pSrc , int len , Apl32f* pMin , Apl32f* pMax );<br />

AplStatus aplsMinMax_64f ( const Apl64f* pSrc , int len , Apl64f* pMin , Apl64f* pMax );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pMax Pointer to the destination buffer that contains the maximum value in the source buffer.<br />

pMin Pointer to the destination buffer that contains the minimum value in the source buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions step through vector elements in a source buffer, find the minimum and maximum values, and write the values to<br />

locations specified by pointers.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 86 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

MinMaxIndx<br />

Minimum and maximum with index<br />

Synopsis<br />

AplStatus aplsMinMaxIndx_8u ( const Apl8u* pSrc , int len , Apl8u* pMin , int* pMinIndx , Apl8u* pMax , int* pMaxIndx );<br />

AplStatus aplsMinMaxIndx_16u ( const Apl16u* pSrc , int len , Apl16u* pMin , int* pMinIndx , Apl16u* pMax , int* pMaxIndx );<br />

AplStatus aplsMinMaxIndx_16s ( const Apl16s* pSrc , int len , Apl16s* pMin , int* pMinIndx , Apl16s* pMax , int* pMaxIndx );<br />

AplStatus aplsMinMaxIndx_32u ( const Apl32u* pSrc , int len , Apl32u* pMin , int* pMinIndx , Apl32u* pMax , int* pMaxIndx );<br />

AplStatus aplsMinMaxIndx_32s ( const Apl32s* pSrc , int len , Apl32s* pMin , int* pMinIndx , Apl32s* pMax , int* pMaxIndx );<br />

AplStatus aplsMinMaxIndx_32f ( const Apl32f* pSrc , int len , Apl32f* pMin , int* pMinIndx , Apl32f* pMax , int* pMaxIndx );<br />

AplStatus aplsMinMaxIndx_64f ( const Apl64f* pSrc , int len , Apl64f* pMin , int* pMinIndx , Apl64f* pMax , int* pMaxIndx );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pMax Pointer to the destination buffer that contains the maximum value in the source buffer.<br />

pMaxIndx Pointer to the destination buffer that contains the index of the maximum value in the source vector.<br />

pMin Pointer to the destination buffer that contains the minimum value in the source buffer.<br />

pMinIndx Pointer to the destination buffer that contains the index of the minimum value in the source buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions step through vector elements in a source buffer, find the minimum and maximum values and the corresponding<br />

indices. The minimum value, the maximum value, and the indices are written locations specified by pointers.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 87 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Norm_Inf<br />

Norm C<br />

Synopsis<br />

AplStatus aplsNorm_Inf_32f ( const Apl32f* pSrc , int len , Apl32f* pNorm );<br />

AplStatus aplsNorm_Inf_64f ( const Apl64f* pSrc , int len , Apl64f* pNorm );<br />

AplStatus aplsNorm_Inf_16s32f ( const Apl16s* pSrc , int len , Apl32f* pNorm );<br />

AplStatus aplsNorm_Inf_32fc32f ( const Apl32fc* pSrc , int len , Apl32f* pNorm );<br />

AplStatus aplsNorm_Inf_64fc64f ( const Apl64fc* pSrc , int len , Apl64f* pNorm );<br />

AplStatus aplsNorm_Inf_16s32s_Sfs ( const Apl16s* pSrc , int len , Apl32s* pNorm , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pNorm<br />

Pointer to the destination buffer that contains the NormC, NormL1, or NormL2 of the values in the source buffer, depending on the<br />

function call.<br />

pSrc Pointer to a source buffer.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through vector elements in a source buffer, calculate the C Norm, and write the value to a location specified by a<br />

pointer.<br />

The following formula is used:<br />

C Norm =((n = 0) - (len-1)) max (|pSrc[n]|)<br />

The 16-bit signed to 32-bit signed version of the function performs an integer scaling operation before the result is written.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 88 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Norm_L1<br />

Norm L1<br />

Synopsis<br />

AplStatus aplsNorm_L1_32f ( const Apl32f* pSrc , int len , Apl32f* pNorm );<br />

AplStatus aplsNorm_L1_64f ( const Apl64f* pSrc , int len , Apl64f* pNorm );<br />

AplStatus aplsNorm_L1_16s32f ( const Apl16s* pSrc , int len , Apl32f* pNorm );<br />

AplStatus aplsNorm_L1_32fc64f ( const Apl32fc* pSrc , int len , Apl64f* pNorm );<br />

AplStatus aplsNorm_L1_64fc64f ( const Apl64fc* pSrc , int len , Apl64f* pNorm );<br />

AplStatus aplsNorm_L1_16s32s_Sfs ( const Apl16s* pSrc , int len , Apl32s* pNorm , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pNorm<br />

Pointer to the destination buffer that contains the NormC, NormL1, or NormL2 of the values in the source buffer, depending on the<br />

function call.<br />

pSrc Pointer to a source buffer.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through vector elements in a source buffer, calculate the L1 Norm, and write the value to a location specified by a<br />

pointer.<br />

The following formula is used:<br />

L1 Norm =((n = 0) - (len-1)) Sum (|pSrc[n]|)<br />

The 16-bit signed to 32-bit signed version of the function performs an integer scaling operation on the result.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 89 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Norm_L2<br />

Norm L2<br />

Synopsis<br />

AplStatus aplsNorm_L2_32f ( const Apl32f* pSrc , int len , Apl32f* pNorm );<br />

AplStatus aplsNorm_L2_64f ( const Apl64f* pSrc , int len , Apl64f* pNorm );<br />

AplStatus aplsNorm_L2_16s32f ( const Apl16s* pSrc , int len , Apl32f* pNorm );<br />

AplStatus aplsNorm_L2_32fc64f ( const Apl32fc* pSrc , int len , Apl64f* pNorm );<br />

AplStatus aplsNorm_L2_64fc64f ( const Apl64fc* pSrc , int len , Apl64f* pNorm );<br />

AplStatus aplsNorm_L2_16s32s_Sfs ( const Apl16s* pSrc , int len , Apl32s* pNorm , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pNorm<br />

Pointer to the destination buffer that contains the NormC, NormL1, or NormL2 of the values in the source buffer, depending on the<br />

function call.<br />

pSrc Pointer to a source buffer.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through vector elements in a source buffer, calculate the L2 Norm, and write the value to a location specified by a<br />

pointer. The following formula is used:<br />

L2 Norm =Sqrt(((n = 0) - (len-1)) Sum(Square(|pSrc[n]|))<br />

The 16-bit signed to 32-bit signed version of the function performs an integer scaling operation on the result.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 90 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

NormDiff_Inf<br />

Norm of difference C<br />

Synopsis<br />

AplStatus aplsNormDiff_Inf_32f ( const Apl32f* pSrc1 , const Apl32f* pSrc2 , int len , Apl32f* pNorm );<br />

AplStatus aplsNormDiff_Inf_64f ( const Apl64f* pSrc1 , const Apl64f* pSrc2 , int len , Apl64f* pNorm );<br />

AplStatus aplsNormDiff_Inf_16s32f ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , int len , Apl32f* pNorm );<br />

AplStatus aplsNormDiff_Inf_32fc32f ( const Apl32fc* pSrc1 , const Apl32fc* pSrc2 , int len , Apl32f* pNorm );<br />

AplStatus aplsNormDiff_Inf_64fc64f ( const Apl64fc* pSrc1 , const Apl64fc* pSrc2 , int len , Apl64f* pNorm );<br />

AplStatus aplsNormDiff_Inf_16s32s_Sfs ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , int len , Apl32s* pNorm , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pNorm<br />

Pointer to the destination buffer that contains the NormC, NormL1, or NormL2 of the values in the source buffer, depending on the<br />

function call.<br />

pSrc1 Pointer to source buffer one.<br />

pSrc2 Pointer to source buffer two.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through vector elements in two source buffers, calculate the C Norm of the difference between the elements in<br />

buffer 1 and the elements in buffer 2, and write the value to a location specified by a pointer.<br />

The following formula is used:<br />

C NormDiff = ((n = 0) - (len-1)) max (|pSrc1[n] - pSrc2[n]|)<br />

The 16-bit signed to 32-bit signed version of the function performs an integer scaling operation on the result.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 91 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

NormDiff_L1<br />

Norm of difference L1<br />

Synopsis<br />

AplStatus aplsNormDiff_L1_32f ( const Apl32f* pSrc1 , const Apl32f* pSrc2 , int len , Apl32f* pNorm );<br />

AplStatus aplsNormDiff_L1_64f ( const Apl64f* pSrc1 , const Apl64f* pSrc2 , int len , Apl64f* pNorm );<br />

AplStatus aplsNormDiff_L1_16s32f ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , int len , Apl32f* pNorm );<br />

AplStatus aplsNormDiff_L1_32fc64f ( const Apl32fc* pSrc1 , const Apl32fc* pSrc2 , int len , Apl64f* pNorm );<br />

AplStatus aplsNormDiff_L1_64fc64f ( const Apl64fc* pSrc1 , const Apl64fc* pSrc2 , int len , Apl64f* pNorm );<br />

AplStatus aplsNormDiff_L1_16s32s_Sfs ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , int len , Apl32s* pNorm , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pNorm<br />

Pointer to the destination buffer that contains the NormC, NormL1, or NormL2 of the values in the source buffer, depending on the<br />

function call.<br />

pSrc1 Pointer to source buffer one.<br />

pSrc2 Pointer to source buffer two.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through vector elements in two source buffers, calculate the L1 Norm of the difference between the elements in<br />

buffer 1 and the elements in buffer 2, and write the value to a location specified by a pointer.<br />

The following formula is used:<br />

NormDiff = ((n = 0) - (len-1)) Sum (|pSrc1[n] - pSrc2[n]|)<br />

The 16-bit signed to 32-bit signed version of the function performs an integer scaling operation on the result.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 92 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

NormDiff_L2<br />

Norm of difference L2<br />

Synopsis<br />

AplStatus aplsNormDiff_L2_32f ( const Apl32f* pSrc1 , const Apl32f* pSrc2 , int len , Apl32f* pNorm );<br />

AplStatus aplsNormDiff_L2_64f ( const Apl64f* pSrc1 , const Apl64f* pSrc2 , int len , Apl64f* pNorm );<br />

AplStatus aplsNormDiff_L2_16s32f ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , int len , Apl32f* pNorm );<br />

AplStatus aplsNormDiff_L2_32fc64f ( const Apl32fc* pSrc1 , const Apl32fc* pSrc2 , int len , Apl64f* pNorm );<br />

AplStatus aplsNormDiff_L2_64fc64f ( const Apl64fc* pSrc1 , const Apl64fc* pSrc2 , int len , Apl64f* pNorm );<br />

AplStatus aplsNormDiff_L2_16s32s_Sfs ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , int len , Apl32s* pNorm , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pNorm<br />

Pointer to the destination buffer that contains the NormC, NormL1, or NormL2 of the values in the source buffer, depending on the<br />

function call.<br />

pSrc1 Pointer to source buffer one.<br />

pSrc2 Pointer to source buffer two.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through vector elements in two source buffers, calculate the L2 Norm of the difference between the elements in<br />

buffer 1 and the elements in buffer 2, and write the value to a location specified by a pointer.<br />

The following formula is used:<br />

NormDiff = Sqrt(((n = 0) - (len-1)) Sum(Square(|pSrc1[n] - pSrc2[n]|))<br />

The 16-bit signed to 32-bit signed version of the function performs an integer scaling operation on the result.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 93 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Mean<br />

Mean<br />

Synopsis<br />

AplStatus aplsMean_32f ( const Apl32f* pSrc , int len , Apl32f* pMean , AplHintAlgorithm hint );<br />

AplStatus aplsMean_32fc ( const Apl32fc* pSrc , int len , Apl32fc* pMean , AplHintAlgorithm hint );<br />

AplStatus aplsMean_64f ( const Apl64f* pSrc , int len , Apl64f* pMean );<br />

AplStatus aplsMean_64fc ( const Apl64fc* pSrc , int len , Apl64fc* pMean );<br />

AplStatus aplsMean_16s_Sfs ( const Apl16s* pSrc , int len , Apl16s* pMean , int scaleFactor );<br />

AplStatus aplsMean_16sc_Sfs ( const Apl16sc* pSrc , int len , Apl16sc* pMean , int scaleFactor );<br />

Parameters<br />

hint Hints whether to choose a fast or accurate computation algorithm.<br />

len Specifies the number of elements in a buffer.<br />

pMean Pointer to the destination buffer that contains the mean of the values in the source buffer.<br />

pSrc Pointer to a source buffer.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through vector elements in a source buffer, calculate the arithmetic mean, and write the value to a location<br />

specified by a pointer.<br />

The following formula is used:<br />

Mean( ) = 1/len ((n = 0) - (len-1)) Sum(pSrc[n]).<br />

The 16-bit signed and 16-bit signed complex versions perform an integer scaling operation on the result.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 94 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

MaxEvery<br />

Maximum (element pair)<br />

Synopsis<br />

AplStatus aplsMaxEvery_16s_I ( const Apl16s* pSrc , Apl16s* pSrcDst , int len );<br />

AplStatus aplsMaxEvery_32s_I ( const Apl32s* pSrc , Apl32s* pSrcDst , int len );<br />

AplStatus aplsMaxEvery_32f_I ( const Apl32f* pSrc , Apl32f* pSrcDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

Description<br />

These functions step through vector elements in two buffers and compare corresponding elements in the source and destination<br />

buffers. The maximum value in the comparison is written to the destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 95 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

MinEvery<br />

Minimum (element pair)<br />

Synopsis<br />

AplStatus aplsMinEvery_16s_I ( const Apl16s* pSrc , Apl16s* pSrcDst , int len );<br />

AplStatus aplsMinEvery_32s_I ( const Apl32s* pSrc , Apl32s* pSrcDst , int len );<br />

AplStatus aplsMinEvery_32f_I ( const Apl32f* pSrc , Apl32f* pSrcDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

Description<br />

These functions step through vector elements in two buffers and compare corresponding elements in the source and destination<br />

buffers. The minimum value in the comparison is written to the destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 96 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

DotProd<br />

Dot Product<br />

Synopsis<br />

AplStatus aplsDotProd_32f ( const Apl32f* pSrc1 , const Apl32f* pSrc2 , int len , Apl32f* pDp );<br />

AplStatus aplsDotProd_32fc ( const Apl32fc* pSrc1 , const Apl32fc* pSrc2 , int len , Apl32fc* pDp );<br />

AplStatus aplsDotProd_32f32fc ( const Apl32f* pSrc1 , const Apl32fc* pSrc2 , int len , Apl32fc* pDp );<br />

AplStatus aplsDotProd_32f64f ( const Apl32f* pSrc1 , const Apl32f* pSrc2 , int len , Apl64f* pDp );<br />

AplStatus aplsDotProd_32fc64fc ( const Apl32fc* pSrc1 , const Apl32fc* pSrc2 , int len , Apl64fc* pDp );<br />

AplStatus aplsDotProd_32f32fc64fc ( const Apl32f* pSrc1 , const Apl32fc* pSrc2 , int len , Apl64fc* pDp );<br />

AplStatus aplsDotProd_64f ( const Apl64f* pSrc1 , const Apl64f* pSrc2 , int len , Apl64f* pDp );<br />

AplStatus aplsDotProd_64fc ( const Apl64fc* pSrc1 , const Apl64fc* pSrc2 , int len , Apl64fc* pDp );<br />

AplStatus aplsDotProd_64f64fc ( const Apl64f* pSrc1 , const Apl64fc* pSrc2 , int len , Apl64fc* pDp );<br />

AplStatus aplsDotProd_16s64s ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , int len , Apl64s* pDp );<br />

AplStatus aplsDotProd_16sc64sc ( const Apl16sc* pSrc1 , const Apl16sc* pSrc2 , int len , Apl64sc* pDp );<br />

AplStatus aplsDotProd_16s16sc64sc ( const Apl16s* pSrc1 , const Apl16sc* pSrc2 , int len , Apl64sc* pDp );<br />

AplStatus aplsDotProd_16s32f ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , int len , Apl32f* pDp );<br />

AplStatus aplsDotProd_16sc32fc ( const Apl16sc* pSrc1 , const Apl16sc* pSrc2 , int len , Apl32fc* pDp );<br />

AplStatus aplsDotProd_16s16sc32fc ( const Apl16s* pSrc1 , const Apl16sc* pSrc2 , int len , Apl32fc* pDp );<br />

AplStatus aplsDotProd_16s_Sfs ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , int len , Apl16s* pDp , int scaleFactor );<br />

AplStatus aplsDotProd_16sc_Sfs ( const Apl16sc* pSrc1 , const Apl16sc* pSrc2 , int len , Apl16sc* pDp , int scaleFactor );<br />

AplStatus aplsDotProd_32s_Sfs ( const Apl32s* pSrc1 , const Apl32s* pSrc2 , int len , Apl32s* pDp , int scaleFactor );<br />

AplStatus aplsDotProd_32sc_Sfs ( const Apl32sc* pSrc1 , const Apl32sc* pSrc2 , int len , Apl32sc* pDp , int scaleFactor );<br />

AplStatus aplsDotProd_16s32s_Sfs ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , int len , Apl32s* pDp , int scaleFactor );<br />

AplStatus aplsDotProd_16s16sc32sc_Sfs ( const Apl16s* pSrc1 , const Apl16sc* pSrc2 , int len , Apl32sc* pDp , int scaleFactor );<br />

AplStatus aplsDotProd_16s32s32s_Sfs ( const Apl16s* pSrc1 , const Apl32s* pSrc2 , int len , Apl32s* pDp , int scaleFactor );<br />

AplStatus aplsDotProd_16s16sc_Sfs ( const Apl16s* pSrc1 , const Apl16sc* pSrc2 , int len , Apl16sc* pDp , int scaleFactor );<br />

AplStatus aplsDotProd_16sc32sc_Sfs ( const Apl16sc* pSrc1 , const Apl16sc* pSrc2 , int len , Apl32sc* pDp , int scaleFactor );<br />

AplStatus aplsDotProd_32s32sc_Sfs ( const Apl32s* pSrc1 , const Apl32sc* pSrc2 , int len , Apl32sc* pDp , int scaleFactor );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDp Pointer to the destination buffer that contains the dot product of the source buffers.<br />

pSrc1 Pointer to source buffer one.<br />

pSrc2 Pointer to source buffer two.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 97 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through vector elements in two buffers, calculate the dot product of the vectors, and write the result to a location<br />

specified by a pointer.<br />

The following formula is used:<br />

DotProduct = ((n = 0) - (len-1)) Sum(pSrc1[n] * pSrc2[n]).<br />

There are 16-bit and 32-bit signed and signed complex versions that perform an integer scaling operation on the result.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 98 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Sum<br />

Sum<br />

Synopsis<br />

AplStatus aplsSum_32f ( const Apl32f* pSrc , int len , Apl32f* pSum , AplHintAlgorithm hint );<br />

AplStatus aplsSum_32fc ( const Apl32fc* pSrc , int len , Apl32fc* pSum , AplHintAlgorithm hint );<br />

AplStatus aplsSum_64f ( const Apl64f* pSrc , int len , Apl64f* pSum );<br />

AplStatus aplsSum_64fc ( const Apl64fc* pSrc , int len , Apl64fc* pSum );<br />

AplStatus aplsSum_16s_Sfs ( const Apl16s* pSrc , int len , Apl16s* pSum , int scaleFactor );<br />

AplStatus aplsSum_32s_Sfs ( const Apl32s* pSrc , int len , Apl32s* pSum , int scaleFactor );<br />

AplStatus aplsSum_16s32s_Sfs ( const Apl16s* pSrc , int len , Apl32s* pSum , int scaleFactor );<br />

AplStatus aplsSum_16sc_Sfs ( const Apl16sc* pSrc , int len , Apl16sc* pSum , int scaleFactor );<br />

AplStatus aplsSum_16sc32sc_Sfs ( const Apl16sc* pSrc , int len , Apl32sc* pSum , int scaleFactor );<br />

Parameters<br />

hint Hints whether to choose a fast or accurate computation algorithm.<br />

len Specifies the number of elements in a buffer.<br />

pSrc Pointer to a source buffer.<br />

pSum Pointer to the destination buffer that contains the sum of all the elements in the source buffer.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through vector elements in a source buffer, calculate the sum of the elements, and write the result to a location<br />

specified by a pointer.<br />

The following formula is used:<br />

Sum( ) = ((n = 0) - (len-1)) Sum(pSrc[n]).<br />

The 16-bit signed and signed complex and 32-bit signed versions perform an integer scaling operation on the result.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 99 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

StdDev<br />

Standard deviation<br />

Synopsis<br />

AplStatus aplsStdDev_32f ( const Apl32f* pSrc , int len , Apl32f* pStdDev , AplHintAlgorithm hint );<br />

AplStatus aplsStdDev_64f ( const Apl64f* pSrc , int len , Apl64f* pStdDev );<br />

AplStatus aplsStdDev_16s32s_Sfs ( const Apl16s* pSrc , int len , Apl32s* pStdDev , int scaleFactor );<br />

AplStatus aplsStdDev_16s_Sfs ( const Apl16s* pSrc , int len , Apl16s* pStdDev , int scaleFactor );<br />

Parameters<br />

hint Hints whether to choose a fast or accurate computation algorithm.<br />

len Specifies the number of elements in a buffer.<br />

pSrc Pointer to a source buffer.<br />

pStdDev Pointer to the destination buffer that contains the standard deviation of the values in the source buffer.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through vector elements in a source buffer, calculate the standard deviation of the elements, and write the result<br />

to a location specified by a pointer.<br />

The following formula is used:<br />

StdDev( ) = Sqrt(((n = 0) - (len-1)) Sum(Square(pSrc[n]-pMean))/len-1)<br />

The 16-bit signed versions perform an integer scaling operation on the result.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 100 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Fixed Accuracy Arithmetic Functions<br />

This chapter describes functions that perform arithmetic operations at a chosen level of accuracy. These functions provide flexible<br />

specification of accuracy and support IEEE-754 standards. Choice of accuracy level is based on practical experience and application<br />

requirements. Options are specified by a function name suffix.<br />

The options for the single-precision data format are A11, A21, and A24.<br />

The options for the double-precision data format are A50 and A53.<br />

For single precision data:<br />

• Suffix_A11 guarantees 11 correctly rounded bits of significand, or at least three exact decimal digits<br />

• Suffix_A21 guarantees 21 correctly rounded bits of significand, or four ulps, or approximately six exact decimal digits<br />

• Suffix_A24 guarantees 24 correctly rounded bits of significand, including the implied bit, with the maximum guaranteed error<br />

within one ulp.<br />

For double precision data:<br />

• Suffix_A50 guarantees 50 correctly rounded bits of significand, or four ulps, or approximately 15 exact decimal digits<br />

• Suffix_A53 guarantees 53 correctly rounded bits of significand, including the implied bit, with the maximum guaranteed error<br />

within one ulp.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 101 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Inv<br />

Inverse<br />

Synopsis<br />

AplStatus aplsInv_32f_A11 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsInv_32f_A21 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsInv_32f_A24 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsInv_64f_A50 ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsInv_64f_A53 ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions step through a source buffer, calculate the inverse of each element, write the results to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSingularity Singularity in operation warning status code.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 102 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Div<br />

Divide<br />

Synopsis<br />

AplStatus aplsDiv_32f_A11 ( const Apl32f* pSrc1 , const Apl32f* pSrc2 , Apl32f* pDst , int len );<br />

AplStatus aplsDiv_32f_A21 ( const Apl32f* pSrc1 , const Apl32f* pSrc2 , Apl32f* pDst , int len );<br />

AplStatus aplsDiv_32f_A24 ( const Apl32f* pSrc1 , const Apl32f* pSrc2 , Apl32f* pDst , int len );<br />

AplStatus aplsDiv_64f_A50 ( const Apl64f* pSrc1 , const Apl64f* pSrc2 , Apl64f* pDst , int len );<br />

AplStatus aplsDiv_64f_A53 ( const Apl64f* pSrc1 , const Apl64f* pSrc2 , Apl64f* pDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc1 Pointer to source buffer one.<br />

pSrc2 Pointer to source buffer two.<br />

Description<br />

These functions step through vector elements in two source buffers, divide the elements in buffer 1 by the elements in buffer 2, and<br />

write the results to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSingularity Singularity in operation warning status code.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 103 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Sqrt<br />

Square root<br />

Synopsis<br />

AplStatus aplsSqrt_32f_A11 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsSqrt_32f_A21 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsSqrt_32f_A24 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsSqrt_64f_A50 ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsSqrt_64f_A53 ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions step through vector elements in a source buffer, calculate the square root of each element, and write the results to a<br />

destination buffer.<br />

Return Values<br />

aplStsDomain Argument out of function domain warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 104 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

InvSqrt<br />

Inverse Square root<br />

Synopsis<br />

AplStatus aplsInvSqrt_32f_A11 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsInvSqrt_32f_A21 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsInvSqrt_32f_A24 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsInvSqrt_64f_A50 ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsInvSqrt_64f_A53 ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions step through vector elements in a source buffer, calculate the inverse square root of each element, and write the<br />

results to a destination buffer.<br />

Return Values<br />

aplStsDomain Argument out of function domain warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSingularity Singularity in operation warning status code.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 105 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Cbrt<br />

Cube root<br />

Synopsis<br />

AplStatus aplsCbrt_32f_A11 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsCbrt_32f_A21 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsCbrt_32f_A24 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsCbrt_64f_A50 ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsCbrt_64f_A53 ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions step through vector elements in a source buffer, calculate the cube root of each element, and write the results to a<br />

destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 106 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

InvCbrt<br />

Inverse cube root<br />

Synopsis<br />

AplStatus aplsInvCbrt_32f_A11 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsInvCbrt_32f_A21 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsInvCbrt_32f_A24 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsInvCbrt_64f_A50 ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsInvCbrt_64f_A53 ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions step through vector elements in a source buffer, calculate the inverse cube root of each element, and write the results<br />

to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSingularity Singularity in operation warning status code.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 107 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Pow<br />

Power<br />

Synopsis<br />

AplStatus aplsPow_32f_A11 ( const Apl32f* pSrc1 , const Apl32f* pSrc2 , Apl32f* pDst , int len );<br />

AplStatus aplsPow_32f_A21 ( const Apl32f* pSrc1 , const Apl32f* pSrc2 , Apl32f* pDst , int len );<br />

AplStatus aplsPow_32f_A24 ( const Apl32f* pSrc1 , const Apl32f* pSrc2 , Apl32f* pDst , int len );<br />

AplStatus aplsPow_64f_A50 ( const Apl64f* pSrc1 , const Apl64f* pSrc2 , Apl64f* pDst , int len );<br />

AplStatus aplsPow_64f_A53 ( const Apl64f* pSrc1 , const Apl64f* pSrc2 , Apl64f* pDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc1 Pointer to source buffer one.<br />

pSrc2 Pointer to source buffer two.<br />

Description<br />

These functions step through vector elements in two source buffers, raise each element of buffer 1 to the power specified by the<br />

corresponding element of buffer 2, and write the results to a destination buffer.<br />

Return Values<br />

aplStsDomain Argument out of function domain warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSingularity Singularity in operation warning status code.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 108 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Powx<br />

Constant power<br />

Synopsis<br />

AplStatus aplsPowx_32f_A11 ( const Apl32f* pSrc1 , Apl32f val , Apl32f* pDst , int len );<br />

AplStatus aplsPowx_32f_A21 ( const Apl32f* pSrc1 , Apl32f val , Apl32f* pDst , int len );<br />

AplStatus aplsPowx_32f_A24 ( const Apl32f* pSrc1 , Apl32f val , Apl32f* pDst , int len );<br />

AplStatus aplsPowx_64f_A50 ( const Apl64f* pSrc1 , Apl64f val , Apl64f* pDst , int len );<br />

AplStatus aplsPowx_64f_A53 ( const Apl64f* pSrc1 , Apl64f val , Apl64f* pDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc1 Pointer to source buffer one.<br />

val Specified value.<br />

Description<br />

These functions step through vector elements in a source buffer, raise each element to a power specified by a constant, and write the<br />

results to a destination buffer.<br />

Return Values<br />

aplStsDomain Argument out of function domain warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSingularity Singularity in operation warning status code.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 109 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Exp<br />

Exponential<br />

Synopsis<br />

AplStatus aplsExp_32f_A11 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsExp_32f_A21 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsExp_32f_A24 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsExp_64f_A50 ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsExp_64f_A53 ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions step through vector elements in a source buffer, raise e to the power specified by each element, and write the results<br />

to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsOverflow Overflow in operation warning status code.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsUnderflow Underflow in operation warning status code.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 110 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Ln<br />

Natural Logarithm<br />

Synopsis<br />

AplStatus aplsLn_32f_A11 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsLn_32f_A21 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsLn_32f_A24 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsLn_64f_A50 ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsLn_64f_A53 ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions step through vector elements in a source buffer, calculate the natural logarithm of each element, and write the results<br />

to a destination buffer.<br />

Return Values<br />

aplStsDomain Argument out of function domain warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSingularity Singularity in operation warning status code.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 111 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Log10<br />

Common Logarithm<br />

Synopsis<br />

AplStatus aplsLog10_32f_A11 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsLog10_32f_A21 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsLog10_32f_A24 ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsLog10_64f_A50 ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsLog10_64f_A53 ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions step through vector elements in a source buffer, calculate the common logarithm of each element, and write the<br />

results to a destination buffer.<br />

Return Values<br />

aplStsDomain Argument out of function domain warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSingularity Singularity in operation warning status code.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 112 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Vector Initialization Functions<br />

This chapter describes functions that perform vector initialization tasks.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 113 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Copy<br />

Copy vector<br />

Synopsis<br />

AplStatus aplsCopy_8u ( const Apl8u* pSrc , Apl8u* pDst , int len );<br />

AplStatus aplsCopy_16s ( const Apl16s* pSrc , Apl16s* pDst , int len );<br />

AplStatus aplsCopy_16sc ( const Apl16sc* pSrc , Apl16sc* pDst , int len );<br />

AplStatus aplsCopy_32f ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsCopy_32fc ( const Apl32fc* pSrc , Apl32fc* pDst , int len );<br />

AplStatus aplsCopy_64f ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsCopy_64fc ( const Apl64fc* pSrc , Apl64fc* pDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions copy the vector elements in a source buffer to a destination buffer.<br />

Return Values<br />

aplStsDomain Argument out of function domain warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSingularity Singularity in operation warning status code.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 114 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Move<br />

Move vector<br />

Synopsis<br />

AplStatus aplsMove_8u ( const Apl8u* pSrc , Apl8u* pDst , int len );<br />

AplStatus aplsMove_16s ( const Apl16s* pSrc , Apl16s* pDst , int len );<br />

AplStatus aplsMove_16sc ( const Apl16sc* pSrc , Apl16sc* pDst , int len );<br />

AplStatus aplsMove_32f ( const Apl32f* pSrc , Apl32f* pDst , int len );<br />

AplStatus aplsMove_32fc ( const Apl32fc* pSrc , Apl32fc* pDst , int len );<br />

AplStatus aplsMove_64f ( const Apl64f* pSrc , Apl64f* pDst , int len );<br />

AplStatus aplsMove_64fc ( const Apl64fc* pSrc , Apl64fc* pDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

Description<br />

These functions move the vector elements in a source buffer to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 115 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Set<br />

Set vector<br />

Synopsis<br />

AplStatus aplsSet_8u ( Apl8u val , Apl8u* pDst , int len );<br />

AplStatus aplsSet_16s ( Apl16s val , Apl16s* pDst , int len );<br />

AplStatus aplsSet_16sc ( Apl16sc val , Apl16sc* pDst , int len );<br />

AplStatus aplsSet_32s ( Apl32s val , Apl32s* pDst , int len );<br />

AplStatus aplsSet_32f ( Apl32f val , Apl32f* pDst , int len );<br />

AplStatus aplsSet_32sc ( Apl32sc val , Apl32sc* pDst , int len );<br />

AplStatus aplsSet_32fc ( Apl32fc val , Apl32fc* pDst , int len );<br />

AplStatus aplsSet_64s ( Apl64s val , Apl64s* pDst , int len );<br />

AplStatus aplsSet_64f ( Apl64f val , Apl64f* pDst , int len );<br />

AplStatus aplsSet_64sc ( Apl64sc val , Apl64sc* pDst , int len );<br />

AplStatus aplsSet_64fc ( Apl64fc val , Apl64fc* pDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

val Specified value.<br />

Description<br />

These functions set elements of a vector in a destination buffer to a specified value. A length parameter specifies the number of<br />

elements that are set.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 116 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Zero<br />

Clear vector<br />

Synopsis<br />

AplStatus aplsZero_8u ( Apl8u* pDst , int len );<br />

AplStatus aplsZero_16s ( Apl16s* pDst , int len );<br />

AplStatus aplsZero_16sc ( Apl16sc* pDst , int len );<br />

AplStatus aplsZero_32f ( Apl32f* pDst , int len );<br />

AplStatus aplsZero_32fc ( Apl32fc* pDst , int len );<br />

AplStatus aplsZero_64f ( Apl64f* pDst , int len );<br />

Parameters<br />

len Specifies the number of elements in a buffer.<br />

pDst Pointer to a destination buffer.<br />

Description<br />

These functions clear elements of a vector in a destination buffer to zero. A length parameter specifies the number of elements that<br />

are cleared.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 117 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Transform Functions<br />

This chapter describes functions that perform frequency and time domain transformation.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 118 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

ConjPack<br />

Convert Pack to complex<br />

Synopsis<br />

AplStatus aplsConjPack_16sc ( const Apl16s* pSrc , Apl16sc* pDst , int lenDst );<br />

AplStatus aplsConjPack_32fc ( const Apl32f* pSrc , Apl32fc* pDst , int lenDst );<br />

AplStatus aplsConjPack_64fc ( const Apl64f* pSrc , Apl64fc* pDst , int lenDst );<br />

AplStatus aplsConjPack_16sc_I ( Apl16sc* pSrcDst , int lenDst );<br />

AplStatus aplsConjPack_32fc_I ( Apl32fc* pSrcDst , int lenDst );<br />

AplStatus aplsConjPack_64fc_I ( Apl64fc* pSrcDst , int lenDst );<br />

Parameters<br />

lenDst Specifies the number of elements in a destination vector.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

Description<br />

These functions step through a source buffer of complex vectors stored in the Pack format and convert them to the general complex<br />

format. The result can be written to a destination buffer or written back to the source buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 119 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

ConjPerm<br />

Convert Perm to complex<br />

Synopsis<br />

AplStatus aplsConjPerm_16sc ( const Apl16s* pSrc , Apl16sc* pDst , int lenDst );<br />

AplStatus aplsConjPerm_32fc ( const Apl32f* pSrc , Apl32fc* pDst , int lenDst );<br />

AplStatus aplsConjPerm_64fc ( const Apl64f* pSrc , Apl64fc* pDst , int lenDst );<br />

AplStatus aplsConjPerm_16sc_I ( Apl16sc* pSrcDst , int lenDst );<br />

AplStatus aplsConjPerm_32fc_I ( Apl32fc* pSrcDst , int lenDst );<br />

AplStatus aplsConjPerm_64fc_I ( Apl64fc* pSrcDst , int lenDst );<br />

Parameters<br />

lenDst Specifies the number of elements in a destination vector.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

Description<br />

These functions step through a source buffer of complex vectors stored in the Perm format and convert them to the general complex<br />

format. The result can be written to a destination buffer or written back to the source buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 120 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

ConjCcs<br />

Convert CCS to complex<br />

Synopsis<br />

AplStatus aplsConjCcs_16sc ( const Apl16s* pSrc , Apl16sc* pDst , int lenDst );<br />

AplStatus aplsConjCcs_32fc ( const Apl32f* pSrc , Apl32fc* pDst , int lenDst );<br />

AplStatus aplsConjCcs_64fc ( const Apl64f* pSrc , Apl64fc* pDst , int lenDst );<br />

AplStatus aplsConjCcs_16sc_I ( Apl16sc* pSrcDst , int lenDst );<br />

AplStatus aplsConjCcs_32fc_I ( Apl32fc* pSrcDst , int lenDst );<br />

AplStatus aplsConjCcs_64fc_I ( Apl64fc* pSrcDst , int lenDst );<br />

Parameters<br />

lenDst Specifies the number of elements in a destination vector.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

Description<br />

These functions step through a source buffer of complex vectors stored in the CCS format and convert them to the general complex<br />

format. The result can be written to a destination buffer or written back to the source buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 121 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

MulPack<br />

Multiply Pack vectors<br />

Synopsis<br />

AplStatus aplsMulPack_16s_Sfs ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , Apl16s* pDst , int length , int scaleFactor );<br />

AplStatus aplsMulPack_32f ( const Apl32f* pSrc1 , const Apl32f* pSrc2 , Apl32f* pDst , int length );<br />

AplStatus aplsMulPack_64f ( const Apl64f* pSrc1 , const Apl64f* pSrc2 , Apl64f* pDst , int length );<br />

AplStatus aplsMulPack_16s_ISfs ( const Apl16s* pSrc , Apl16s* pSrcDst , int length , int scaleFactor );<br />

AplStatus aplsMulPack_32f_I ( const Apl32f* pSrc , Apl32f* pSrcDst , int length );<br />

AplStatus aplsMulPack_64f_I ( const Apl64f* pSrc , Apl64f* pSrcDst , int length );<br />

Parameters<br />

length Specifies the number of elements in a vector.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrc1 Pointer to source buffer one.<br />

pSrc2 Pointer to source buffer two.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through two source buffers, multiply a Pack format complex vector in source buffer 1 by a Pack format complex<br />

vector in source buffer 2, and write the product in Pack format. The product can be written to a destination buffer or written back to<br />

source buffer 2.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 122 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

MulPerm<br />

Multiply Perm vectors<br />

Synopsis<br />

AplStatus aplsMulPerm_16s_Sfs ( const Apl16s* pSrc1 , const Apl16s* pSrc2 , Apl16s* pDst , int length , int scaleFactor );<br />

AplStatus aplsMulPerm_32f ( const Apl32f* pSrc1 , const Apl32f* pSrc2 , Apl32f* pDst , int length );<br />

AplStatus aplsMulPerm_64f ( const Apl64f* pSrc1 , const Apl64f* pSrc2 , Apl64f* pDst , int length );<br />

AplStatus aplsMulPerm_16s_ISfs ( const Apl16s* pSrc , Apl16s* pSrcDst , int length , int scaleFactor );<br />

AplStatus aplsMulPerm_32f_I ( const Apl32f* pSrc , Apl32f* pSrcDst , int length );<br />

AplStatus aplsMulPerm_64f_I ( const Apl64f* pSrc , Apl64f* pSrcDst , int length );<br />

Parameters<br />

length Specifies the number of elements in a vector.<br />

pDst Pointer to a destination buffer.<br />

pSrc Pointer to a source buffer.<br />

pSrc1 Pointer to source buffer one.<br />

pSrc2 Pointer to source buffer two.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through two source buffers, multiply a Perm format complex vector in source buffer 1 by a Perm format complex<br />

vector in source buffer 2, and write the product in Perm format. The product can be written to a destination buffer or written back to<br />

source buffer 2.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 123 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

MulPackConj<br />

Multiply Pack vector and complex-conjugate<br />

Synopsis<br />

AplStatus aplsMulPackConj_32f_I ( const Apl32f* pSrc , Apl32f* pSrcDst , int length );<br />

AplStatus aplsMulPackConj_64f_I ( const Apl64f* pSrc , Apl64f* pSrcDst , int length );<br />

Parameters<br />

length Specifies the number of elements in a vector.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

Description<br />

These functions Step through two source buffers, multiply a Pack format complex vector in source buffer 1 by the complex-conjugate<br />

of Pack format complex vector in source buffer 2, and write the product in Pack format. The product is written back to source buffer 2.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 124 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FFTInitAlloc<br />

Allocate memory and initialize FFT structure<br />

Synopsis<br />

AplStatus aplsFFTInitAlloc_C_16sc ( AplsFFTSpec_C_16sc** ppFFTSpec , int order , int flag , AplHintAlgorithm hint );<br />

AplStatus aplsFFTInitAlloc_C_32sc ( AplsFFTSpec_C_32sc** ppFFTSpec , int order , int flag , AplHintAlgorithm hint );<br />

AplStatus aplsFFTInitAlloc_C_32fc ( AplsFFTSpec_C_32fc** ppFFTSpec , int order , int flag , AplHintAlgorithm hint );<br />

AplStatus aplsFFTInitAlloc_C_64fc ( AplsFFTSpec_C_64fc** ppFFTSpec , int order , int flag , AplHintAlgorithm hint );<br />

AplStatus aplsFFTInitAlloc_C_16s ( AplsFFTSpec_C_16s** ppFFTSpec , int order , int flag , AplHintAlgorithm hint );<br />

AplStatus aplsFFTInitAlloc_C_32s ( AplsFFTSpec_C_32s** ppFFTSpec , int order , int flag , AplHintAlgorithm hint );<br />

AplStatus aplsFFTInitAlloc_C_32f ( AplsFFTSpec_C_32f** ppFFTSpec , int order , int flag , AplHintAlgorithm hint );<br />

AplStatus aplsFFTInitAlloc_C_64f ( AplsFFTSpec_C_64f** ppFFTSpec , int order , int flag , AplHintAlgorithm hint );<br />

AplStatus aplsFFTInitAlloc_R_16s ( AplsFFTSpec_R_16s** ppFFTSpec , int order , int flag , AplHintAlgorithm hint );<br />

AplStatus aplsFFTInitAlloc_R_32s ( AplsFFTSpec_R_32s** ppFFTSpec , int order , int flag , AplHintAlgorithm hint );<br />

AplStatus aplsFFTInitAlloc_R_16s32s ( AplsFFTSpec_R_16s32s** ppFFTSpec , int order , int flag , AplHintAlgorithm hint );<br />

AplStatus aplsFFTInitAlloc_R_32f ( AplsFFTSpec_R_32f** ppFFTSpec , int order , int flag , AplHintAlgorithm hint );<br />

AplStatus aplsFFTInitAlloc_R_64f ( AplsFFTSpec_R_64f** ppFFTSpec , int order , int flag , AplHintAlgorithm hint );<br />

Parameters<br />

flag Specifies the FFT division type. It is enumerated in aplBase.h.<br />

hint Hints whether to choose a fast or accurate computation algorithm.<br />

order Order of an FFT signal. The length of the signal is 2^order.<br />

ppFFTSpec Double pointer to the FFT specification structure.<br />

Description<br />

These functions allocate memory and initialize an FFT specification structure defined by double pointer ppFFTSpec, based on the values<br />

of the order, hint and flag parameters. The order parameter specifies the transform length. The hint argument suggests using either a<br />

faster or more accurate algorithm. The flag parameter specifies the method of normalization to be used. There are separate functions<br />

for complex and real signals. The structure can be used by the FFTFwd and FFTInv functions.<br />

Return Values<br />

aplStsFftFlagErr The flag value is incorrect.<br />

aplStsFftOrderErr The specified order is out of bounds.<br />

aplStsMemAllocErr The function failed to allocate memory.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 125 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FFTFree<br />

Free FFT structure memory<br />

Synopsis<br />

AplStatus aplsFFTFree_C_16sc ( AplsFFTSpec_C_16sc* pFFTSpec );<br />

AplStatus aplsFFTFree_C_32sc ( AplsFFTSpec_C_32sc* pFFTSpec );<br />

AplStatus aplsFFTFree_C_32fc ( AplsFFTSpec_C_32fc* pFFTSpec );<br />

AplStatus aplsFFTFree_C_64fc ( AplsFFTSpec_C_64fc* pFFTSpec );<br />

AplStatus aplsFFTFree_C_16s ( AplsFFTSpec_C_16s* pFFTSpec );<br />

AplStatus aplsFFTFree_C_32s ( AplsFFTSpec_C_32s* pFFTSpec );<br />

AplStatus aplsFFTFree_C_32f ( AplsFFTSpec_C_32f* pFFTSpec );<br />

AplStatus aplsFFTFree_C_64f ( AplsFFTSpec_C_64f* pFFTSpec );<br />

AplStatus aplsFFTFree_R_16s ( AplsFFTSpec_R_16s* pFFTSpec );<br />

AplStatus aplsFFTFree_R_32s ( AplsFFTSpec_R_32s* pFFTSpec );<br />

AplStatus aplsFFTFree_R_16s32s ( AplsFFTSpec_R_16s32s* pFFTSpec );<br />

AplStatus aplsFFTFree_R_32f ( AplsFFTSpec_R_32f* pFFTSpec );<br />

AplStatus aplsFFTFree_R_64f ( AplsFFTSpec_R_64f* pFFTSpec );<br />

Parameters<br />

pFFTSpec Pointer to the FFT specification structure.<br />

Description<br />

These functions free the memory allocated to a specification structure by the FFTInitAlloc( ) function. The pointer pFFTSpec indicates<br />

the structure to be removed. There are functions for real and complex signals. Make sure to use the FFTFree( ) function only for a<br />

structure created with the FFTInitAlloc( ) function.<br />

Return Values<br />

aplStsContextMatchErr The specification structure does not match the function or is invalid.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 126 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FFTInit<br />

Initialize FFT structure<br />

Synopsis<br />

AplStatus aplsFFTInit_C_16sc ( AplsFFTSpec_C_16sc** ppFFTSpec , int order , int flag , AplHintAlgorithm hint , Apl8u* pMemSpec ,<br />

Apl8u* pBufInit );<br />

AplStatus aplsFFTInit_C_32sc ( AplsFFTSpec_C_32sc** ppFFTSpec , int order , int flag , AplHintAlgorithm hint , Apl8u* pMemSpec ,<br />

Apl8u* pBufInit );<br />

AplStatus aplsFFTInit_C_32fc ( AplsFFTSpec_C_32fc** ppFFTSpec , int order , int flag , AplHintAlgorithm hint , Apl8u* pMemSpec ,<br />

Apl8u* pBufInit );<br />

AplStatus aplsFFTInit_C_64fc ( AplsFFTSpec_C_64fc** ppFFTSpec , int order , int flag , AplHintAlgorithm hint , Apl8u* pMemSpec ,<br />

Apl8u* pBufInit );<br />

AplStatus aplsFFTInit_C_16s ( AplsFFTSpec_C_16s** ppFFTSpec , int order , int flag , AplHintAlgorithm hint , Apl8u* pMemSpec , Apl8u*<br />

pBufInit );<br />

AplStatus aplsFFTInit_C_32s ( AplsFFTSpec_C_32s** ppFFTSpec , int order , int flag , AplHintAlgorithm hint , Apl8u* pMemSpec , Apl8u*<br />

pBufInit );<br />

AplStatus aplsFFTInit_C_32f ( AplsFFTSpec_C_32f** ppFFTSpec , int order , int flag , AplHintAlgorithm hint , Apl8u* pMemSpec , Apl8u*<br />

pBufInit );<br />

AplStatus aplsFFTInit_C_64f ( AplsFFTSpec_C_64f** ppFFTSpec , int order , int flag , AplHintAlgorithm hint , Apl8u* pMemSpec , Apl8u*<br />

pBufInit );<br />

AplStatus aplsFFTInit_R_16s ( AplsFFTSpec_R_16s** ppFFTSpec , int order , int flag , AplHintAlgorithm hint , Apl8u* pMemSpec , Apl8u*<br />

pBufInit );<br />

AplStatus aplsFFTInit_R_32s ( AplsFFTSpec_R_32s** ppFFTSpec , int order , int flag , AplHintAlgorithm hint , Apl8u* pMemSpec , Apl8u*<br />

pBufInit );<br />

AplStatus aplsFFTInit_R_16s32s ( AplsFFTSpec_R_16s32s** ppFFTSpec , int order , int flag , AplHintAlgorithm hint , Apl8u* pMemSpec ,<br />

Apl8u* pBufInit );<br />

AplStatus aplsFFTInit_R_32f ( AplsFFTSpec_R_32f** ppFFTSpec , int order , int flag , AplHintAlgorithm hint , Apl8u* pMemSpec , Apl8u*<br />

pBufInit );<br />

AplStatus aplsFFTInit_R_64f ( AplsFFTSpec_R_64f** ppFFTSpec , int order , int flag , AplHintAlgorithm hint , Apl8u* pMemSpec , Apl8u*<br />

pBufInit );<br />

Parameters<br />

flag Specifies the FFT division type. It is enumerated in aplBase.h.<br />

hint Hints whether to choose a fast or accurate computation algorithm.<br />

order Order of an FFT signal. The length of the signal is 2^order.<br />

pBufInit Pointer to memory required for FFT initialization.<br />

pMemSpec Pointer to memory where the FFT specification structure is initialized.<br />

ppFFTSpec Double pointer to the FFT specification structure.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 127 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions initialize an FFT specification structure defined by double pointer ppFFTSpec. The structure is initialized based on the<br />

values of the order, hint and flag parameters. The order parameter specifies the transform length. The hint argument suggests using<br />

either a faster or more accurate algorithm. The flag parameter specifies the method of normalization to be used. There are functions<br />

for real and complex signals. Pointer pMemSpec points to the location of the structure (MemSpec) and pointer pBufInit points to the<br />

location of the initialization buffer (BufInit). To allocate memory for the specification structure and initialization buffer, first use the<br />

appropriate FFTGetSize function to obtain the sizes of the structure and the buffer, then use the Malloc function. Use the Free function<br />

to remove buffer and structure.<br />

Return Values<br />

aplStsFftFlagErr The flag value is incorrect.<br />

aplStsFftOrderErr The specified order is out of bounds.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 128 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FFTGetSize<br />

Get FFTInit buffer size<br />

Synopsis<br />

AplStatus aplsFFTGetSize_C_16sc ( int order , int flag , AplHintAlgorithm hint , int* pSizeSpec , int* pSizeInit , int* pSizeBuf );<br />

AplStatus aplsFFTGetSize_C_32sc ( int order , int flag , AplHintAlgorithm hint , int* pSizeSpec , int* pSizeInit , int* pSizeBuf );<br />

AplStatus aplsFFTGetSize_C_32fc ( int order , int flag , AplHintAlgorithm hint , int* pSizeSpec , int* pSizeInit , int* pSizeBuf );<br />

AplStatus aplsFFTGetSize_C_64fc ( int order , int flag , AplHintAlgorithm hint , int* pSizeSpec , int* pSizeInit , int* pSizeBuf );<br />

AplStatus aplsFFTGetSize_C_16s ( int order , int flag , AplHintAlgorithm hint , int* pSizeSpec , int* pSizeInit , int* pSizeBuf );<br />

AplStatus aplsFFTGetSize_C_32s ( int order , int flag , AplHintAlgorithm hint , int* pSizeSpec , int* pSizeInit , int* pSizeBuf );<br />

AplStatus aplsFFTGetSize_C_32f ( int order , int flag , AplHintAlgorithm hint , int* pSizeSpec , int* pSizeInit , int* pSizeBuf );<br />

AplStatus aplsFFTGetSize_C_64f ( int order , int flag , AplHintAlgorithm hint , int* pSizeSpec , int* pSizeInit , int* pSizeBuf );<br />

AplStatus aplsFFTGetSize_R_16s ( int order , int flag , AplHintAlgorithm hint , int* pSizeSpec , int* pSizeInit , int* pSizeBuf );<br />

AplStatus aplsFFTGetSize_R_32s ( int order , int flag , AplHintAlgorithm hint , int* pSizeSpec , int* pSizeInit , int* pSizeBuf );<br />

AplStatus aplsFFTGetSize_R_16s32s ( int order , int flag , AplHintAlgorithm hint , int* pSizeSpec , int* pSizeInit , int* pSizeBuf );<br />

AplStatus aplsFFTGetSize_R_32f ( int order , int flag , AplHintAlgorithm hint , int* pSizeSpec , int* pSizeInit , int* pSizeBuf );<br />

AplStatus aplsFFTGetSize_R_64f ( int order , int flag , AplHintAlgorithm hint , int* pSizeSpec , int* pSizeInit , int* pSizeBuf );<br />

Parameters<br />

flag Specifies the FFT division type. It is enumerated in aplBase.h.<br />

hint Hints whether to choose a fast or accurate computation algorithm.<br />

order Order of an FFT signal. The length of the signal is 2^order.<br />

pSizeBuf Pointer to the size of the FFT work buffer used by the FFTFwd and FFTInv functions.<br />

pSizeInit Pointer to the size of the BufInit buffer used by the FFTInit function.<br />

pSizeSpec Pointer to the size of the MemSpec buffer used by the FFTInit function.<br />

Description<br />

These functions calculate the sizes of buffers used by the FFTInit, FFTFwd, and FFTInv functions. After the function call, pSizeSpec<br />

points to the size of the FFTInit( ) MemSpec buffer, pSizeInit points to the size of the FFTInit( ) BufInit buffer, and pSizeBuf points<br />

to the size of the work buffer used by the FFTFwd, and FFTInv functions. Buffer memory must be allocated by the Malloc function<br />

before FFTInit( ) is called. There are separate functions for real and complex signals.<br />

Return Values<br />

aplStsFftFlagErr The flag value is incorrect.<br />

aplStsFftOrderErr The specified order is out of bounds.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 129 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FFTGetBufSize<br />

Get FFT buffer size<br />

Synopsis<br />

AplStatus aplsFFTGetBufSize_C_16sc ( const AplsFFTSpec_C_16sc* pFFTSpec , int* pSize );<br />

AplStatus aplsFFTGetBufSize_C_32sc ( const AplsFFTSpec_C_32sc* pFFTSpec , int* pSize );<br />

AplStatus aplsFFTGetBufSize_C_32fc ( const AplsFFTSpec_C_32fc* pFFTSpec , int* pSize );<br />

AplStatus aplsFFTGetBufSize_C_64fc ( const AplsFFTSpec_C_64fc* pFFTSpec , int* pSize );<br />

AplStatus aplsFFTGetBufSize_C_16s ( const AplsFFTSpec_C_16s* pFFTSpec , int* pSize );<br />

AplStatus aplsFFTGetBufSize_C_32s ( const AplsFFTSpec_C_32s* pFFTSpec , int* pSize );<br />

AplStatus aplsFFTGetBufSize_C_32f ( const AplsFFTSpec_C_32f* pFFTSpec , int* pSize );<br />

AplStatus aplsFFTGetBufSize_C_64f ( const AplsFFTSpec_C_64f* pFFTSpec , int* pSize );<br />

AplStatus aplsFFTGetBufSize_R_16s ( const AplsFFTSpec_R_16s* pFFTSpec , int* pSize );<br />

AplStatus aplsFFTGetBufSize_R_32s ( const AplsFFTSpec_R_32s* pFFTSpec , int* pSize );<br />

AplStatus aplsFFTGetBufSize_R_16s32s ( const AplsFFTSpec_R_16s32s* pFFTSpec , int* pSize );<br />

AplStatus aplsFFTGetBufSize_R_32f ( const AplsFFTSpec_R_32f* pFFTSpec , int* pSize );<br />

AplStatus aplsFFTGetBufSize_R_64f ( const AplsFFTSpec_R_64f* pFFTSpec , int* pSize );<br />

Parameters<br />

pFFTSpec Pointer to the FFT specification structure.<br />

pSize Pointer to the size of the FFT work buffer used by the FFTFwd and FFTInv functions.<br />

Description<br />

These functions calculate the size of the work buffer used by the FFTFwd and FFTInv functions. After the function call, pSize points to<br />

the size of the work buffer. The pBuffer parameter of the FFTFwd and FFTInv functions point to the work buffer. There are separate<br />

functions for real and complex signals.<br />

Return Values<br />

aplStsContextMatchErr The specification structure does not match the function or is invalid.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 130 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FFTFwd_CToC<br />

FFT forward complex<br />

Synopsis<br />

AplStatus aplsFFTFwd_CToC_16sc_Sfs ( const Apl16sc* pSrc , Apl16sc* pDst , const AplsFFTSpec_C_16sc* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_CToC_32sc_Sfs ( const Apl32sc* pSrc , Apl32sc* pDst , const AplsFFTSpec_C_32sc* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_CToC_32fc ( const Apl32fc* pSrc , Apl32fc* pDst , const AplsFFTSpec_C_32fc* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_CToC_64fc ( const Apl64fc* pSrc , Apl64fc* pDst , const AplsFFTSpec_C_64fc* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_CToC_16sc_ISfs ( Apl16sc* pSrcDst , const AplsFFTSpec_C_16sc* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_CToC_32sc_ISfs ( Apl32sc* pSrcDst , const AplsFFTSpec_C_32sc* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_CToC_32fc_I ( Apl32fc* pSrcDst , const AplsFFTSpec_C_32fc* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_CToC_64fc_I ( Apl64fc* pSrcDst , const AplsFFTSpec_C_64fc* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_CToC_16s_Sfs ( const Apl16s* pSrcRe , const Apl16s* pSrcIm , Apl16s* pDstRe , Apl16s* pDstIm , const<br />

AplsFFTSpec_C_16s* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_CToC_32s_Sfs ( const Apl32s* pSrcRe , const Apl32s* pSrcIm , Apl32s* pDstRe , Apl32s* pDstIm , const<br />

AplsFFTSpec_C_32s* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_CToC_32f ( const Apl32f* pSrcRe , const Apl32f* pSrcIm , Apl32f* pDstRe , Apl32f* pDstIm , const<br />

AplsFFTSpec_C_32f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_CToC_64f ( const Apl64f* pSrcRe , const Apl64f* pSrcIm , Apl64f* pDstRe , Apl64f* pDstIm , const<br />

AplsFFTSpec_C_64f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_CToC_16s_ISfs ( Apl16s* pSrcDstRe , Apl16s* pSrcDstIm , const AplsFFTSpec_C_16s* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_CToC_32s_ISfs ( Apl32s* pSrcDstRe , Apl32s* pSrcDstIm , const AplsFFTSpec_C_32s* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_CToC_32f_I ( Apl32f* pSrcDstRe , Apl32f* pSrcDstIm , const AplsFFTSpec_C_32f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_CToC_64f_I ( Apl64f* pSrcDstRe , Apl64f* pSrcDstIm , const AplsFFTSpec_C_64f* pFFTSpec , Apl8u* pBuffer );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 131 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

pBuffer Pointer to the FFT work buffer.<br />

pDst Pointer to a destination buffer.<br />

pDstIm Pointer to a destination buffer that contains the imaginary component values of an output signal.<br />

pDstRe Pointer to a destination buffer that contains the real component values of an output signal.<br />

pFFTSpec Pointer to the FFT specification structure.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

pSrcDstIm Pointer to a source/destination buffer that contains the imaginary components of input and output signals.<br />

pSrcDstRe Pointer to a source/destination buffer that contains the real components of input and output signals.<br />

pSrcIm Pointer to a source buffer that contains the imaginary component values of an input signal.<br />

pSrcRe Pointer to a source buffer that contains the real component values of an input signal.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions calculate the forward FFT of a complex signal. There are versions that step through a single source buffer that contains<br />

complex numbers and versions that step through dual source buffers that contain real and imaginary component values. Each version<br />

writes results of the corresponding type. Results can be written to a separate destination or written back to the source. The pointer<br />

pBuffer specifies the work buffer required for the FFT operation. When the value of pBuffer is NULL, memory is internally allocated.<br />

Return Values<br />

aplStsContextMatchErr The specification structure does not match the function or is invalid.<br />

aplStsMemAllocErr The function failed to allocate memory.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 132 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FFTInv_CToC<br />

FFT inverse complex<br />

Synopsis<br />

AplStatus aplsFFTInv_CToC_16sc_Sfs ( const Apl16sc* pSrc , Apl16sc* pDst , const AplsFFTSpec_C_16sc* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CToC_32sc_Sfs ( const Apl32sc* pSrc , Apl32sc* pDst , const AplsFFTSpec_C_32sc* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CToC_32fc ( const Apl32fc* pSrc , Apl32fc* pDst , const AplsFFTSpec_C_32fc* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CToC_64fc ( const Apl64fc* pSrc , Apl64fc* pDst , const AplsFFTSpec_C_64fc* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CToC_16sc_ISfs ( Apl16sc* pSrcDst , const AplsFFTSpec_C_16sc* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CToC_32sc_ISfs ( Apl32sc* pSrcDst , const AplsFFTSpec_C_32sc* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CToC_32fc_I ( Apl32fc* pSrcDst , const AplsFFTSpec_C_32fc* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CToC_64fc_I ( Apl64fc* pSrcDst , const AplsFFTSpec_C_64fc* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CToC_16s_Sfs ( const Apl16s* pSrcRe , const Apl16s* pSrcIm , Apl16s* pDstRe , Apl16s* pDstIm , const<br />

AplsFFTSpec_C_16s* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CToC_32s_Sfs ( const Apl32s* pSrcRe , const Apl32s* pSrcIm , Apl32s* pDstRe , Apl32s* pDstIm , const<br />

AplsFFTSpec_C_32s* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CToC_32f ( const Apl32f* pSrcRe , const Apl32f* pSrcIm , Apl32f* pDstRe , Apl32f* pDstIm , const<br />

AplsFFTSpec_C_32f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CToC_64f ( const Apl64f* pSrcRe , const Apl64f* pSrcIm , Apl64f* pDstRe , Apl64f* pDstIm , const<br />

AplsFFTSpec_C_64f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CToC_16s_ISfs ( Apl16s* pSrcDstRe , Apl16s* pSrcDstIm , const AplsFFTSpec_C_16s* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CToC_32s_ISfs ( Apl32s* pSrcDstRe , Apl32s* pSrcDstIm , const AplsFFTSpec_C_32s* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CToC_32f_I ( Apl32f* pSrcDstRe , Apl32f* pSrcDstIm , const AplsFFTSpec_C_32f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CToC_64f_I ( Apl64f* pSrcDstRe , Apl64f* pSrcDstIm , const AplsFFTSpec_C_64f* pFFTSpec , Apl8u* pBuffer );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 133 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

pBuffer Pointer to the FFT work buffer.<br />

pDst Pointer to a destination buffer.<br />

pDstIm Pointer to a destination buffer that contains the imaginary component values of an output signal.<br />

pDstRe Pointer to a destination buffer that contains the real component values of an output signal.<br />

pFFTSpec Pointer to the FFT specification structure.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

pSrcDstIm Pointer to a source/destination buffer that contains the imaginary components of input and output signals.<br />

pSrcDstRe Pointer to a source/destination buffer that contains the real components of input and output signals.<br />

pSrcIm Pointer to a source buffer that contains the imaginary component values of an input signal.<br />

pSrcRe Pointer to a source buffer that contains the real component values of an input signal.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions calculate the inverse FFT of a complex signal. There are versions that step through a single source buffer that contains<br />

complex numbers and versions that step through dual source buffers that contain real and imaginary component values. Each version<br />

writes results of the corresponding type. Results can be written to a separate destination or written back to the source. The pointer<br />

pBuffer specifies the work buffer required for the FFT operation. When the value of pBuffer is NULL, memory is internally allocated.<br />

Return Values<br />

aplStsContextMatchErr The specification structure does not match the function or is invalid.<br />

aplStsMemAllocErr The function failed to allocate memory.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 134 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FFTFwd_RToCCS<br />

FFT forward real CCS<br />

Synopsis<br />

AplStatus aplsFFTFwd_RToCCS_16s_Sfs ( const Apl16s* pSrc , Apl16s* pDst , const AplsFFTSpec_R_16s* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToCCS_32s_Sfs ( const Apl32s* pSrc , Apl32s* pDst , const AplsFFTSpec_R_32s* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToCCS_16s32s_Sfs ( const Apl16s* pSrc , Apl32s* pDst , const AplsFFTSpec_R_16s32s* pFFTSpec , int<br />

scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToCCS_32f ( const Apl32f* pSrc , Apl32f* pDst , const AplsFFTSpec_R_32f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToCCS_64f ( const Apl64f* pSrc , Apl64f* pDst , const AplsFFTSpec_R_64f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToCCS_16s_ISfs ( Apl16s* pSrcDst , const AplsFFTSpec_R_16s* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToCCS_32s_ISfs ( Apl32s* pSrcDst , const AplsFFTSpec_R_32s* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToCCS_32f_I ( Apl32f* pSrcDst , const AplsFFTSpec_R_32f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToCCS_64f_I ( Apl64f* pSrcDst , const AplsFFTSpec_R_64f* pFFTSpec , Apl8u* pBuffer );<br />

Parameters<br />

pBuffer Pointer to the FFT work buffer.<br />

pDst Pointer to a destination buffer.<br />

pFFTSpec Pointer to the FFT specification structure.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through a source buffer, calculate the forward FFT of a real signal, and write the result in CCS format. The Fourier<br />

transform of a real signal is in the Hermitian complex form. The forward FFT of an N-element real signal is a N-element complex signal<br />

(2N real elements). Because it is an Hermitian sequence, almost half of the signal can be reproduced from the rest due to complexconjugate<br />

redundancy. This redundancy is used to save space in storing the FFT output. CCS is a format for storing FFT output of real<br />

signals. Results can be written to a destination buffer or written back to the source buffer. The pointer pBuffer specifies the work buffer<br />

required for the FFT operation. When the value of pBuffer is NULL, memory is internally allocated.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 135 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsContextMatchErr The specification structure does not match the function or is invalid.<br />

aplStsMemAllocErr The function failed to allocate memory.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 136 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FFTFwd_RToPack<br />

FFT forward real Pack<br />

Synopsis<br />

AplStatus aplsFFTFwd_RToPack_16s_Sfs ( const Apl16s* pSrc , Apl16s* pDst , const AplsFFTSpec_R_16s* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToPack_32s_Sfs ( const Apl32s* pSrc , Apl32s* pDst , const AplsFFTSpec_R_32s* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToPack_32f ( const Apl32f* pSrc , Apl32f* pDst , const AplsFFTSpec_R_32f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToPack_64f ( const Apl64f* pSrc , Apl64f* pDst , const AplsFFTSpec_R_64f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToPack_16s_ISfs ( Apl16s* pSrcDst , const AplsFFTSpec_R_16s* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToPack_32s_ISfs ( Apl32s* pSrcDst , const AplsFFTSpec_R_32s* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToPack_32f_I ( Apl32f* pSrcDst , const AplsFFTSpec_R_32f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToPack_64f_I ( Apl64f* pSrcDst , const AplsFFTSpec_R_64f* pFFTSpec , Apl8u* pBuffer );<br />

Parameters<br />

pBuffer Pointer to the FFT work buffer.<br />

pDst Pointer to a destination buffer.<br />

pFFTSpec Pointer to the FFT specification structure.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through a source buffer, calculate the forward FFT of a real signal, and write the result in Pack format. The<br />

Fourier transform of a real signal is in the Hermitian complex form. The forward FFT of an N-element real signal is a N-element<br />

complex signal (2N real elements). Because it is an Hermitian sequence, almost half of the signal can be reproduced from the rest due<br />

to complex-conjugate redundancy. This redundancy is used to save space in storing the FFT output. Pack is a format for storing FFT<br />

output of real signals. Results can be written to a destination buffer or written back to the source buffer. The pointer pBuffer specifies<br />

the work buffer required for the FFT operation. When the value of pBuffer is NULL, memory is internally allocated.<br />

Return Values<br />

aplStsContextMatchErr The specification structure does not match the function or is invalid.<br />

aplStsMemAllocErr The function failed to allocate memory.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 137 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FFTFwd_RToPerm<br />

FFT forward real Perm<br />

Synopsis<br />

AplStatus aplsFFTFwd_RToPerm_16s_Sfs ( const Apl16s* pSrc , Apl16s* pDst , const AplsFFTSpec_R_16s* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToPerm_32s_Sfs ( const Apl32s* pSrc , Apl32s* pDst , const AplsFFTSpec_R_32s* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToPerm_32f ( const Apl32f* pSrc , Apl32f* pDst , const AplsFFTSpec_R_32f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToPerm_64f ( const Apl64f* pSrc , Apl64f* pDst , const AplsFFTSpec_R_64f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToPerm_16s_ISfs ( Apl16s* pSrcDst , const AplsFFTSpec_R_16s* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToPerm_32s_ISfs ( Apl32s* pSrcDst , const AplsFFTSpec_R_32s* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToPerm_32f_I ( Apl32f* pSrcDst , const AplsFFTSpec_R_32f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTFwd_RToPerm_64f_I ( Apl64f* pSrcDst , const AplsFFTSpec_R_64f* pFFTSpec , Apl8u* pBuffer );<br />

Parameters<br />

pBuffer Pointer to the FFT work buffer.<br />

pDst Pointer to a destination buffer.<br />

pFFTSpec Pointer to the FFT specification structure.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through a source buffer, calculate the forward FFT of a real signal, and write the result in Perm format. The<br />

Fourier transform of a real signal is in the Hermitian complex form. The forward FFT of an N-element real signal is a N-element<br />

complex signal (2N real elements). Because it is an Hermitian sequence, almost half of the signal can be reproduced from the rest due<br />

to complex-conjugate redundancy. This redundancy is used to save space in storing the FFT output. Perm is a format for storing FFT<br />

output of real signals. Results can be written to a destination buffer or written back to the source buffer. The pointer pBuffer specifies<br />

the work buffer required for the FFT operation. When the value of pBuffer is NULL, memory is internally allocated.<br />

Return Values<br />

aplStsContextMatchErr The specification structure does not match the function or is invalid.<br />

aplStsMemAllocErr The function failed to allocate memory.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 138 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FFTInv_CCSToR<br />

FFT inverse complex CCS to real<br />

Synopsis<br />

AplStatus aplsFFTInv_CCSToR_16s_Sfs ( const Apl16s* pSrc , Apl16s* pDst , const AplsFFTSpec_R_16s* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CCSToR_32s_Sfs ( const Apl32s* pSrc , Apl32s* pDst , const AplsFFTSpec_R_32s* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CCSToR_32s16s_Sfs ( const Apl32s* pSrc , Apl16s* pDst , const AplsFFTSpec_R_16s32s* pFFTSpec , int<br />

scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CCSToR_32f ( const Apl32f* pSrc , Apl32f* pDst , const AplsFFTSpec_R_32f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CCSToR_64f ( const Apl64f* pSrc , Apl64f* pDst , const AplsFFTSpec_R_64f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CCSToR_16s_ISfs ( Apl16s* pSrcDst , const AplsFFTSpec_R_16s* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CCSToR_32s_ISfs ( Apl32s* pSrcDst , const AplsFFTSpec_R_32s* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CCSToR_32f_I ( Apl32f* pSrcDst , const AplsFFTSpec_R_32f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_CCSToR_64f_I ( Apl64f* pSrcDst , const AplsFFTSpec_R_64f* pFFTSpec , Apl8u* pBuffer );<br />

Parameters<br />

pBuffer Pointer to the FFT work buffer.<br />

pDst Pointer to a destination buffer.<br />

pFFTSpec Pointer to the FFT specification structure.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through a source buffer, calculate the inverse FFT of a complex signal in CCS format, and write a real number<br />

result. The forward Fourier transform of a real signal is in the Hermitian complex form. Inverse Fourier transformation of an Hermitian<br />

complex signal results in a real signal. Results can be written to a destination buffer or written back to the source buffer. The pointer<br />

pBuffer specifies the work buffer required for the FFT operation. When the value of pBuffer is NULL, memory is internally allocated.<br />

Return Values<br />

aplStsContextMatchErr The specification structure does not match the function or is invalid.<br />

aplStsMemAllocErr The function failed to allocate memory.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 139 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FFTInv_PackToR<br />

FFT inverse complex Pack to real<br />

Synopsis<br />

AplStatus aplsFFTInv_PackToR_16s_Sfs ( const Apl16s* pSrc , Apl16s* pDst , const AplsFFTSpec_R_16s* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_PackToR_32s_Sfs ( const Apl32s* pSrc , Apl32s* pDst , const AplsFFTSpec_R_32s* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_PackToR_32f ( const Apl32f* pSrc , Apl32f* pDst , const AplsFFTSpec_R_32f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_PackToR_64f ( const Apl64f* pSrc , Apl64f* pDst , const AplsFFTSpec_R_64f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_PackToR_16s_ISfs ( Apl16s* pSrcDst , const AplsFFTSpec_R_16s* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_PackToR_32s_ISfs ( Apl32s* pSrcDst , const AplsFFTSpec_R_32s* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_PackToR_32f_I ( Apl32f* pSrcDst , const AplsFFTSpec_R_32f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_PackToR_64f_I ( Apl64f* pSrcDst , const AplsFFTSpec_R_64f* pFFTSpec , Apl8u* pBuffer );<br />

Parameters<br />

pBuffer Pointer to the FFT work buffer.<br />

pDst Pointer to a destination buffer.<br />

pFFTSpec Pointer to the FFT specification structure.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through a source buffer, calculate the inverse FFT of a complex signal in Pack format, and write a real number<br />

result. The forward Fourier transform of a real signal is in the Hermitian complex form. Inverse Fourier transformation of an Hermitian<br />

complex signal results in a real signal. Results can be written to a destination buffer or written back to the source buffer. The pointer<br />

pBuffer specifies the work buffer required for the FFT operation. When the value of pBuffer is NULL, memory is internally allocated.<br />

Return Values<br />

aplStsContextMatchErr The specification structure does not match the function or is invalid.<br />

aplStsMemAllocErr The function failed to allocate memory.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 140 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FFTInv_PermToR<br />

FFT inverse complex Perm to real<br />

Synopsis<br />

AplStatus aplsFFTInv_PermToR_16s_Sfs ( const Apl16s* pSrc , Apl16s* pDst , const AplsFFTSpec_R_16s* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_PermToR_32s_Sfs ( const Apl32s* pSrc , Apl32s* pDst , const AplsFFTSpec_R_32s* pFFTSpec , int scaleFactor ,<br />

Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_PermToR_32f ( const Apl32f* pSrc , Apl32f* pDst , const AplsFFTSpec_R_32f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_PermToR_64f ( const Apl64f* pSrc , Apl64f* pDst , const AplsFFTSpec_R_64f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_PermToR_16s_ISfs ( Apl16s* pSrcDst , const AplsFFTSpec_R_16s* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_PermToR_32s_ISfs ( Apl32s* pSrcDst , const AplsFFTSpec_R_32s* pFFTSpec , int scaleFactor , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_PermToR_32f_I ( Apl32f* pSrcDst , const AplsFFTSpec_R_32f* pFFTSpec , Apl8u* pBuffer );<br />

AplStatus aplsFFTInv_PermToR_64f_I ( Apl64f* pSrcDst , const AplsFFTSpec_R_64f* pFFTSpec , Apl8u* pBuffer );<br />

Parameters<br />

pBuffer Pointer to the FFT work buffer.<br />

pDst Pointer to a destination buffer.<br />

pFFTSpec Pointer to the FFT specification structure.<br />

pSrc Pointer to a source buffer.<br />

pSrcDst Pointer to a buffer that is both the source and destination.<br />

Specifies the integer scaling factor for the Sfs operation. The returned result is<br />

scaleFactor<br />

multiplied by 2^(-scaleFactor).<br />

Description<br />

These functions step through a source buffer, calculate the inverse FFT of a complex signal in Perm format, and write a real number<br />

result. The forward Fourier transform of a real signal is in the Hermitian complex form. Inverse Fourier transformation of an Hermitian<br />

complex signal results in a real signal. Results can be written to a destination buffer or written back to the source buffer. The pointer<br />

pBuffer specifies the work buffer required for the FFT operation. When the value of pBuffer is NULL, memory is internally allocated.<br />

Return Values<br />

aplStsContextMatchErr The specification structure does not match the function or is invalid.<br />

aplStsMemAllocErr The function failed to allocate memory.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 141 Signal Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Image Processing <strong>Library</strong><br />

Introduction<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> (APL) image library functions perform image processing and video related tasks.<br />

This section of the manual describes each of the image processing functions in detail.<br />

Organization<br />

Two introductory chapters are followed by chapters that describe groups of functions related by purpose.<br />

• This Introduction provides a brief summary of the section.<br />

• Basic Concepts provides an overview of the information contained in the functional descriptions.<br />

• <strong>Library</strong> Version describes the function that returns information about the current version of the APL.<br />

• Support Functions describes functions that are used to set up or maintain other APL functions.<br />

• Data Exchange and Initialization Functions describes functions that set the initial value of an image data buffer, copy data<br />

from one buffer to another, convert data type, and scale image data.<br />

• Arithmetic and Logic Functions describes general-purpose mathematic functions and functions that perform specific<br />

mathematic operations related to image processing.<br />

• Color Model Conversion Functions describes functions that convert image data from one color model or space to another.<br />

• Threshold and Compare Functions describes functions that compare image data and manipulate image data based on<br />

compare operations.<br />

• Geometric Transform Functions describes functions that warp, shear, resize, mirror, and rotate images.<br />

• Digital Filter Functions describes functions that alter frequency-related visual properties of images.<br />

• Video Coding Functions describes functions that are used to encode and decode moving images.<br />

Within the chapters, each functional description consists ofa Function Name followed by a short description, a Synopsis of the<br />

function syntax , a list of function Parameters, a detailed Description of the function, and a list of Return Values.<br />

Basic Concepts<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 142 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Image library functional descriptions include the following types of information.<br />

Data Structures<br />

Image library function definitions use the following data structures.<br />

ApliPoint The point represented by (x, y).<br />

ApliRect The position and size of a rectangle represented by (x, y, width, height).<br />

ApliSize The size of a rectangle represented by (width, height).<br />

Enumerators<br />

Image library function definitions use the following enumerators.<br />

ApliAlphaType Type of compositing operation for alpha composition functions.<br />

ApliAxis Image intensity ramp for apliImageRamp functions or flip axes for apliMirror functions.<br />

ApliBorderType Border type for filter functions.<br />

ApliMaskSize Neighborhood area for filter functions.<br />

Color Channel Buffers<br />

Image library function definitions use the following color channel buffer types.<br />

C1 Single-channel color<br />

C2 Two-channel color<br />

C3 Three-channel color<br />

C4 Four-channel color<br />

AC4 Three-channel color with an additional alpha (transparency) channel<br />

A channel is a pixel-ordered grayscale representation of a single color. The RGB color model uses three channels, one each for red,<br />

green, and blue color data. RGBA adds a fourth channel for transparency.<br />

Image processing functions generally show source and destination buffers in a combined pair, such as C4P4. Use of a single buffer<br />

type indicates that the source and destination buffers are of the same type or that a function writes data back to the source location.<br />

Color Plane Buffers<br />

Image library functions use the following color plane buffer types.<br />

P1 Single-plane color<br />

P3 Three-plane color<br />

P4 Four-plane color<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 143 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Planes map color spaces. A color space is defined by a color model and a gamut, or range of colors. Many color spaces can be<br />

represented by three planes (XYZ coordinated), but there are spaces of greater and lesser dimensions. A single-plane color can be<br />

viewed as a slice through a larger color space.<br />

Functions generally show source and destination buffers in a combined pair, such as P4C4. Use of a single buffer type indicates either<br />

that the source and destination buffers are of the same type, or that the function writes data back to the source buffer.<br />

Regions of Interest<br />

Many image library functions use the concept of a Region of Interest (ROI). A programmer can choose to manipulate specific regions of<br />

an image buffer rather than an entire image. The following figure shows an ROI for a typical in-place (same source and destination)<br />

operation.<br />

The outer rectangle represents an image buffer. The inner grey rectangle represents the ROI inside the buffer.<br />

Four pieces of information define the ROI:<br />

1. A pointer to the starting pixel of the ROI (pSrcDstStep)<br />

2. The number of bytes from starting pixel of ROI to the end of that image row (srcDstStep)<br />

3. Then number of pixels in one row of the ROI (roiSize.width)<br />

4. The number of pixels in one column of the ROI (roiSize.height)<br />

ROIs for operations that use separate source and destination buffers are defined in the same way.<br />

Image Masking<br />

Some image library functions work with image masks. In an iterative operation that involves image buffers, it may be necessary to<br />

skip operating on certain portions of the ROI. This is accomplished by using a mask of the same size as the ROI. When a mask is used,<br />

the function writes a result to a destination pixel only when the corresponding pixel value in the mask is non-zero. The function does<br />

not write a result to a destination pixel when the corresponding pixel value in the mask is zero.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 144 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Borders in Image Functions<br />

Many of the APL image functions require a source image to have a defined border area. This is because the functions use neighboring<br />

values to calculate a destination value.<br />

For example, the FilterSharpen function always uses a 3X3 kernel mask with the anchor in the center, location (1,1) in zero-based<br />

coordinates, relative to the top left corner of the mask. This means that the source image must have a complete one-pixel border on<br />

both sides, top and bottom.<br />

Consider a Filter32f function with variable-size mask and anchor:<br />

Let the source image be 19 X 17 pixels.<br />

Let the mask size be 4 X 5 pixels.<br />

Let the anchor coordinates be (2,1) relative to the top left corner.<br />

The maximum ROI size that can be safely used with the source image is 16 X 13 pixels, and the minimum destination image<br />

size is 16 X 13.<br />

The following diagram illustrates these concepts. It shows a source image with borders, a destination image, and a kernel mask with<br />

an anchor point.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 145 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Anchor<br />

Mask<br />

Source Data<br />

Border<br />

Destination Data<br />

Most functions that operate on borders assume the image buffer pointer initially points to the first pixel of the non-border area. In<br />

other words, the functions assume that locations in memory before the initial pointer location contain border data.<br />

Assume that:<br />

Wsrc and Hsrc are the width and height of the source image in pixels.<br />

Wmask and Hmask are the width and height of the mask in pixels.<br />

Xanchor and Yanchor are the zero-based coordinates of the anchor point, relative to the top left corner of the mask.<br />

Channels is the number of channels in the image (in non-planar format).<br />

ElementSize is the size of a single value in the source image, for example, four (bytes) for single precision floating point.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 146 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

The following formulas calculate the offset from the top left corner of the image to the top left corner of the non-border area of the<br />

image<br />

Where:<br />

Offset = StepSizesrcX Yanchor + Xanchor X Channels X ElementSize<br />

StepSizesrc = Wsrc X Channels X ElementSize<br />

Maximum ROI size is:<br />

WROI = Wsrc - Wmask + 1<br />

HROI = Hsrc - Hmask + 1<br />

The destination image size is at least the size of the ROI.<br />

Some APL functions assume that the anchor coordinates are relative to the bottom right corner of the mask.In this case, the formulas<br />

must be modified accordingly.<br />

It is possible to have a source image with a much larger StepSizesrc value than specified in the formula.This typically occurs when<br />

using an APL function to process a small part of a source image. In this case, the Offset value can also be much larger, pointing<br />

somewhere in the middle of the source image data buffer. The developer must make sure there is a safe border area around the image<br />

that the function can safely read and, in some cases, modify.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 147 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameter Glossary<br />

Image library function definitions use the following parameters.<br />

Al Progressive JPEG successive approximation parameter for actual point transform.<br />

EdgePelCount Specifies the minimum number of pairs of elements that differ by more than EdgePelDifference.<br />

EdgePelDifference Specifies the edge difference threshold between neighboring elements.<br />

Se Progressive JPEG spectral selection end index.<br />

Ss Progressive JPEG spectral selection start index.<br />

alpha Alpha (RGBA transparency) constant value.<br />

anchor A pixel locating the kernel (mask) according to source image.<br />

angle Specifies the rotation angle in degrees, counterclockwise.<br />

aplCmpOp<br />

Specifies a comparison operation to be performed (aplCmpLess, aplCmpGreater, aplCmpLessEq, aplCmpEq, or<br />

aplCmpGreaterEq).<br />

axis An enumeration describing the type of gradiation in ImageRamp functions.<br />

bFlushState Indicator for last 8X8 block in a scan.<br />

border The set of source image boundary pixels.<br />

borderType Specifies a boundary type.<br />

borderValue A constant value assigned to the pixels in a constant border (not used by any other border type).<br />

borderValue[3] A three-channel constant value assigned to the pixels in a constant border (not used by any other border type).<br />

bound[2][2] Boundary rectangle vertex coordinates for a transformed source ROI.<br />

coeffs[2][3] Coefficients for Warp Affine transform.<br />

coeffs[2][4] Coefficients for Warp Affine Bilinear transform.<br />

coeffs[3][3] Coefficients for Warp Affine Perspective transform.<br />

const Constant value.<br />

divisor An integer value by which the result is divided.<br />

dst1Step Destination buffer one step size (width of the buffer in bytes).<br />

dst2Step Destination buffer two step size (width of the buffer in bytes).<br />

dstDiffStep Destination block step size (width of the block in bytes).<br />

dstLenBytes Destination buffer length in bytes.<br />

dstOrder[3]<br />

Specifies destination buffer channel order. For example, dstOrder[1]= 0 indicates that source channel 0 is destination<br />

channel 1.<br />

dstPredictorStep Destination predictor block step size (width of the block in bytes).<br />

dstQuad[4][2] Destination quadrangle vertex coordinates.<br />

dstRoi Destination image ROI.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 148 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

dstRoiSize Destination image ROI size.<br />

dstSize Destination image size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

dstStep[3] Destination three-channel planar buffer step size (array values define width of each plane in bytes).<br />

eps Tolerance value.<br />

flip Image mirror flip mode.<br />

heightPixels Height of image (number of pixels in one column of image).<br />

hint Suggests a level of precision using one of the following values (aplAlgHintNone, aplAlgHintFast, aplAlgHintAccurate).<br />

imgSize Specifies the dimensions of an entire image.<br />

interpolation Specifies the method of interpolation.<br />

kernelSize Size of the kernel used in the calculations.<br />

mask An analysis window (only non-zero mask array values are processed).<br />

maskSize Size of the mask used in the calculations.<br />

maskStep Mask buffer step size in bytes (width of the buffer in bytes).<br />

mcType Specifies the type of prediction used for motion compensation.<br />

mcTypeB Specifies the type of prediction used for backward frame motion compensation.<br />

mcTypeF Specifies the type of prediction used for forward frame motion compensation.<br />

nChannel Number of channels in the image.<br />

offset A floating-point value describing the starting value for ImageRamp functions.<br />

pAcStatistics[256] Pointer to Huffman symbol statistics for AC coefficient.<br />

pAcTable Pointer to the Huffman AC coefficient table.<br />

pBuffer Pointer to the location of a temporary buffer.<br />

pBufferSize Pointer to the size of a temporary buffer.<br />

pDcStatistics[256] Pointer to Huffman symbol statistics for DC coefficient.<br />

pDcTable Pointer to the Huffman DC coefficient table.<br />

pDecHuffSpec Pointer to the ApliDecodeHuffmanSpec structure.<br />

pDecHuffState Pointer to the ApliDecodeHuffmanState structure.<br />

pDiff Pointer to an array of size 16 that contains the sums of 4X4 difference block coefficients.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst1 Pointer to a location in destination buffer one.<br />

pDst2 Pointer to a location in destination buffer two.<br />

pDstBGR Pointer to destination image ROI for BGR image format.<br />

pDstBitsLen Pointer to destination buffer length in bits.<br />

pDstCMYK Pointer to destination image ROI for CMYK image format.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 149 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

pDstCMYK[4] Pointer to destination image ROI for CMYK image format (four-channel planar).<br />

pDstCurrPos Pointer to the shift value at the current destination buffer in bytes.<br />

pDstDiff Pointer to a block of size 16X16 in the destination plane which contains difference between the current and reference blocks.<br />

pDstMCU[3] Array of pointers to destination MCU image blocks.<br />

pDstMCU[4] Array of pointers to destination MCU image blocks.<br />

pDstPredictor Pointer to a destination predictor block.<br />

pDstRGB Pointer to destination image ROI for RGB image format.<br />

pDstRGB[3] Pointer to destination image ROI for RGB image format (three-channel planar).<br />

pDstSAD Pointer to a destination array of size 4 that stores SAD values.<br />

pDstY Pointer to destination image ROI for grayscale image format.<br />

pDstYCCK[4] Pointer to destination image ROI for YCCK image format (four-channel planar).<br />

pDstYCbCr[3] Pointer to destination image ROI for YCbCr image format (three-channel planar).<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pEncHuffSpec Pointer to the ApliEncodeHuffmanSpec structure.<br />

pEncHuffState Pointer to the ApliEncodeHuffmanState structure.<br />

pKernel Pointer to the kernel array.<br />

pLastDC Pointer to the last DC coefficient, which is in the previous 8X8 block.<br />

pListBits Pointer to the Bits list.<br />

pListVals Pointer to the Vals list.<br />

pMarker Pointer to the JPEG marker position.<br />

pMask Pointer to a location in a buffer that contains a mask to be used in the operation.<br />

pMean Pointer to a computed mean of pixel values.<br />

pNumValidPrefetchedBits Pointer to the value of valid bits in the prefetch buffer.<br />

pPred Pointer to a 16x16 predictor block in the reference plane.<br />

pPrefetchedBits Pointer to the prefetch buffer, which contains decoded data from the previous block.<br />

pQuantFwdTable Pointer to the forward quantization table (encoder).<br />

pQuantInvTable Pointer to the inverse quantization table (decoder).<br />

pQuantRawTable Pointer to the raw quantization table.<br />

pRef Pointer to a prefetch buffer which contains previously decoded bits.<br />

pRefB Pointer to a backward reference block of specified size.<br />

pRefF Pointer to a forward reference block of specified size.<br />

pRes Pointer to a result value.<br />

pSAD Pointer to an SAD result.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 150 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

pSize Pointer to the size of an internal structure.<br />

pSqrDiff Pointer to a sum of square differences of all the elements in the current and reference blocks.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc1 Pointer to a location in source buffer one.<br />

pSrc2 Pointer to a location in source buffer two.<br />

pSrcBGR Pointer to source image ROI for BGR image format.<br />

pSrcBitsLen Pointer to the source buffer length in bits.<br />

pSrcCMYK Pointer to source image ROI for CMYK image format.<br />

pSrcCMYK[4] Pointer to source image ROI for CMYK image format (four-channel planar).<br />

pSrcCur Pointer to a block in the current plane.<br />

pSrcCurrPos Pointer to the shift value at the current source buffer in bytes.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

pSrcMCU[3] Array of pointers to source MCU image blocks.<br />

pSrcMCU[4] Array of pointers to source MCU image blocks.<br />

pSrcRGB Pointer to source image ROI for RGB image format.<br />

pSrcRGB[3] Pointer to source image ROI for RGB image format (three-channel planar).<br />

pSrcRef Pointer to a block in the reference plane.<br />

pSrcRefB Pointer to a backward block in the reference plane.<br />

pSrcRefF Pointer to a forward block in the reference plane.<br />

pSrcSum Pointer to a sum of pixel values for the current block.<br />

pSrcYCCK[4] Pointer to source image ROI for YCCK image format (four-channel planar).<br />

pSrcYCbCr[3] Pointer to source image ROI for YCbCr image format (three-channel planar).<br />

pSrcYData Pointer to a block of inverse DCT output data.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

pState Pointer to the morphology state structure.<br />

pStatistics[256] Pointer to Huffman symbol statistics.<br />

pStepBytes Pointer to the step size specified in bytes.<br />

pSums Pointer to an array of size 256 that contains a sequence of 4X4 residual blocks.<br />

pVar Pointer to a variance value.<br />

ppDst Double pointer to the destination image ROI.<br />

ppState Double pointer to the morphology state structure.<br />

predStep Reference plane step size (in bytes).<br />

ptr Pointer to buffer.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 151 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

pxMap Pointer to X axis mapping table array.<br />

pyMap Pointer to Y axis mapping table array.<br />

quad[4][2] Quadrangle vertex coordinates.<br />

qualityFactor JPEG image quality factor between 1 and 100.<br />

refStep Reference block step size (width of the block in bytes).<br />

refStepB Backward reference frame reference block step size (width of the block in bytes).<br />

refStepF Forward reference frame reference block step size (width of the block in bytes).<br />

roiSize Specifies the height and width of an ROI.<br />

roiWidth Width of ROI image in pixels.<br />

roundControl Specifies the type of rounding used for half-pixel approximation.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

slope A floating-point value describing the amount of gradiation in ImageRamp functions.<br />

src1Step Source buffer one step size (width of the buffer in bytes).<br />

src2Step Source buffer two step size (width of the buffer in bytes).<br />

srcCurStep Source current block step size (width of the block in bytes)<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcLenBytes Source buffer length in bytes.<br />

srcQuad[4][2] Source quadrangle vertex coordinates.<br />

srcRefStep Source reference block step size (width of the block in bytes)<br />

srcRefStepB Source backward reference block step size (width of the block in bytes)<br />

srcRefStepF Source forward reference block step size (width of the block in bytes)<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcSize1 Specifies the size of source image one.<br />

srcSize2 Specifies the size of source image two.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

srcStep1 Source image one step size (width of the buffer in bytes).<br />

srcStep2 Source image two step size (width of the buffer in bytes).<br />

srcStepB Source aligned backward reference frame step size (width in bytes).<br />

srcStepF Source aligned forward reference frame step size (width in bytes).<br />

srcStep[3] Source three-channel planar buffer step size (array values define width of each plane in bytes).<br />

srcWidth Width of the source row in pixels.<br />

srcYDataStep Source aligned DCT output data block step size (width of the block in bytes).<br />

threshold Threshold for each pixel.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 152 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

thresholdGT Three-channel threshold for each pixel in greater-than operation.<br />

thresholdGT[3] Three-channel threshold for each pixel in greater-than operation.<br />

thresholdLT Threshold for each pixel in less-than operation.<br />

thresholdLT[3] Three-channel threshold for each pixel in less-than operation.<br />

threshold[3] Three-channel threshold for each pixel.<br />

threshold[4] Four-channel threshold for each pixel.<br />

vMax Maximum value.<br />

vMin Minimum value.<br />

value Specified value.<br />

valueGT Threshold for each pixel in greater-than operation.<br />

valueGT[3] Three-channel threshold for each pixel in greater-than operation.<br />

valueLT Threshold for each pixel in less-than operation.<br />

valueLT[3] Three-channel threshold for each pixel in less-than operation.<br />

value[3] An array of three specified values.<br />

value[4] An array of four specified values.<br />

widthPixels Width of image (number of pixels in one row of image).<br />

xAnchor Anchor cell that specifies the horizontal alignment of the kernel with respect to the input pixel.<br />

xCenter X coordinate of center.<br />

xFactor Factor value for X axis direction.<br />

xFr Inverse factor value for X axis direction.<br />

xMapStep X axis mapping table step size (width of the buffer in bytes).<br />

xShear Shear value for X axis in Shear transformation.<br />

xShift Shift value for X axis direction.<br />

yAnchor Anchor cell that specifies the vertical alignment of the kernel with respect to the input pixel.<br />

yCenter Y coordinate of center.<br />

yFactor Factor value for Y axis direction .<br />

yFr Inverse factor value for Y axis direction .<br />

yMapStep Y axis mapping table step size (width of the buffer in bytes).<br />

yShear Shear value for Y axis in Shear transformation.<br />

yShift Shift value for Y axis direction.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 153 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

<strong>Library</strong> Version<br />

This chapter describes the APL function that provides library version information.<br />

GetLibVersion<br />

Get library version<br />

Synopsis<br />

const Apl<strong>Library</strong>Version* apliGetLibVersion ( );<br />

const Apl<strong>Library</strong>Version* apljGetLibVersion ( );<br />

const Apl<strong>Library</strong>Version* aplcvGetLibVersion ( );<br />

const Apl<strong>Library</strong>Version* aplvcGetLibVersion ( );<br />

const Apl<strong>Library</strong>Version* aplccGetLibVersion ( );<br />

Description<br />

This function returns a pointer to the Apl<strong>Library</strong>Version structure that contains APL <strong>Library</strong> version information.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 154 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Support Functions<br />

This chapters describes APL functions that support other APL functions.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 155 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Malloc<br />

Memory allocation<br />

Synopsis<br />

Apl8u* apliMalloc_8u_C1 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl8u* apliMalloc_8u_C2 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl8u* apliMalloc_8u_C3 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl8u* apliMalloc_8u_C4 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl8u* apliMalloc_8u_AC4 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl16u* apliMalloc_16u_C1 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl16u* apliMalloc_16u_C2 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl16u* apliMalloc_16u_C3 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl16u* apliMalloc_16u_C4 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl16u* apliMalloc_16u_AC4 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl16s* apliMalloc_16s_C1 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl16s* apliMalloc_16s_C2 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl16s* apliMalloc_16s_C3 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl16s* apliMalloc_16s_C4 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl16s* apliMalloc_16s_AC4 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32s* apliMalloc_32s_C1 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32s* apliMalloc_32s_C2 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32s* apliMalloc_32s_C3 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32s* apliMalloc_32s_C4 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32s* apliMalloc_32s_AC4 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32f* apliMalloc_32f_C1 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32f* apliMalloc_32f_C2 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32f* apliMalloc_32f_C3 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32f* apliMalloc_32f_C4 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32f* apliMalloc_32f_AC4 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32sc* apliMalloc_32sc_C1 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32sc* apliMalloc_32sc_C2 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32sc* apliMalloc_32sc_C3 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32sc* apliMalloc_32sc_C4 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32sc* apliMalloc_32sc_AC4 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32fc* apliMalloc_32fc_C1 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32fc* apliMalloc_32fc_C2 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32fc* apliMalloc_32fc_C3 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32fc* apliMalloc_32fc_C4 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

Apl32fc* apliMalloc_32fc_AC4 ( int widthPixels , int heightPixels , int* pStepBytes );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 156 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

heightPixels Height of image (number of pixels in one column of image).<br />

pStepBytes Pointer to the step size specified in bytes.<br />

widthPixels Width of image (number of pixels in one row of image).<br />

Description<br />

These functions allocate memory for image processing. Every row is aligned to 32-bit boundaries. Zero-padding is used to force<br />

alignment.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 157 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Free<br />

Free allocated memory<br />

Synopsis<br />

void STDCALL apliFree ( void* ptr );<br />

Parameters<br />

ptr Pointer to buffer.<br />

Description<br />

These functions free memory allocated by the Malloc( ) functions.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 158 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Image Data Exchange and Initialization Functions<br />

This chapter describes functions that set the initial value of an image data buffer, copy data from one buffer to another, convert data<br />

type, and scale image data.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 159 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Convert<br />

Convert data from one type to another<br />

Synopsis<br />

AplStatus apliConvert_8u16u_C1R ( const Apl8u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8u16u_C3R ( const Apl8u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8u16u_C4R ( const Apl8u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8u16u_AC4R ( const Apl8u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8u16s_C1R ( const Apl8u * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8u16s_C3R ( const Apl8u * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8u16s_C4R ( const Apl8u * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8u16s_AC4R ( const Apl8u * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8u32s_C1R ( const Apl8u * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8u32s_C3R ( const Apl8u * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8u32s_C4R ( const Apl8u * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8u32s_AC4R ( const Apl8u * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8s32s_C1R ( const Apl8s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8s32s_C3R ( const Apl8s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8s32s_C4R ( const Apl8s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8s32s_AC4R ( const Apl8s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16u32s_C1R ( const Apl16u * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16u32s_C3R ( const Apl16u * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16u32s_C4R ( const Apl16u * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16u32s_AC4R ( const Apl16u * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8u32f_C1R ( const Apl8u * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8u32f_C3R ( const Apl8u * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8u32f_C4R ( const Apl8u * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8u32f_AC4R ( const Apl8u * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8s32f_C1R ( const Apl8s * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8s32f_C3R ( const Apl8s * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8s32f_C4R ( const Apl8s * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_8s32f_AC4R ( const Apl8s * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16u32f_C1R ( const Apl16u * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16u32f_C3R ( const Apl16u * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16u32f_C4R ( const Apl16u * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16u32f_AC4R ( const Apl16u * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16s32f_C1R ( const Apl16s * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16s32f_C3R ( const Apl16s * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16s32f_C4R ( const Apl16s * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16s32f_AC4R ( const Apl16s * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16u8u_C1R ( const Apl16u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16u8u_C3R ( const Apl16u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16u8u_C4R ( const Apl16u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 160 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AplStatus apliConvert_16u8u_AC4R ( const Apl16u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16s8u_C1R ( const Apl16s * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16s8u_C3R ( const Apl16s * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16s8u_C4R ( const Apl16s * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_16s8u_AC4R ( const Apl16s * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_32s8u_C1R ( const Apl32s * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_32s8u_C3R ( const Apl32s * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_32s8u_C4R ( const Apl32s * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_32s8u_AC4R ( const Apl32s * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_32s8s_C1R ( const Apl32s * pSrc , int srcStep , Apl8s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_32s8s_C3R ( const Apl32s * pSrc , int srcStep , Apl8s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_32s8s_C4R ( const Apl32s * pSrc , int srcStep , Apl8s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliConvert_32s8s_AC4R ( const Apl32s * pSrc , int srcStep , Apl8s * pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data to another data type, and write the converted data to<br />

a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 161 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Copy<br />

Copy values from one buffer to another<br />

Synopsis<br />

AplStatus apliCopy_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_8u_C3AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_8u_AC4C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_8u_C1MR ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int<br />

maskStep );<br />

AplStatus apliCopy_8u_C3MR ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int<br />

maskStep );<br />

AplStatus apliCopy_8u_C4MR ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int<br />

maskStep );<br />

AplStatus apliCopy_8u_AC4MR ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int<br />

maskStep );<br />

AplStatus apliCopy_8u_C3CR ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_8u_C4CR ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_8u_C3C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_8u_C4C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_8u_C1C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_8u_C1C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_8u_C3P3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst[3] , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_8u_C4P4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst[4] , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_8u_P3C3R ( const Apl8u * const pSrc[3] , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_8u_P4C4R ( const Apl8u * const pSrc[4] , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_16s_C3AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_16s_AC4C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_16s_C1MR ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int<br />

maskStep );<br />

AplStatus apliCopy_16s_C3MR ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int<br />

maskStep );<br />

AplStatus apliCopy_16s_C4MR ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int<br />

maskStep );<br />

AplStatus apliCopy_16s_AC4MR ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask ,<br />

int maskStep );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 162 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AplStatus apliCopy_16s_C3CR ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_16s_C4CR ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_16s_C3C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_16s_C4C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_16s_C1C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_16s_C1C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_16s_C3P3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst[3] , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_16s_C4P4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst[4] , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_16s_P3C3R ( const Apl16s * const pSrc[3] , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_16s_P4C4R ( const Apl16s * const pSrc[4] , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32s_C1R ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32s_C3R ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32s_C4R ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32s_AC4R ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32s_C3AC4R ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32s_AC4C3R ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32s_C1MR ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int<br />

maskStep );<br />

AplStatus apliCopy_32s_C3MR ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int<br />

maskStep );<br />

AplStatus apliCopy_32s_C4MR ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int<br />

maskStep );<br />

AplStatus apliCopy_32s_AC4MR ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask ,<br />

int maskStep );<br />

AplStatus apliCopy_32s_C3CR ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32s_C4CR ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32s_C3C1R ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32s_C4C1R ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32s_C1C3R ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32s_C1C4R ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32s_C3P3R ( const Apl32s * pSrc , int srcStep , Apl32s * pDst[3] , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32s_C4P4R ( const Apl32s * pSrc , int srcStep , Apl32s * pDst[4] , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32s_P3C3R ( const Apl32s * const pSrc[3] , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32s_P4C4R ( const Apl32s * const pSrc[4] , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32f_C3AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32f_AC4C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32f_C1MR ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int<br />

maskStep );<br />

AplStatus apliCopy_32f_C3MR ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int<br />

maskStep );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 163 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AplStatus apliCopy_32f_C4MR ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int<br />

maskStep );<br />

AplStatus apliCopy_32f_AC4MR ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int<br />

maskStep );<br />

AplStatus apliCopy_32f_C3CR ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32f_C4CR ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32f_C3C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32f_C4C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32f_C1C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32f_C1C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32f_C3P3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst[3] , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32f_C4P4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst[4] , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32f_P3C3R ( const Apl32f * const pSrc[3] , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliCopy_32f_P4C4R ( const Apl32f * const pSrc[4] , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

maskStep Mask buffer step size in bytes (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pMask Pointer to a location in a buffer that contains a mask to be used in the operation.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer and copy the source data to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 164 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Swap<br />

Change channel order<br />

Synopsis<br />

AplStatus apliSwapChannels_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const int dstOrder[3]<br />

);<br />

AplStatus apliSwapChannels_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const int<br />

dstOrder[3] );<br />

AplStatus apliSwapChannels_16u_C3R ( const Apl16u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize , const int<br />

dstOrder[3] );<br />

AplStatus apliSwapChannels_16u_AC4R ( const Apl16u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize , const int<br />

dstOrder[3] );<br />

AplStatus apliSwapChannels_32s_C3R ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize , const int<br />

dstOrder[3] );<br />

AplStatus apliSwapChannels_32s_AC4R ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize , const int<br />

dstOrder[3] );<br />

AplStatus apliSwapChannels_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const int<br />

dstOrder[3] );<br />

AplStatus apliSwapChannels_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const int<br />

dstOrder[3] );<br />

AplStatus apliSwapChannels_8u_C3IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , const int dstOrder[3] );<br />

Parameters<br />

dstOrder[3] Specifies destination buffer channel order. For example, dstOrder[1]= 0 indicates that source channel 0 is destination channel 1.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, swap the source buffer channels as specified by the destination order, and<br />

write the channel data to the destination buffer. For example,dstOrder[1]= 0 => channel 0 in source buffer should be put into channel<br />

1 of destination buffer.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 165 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsChannelOrderErr The given destination order is not valid (contains values other than 0,1,2).<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 166 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Set<br />

Set buffer to a value<br />

Synopsis<br />

AplStatus apliSet_8u_C1R ( Apl8u value , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_8u_C3R ( const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_8u_AC4R ( const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_8u_C4R ( const Apl8u value[4] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_8u_C1MR ( Apl8u value , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int maskStep );<br />

AplStatus apliSet_8u_C3MR ( const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int maskStep );<br />

AplStatus apliSet_8u_AC4MR ( const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int maskStep );<br />

AplStatus apliSet_8u_C4MR ( const Apl8u value[4] , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int maskStep );<br />

AplStatus apliSet_8u_C3CR ( Apl8u value , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_8u_C4CR ( Apl8u value , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_16s_C1R ( Apl16s value , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_16s_C3R ( const Apl16s value[3] , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_16s_AC4R ( const Apl16s value[3] , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_16s_C4R ( const Apl16s value[4] , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_16s_C1MR ( Apl16s value , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int maskStep );<br />

AplStatus apliSet_16s_C3MR ( const Apl16s value[3] , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int maskStep );<br />

AplStatus apliSet_16s_AC4MR ( const Apl16s value[3] , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int maskStep<br />

);<br />

AplStatus apliSet_16s_C4MR ( const Apl16s value[4] , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int maskStep );<br />

AplStatus apliSet_16s_C3CR ( Apl16s value , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_16s_C4CR ( Apl16s value , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_32s_C1R ( Apl32s value , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_32s_C3R ( const Apl32s value[3] , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_32s_AC4R ( const Apl32s value[3] , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_32s_C4R ( const Apl32s value[4] , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_32s_C1MR ( Apl32s value , Apl32s * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int maskStep );<br />

AplStatus apliSet_32s_C3MR ( const Apl32s value[3] , Apl32s * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int maskStep );<br />

AplStatus apliSet_32s_AC4MR ( const Apl32s value[3] , Apl32s * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int maskStep<br />

);<br />

AplStatus apliSet_32s_C4MR ( const Apl32s value[4] , Apl32s * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int maskStep );<br />

AplStatus apliSet_32s_C3CR ( Apl32s value , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_32s_C4CR ( Apl32s value , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_32f_C1R ( Apl32f value , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_32f_C3R ( const Apl32f value[3] , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_32f_AC4R ( const Apl32f value[3] , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_32f_C4R ( const Apl32f value[4] , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_32f_C1MR ( Apl32f value , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int maskStep );<br />

AplStatus apliSet_32f_C3MR ( const Apl32f value[3] , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int maskStep );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 167 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AplStatus apliSet_32f_AC4MR ( const Apl32f value[3] , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int maskStep );<br />

AplStatus apliSet_32f_C4MR ( const Apl32f value[4] , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl8u * pMask , int maskStep );<br />

AplStatus apliSet_32f_C3CR ( Apl32f value , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSet_32f_C4CR ( Apl32f value , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

maskStep Mask buffer step size in bytes (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pMask Pointer to a location in a buffer that contains a mask to be used in the operation.<br />

roiSize Specifies the height and width of an ROI.<br />

value Specified value.<br />

value[3] An array of three specified values.<br />

value[4] An array of four specified values.<br />

Description<br />

These functions write a specified value to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 168 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Scale<br />

Scale buffer data<br />

Synopsis<br />

AplStatus apliScale_8u16u_C1R ( const Apl8u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliScale_8u16u_C3R ( const Apl8u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliScale_8u16u_C4R ( const Apl8u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliScale_8u16u_AC4R ( const Apl8u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliScale_8u16s_C1R ( const Apl8u * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliScale_8u16s_C3R ( const Apl8u * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliScale_8u16s_C4R ( const Apl8u * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliScale_8u16s_AC4R ( const Apl8u * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliScale_8u32s_C1R ( const Apl8u * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliScale_8u32s_C3R ( const Apl8u * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliScale_8u32s_C4R ( const Apl8u * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliScale_8u32s_AC4R ( const Apl8u * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliScale_8u32f_C1R ( const Apl8u * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , Apl32f vMin , Apl32f vMax<br />

);<br />

AplStatus apliScale_8u32f_C3R ( const Apl8u * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , Apl32f vMin , Apl32f vMax<br />

);<br />

AplStatus apliScale_8u32f_C4R ( const Apl8u * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , Apl32f vMin , Apl32f vMax<br />

);<br />

AplStatus apliScale_8u32f_AC4R ( const Apl8u * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , Apl32f vMin , Apl32f<br />

vMax );<br />

AplStatus apliScale_16u8u_C1R ( const Apl16u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , AplHintAlgorithm hint );<br />

AplStatus apliScale_16u8u_C3R ( const Apl16u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , AplHintAlgorithm hint );<br />

AplStatus apliScale_16u8u_C4R ( const Apl16u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , AplHintAlgorithm hint );<br />

AplStatus apliScale_16u8u_AC4R ( const Apl16u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , AplHintAlgorithm hint<br />

);<br />

AplStatus apliScale_16s8u_C1R ( const Apl16s * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , AplHintAlgorithm hint );<br />

AplStatus apliScale_16s8u_C3R ( const Apl16s * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , AplHintAlgorithm hint );<br />

AplStatus apliScale_16s8u_C4R ( const Apl16s * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , AplHintAlgorithm hint );<br />

AplStatus apliScale_16s8u_AC4R ( const Apl16s * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , AplHintAlgorithm hint );<br />

AplStatus apliScale_32s8u_C1R ( const Apl32s * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , AplHintAlgorithm hint );<br />

AplStatus apliScale_32s8u_C3R ( const Apl32s * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , AplHintAlgorithm hint );<br />

AplStatus apliScale_32s8u_C4R ( const Apl32s * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , AplHintAlgorithm hint );<br />

AplStatus apliScale_32s8u_AC4R ( const Apl32s * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , AplHintAlgorithm hint );<br />

AplStatus apliScale_32f8u_C1R ( const Apl32f * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , Apl32f vMin , Apl32f vMax<br />

);<br />

AplStatus apliScale_32f8u_C3R ( const Apl32f * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , Apl32f vMin , Apl32f vMax<br />

);<br />

AplStatus apliScale_32f8u_C4R ( const Apl32f * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , Apl32f vMin , Apl32f vMax<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 169 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

);<br />

AplStatus apliScale_32f8u_AC4R ( const Apl32f * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , Apl32f vMin , Apl32f<br />

vMax );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

hint Suggests a level of precision using one of the following values (aplAlgHintNone, aplAlgHintFast, aplAlgHintAccurate).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

vMax Maximum value.<br />

vMin Minimum value.<br />

Description<br />

These functions step through an ROI in a source buffer, scale the source data, and write the scaled data to a destination buffer. The<br />

output is scaled so that the median value in the source range is the median value in the destination range.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 170 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Arithmetic and Logic Functions<br />

This chapter describes general-purpose mathematic functions and functions that perform specific mathematic operations related to<br />

image processing.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 171 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Abs<br />

Get absolute value<br />

Synopsis<br />

AplStatus apliAbs_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAbs_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAbs_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAbs_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAbs_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAbs_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAbs_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAbs_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAbs_16s_C1IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAbs_16s_C3IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAbs_16s_C4IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAbs_16s_AC4IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAbs_32f_C1IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAbs_32f_C3IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAbs_32f_C4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAbs_32f_AC4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer and calculate the absolute value of the source data. The results can be written<br />

to a destination buffer, or back to the source buffer.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 172 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 173 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AbsDiff<br />

Absolute difference of two source values<br />

Synopsis<br />

AplStatus apliAbsDiff_8u_C1R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliAbsDiff_16u_C1R ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , Apl16u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliAbsDiff_32f_C1R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl32f * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc1 Pointer to a location in source buffer one.<br />

pSrc2 Pointer to a location in source buffer two.<br />

roiSize Specifies the height and width of an ROI.<br />

src1Step Source buffer one step size (width of the buffer in bytes).<br />

src2Step Source buffer two step size (width of the buffer in bytes).<br />

Description<br />

These functions step through ROIs in two source buffers, calculate the absolute value of the difference between the data in source<br />

buffer 1 and the data in source buffer 2, and write the results to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 174 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AbsDiffC<br />

Absolute difference of a source value and a constant<br />

Synopsis<br />

AplStatus apliAbsDiffC_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , int value );<br />

AplStatus apliAbsDiffC_16u_C1R ( const Apl16u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize , int value );<br />

AplStatus apliAbsDiffC_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , Apl32f value );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

value Specified value.<br />

Description<br />

These functions step through an ROI in a source buffer, calculate the absolute value of the difference between the source data and a<br />

specified constant, and write the result to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 175 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Add<br />

Add<br />

Synopsis<br />

AplStatus apliAdd_8u_C1IRSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_8u_C3IRSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_8u_C4IRSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_8u_AC4IRSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_8u_C1RSfs ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliAdd_8u_C3RSfs ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliAdd_8u_C4RSfs ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliAdd_8u_AC4RSfs ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_16s_C1IRSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_16s_C3IRSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_16s_C4IRSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_16s_AC4IRSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_16s_C1RSfs ( const Apl16s * pSrc1 , int src1Step , const Apl16s * pSrc2 , int src2Step , Apl16s * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_16s_C3RSfs ( const Apl16s * pSrc1 , int src1Step , const Apl16s * pSrc2 , int src2Step , Apl16s * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_16s_C4RSfs ( const Apl16s * pSrc1 , int src1Step , const Apl16s * pSrc2 , int src2Step , Apl16s * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_16s_AC4RSfs ( const Apl16s * pSrc1 , int src1Step , const Apl16s * pSrc2 , int src2Step , Apl16s * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_16sc_C1IRSfs ( const Apl16sc * pSrc , int srcStep , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliAdd_16sc_C3IRSfs ( const Apl16sc * pSrc , int srcStep , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliAdd_16sc_AC4IRSfs ( const Apl16sc * pSrc , int srcStep , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliAdd_16sc_C1RSfs ( const Apl16sc * pSrc1 , int src1Step , const Apl16sc * pSrc2 , int src2Step , Apl16sc * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_16sc_C3RSfs ( const Apl16sc * pSrc1 , int src1Step , const Apl16sc * pSrc2 , int src2Step , Apl16sc * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_16sc_AC4RSfs ( const Apl16sc * pSrc1 , int src1Step , const Apl16sc * pSrc2 , int src2Step , Apl16sc * pDst , int dstStep<br />

, ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_32sc_C1IRSfs ( const Apl32sc * pSrc , int srcStep , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 176 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AplStatus apliAdd_32sc_C3IRSfs ( const Apl32sc * pSrc , int srcStep , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliAdd_32sc_AC4IRSfs ( const Apl32sc * pSrc , int srcStep , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliAdd_32sc_C1RSfs ( const Apl32sc * pSrc1 , int src1Step , const Apl32sc * pSrc2 , int src2Step , Apl32sc * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_32sc_C3RSfs ( const Apl32sc * pSrc1 , int src1Step , const Apl32sc * pSrc2 , int src2Step , Apl32sc * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_32sc_AC4RSfs ( const Apl32sc * pSrc1 , int src1Step , const Apl32sc * pSrc2 , int src2Step , Apl32sc * pDst , int dstStep<br />

, ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAdd_32f_C1IR ( const Apl32f * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAdd_32f_C3IR ( const Apl32f * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAdd_32f_C4IR ( const Apl32f * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAdd_32f_AC4IR ( const Apl32f * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAdd_32f_C1R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl32f * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliAdd_32f_C3R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl32f * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliAdd_32f_C4R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl32f * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliAdd_32f_AC4R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl32f * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliAdd_32fc_C1IR ( const Apl32fc * pSrc , int srcStep , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAdd_32fc_C3IR ( const Apl32fc * pSrc , int srcStep , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAdd_32fc_AC4IR ( const Apl32fc * pSrc , int srcStep , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAdd_32fc_C1R ( const Apl32fc * pSrc1 , int src1Step , const Apl32fc * pSrc2 , int src2Step , Apl32fc * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliAdd_32fc_C3R ( const Apl32fc * pSrc1 , int src1Step , const Apl32fc * pSrc2 , int src2Step , Apl32fc * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliAdd_32fc_AC4R ( const Apl32fc * pSrc1 , int src1Step , const Apl32fc * pSrc2 , int src2Step , Apl32fc * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliAdd_8u32f_C1IR ( const Apl8u * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAdd_8s32f_C1IR ( const Apl8s * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAdd_16u32f_C1IR ( const Apl16u * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAdd_8u32f_C1IMR ( const Apl8u * pSrc , int srcStep , const Apl8u * pMask , int maskStep , Apl32f * pSrcDst , int srcDstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliAdd_8s32f_C1IMR ( const Apl8s * pSrc , int srcStep , const Apl8u * pMask , int maskStep , Apl32f * pSrcDst , int srcDstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliAdd_16u32f_C1IMR ( const Apl16u * pSrc , int srcStep , const Apl8u * pMask , int maskStep , Apl32f * pSrcDst , int<br />

srcDstStep , ApliSize roiSize );<br />

AplStatus apliAdd_32f_C1IMR ( const Apl32f * pSrc , int srcStep , const Apl8u * pMask , int maskStep , Apl32f * pSrcDst , int srcDstStep ,<br />

ApliSize roiSize );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 177 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

maskStep Mask buffer step size in bytes (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pMask Pointer to a location in a buffer that contains a mask to be used in the operation.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc1 Pointer to a location in source buffer one.<br />

pSrc2 Pointer to a location in source buffer two.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

src1Step Source buffer one step size (width of the buffer in bytes).<br />

src2Step Source buffer two step size (width of the buffer in bytes).<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through ROIs in two source buffers and add the data in buffer 2 to the data in buffer 1. The sum can be written<br />

back to the source location or to a destination buffer. The 8-bit unsigned, 16-bit signed, 16-bit signed complex, and 32-bit signed<br />

complex versions of the functions perform an integer scaling operation before writing the results. Other versions add signed and<br />

unsigned integers and write 32-bit floating point results; variations of these functions can also perform a masking operation before<br />

writing the results.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 178 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AddC<br />

Add constant<br />

Synopsis<br />

AplStatus apliAddC_8u_C1IRSfs ( Apl8u value , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAddC_8u_C3IRSfs ( const Apl8u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAddC_8u_AC4IRSfs ( const Apl8u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAddC_8u_C4IRSfs ( const Apl8u value[4] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAddC_8u_C1RSfs ( const Apl8u * pSrc , int srcStep , Apl8u value , Apl8u * pDst , int dstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliAddC_8u_C3RSfs ( const Apl8u * pSrc , int srcStep , const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliAddC_8u_AC4RSfs ( const Apl8u * pSrc , int srcStep , const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliAddC_8u_C4RSfs ( const Apl8u * pSrc , int srcStep , const Apl8u value[4] , Apl8u * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliAddC_16s_C1IRSfs ( Apl16s value , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAddC_16s_C3IRSfs ( const Apl16s value[3] , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAddC_16s_AC4IRSfs ( const Apl16s value[3] , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAddC_16s_C4IRSfs ( const Apl16s value[4] , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAddC_16s_C1RSfs ( const Apl16s * pSrc , int srcStep , Apl16s value , Apl16s * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliAddC_16s_C3RSfs ( const Apl16s * pSrc , int srcStep , const Apl16s value[3] , Apl16s * pDst , int dstStep , ApliSize roiSize ,<br />

int scaleFactor );<br />

AplStatus apliAddC_16s_AC4RSfs ( const Apl16s * pSrc , int srcStep , const Apl16s value[3] , Apl16s * pDst , int dstStep , ApliSize roiSize ,<br />

int scaleFactor );<br />

AplStatus apliAddC_16s_C4RSfs ( const Apl16s * pSrc , int srcStep , const Apl16s value[4] , Apl16s * pDst , int dstStep , ApliSize roiSize ,<br />

int scaleFactor );<br />

AplStatus apliAddC_16sc_C1IRSfs ( Apl16sc value , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAddC_16sc_C3IRSfs ( const Apl16sc value[3] , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAddC_16sc_AC4IRSfs ( const Apl16sc value[3] , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAddC_16sc_C1RSfs ( const Apl16sc * pSrc , int srcStep , Apl16sc value , Apl16sc * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliAddC_16sc_C3RSfs ( const Apl16sc * pSrc , int srcStep , const Apl16sc value[3] , Apl16sc * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliAddC_16sc_AC4RSfs ( const Apl16sc * pSrc , int srcStep , const Apl16sc value[3] , Apl16sc * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliAddC_32sc_C1IRSfs ( Apl32sc value , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAddC_32sc_C3IRSfs ( const Apl32sc value[3] , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAddC_32sc_AC4IRSfs ( const Apl32sc value[3] , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliAddC_32sc_C1RSfs ( const Apl32sc * pSrc , int srcStep , Apl32sc value , Apl32sc * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 179 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AplStatus apliAddC_32sc_C3RSfs ( const Apl32sc * pSrc , int srcStep , const Apl32sc value[3] , Apl32sc * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliAddC_32sc_AC4RSfs ( const Apl32sc * pSrc , int srcStep , const Apl32sc value[3] , Apl32sc * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliAddC_32f_C1IR ( Apl32f value , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddC_32f_C3IR ( const Apl32f value[3] , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddC_32f_AC4IR ( const Apl32f value[3] , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddC_32f_C4IR ( const Apl32f value[4] , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddC_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f value , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAddC_32f_C3R ( const Apl32f * pSrc , int srcStep , const Apl32f value[3] , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAddC_32f_AC4R ( const Apl32f * pSrc , int srcStep , const Apl32f value[3] , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAddC_32f_C4R ( const Apl32f * pSrc , int srcStep , const Apl32f value[4] , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAddC_32fc_C1IR ( Apl32fc value , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddC_32fc_C3IR ( const Apl32fc value[3] , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddC_32fc_AC4IR ( const Apl32fc value[3] , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddC_32fc_C1R ( const Apl32fc * pSrc , int srcStep , Apl32fc value , Apl32fc * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAddC_32fc_C3R ( const Apl32fc * pSrc , int srcStep , const Apl32fc value[3] , Apl32fc * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAddC_32fc_AC4R ( const Apl32fc * pSrc , int srcStep , const Apl32fc value[3] , Apl32fc * pDst , int dstStep , ApliSize roiSize<br />

);<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

value Specified value.<br />

value[3] An array of three specified values.<br />

value[4] An array of four specified values.<br />

Description<br />

These functions step through an ROI in a source buffer and add a specified constant value to the source data. The sum can be written<br />

back to the source location or to a destination buffer. The 8-bit unsigned, 16-bit signed, 16-bit signed complex, and 32-bit signed<br />

complex versions of the functions perform an integer scaling operation before writing the results.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 180 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 181 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AddProduct<br />

Add product<br />

Synopsis<br />

AplStatus apliAddProduct_8u32f_C1IR ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl32f * pSrcDst , int<br />

srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddProduct_8s32f_C1IR ( const Apl8s * pSrc1 , int src1Step , const Apl8s * pSrc2 , int src2Step , Apl32f * pSrcDst , int<br />

srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddProduct_16u32f_C1IR ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , Apl32f * pSrcDst , int<br />

srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddProduct_32f_C1IR ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl32f * pSrcDst , int<br />

srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddProduct_8u32f_C1IMR ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , const Apl8u* pMask ,<br />

int maskStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddProduct_8s32f_C1IMR ( const Apl8s * pSrc1 , int src1Step , const Apl8s * pSrc2 , int src2Step , const Apl8u* pMask , int<br />

maskStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddProduct_16u32f_C1IMR ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , const Apl8u* pMask<br />

, int maskStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddProduct_32f_C1IMR ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , const Apl8u* pMask , int<br />

maskStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

Parameters<br />

maskStep Mask buffer step size in bytes (width of the buffer in bytes).<br />

pMask Pointer to a location in a buffer that contains a mask to be used in the operation.<br />

pSrc1 Pointer to a location in source buffer one.<br />

pSrc2 Pointer to a location in source buffer two.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

src1Step Source buffer one step size (width of the buffer in bytes).<br />

src2Step Source buffer two step size (width of the buffer in bytes).<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

Description<br />

These functions step through ROIs in two source buffers, add the product of the data in buffer 1 and the data in buffer 2 to the data in<br />

buffer 1, and write the sum back to the source location. There are versions of the functions that perform a masking operation before<br />

writing the results.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 182 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 183 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AddSquare<br />

Add square<br />

Synopsis<br />

AplStatus apliAddSquare_8u32f_C1IR ( const Apl8u * pSrc , int srcStep , Apl32f* pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddSquare_8s32f_C1IR ( const Apl8s * pSrc , int srcStep , Apl32f* pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddSquare_16u32f_C1IR ( const Apl16u * pSrc , int srcStep , Apl32f* pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddSquare_32f_C1IR ( const Apl32f * pSrc , int srcStep , Apl32f* pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddSquare_8u32f_C1IMR ( const Apl8u * pSrc , int srcStep , const Apl8u* pMask , int maskStep , Apl32f* pSrcDst , int<br />

srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddSquare_8s32f_C1IMR ( const Apl8s * pSrc , int srcStep , const Apl8u* pMask , int maskStep , Apl32f* pSrcDst , int<br />

srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddSquare_16u32f_C1IMR ( const Apl16u * pSrc , int srcStep , const Apl8u* pMask , int maskStep , Apl32f* pSrcDst , int<br />

srcDstStep , ApliSize roiSize );<br />

AplStatus apliAddSquare_32f_C1IMR ( const Apl32f * pSrc , int srcStep , const Apl8u* pMask , int maskStep , Apl32f* pSrcDst , int<br />

srcDstStep , ApliSize roiSize );<br />

Parameters<br />

maskStep Mask buffer step size in bytes (width of the buffer in bytes).<br />

pMask Pointer to a location in a buffer that contains a mask to be used in the operation.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through ROIs in two source buffers, add the square of the data in buffer 1 to the data in buffer 2, and write the<br />

sum back to the source location. There are versions of the functions that perform a masking operation before writing the results.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 184 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AddWeighted<br />

Add weighted<br />

Synopsis<br />

AplStatus apliAddWeighted_8u32f_C1IR ( const Apl8u * pSrc , int srcStep , Apl32f* pSrcDst , int srcDstStep , ApliSize roiSize , Apl32f<br />

alpha );<br />

AplStatus apliAddWeighted_8s32f_C1IR ( const Apl8s * pSrc , int srcStep , Apl32f* pSrcDst , int srcDstStep , ApliSize roiSize , Apl32f alpha<br />

);<br />

AplStatus apliAddWeighted_16u32f_C1IR ( const Apl16u * pSrc , int srcStep , Apl32f* pSrcDst , int srcDstStep , ApliSize roiSize , Apl32f<br />

alpha );<br />

AplStatus apliAddWeighted_32f_C1IR ( const Apl32f * pSrc , int srcStep , Apl32f* pSrcDst , int srcDstStep , ApliSize roiSize , Apl32f alpha<br />

);<br />

AplStatus apliAddWeighted_8u32f_C1IMR ( const Apl8u * pSrc , int srcStep , const Apl8u* pMask , int maskStep , Apl32f* pSrcDst , int<br />

srcDstStep , ApliSize roiSize , Apl32f alpha );<br />

AplStatus apliAddWeighted_8s32f_C1IMR ( const Apl8s * pSrc , int srcStep , const Apl8u* pMask , int maskStep , Apl32f* pSrcDst , int<br />

srcDstStep , ApliSize roiSize , Apl32f alpha );<br />

AplStatus apliAddWeighted_16u32f_C1IMR ( const Apl16u * pSrc , int srcStep , const Apl8u* pMask , int maskStep , Apl32f* pSrcDst , int<br />

srcDstStep , ApliSize roiSize , Apl32f alpha );<br />

AplStatus apliAddWeighted_32f_C1IMR ( const Apl32f * pSrc , int srcStep , const Apl8u* pMask , int maskStep , Apl32f* pSrcDst , int<br />

srcDstStep , ApliSize roiSize , Apl32f alpha );<br />

Parameters<br />

alpha Alpha (RGBA transparency) constant value.<br />

maskStep Mask buffer step size in bytes (width of the buffer in bytes).<br />

pMask Pointer to a location in a buffer that contains a mask to be used in the operation.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through ROIs in two source buffers, multiply the data in buffer 1 by an alpha scaling factor, multiply the data in<br />

buffer 2 by a scaling factor of 1 minus alpha, add the two products, and write the sum back to the source location. There are versions<br />

of the functions that perform a masking operation before writing the results.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 185 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 186 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Div<br />

Divide<br />

Synopsis<br />

AplStatus apliDiv_8u_C1IRSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDiv_8u_C3IRSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDiv_8u_C1RSfs ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliDiv_8u_C3RSfs ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliDiv_16s_C1IRSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDiv_16s_C3IRSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDiv_16s_C1RSfs ( const Apl16s * pSrc1 , int src1Step , const Apl16s * pSrc2 , int src2Step , Apl16s * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDiv_16s_C3RSfs ( const Apl16s * pSrc1 , int src1Step , const Apl16s * pSrc2 , int src2Step , Apl16s * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDiv_16sc_C1IRSfs ( const Apl16sc * pSrc , int srcStep , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDiv_16sc_C3IRSfs ( const Apl16sc * pSrc , int srcStep , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDiv_16sc_AC4IRSfs ( const Apl16sc * pSrc , int srcStep , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliDiv_16sc_C1RSfs ( const Apl16sc * pSrc1 , int src1Step , const Apl16sc * pSrc2 , int src2Step , Apl16sc * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDiv_16sc_C3RSfs ( const Apl16sc * pSrc1 , int src1Step , const Apl16sc * pSrc2 , int src2Step , Apl16sc * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDiv_16sc_AC4RSfs ( const Apl16sc * pSrc1 , int src1Step , const Apl16sc * pSrc2 , int src2Step , Apl16sc * pDst , int dstStep<br />

, ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDiv_32sc_C1IRSfs ( const Apl32sc * pSrc , int srcStep , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDiv_32sc_C3IRSfs ( const Apl32sc * pSrc , int srcStep , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDiv_32sc_AC4IRSfs ( const Apl32sc * pSrc , int srcStep , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliDiv_32sc_C1RSfs ( const Apl32sc * pSrc1 , int src1Step , const Apl32sc * pSrc2 , int src2Step , Apl32sc * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDiv_32sc_C3RSfs ( const Apl32sc * pSrc1 , int src1Step , const Apl32sc * pSrc2 , int src2Step , Apl32sc * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDiv_32sc_AC4RSfs ( const Apl32sc * pSrc1 , int src1Step , const Apl32sc * pSrc2 , int src2Step , Apl32sc * pDst , int dstStep<br />

, ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDiv_32f_C1IR ( const Apl32f * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliDiv_32f_C3IR ( const Apl32f * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliDiv_32f_C4IR ( const Apl32f * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliDiv_32f_AC4IR ( const Apl32f * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliDiv_32f_C1R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl32f * pDst , int dstStep , ApliSize<br />

roiSize );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 187 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AplStatus apliDiv_32f_C3R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl32f * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliDiv_32f_C4R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl32f * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliDiv_32f_AC4R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl32f * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliDiv_32fc_C1IR ( const Apl32fc * pSrc , int srcStep , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliDiv_32fc_C3IR ( const Apl32fc * pSrc , int srcStep , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliDiv_32fc_AC4IR ( const Apl32fc * pSrc , int srcStep , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliDiv_32fc_C1R ( const Apl32fc * pSrc1 , int src1Step , const Apl32fc * pSrc2 , int src2Step , Apl32fc * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliDiv_32fc_C3R ( const Apl32fc * pSrc1 , int src1Step , const Apl32fc * pSrc2 , int src2Step , Apl32fc * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliDiv_32fc_AC4R ( const Apl32fc * pSrc1 , int src1Step , const Apl32fc * pSrc2 , int src2Step , Apl32fc * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc1 Pointer to a location in source buffer one.<br />

pSrc2 Pointer to a location in source buffer two.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

src1Step Source buffer one step size (width of the buffer in bytes).<br />

src2Step Source buffer two step size (width of the buffer in bytes).<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through ROIs in two source buffers and divide the data in buffer 1 by the data in buffer 2. The quotient can be<br />

written back to the source location or to a destination buffer. The 8-bit unsigned, 16-bit signed, 16-bit signed complex, and 32-bit<br />

signed complex versions of the functions perform an integer scaling operation before writing the results.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 188 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 189 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

DivC<br />

Divide by a constant<br />

Synopsis<br />

AplStatus apliDivC_8u_C1IRSfs ( Apl8u value , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDivC_8u_C3IRSfs ( const Apl8u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDivC_8u_AC4IRSfs ( const Apl8u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDivC_8u_C1RSfs ( const Apl8u * pSrc , int srcStep , Apl8u value , Apl8u * pDst , int dstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliDivC_8u_C3RSfs ( const Apl8u * pSrc , int srcStep , const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliDivC_8u_AC4RSfs ( const Apl8u * pSrc , int srcStep , const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliDivC_16s_C1IRSfs ( Apl16s value , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDivC_16s_C3IRSfs ( const Apl16s value[3] , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDivC_16s_AC4IRSfs ( const Apl16s value[3] , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDivC_16s_C1RSfs ( const Apl16s * pSrc , int srcStep , Apl16s value , Apl16s * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliDivC_16s_C3RSfs ( const Apl16s * pSrc , int srcStep , const Apl16s value[3] , Apl16s * pDst , int dstStep , ApliSize roiSize ,<br />

int scaleFactor );<br />

AplStatus apliDivC_16s_AC4RSfs ( const Apl16s * pSrc , int srcStep , const Apl16s value[3] , Apl16s * pDst , int dstStep , ApliSize roiSize ,<br />

int scaleFactor );<br />

AplStatus apliDivC_16sc_C1IRSfs ( Apl16sc value , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDivC_16sc_C3IRSfs ( const Apl16sc value[3] , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDivC_16sc_AC4IRSfs ( const Apl16sc value[3] , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDivC_16sc_C1RSfs ( const Apl16sc * pSrc , int srcStep , Apl16sc value , Apl16sc * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliDivC_16sc_C3RSfs ( const Apl16sc * pSrc , int srcStep , const Apl16sc value[3] , Apl16sc * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliDivC_16sc_AC4RSfs ( const Apl16sc * pSrc , int srcStep , const Apl16sc value[3] , Apl16sc * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliDivC_32sc_C1IRSfs ( Apl32sc value , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDivC_32sc_C3IRSfs ( const Apl32sc value[3] , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDivC_32sc_AC4IRSfs ( const Apl32sc value[3] , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliDivC_32sc_C1RSfs ( const Apl32sc * pSrc , int srcStep , Apl32sc value , Apl32sc * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliDivC_32sc_C3RSfs ( const Apl32sc * pSrc , int srcStep , const Apl32sc value[3] , Apl32sc * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliDivC_32sc_AC4RSfs ( const Apl32sc * pSrc , int srcStep , const Apl32sc value[3] , Apl32sc * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliDivC_32f_C1IR ( Apl32f value , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliDivC_32f_C3IR ( const Apl32f value[3] , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 190 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AplStatus apliDivC_32f_AC4IR ( const Apl32f value[3] , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliDivC_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f value , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliDivC_32f_C3R ( const Apl32f * pSrc , int srcStep , const Apl32f value[3] , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliDivC_32f_AC4R ( const Apl32f * pSrc , int srcStep , const Apl32f value[3] , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliDivC_32fc_C1IR ( Apl32fc value , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliDivC_32fc_C3IR ( const Apl32fc value[3] , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliDivC_32fc_AC4IR ( const Apl32fc value[3] , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliDivC_32fc_C1R ( const Apl32fc * pSrc , int srcStep , Apl32fc value , Apl32fc * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliDivC_32fc_C3R ( const Apl32fc * pSrc , int srcStep , const Apl32fc value[3] , Apl32fc * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliDivC_32fc_AC4R ( const Apl32fc * pSrc , int srcStep , const Apl32fc value[3] , Apl32fc * pDst , int dstStep , ApliSize roiSize<br />

);<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

value Specified value.<br />

value[3] An array of three specified values.<br />

Description<br />

These functions step through an ROI in a source buffer and divide the source data by a constant value. The quotient can be written<br />

back to the source location or to a destination buffer. The 8-bit unsigned, 16-bit signed, 16-bit signed complex, and 32-bit signed<br />

complex versions of the functions perform an integer scaling operation before writing the results.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 191 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Exp<br />

Raise base e to a power<br />

Synopsis<br />

AplStatus apliExp_8u_C1IRSfs ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliExp_8u_C3IRSfs ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliExp_8u_C1RSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliExp_8u_C3RSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliExp_16s_C1IRSfs ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliExp_16s_C3IRSfs ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliExp_16s_C1RSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliExp_16s_C3RSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliExp_32f_C1IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliExp_32f_C3IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliExp_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliExp_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer and raise the base e to the power specified by the source data. Results can be<br />

written back to the source location or to a destination buffer. The 8-bit unsigned and 16-bit signed versions of the functions perform<br />

an integer scaling operation before writing the results. These functions are the inverses of the Ln functions.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 192 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Ln<br />

Natural logarithm<br />

Synopsis<br />

AplStatus apliLn_8u_C1IRSfs ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliLn_8u_C3IRSfs ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliLn_8u_C1RSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliLn_8u_C3RSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliLn_16s_C1IRSfs ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliLn_16s_C3IRSfs ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliLn_16s_C1RSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliLn_16s_C3RSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliLn_32f_C1IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliLn_32f_C3IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliLn_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLn_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer and calculate the natural logarithms of the source data. Results can be written<br />

back to the source location or to a destination buffer. The 8-bit unsigned and 16-bit signed versions of the functions perform an<br />

integer scaling operation before writing the results.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 193 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Mul<br />

Multiply<br />

Synopsis<br />

AplStatus apliMul_8u_C1IRSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_8u_C3IRSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_8u_C4IRSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_8u_AC4IRSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_8u_C1RSfs ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliMul_8u_C3RSfs ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliMul_8u_C4RSfs ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliMul_8u_AC4RSfs ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_16s_C1IRSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_16s_C3IRSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_16s_C4IRSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_16s_AC4IRSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_16s_C1RSfs ( const Apl16s * pSrc1 , int src1Step , const Apl16s * pSrc2 , int src2Step , Apl16s * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_16s_C3RSfs ( const Apl16s * pSrc1 , int src1Step , const Apl16s * pSrc2 , int src2Step , Apl16s * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_16s_C4RSfs ( const Apl16s * pSrc1 , int src1Step , const Apl16s * pSrc2 , int src2Step , Apl16s * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_16s_AC4RSfs ( const Apl16s * pSrc1 , int src1Step , const Apl16s * pSrc2 , int src2Step , Apl16s * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_16sc_C1IRSfs ( const Apl16sc * pSrc , int srcStep , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliMul_16sc_C3IRSfs ( const Apl16sc * pSrc , int srcStep , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliMul_16sc_AC4IRSfs ( const Apl16sc * pSrc , int srcStep , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliMul_16sc_C1RSfs ( const Apl16sc * pSrc1 , int src1Step , const Apl16sc * pSrc2 , int src2Step , Apl16sc * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_16sc_C3RSfs ( const Apl16sc * pSrc1 , int src1Step , const Apl16sc * pSrc2 , int src2Step , Apl16sc * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_16sc_AC4RSfs ( const Apl16sc * pSrc1 , int src1Step , const Apl16sc * pSrc2 , int src2Step , Apl16sc * pDst , int dstStep<br />

, ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_32sc_C1IRSfs ( const Apl32sc * pSrc , int srcStep , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 194 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AplStatus apliMul_32sc_C3IRSfs ( const Apl32sc * pSrc , int srcStep , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliMul_32sc_AC4IRSfs ( const Apl32sc * pSrc , int srcStep , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliMul_32sc_C1RSfs ( const Apl32sc * pSrc1 , int src1Step , const Apl32sc * pSrc2 , int src2Step , Apl32sc * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_32sc_C3RSfs ( const Apl32sc * pSrc1 , int src1Step , const Apl32sc * pSrc2 , int src2Step , Apl32sc * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_32sc_AC4RSfs ( const Apl32sc * pSrc1 , int src1Step , const Apl32sc * pSrc2 , int src2Step , Apl32sc * pDst , int dstStep<br />

, ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMul_32f_C1IR ( const Apl32f * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMul_32f_C3IR ( const Apl32f * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMul_32f_C4IR ( const Apl32f * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMul_32f_AC4IR ( const Apl32f * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMul_32f_C1R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl32f * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliMul_32f_C3R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl32f * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliMul_32f_C4R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl32f * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliMul_32f_AC4R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl32f * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliMul_32fc_C1IR ( const Apl32fc * pSrc , int srcStep , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMul_32fc_C3IR ( const Apl32fc * pSrc , int srcStep , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMul_32fc_AC4IR ( const Apl32fc * pSrc , int srcStep , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMul_32fc_C1R ( const Apl32fc * pSrc1 , int src1Step , const Apl32fc * pSrc2 , int src2Step , Apl32fc * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliMul_32fc_C3R ( const Apl32fc * pSrc1 , int src1Step , const Apl32fc * pSrc2 , int src2Step , Apl32fc * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliMul_32fc_AC4R ( const Apl32fc * pSrc1 , int src1Step , const Apl32fc * pSrc2 , int src2Step , Apl32fc * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 195 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc1 Pointer to a location in source buffer one.<br />

pSrc2 Pointer to a location in source buffer two.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

src1Step Source buffer one step size (width of the buffer in bytes).<br />

src2Step Source buffer two step size (width of the buffer in bytes).<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through ROIs in two source buffers and multiply the data in buffer 1 by the data in buffer 2. The product can be<br />

written back to the source location or to a destination buffer. The 8-bit unsigned, 16-bit signed, 16-bit signed complex, and 32-bit<br />

signed complex versions of the functions perform an integer scaling operation before writing the results.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 196 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

MulC<br />

Multiply by a constant<br />

Synopsis<br />

AplStatus apliMulC_8u_C1IRSfs ( Apl8u value , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMulC_8u_C3IRSfs ( const Apl8u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMulC_8u_AC4IRSfs ( const Apl8u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMulC_8u_C4IRSfs ( const Apl8u value[4] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMulC_8u_C1RSfs ( const Apl8u * pSrc , int srcStep , Apl8u value , Apl8u * pDst , int dstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliMulC_8u_C3RSfs ( const Apl8u * pSrc , int srcStep , const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliMulC_8u_AC4RSfs ( const Apl8u * pSrc , int srcStep , const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliMulC_8u_C4RSfs ( const Apl8u * pSrc , int srcStep , const Apl8u value[4] , Apl8u * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliMulC_16s_C1IRSfs ( Apl16s value , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMulC_16s_C3IRSfs ( const Apl16s value[3] , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMulC_16s_AC4IRSfs ( const Apl16s value[3] , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMulC_16s_C4IRSfs ( const Apl16s value[4] , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMulC_16s_C1RSfs ( const Apl16s * pSrc , int srcStep , Apl16s value , Apl16s * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliMulC_16s_C3RSfs ( const Apl16s * pSrc , int srcStep , const Apl16s value[3] , Apl16s * pDst , int dstStep , ApliSize roiSize ,<br />

int scaleFactor );<br />

AplStatus apliMulC_16s_AC4RSfs ( const Apl16s * pSrc , int srcStep , const Apl16s value[3] , Apl16s * pDst , int dstStep , ApliSize roiSize ,<br />

int scaleFactor );<br />

AplStatus apliMulC_16s_C4RSfs ( const Apl16s * pSrc , int srcStep , const Apl16s value[4] , Apl16s * pDst , int dstStep , ApliSize roiSize ,<br />

int scaleFactor );<br />

AplStatus apliMulC_16sc_C1IRSfs ( Apl16sc value , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMulC_16sc_C3IRSfs ( const Apl16sc value[3] , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMulC_16sc_AC4IRSfs ( const Apl16sc value[3] , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMulC_16sc_C1RSfs ( const Apl16sc * pSrc , int srcStep , Apl16sc value , Apl16sc * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliMulC_16sc_C3RSfs ( const Apl16sc * pSrc , int srcStep , const Apl16sc value[3] , Apl16sc * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliMulC_16sc_AC4RSfs ( const Apl16sc * pSrc , int srcStep , const Apl16sc value[3] , Apl16sc * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliMulC_32sc_C1IRSfs ( Apl32sc value , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMulC_32sc_C3IRSfs ( const Apl32sc value[3] , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMulC_32sc_AC4IRSfs ( const Apl32sc value[3] , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliMulC_32sc_C1RSfs ( const Apl32sc * pSrc , int srcStep , Apl32sc value , Apl32sc * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 197 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AplStatus apliMulC_32sc_C3RSfs ( const Apl32sc * pSrc , int srcStep , const Apl32sc value[3] , Apl32sc * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliMulC_32sc_AC4RSfs ( const Apl32sc * pSrc , int srcStep , const Apl32sc value[3] , Apl32sc * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliMulC_32f_C1IR ( Apl32f value , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulC_32f_C3IR ( const Apl32f value[3] , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulC_32f_AC4IR ( const Apl32f value[3] , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulC_32f_C4IR ( const Apl32f value[4] , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulC_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f value , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliMulC_32f_C3R ( const Apl32f * pSrc , int srcStep , const Apl32f value[3] , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliMulC_32f_AC4R ( const Apl32f * pSrc , int srcStep , const Apl32f value[3] , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliMulC_32f_C4R ( const Apl32f * pSrc , int srcStep , const Apl32f value[4] , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliMulC_32fc_C1IR ( Apl32fc value , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulC_32fc_C3IR ( const Apl32fc value[3] , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulC_32fc_AC4IR ( const Apl32fc value[3] , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulC_32fc_C1R ( const Apl32fc * pSrc , int srcStep , Apl32fc value , Apl32fc * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliMulC_32fc_C3R ( const Apl32fc * pSrc , int srcStep , const Apl32fc value[3] , Apl32fc * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliMulC_32fc_AC4R ( const Apl32fc * pSrc , int srcStep , const Apl32fc value[3] , Apl32fc * pDst , int dstStep , ApliSize roiSize<br />

);<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

value Specified value.<br />

value[3] An array of three specified values.<br />

value[4] An array of four specified values.<br />

Description<br />

These functions step through an ROI in a source buffer and multiply the source data by a specified constant value. The product can be<br />

written back to the source location or to a destination buffer. The 8-bit unsigned, 16-bit signed, 16-bit signed complex, and 32-bit<br />

signed complex versions of the functions perform an integer scaling operation before writing the results.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 198 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 199 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

MulScale<br />

Multiply with scaling<br />

Synopsis<br />

AplStatus apliMulScale_8u_C1IR ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulScale_8u_C3IR ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulScale_8u_C4IR ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulScale_8u_AC4IR ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulScale_8u_C1R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliMulScale_8u_C3R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliMulScale_8u_C4R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliMulScale_8u_AC4R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliMulScale_16u_C1IR ( const Apl16u * pSrc , int srcStep , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulScale_16u_C3IR ( const Apl16u * pSrc , int srcStep , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulScale_16u_C4IR ( const Apl16u * pSrc , int srcStep , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulScale_16u_AC4IR ( const Apl16u * pSrc , int srcStep , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulScale_16u_C1R ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , Apl16u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliMulScale_16u_C3R ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , Apl16u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliMulScale_16u_C4R ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , Apl16u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliMulScale_16u_AC4R ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , Apl16u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 200 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc1 Pointer to a location in source buffer one.<br />

pSrc2 Pointer to a location in source buffer two.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

src1Step Source buffer one step size (width of the buffer in bytes).<br />

src2Step Source buffer two step size (width of the buffer in bytes).<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through ROIs in two source buffers, multiply the data in buffer 1 by the data in buffer 2, then divide the product<br />

by a scaling factor equal to the upper bound of the range of values that can be represented by the source data type. Results can be<br />

written back to the source location or to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 201 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

MulCScale<br />

Multiply by constant with scaling<br />

Synopsis<br />

AplStatus apliMulCScale_8u_C1IR ( Apl8u value , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulCScale_8u_C3IR ( const Apl8u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulCScale_8u_AC4IR ( const Apl8u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulCScale_8u_C4IR ( const Apl8u value[4] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulCScale_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u value , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliMulCScale_8u_C3R ( const Apl8u * pSrc , int srcStep , const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliMulCScale_8u_AC4R ( const Apl8u * pSrc , int srcStep , const Apl8u value[4] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliMulCScale_8u_C4R ( const Apl8u * pSrc , int srcStep , const Apl8u value[4] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliMulCScale_16u_C1IR ( Apl16u value , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulCScale_16u_C3IR ( const Apl16u value[3] , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulCScale_16u_AC4IR ( const Apl16u value[3] , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulCScale_16u_C4IR ( const Apl16u value[4] , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliMulCScale_16u_C1R ( const Apl16u * pSrc , int srcStep , Apl16u value , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliMulCScale_16u_C3R ( const Apl16u * pSrc , int srcStep , const Apl16u value[3] , Apl16u * pDst , int dstStep , ApliSize roiSize<br />

);<br />

AplStatus apliMulCScale_16u_AC4R ( const Apl16u * pSrc , int srcStep , const Apl16u value[4] , Apl16u * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliMulCScale_16u_C4R ( const Apl16u * pSrc , int srcStep , const Apl16u value[4] , Apl16u * pDst , int dstStep , ApliSize roiSize<br />

);<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

value Specified value.<br />

value[3] An array of three specified values.<br />

value[4] An array of four specified values.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 202 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through an ROI in a source buffer, multiply the source data by a specified constant value, then divide the product<br />

by a scaling factor equal to the upper bound of the range of values that can be represented by the source data type. Results can be<br />

written back to the source location or to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 203 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Sqr<br />

Square<br />

Synopsis<br />

AplStatus apliSqr_8u_C1IRSfs ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_8u_C3IRSfs ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_8u_C4IRSfs ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_8u_AC4IRSfs ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_8u_C1RSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_8u_C3RSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_8u_C4RSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_8u_AC4RSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_16u_C1IRSfs ( Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_16u_C3IRSfs ( Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_16u_C4IRSfs ( Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_16u_AC4IRSfs ( Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_16u_C1RSfs ( const Apl16u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_16u_C3RSfs ( const Apl16u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_16u_C4RSfs ( const Apl16u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_16u_AC4RSfs ( const Apl16u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_16s_C1IRSfs ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_16s_C3IRSfs ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_16s_C4IRSfs ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_16s_AC4IRSfs ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_16s_C1RSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_16s_C3RSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_16s_C4RSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_16s_AC4RSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqr_32f_C1IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSqr_32f_C3IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSqr_32f_C4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSqr_32f_AC4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSqr_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSqr_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSqr_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 204 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer and calculate the square of the source data. Results can be written back to the<br />

source location or to a destination buffer. The 8-bit unsigned, 16-bit unsigned, and 16-bit signed versions of the functions perform an<br />

integer scaling operation before writing the results.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 205 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Sqrt<br />

Square root<br />

Synopsis<br />

AplStatus apliSqrt_8u_C1IRSfs ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqrt_8u_C3IRSfs ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqrt_8u_AC4IRSfs ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqrt_8u_C1RSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqrt_8u_C3RSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqrt_8u_AC4RSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqrt_16s_C1IRSfs ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqrt_16s_C3IRSfs ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqrt_16s_AC4IRSfs ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqrt_16s_C1RSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqrt_16s_C3RSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqrt_16s_AC4RSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqrt_16u_C1IRSfs ( Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqrt_16u_C3IRSfs ( Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqrt_16u_AC4IRSfs ( Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqrt_16u_C1RSfs ( const Apl16u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqrt_16u_C3RSfs ( const Apl16u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqrt_16u_AC4RSfs ( const Apl16u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSqrt_32f_C1IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSqrt_32f_C3IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSqrt_32f_C4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSqrt_32f_AC4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSqrt_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSqrt_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSqrt_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 206 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through an ROI in a source buffer and calculate the square root of the source data. Results can be written back to<br />

the source location or to a destination buffer. The 8-bit unsigned, 16-bit unsigned, and 16-bit signed versions of the functions perform<br />

an integer scaling operation before writing the results.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 207 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Sub<br />

Subtract<br />

Synopsis<br />

AplStatus apliSub_8u_C1IRSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_8u_C3IRSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_8u_C4IRSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_8u_AC4IRSfs ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_8u_C1RSfs ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliSub_8u_C3RSfs ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliSub_8u_C4RSfs ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliSub_8u_AC4RSfs ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_16s_C1IRSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_16s_C3IRSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_16s_C4IRSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_16s_AC4IRSfs ( const Apl16s * pSrc , int srcStep , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_16s_C1RSfs ( const Apl16s * pSrc1 , int src1Step , const Apl16s * pSrc2 , int src2Step , Apl16s * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_16s_C3RSfs ( const Apl16s * pSrc1 , int src1Step , const Apl16s * pSrc2 , int src2Step , Apl16s * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_16s_C4RSfs ( const Apl16s * pSrc1 , int src1Step , const Apl16s * pSrc2 , int src2Step , Apl16s * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_16s_AC4RSfs ( const Apl16s * pSrc1 , int src1Step , const Apl16s * pSrc2 , int src2Step , Apl16s * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_16sc_C1IRSfs ( const Apl16sc * pSrc , int srcStep , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliSub_16sc_C3IRSfs ( const Apl16sc * pSrc , int srcStep , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliSub_16sc_AC4IRSfs ( const Apl16sc * pSrc , int srcStep , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliSub_16sc_C1RSfs ( const Apl16sc * pSrc1 , int src1Step , const Apl16sc * pSrc2 , int src2Step , Apl16sc * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_16sc_C3RSfs ( const Apl16sc * pSrc1 , int src1Step , const Apl16sc * pSrc2 , int src2Step , Apl16sc * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_16sc_AC4RSfs ( const Apl16sc * pSrc1 , int src1Step , const Apl16sc * pSrc2 , int src2Step , Apl16sc * pDst , int dstStep<br />

, ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_32sc_C1IRSfs ( const Apl32sc * pSrc , int srcStep , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 208 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AplStatus apliSub_32sc_C3IRSfs ( const Apl32sc * pSrc , int srcStep , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliSub_32sc_AC4IRSfs ( const Apl32sc * pSrc , int srcStep , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliSub_32sc_C1RSfs ( const Apl32sc * pSrc1 , int src1Step , const Apl32sc * pSrc2 , int src2Step , Apl32sc * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_32sc_C3RSfs ( const Apl32sc * pSrc1 , int src1Step , const Apl32sc * pSrc2 , int src2Step , Apl32sc * pDst , int dstStep ,<br />

ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_32sc_AC4RSfs ( const Apl32sc * pSrc1 , int src1Step , const Apl32sc * pSrc2 , int src2Step , Apl32sc * pDst , int dstStep<br />

, ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSub_32f_C1IR ( const Apl32f * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSub_32f_C3IR ( const Apl32f * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSub_32f_C4IR ( const Apl32f * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSub_32f_AC4IR ( const Apl32f * pSrc , int srcStep , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSub_32f_C1R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl32f * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliSub_32f_C3R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl32f * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliSub_32f_C4R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl32f * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliSub_32f_AC4R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl32f * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliSub_32fc_C1IR ( const Apl32fc * pSrc , int srcStep , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSub_32fc_C3IR ( const Apl32fc * pSrc , int srcStep , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSub_32fc_AC4IR ( const Apl32fc * pSrc , int srcStep , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSub_32fc_C1R ( const Apl32fc * pSrc1 , int src1Step , const Apl32fc * pSrc2 , int src2Step , Apl32fc * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliSub_32fc_C3R ( const Apl32fc * pSrc1 , int src1Step , const Apl32fc * pSrc2 , int src2Step , Apl32fc * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliSub_32fc_AC4R ( const Apl32fc * pSrc1 , int src1Step , const Apl32fc * pSrc2 , int src2Step , Apl32fc * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 209 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc1 Pointer to a location in source buffer one.<br />

pSrc2 Pointer to a location in source buffer two.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

src1Step Source buffer one step size (width of the buffer in bytes).<br />

src2Step Source buffer two step size (width of the buffer in bytes).<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through ROIs in two source buffers and subtract the data in buffer 1 from the data in buffer 2. The difference can<br />

be written back to the source location or to a destination buffer. The 8-bit unsigned, 16-bit signed, 16-bit signed complex, and 32-bit<br />

signed complex versions of the functions perform an integer scaling operation before writing the results.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 210 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

SubC<br />

Subtract a constant value<br />

Synopsis<br />

AplStatus apliSubC_8u_C1IRSfs ( Apl8u value , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSubC_8u_C3IRSfs ( const Apl8u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSubC_8u_AC4IRSfs ( const Apl8u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSubC_8u_C4IRSfs ( const Apl8u value[4] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSubC_8u_C1RSfs ( const Apl8u * pSrc , int srcStep , Apl8u value , Apl8u * pDst , int dstStep , ApliSize roiSize , int scaleFactor<br />

);<br />

AplStatus apliSubC_8u_C3RSfs ( const Apl8u * pSrc , int srcStep , const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliSubC_8u_AC4RSfs ( const Apl8u * pSrc , int srcStep , const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliSubC_8u_C4RSfs ( const Apl8u * pSrc , int srcStep , const Apl8u value[4] , Apl8u * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliSubC_16s_C1IRSfs ( Apl16s value , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSubC_16s_C3IRSfs ( const Apl16s value[3] , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSubC_16s_AC4IRSfs ( const Apl16s value[3] , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSubC_16s_C4IRSfs ( const Apl16s value[4] , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSubC_16s_C1RSfs ( const Apl16s * pSrc , int srcStep , Apl16s value , Apl16s * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliSubC_16s_C3RSfs ( const Apl16s * pSrc , int srcStep , const Apl16s value[3] , Apl16s * pDst , int dstStep , ApliSize roiSize ,<br />

int scaleFactor );<br />

AplStatus apliSubC_16s_AC4RSfs ( const Apl16s * pSrc , int srcStep , const Apl16s value[3] , Apl16s * pDst , int dstStep , ApliSize roiSize ,<br />

int scaleFactor );<br />

AplStatus apliSubC_16s_C4RSfs ( const Apl16s * pSrc , int srcStep , const Apl16s value[4] , Apl16s * pDst , int dstStep , ApliSize roiSize ,<br />

int scaleFactor );<br />

AplStatus apliSubC_16sc_C1IRSfs ( Apl16sc value , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSubC_16sc_C3IRSfs ( const Apl16sc value[3] , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSubC_16sc_AC4IRSfs ( const Apl16sc value[3] , Apl16sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSubC_16sc_C1RSfs ( const Apl16sc * pSrc , int srcStep , Apl16sc value , Apl16sc * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

AplStatus apliSubC_16sc_C3RSfs ( const Apl16sc * pSrc , int srcStep , const Apl16sc value[3] , Apl16sc * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliSubC_16sc_AC4RSfs ( const Apl16sc * pSrc , int srcStep , const Apl16sc value[3] , Apl16sc * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliSubC_32sc_C1IRSfs ( Apl32sc value , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSubC_32sc_C3IRSfs ( const Apl32sc value[3] , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSubC_32sc_AC4IRSfs ( const Apl32sc value[3] , Apl32sc * pSrcDst , int srcDstStep , ApliSize roiSize , int scaleFactor );<br />

AplStatus apliSubC_32sc_C1RSfs ( const Apl32sc * pSrc , int srcStep , Apl32sc value , Apl32sc * pDst , int dstStep , ApliSize roiSize , int<br />

scaleFactor );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 211 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AplStatus apliSubC_32sc_C3RSfs ( const Apl32sc * pSrc , int srcStep , const Apl32sc value[3] , Apl32sc * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliSubC_32sc_AC4RSfs ( const Apl32sc * pSrc , int srcStep , const Apl32sc value[3] , Apl32sc * pDst , int dstStep , ApliSize<br />

roiSize , int scaleFactor );<br />

AplStatus apliSubC_32f_C1IR ( Apl32f value , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSubC_32f_C3IR ( const Apl32f value[3] , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSubC_32f_AC4IR ( const Apl32f value[3] , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSubC_32f_C4IR ( const Apl32f value[4] , Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSubC_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f value , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSubC_32f_C3R ( const Apl32f * pSrc , int srcStep , const Apl32f value[3] , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSubC_32f_AC4R ( const Apl32f * pSrc , int srcStep , const Apl32f value[3] , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSubC_32f_C4R ( const Apl32f * pSrc , int srcStep , const Apl32f value[4] , Apl32f * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSubC_32fc_C1IR ( Apl32fc value , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSubC_32fc_C3IR ( const Apl32fc value[3] , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSubC_32fc_AC4IR ( const Apl32fc value[3] , Apl32fc * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliSubC_32fc_C1R ( const Apl32fc * pSrc , int srcStep , Apl32fc value , Apl32fc * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSubC_32fc_C3R ( const Apl32fc * pSrc , int srcStep , const Apl32fc value[3] , Apl32fc * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliSubC_32fc_AC4R ( const Apl32fc * pSrc , int srcStep , const Apl32fc value[3] , Apl32fc * pDst , int dstStep , ApliSize roiSize<br />

);<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

scaleFactor Specifies the integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

value Specified value.<br />

value[3] An array of three specified values.<br />

value[4] An array of four specified values.<br />

Description<br />

These functions step through an ROI in a source buffer and subtract a specified constant value from the source data. The difference<br />

can be written back to the source location or to a destination buffer. The 8-bit unsigned, 16-bit signed, 16-bit signed complex, and 32bit<br />

signed complex versions of the functions perform an integer scaling operation before writing the results.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 212 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 213 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

And<br />

AND<br />

Synopsis<br />

AplStatus apliAnd_8u_C1IR ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAnd_8u_C3IR ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAnd_8u_C4IR ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAnd_8u_AC4IR ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAnd_8u_C1R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliAnd_8u_C3R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliAnd_8u_C4R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliAnd_8u_AC4R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliAnd_16u_C1IR ( const Apl16u * pSrc , int srcStep , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAnd_16u_C3IR ( const Apl16u * pSrc , int srcStep , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAnd_16u_C4IR ( const Apl16u * pSrc , int srcStep , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAnd_16u_AC4IR ( const Apl16u * pSrc , int srcStep , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAnd_16u_C1R ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , Apl16u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliAnd_16u_C3R ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , Apl16u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliAnd_16u_C4R ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , Apl16u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliAnd_16u_AC4R ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , Apl16u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliAnd_32s_C1IR ( const Apl32s * pSrc , int srcStep , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAnd_32s_C3IR ( const Apl32s * pSrc , int srcStep , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAnd_32s_C4IR ( const Apl32s * pSrc , int srcStep , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAnd_32s_AC4IR ( const Apl32s * pSrc , int srcStep , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAnd_32s_C1R ( const Apl32s * pSrc1 , int src1Step , const Apl32s * pSrc2 , int src2Step , Apl32s * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliAnd_32s_C3R ( const Apl32s * pSrc1 , int src1Step , const Apl32s * pSrc2 , int src2Step , Apl32s * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliAnd_32s_C4R ( const Apl32s * pSrc1 , int src1Step , const Apl32s * pSrc2 , int src2Step , Apl32s * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliAnd_32s_AC4R ( const Apl32s * pSrc1 , int src1Step , const Apl32s * pSrc2 , int src2Step , Apl32s * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 214 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc1 Pointer to a location in source buffer one.<br />

pSrc2 Pointer to a location in source buffer two.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

src1Step Source buffer one step size (width of the buffer in bytes).<br />

src2Step Source buffer two step size (width of the buffer in bytes).<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through ROIs in two source buffers and perform a bitwise logical AND of the data in buffer 1 and the data in<br />

buffer 2. The results can be written back to the source location or to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 215 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AndC<br />

AND with constant<br />

Synopsis<br />

AplStatus apliAndC_8u_C1IR ( Apl8u value , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAndC_8u_C3IR ( const Apl8u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAndC_8u_AC4IR ( const Apl8u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAndC_8u_C4IR ( const Apl8u value[4] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAndC_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u value , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAndC_8u_C3R ( const Apl8u * pSrc , int srcStep , const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAndC_8u_AC4R ( const Apl8u * pSrc , int srcStep , const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAndC_8u_C4R ( const Apl8u * pSrc , int srcStep , const Apl8u value[4] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAndC_16u_C1IR ( Apl16u value , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAndC_16u_C3IR ( const Apl16u value[3] , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAndC_16u_AC4IR ( const Apl16u value[3] , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAndC_16u_C4IR ( const Apl16u value[4] , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAndC_16u_C1R ( const Apl16u * pSrc , int srcStep , Apl16u value , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAndC_16u_C3R ( const Apl16u * pSrc , int srcStep , const Apl16u value[3] , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAndC_16u_AC4R ( const Apl16u * pSrc , int srcStep , const Apl16u value[3] , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAndC_16u_C4R ( const Apl16u * pSrc , int srcStep , const Apl16u value[4] , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAndC_32s_C1IR ( Apl32s value , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAndC_32s_C3IR ( const Apl32s value[3] , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAndC_32s_AC4IR ( const Apl32s value[3] , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAndC_32s_C4IR ( const Apl32s value[4] , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliAndC_32s_C1R ( const Apl32s * pSrc , int srcStep , Apl32s value , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAndC_32s_C3R ( const Apl32s * pSrc , int srcStep , const Apl32s value[3] , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAndC_32s_AC4R ( const Apl32s * pSrc , int srcStep , const Apl32s value[3] , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliAndC_32s_C4R ( const Apl32s * pSrc , int srcStep , const Apl32s value[4] , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 216 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

value Specified value.<br />

value[3] An array of three specified values.<br />

value[4] An array of four specified values.<br />

Description<br />

These functions step through an ROI in a source buffer and perform a bitwise logical AND of the source data and a specified constant.<br />

The results can be written back to the source location or to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 217 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Comp<br />

Complement<br />

Synopsis<br />

AplStatus apliComplement_32s_C1IR ( Apl32s* pSrcDst , int srcDstStep , ApliSize roiSize );<br />

Parameters<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

Description<br />

This function steps through an ROI in a source buffer, performs a logical complementation of the source data, and writes the results<br />

back to the source location.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 218 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Not<br />

NOT<br />

Synopsis<br />

AplStatus apliNot_8u_C1IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliNot_8u_C3IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliNot_8u_AC4IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliNot_8u_C4IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliNot_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliNot_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliNot_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliNot_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer and perform a bitwise negation of the source data. The results can be written<br />

back to the source location or to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 219 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Or<br />

OR<br />

Synopsis<br />

AplStatus apliOr_8u_C1IR ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOr_8u_C3IR ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOr_8u_C4IR ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOr_8u_AC4IR ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOr_8u_C1R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliOr_8u_C3R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliOr_8u_C4R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliOr_8u_AC4R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliOr_16u_C1IR ( const Apl16u * pSrc , int srcStep , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOr_16u_C3IR ( const Apl16u * pSrc , int srcStep , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOr_16u_C4IR ( const Apl16u * pSrc , int srcStep , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOr_16u_AC4IR ( const Apl16u * pSrc , int srcStep , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOr_16u_C1R ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , Apl16u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliOr_16u_C3R ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , Apl16u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliOr_16u_C4R ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , Apl16u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliOr_16u_AC4R ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , Apl16u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliOr_32s_C1IR ( const Apl32s * pSrc , int srcStep , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOr_32s_C3IR ( const Apl32s * pSrc , int srcStep , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOr_32s_C4IR ( const Apl32s * pSrc , int srcStep , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOr_32s_AC4IR ( const Apl32s * pSrc , int srcStep , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOr_32s_C1R ( const Apl32s * pSrc1 , int src1Step , const Apl32s * pSrc2 , int src2Step , Apl32s * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliOr_32s_C3R ( const Apl32s * pSrc1 , int src1Step , const Apl32s * pSrc2 , int src2Step , Apl32s * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliOr_32s_C4R ( const Apl32s * pSrc1 , int src1Step , const Apl32s * pSrc2 , int src2Step , Apl32s * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliOr_32s_AC4R ( const Apl32s * pSrc1 , int src1Step , const Apl32s * pSrc2 , int src2Step , Apl32s * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 220 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc1 Pointer to a location in source buffer one.<br />

pSrc2 Pointer to a location in source buffer two.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

src1Step Source buffer one step size (width of the buffer in bytes).<br />

src2Step Source buffer two step size (width of the buffer in bytes).<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through ROIs in two source buffers and perform a bitwise inclusive logical OR of the data in buffer 1 and the data<br />

in buffer 2. The results can be written back to the source location or to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 221 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

OrC<br />

OR with constant<br />

Synopsis<br />

AplStatus apliOrC_8u_C1IR ( Apl8u value , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOrC_8u_C3IR ( const Apl8u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOrC_8u_AC4IR ( const Apl8u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOrC_8u_C4IR ( const Apl8u value[4] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOrC_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u value , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliOrC_8u_C3R ( const Apl8u * pSrc , int srcStep , const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliOrC_8u_AC4R ( const Apl8u * pSrc , int srcStep , const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliOrC_8u_C4R ( const Apl8u * pSrc , int srcStep , const Apl8u value[4] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliOrC_16u_C1IR ( Apl16u value , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOrC_16u_C3IR ( const Apl16u value[3] , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOrC_16u_AC4IR ( const Apl16u value[3] , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOrC_16u_C4IR ( const Apl16u value[4] , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOrC_16u_C1R ( const Apl16u * pSrc , int srcStep , Apl16u value , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliOrC_16u_C3R ( const Apl16u * pSrc , int srcStep , const Apl16u value[3] , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliOrC_16u_AC4R ( const Apl16u * pSrc , int srcStep , const Apl16u value[3] , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliOrC_16u_C4R ( const Apl16u * pSrc , int srcStep , const Apl16u value[4] , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliOrC_32s_C1IR ( Apl32s value , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOrC_32s_C3IR ( const Apl32s value[3] , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOrC_32s_AC4IR ( const Apl32s value[3] , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOrC_32s_C4IR ( const Apl32s value[4] , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliOrC_32s_C1R ( const Apl32s * pSrc , int srcStep , Apl32s value , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliOrC_32s_C3R ( const Apl32s * pSrc , int srcStep , const Apl32s value[3] , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliOrC_32s_AC4R ( const Apl32s * pSrc , int srcStep , const Apl32s value[3] , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliOrC_32s_C4R ( const Apl32s * pSrc , int srcStep , const Apl32s value[4] , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 222 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

value Specified value.<br />

value[3] An array of three specified values.<br />

value[4] An array of four specified values.<br />

Description<br />

These functions step through an ROI in a source buffer and perform a bitwise inclusive logical OR of the source data and a specified<br />

constant. The results can be written back to the source location or to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 223 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

LShiftC<br />

Left shift by a constant value<br />

Synopsis<br />

AplStatus apliLShiftC_8u_C1IR ( Apl32u value , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_8u_C3IR ( const Apl32u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_8u_AC4IR ( const Apl32u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_8u_C4IR ( const Apl32u value[4] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl32u value , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_8u_C3R ( const Apl8u * pSrc , int srcStep , const Apl32u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_8u_AC4R ( const Apl8u * pSrc , int srcStep , const Apl32u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_8u_C4R ( const Apl8u * pSrc , int srcStep , const Apl32u value[4] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_16u_C1IR ( Apl32u value , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_16u_C3IR ( const Apl32u value[3] , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_16u_AC4IR ( const Apl32u value[3] , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_16u_C4IR ( const Apl32u value[4] , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_16u_C1R ( const Apl16u * pSrc , int srcStep , Apl32u value , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_16u_C3R ( const Apl16u * pSrc , int srcStep , const Apl32u value[3] , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_16u_AC4R ( const Apl16u * pSrc , int srcStep , const Apl32u value[3] , Apl16u * pDst , int dstStep , ApliSize roiSize<br />

);<br />

AplStatus apliLShiftC_16u_C4R ( const Apl16u * pSrc , int srcStep , const Apl32u value[4] , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_32s_C1IR ( Apl32u value , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_32s_C3IR ( const Apl32u value[3] , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_32s_AC4IR ( const Apl32u value[3] , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_32s_C4IR ( const Apl32u value[4] , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_32s_C1R ( const Apl32s * pSrc , int srcStep , Apl32u value , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_32s_C3R ( const Apl32s * pSrc , int srcStep , const Apl32u value[3] , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_32s_AC4R ( const Apl32s * pSrc , int srcStep , const Apl32u value[3] , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLShiftC_32s_C4R ( const Apl32s * pSrc , int srcStep , const Apl32u value[4] , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 224 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

value Specified value.<br />

value[3] An array of three specified values.<br />

value[4] An array of four specified values.<br />

Description<br />

These functions step through an ROI in a source buffer and shift the bits of the source data a specified number of bit positions to the<br />

left. The results can be written back to the source location or to a destination buffer. Left-shifting is equivalent to multiplying by 2 to<br />

the constant power.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 225 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

RShiftC<br />

Right shift by a constant value<br />

Synopsis<br />

AplStatus apliRShiftC_8u_C1IR ( Apl32u value , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_8u_C3IR ( const Apl32u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_8u_AC4IR ( const Apl32u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_8u_C4IR ( const Apl32u value[4] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl32u value , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_8u_C3R ( const Apl8u * pSrc , int srcStep , const Apl32u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_8u_AC4R ( const Apl8u * pSrc , int srcStep , const Apl32u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_8u_C4R ( const Apl8u * pSrc , int srcStep , const Apl32u value[4] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_8s_C1IR ( Apl32u value , Apl8s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_8s_C3IR ( const Apl32u value[3] , Apl8s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_8s_AC4IR ( const Apl32u value[3] , Apl8s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_8s_C4IR ( const Apl32u value[4] , Apl8s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_8s_C1R ( const Apl8s * pSrc , int srcStep , Apl32u value , Apl8s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_8s_C3R ( const Apl8s * pSrc , int srcStep , const Apl32u value[3] , Apl8s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_8s_AC4R ( const Apl8s * pSrc , int srcStep , const Apl32u value[3] , Apl8s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_8s_C4R ( const Apl8s * pSrc , int srcStep , const Apl32u value[4] , Apl8s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_16u_C1IR ( Apl32u value , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_16u_C3IR ( const Apl32u value[3] , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_16u_AC4IR ( const Apl32u value[3] , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_16u_C4IR ( const Apl32u value[4] , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_16u_C1R ( const Apl16u * pSrc , int srcStep , Apl32u value , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_16u_C3R ( const Apl16u * pSrc , int srcStep , const Apl32u value[3] , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_16u_AC4R ( const Apl16u * pSrc , int srcStep , const Apl32u value[3] , Apl16u * pDst , int dstStep , ApliSize roiSize<br />

);<br />

AplStatus apliRShiftC_16u_C4R ( const Apl16u * pSrc , int srcStep , const Apl32u value[4] , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_16s_C1IR ( Apl32u value , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_16s_C3IR ( const Apl32u value[3] , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_16s_AC4IR ( const Apl32u value[3] , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_16s_C4IR ( const Apl32u value[4] , Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl32u value , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_16s_C3R ( const Apl16s * pSrc , int srcStep , const Apl32u value[3] , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_16s_AC4R ( const Apl16s * pSrc , int srcStep , const Apl32u value[3] , Apl16s * pDst , int dstStep , ApliSize roiSize<br />

);<br />

AplStatus apliRShiftC_16s_C4R ( const Apl16s * pSrc , int srcStep , const Apl32u value[4] , Apl16s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_32s_C1IR ( Apl32u value , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_32s_C3IR ( const Apl32u value[3] , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_32s_AC4IR ( const Apl32u value[3] , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_32s_C4IR ( const Apl32u value[4] , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 226 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AplStatus apliRShiftC_32s_C1R ( const Apl32s * pSrc , int srcStep , Apl32u value , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_32s_C3R ( const Apl32s * pSrc , int srcStep , const Apl32u value[3] , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRShiftC_32s_AC4R ( const Apl32s * pSrc , int srcStep , const Apl32u value[3] , Apl32s * pDst , int dstStep , ApliSize roiSize<br />

);<br />

AplStatus apliRShiftC_32s_C4R ( const Apl32s * pSrc , int srcStep , const Apl32u value[4] , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

value Specified value.<br />

value[3] An array of three specified values.<br />

value[4] An array of four specified values.<br />

Description<br />

These functions step through an ROI in a source buffer and shift the bits of the source data a specified number of bit positions to the<br />

right. The results can be written back to the source location or to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 227 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Xor<br />

XOR<br />

Synopsis<br />

AplStatus apliXor_8u_C1IR ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXor_8u_C3IR ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXor_8u_C4IR ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXor_8u_AC4IR ( const Apl8u * pSrc , int srcStep , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXor_8u_C1R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliXor_8u_C3R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliXor_8u_C4R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliXor_8u_AC4R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize );<br />

AplStatus apliXor_16u_C1IR ( const Apl16u * pSrc , int srcStep , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXor_16u_C3IR ( const Apl16u * pSrc , int srcStep , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXor_16u_C4IR ( const Apl16u * pSrc , int srcStep , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXor_16u_AC4IR ( const Apl16u * pSrc , int srcStep , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXor_16u_C1R ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , Apl16u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliXor_16u_C3R ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , Apl16u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliXor_16u_C4R ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , Apl16u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliXor_16u_AC4R ( const Apl16u * pSrc1 , int src1Step , const Apl16u * pSrc2 , int src2Step , Apl16u * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliXor_32s_C1IR ( const Apl32s * pSrc , int srcStep , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXor_32s_C3IR ( const Apl32s * pSrc , int srcStep , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXor_32s_C4IR ( const Apl32s * pSrc , int srcStep , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXor_32s_AC4IR ( const Apl32s * pSrc , int srcStep , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXor_32s_C1R ( const Apl32s * pSrc1 , int src1Step , const Apl32s * pSrc2 , int src2Step , Apl32s * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliXor_32s_C3R ( const Apl32s * pSrc1 , int src1Step , const Apl32s * pSrc2 , int src2Step , Apl32s * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliXor_32s_C4R ( const Apl32s * pSrc1 , int src1Step , const Apl32s * pSrc2 , int src2Step , Apl32s * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

AplStatus apliXor_32s_AC4R ( const Apl32s * pSrc1 , int src1Step , const Apl32s * pSrc2 , int src2Step , Apl32s * pDst , int dstStep ,<br />

ApliSize roiSize );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 228 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc1 Pointer to a location in source buffer one.<br />

pSrc2 Pointer to a location in source buffer two.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

src1Step Source buffer one step size (width of the buffer in bytes).<br />

src2Step Source buffer two step size (width of the buffer in bytes).<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through ROIs in two source buffers and perform a bitwise exclusive logical OR (XOR) of the data in buffer 1 and<br />

the data in buffer 2. The results can be written back to the source location or to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 229 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

XorC<br />

XOR with constant<br />

Synopsis<br />

AplStatus apliXorC_8u_C1IR ( Apl8u value , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXorC_8u_C3IR ( const Apl8u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXorC_8u_AC4IR ( const Apl8u value[3] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXorC_8u_C4IR ( const Apl8u value[4] , Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXorC_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u value , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliXorC_8u_C3R ( const Apl8u * pSrc , int srcStep , const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliXorC_8u_AC4R ( const Apl8u * pSrc , int srcStep , const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliXorC_8u_C4R ( const Apl8u * pSrc , int srcStep , const Apl8u value[4] , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliXorC_16u_C1IR ( Apl16u value , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXorC_16u_C3IR ( const Apl16u value[3] , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXorC_16u_AC4IR ( const Apl16u value[3] , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXorC_16u_C4IR ( const Apl16u value[4] , Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXorC_16u_C1R ( const Apl16u * pSrc , int srcStep , Apl16u value , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliXorC_16u_C3R ( const Apl16u * pSrc , int srcStep , const Apl16u value[3] , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliXorC_16u_AC4R ( const Apl16u * pSrc , int srcStep , const Apl16u value[3] , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliXorC_16u_C4R ( const Apl16u * pSrc , int srcStep , const Apl16u value[4] , Apl16u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliXorC_32s_C1IR ( Apl32s value , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXorC_32s_C3IR ( const Apl32s value[3] , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXorC_32s_AC4IR ( const Apl32s value[3] , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXorC_32s_C4IR ( const Apl32s value[4] , Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize );<br />

AplStatus apliXorC_32s_C1R ( const Apl32s * pSrc , int srcStep , Apl32s value , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliXorC_32s_C3R ( const Apl32s * pSrc , int srcStep , const Apl32s value[3] , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliXorC_32s_AC4R ( const Apl32s * pSrc , int srcStep , const Apl32s value[3] , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliXorC_32s_C4R ( const Apl32s * pSrc , int srcStep , const Apl32s value[4] , Apl32s * pDst , int dstStep , ApliSize roiSize );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 230 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

value Specified value.<br />

value[3] An array of three specified values.<br />

value[4] An array of four specified values.<br />

Description<br />

These functions step through an ROI in a source buffer and perform a bitwise exclusive logical OR (XOR) of the source data and a<br />

specified constant. The results can be written back to the source location or to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 231 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Color Model Conversion Functions<br />

This chapter describes functions that convert image data from one color model or space to another.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 232 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

RGBToYUV<br />

Convert from RGB to YUV<br />

Synopsis<br />

AplStatus apliRGBToYUV_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToYUV_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToYUV_8u_P3R ( const Apl8u * const pSrc[3] , int srcStep , Apl8u * pDst[3] , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToYUV_8u_C3P3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst[3] , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the RGB color model to the YUV color space, and<br />

write the converted data to a destination buffer.<br />

A gamma-corrected RGB image (pSrc) declared in the ROI is converted to a YUV image (pDst).<br />

The following conversion formulas are used:<br />

Y = 0.299*R + 0.587*G + 0.114*B<br />

U = -0.147*R + 0.289*G + 0.436*B<br />

V = 0.615*R - 0.515*G - 0.100*B<br />

The input RGB contains the range [0 to 255]. The output Y contains the range [0 to 255]. The output U contains the range [16 to<br />

240], with 128 corresponding to zero. The output V ranges from [-157 to 157]. In order to fit the range [0 to 255], a constant value of<br />

128 is added and the values are saturated to the range [0 to 255].<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 233 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

YUVToRGB<br />

Convert from YUV to RGB<br />

Synopsis<br />

AplStatus apliYUVToRGB_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYUVToRGB_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYUVToRGB_8u_P3R ( const Apl8u * const pSrc[3] , int srcStep , Apl8u * pDst[3] , int dstStep , ApliSize roiSize );<br />

AplStatus apliYUVToRGB_8u_P3C3R ( const Apl8u * const pSrc[3] , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the YUV color space to the RGB color model, and<br />

write the converted data to a destination buffer.<br />

A YUV image (pSrc) declared in the ROI (roiSize) is converted to a gamma-corrected RGB image (pDst).<br />

The following conversion formulas are used:<br />

R = Y + 1.140*V<br />

G = Y - 0.394*U - 0.581*V<br />

B = Y + 2.032*U<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 234 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

RGBToYUV422<br />

Convert from RGB to YUV with 4:2:2 sampling<br />

Synopsis<br />

AplStatus apliRGBToYUV422_8u_C3C2R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToYUV422_8u_P3R ( const Apl8u * const pSrc[3] , int srcStep , Apl8u * pDst[3] , int dstStep[3] , ApliSize roiSize );<br />

AplStatus apliRGBToYUV422_8u_P3 ( const Apl8u * const pSrc[3] , Apl8u * pDst[3] , ApliSize imgSize );<br />

AplStatus apliRGBToYUV422_8u_C3P3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst[3] , int dstStep[3] , ApliSize roiSize );<br />

AplStatus apliRGBToYUV422_8u_C3P3 ( const Apl8u * pSrc , Apl8u * pDst[3] , ApliSize imgSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

dstStep[3] Destination three-channel planar buffer step size (array values define width of each plane in bytes).<br />

imgSize Specifies the dimensions of an entire image.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions convert data in a source buffer from the RGB color model to the YUV color space with 4:2:2 chroma subsampling, and<br />

write the converted data to a destination buffer. The repeating versions of the functions step through an ROI in a source buffer and<br />

write the converted data to a destination buffer.<br />

A gamma-corrected RGB image (pSrc) is converted to a YUV image with 4:2:2 chroma subsampling.<br />

The following conversion formulas are used:<br />

Y = 0.299*R + 0.587*G + 0.114*B<br />

U = -0.147*R + 0.289*G + 0.436*B<br />

V = 0.615*R - 0.515*G - 0.100*B<br />

The input RGB contains the range [0 to 255]. The output Y contains the range [0 to 255]. The output U contains the range [16 to<br />

240], with 128 corresponding to zero. The output V ranges from [-157 to 157]. In order to fit the range [0 to 255], a constant value of<br />

128 is added and the values are saturated to the range [0 to 255].<br />

Versions of the functions that don't specify an ROI apply the conversion to the whole image buffer.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 235 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 236 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

YUV422ToRGB<br />

Convert from YUV with 4:2:2 sampling to RGB<br />

Synopsis<br />

AplStatus apliYUV422ToRGB_8u_C2C3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYUV422ToRGB_8u_P3R ( const Apl8u* const pSrc[3] , int srcStep[3] , Apl8u* pDst[3] , int dstStep , ApliSize roiSize );<br />

AplStatus apliYUV422ToRGB_8u_P3 ( const Apl8u* const pSrc[3] , Apl8u* pDst[3] , ApliSize imgSize );<br />

AplStatus apliYUV422ToRGB_8u_P3C3R ( const Apl8u* const pSrc[3] , int srcStep[3] , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYUV422ToRGB_8u_P3AC4R ( const Apl8u* const pSrc[3] , int srcStep[3] , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYUV422ToRGB_8u_P3C3 ( const Apl8u* const pSrc[3] , Apl8u* pDst , ApliSize imgSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

imgSize Specifies the dimensions of an entire image.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

srcStep[3] Source three-channel planar buffer step size (array values define width of each plane in bytes).<br />

Description<br />

These functions convert data in a source buffer from the YUV color space with 4:2:2 chroma subsampling to the RGB model, and write<br />

the converted data to a destination buffer. The repeating versions of the functions step through an ROI in a source buffer and write the<br />

converted data to a destination buffer.<br />

A YUV image with 4:2:2 chroma subsampling (pSrc) is converted to a gamma-corrected RGB image (pDst).<br />

The following conversion formulas are used:<br />

R = Y + 1.140*V<br />

G = Y - 0.394*U - 0.581*V<br />

B = Y + 2.032*U<br />

Versions of the functions that don't specify an ROI apply the conversion to the whole image buffer.<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 237 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 238 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

RGBToYUV420<br />

Convert from RGB to YUV with 4:2:0 sampling<br />

Synopsis<br />

AplStatus apliRGBToYUV420_8u_P3R ( const Apl8u* const pSrc[3] , int srcStep , Apl8u* pDst[3] , int dstStep[3] , ApliSize roiSize );<br />

AplStatus apliRGBToYUV420_8u_P3 ( const Apl8u* const pSrc[3] , Apl8u* pDst[3] , ApliSize imgSize );<br />

AplStatus apliRGBToYUV420_8u_C3P3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst[3] , int dstStep[3] , ApliSize roiSize );<br />

AplStatus apliRGBToYUV420_8u_C3P3 ( const Apl8u* pSrc , Apl8u* pDst[3] , ApliSize imgSize );<br />

Parameters<br />

dstStep[3] Destination three-channel planar buffer step size (array values define width of each plane in bytes).<br />

imgSize Specifies the dimensions of an entire image.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions convert the data in a source buffer from the RGB color model to the YUV color space with 4:2:0 chroma subsampling,<br />

and write the converted data to a destination buffer. The repeating versions of the functions step through an ROI in a source buffer<br />

and write the converted data to a destination buffer.<br />

A gamma-corrected RGB image (pSrc) is converted to a YUV image with 4:2:0 chroma subsampling.<br />

The following conversion formulas are used:<br />

Y = 0.299*R + 0.587*G + 0.114*B<br />

U = -0.147*R + 0.289*G + 0.436*B<br />

V = 0.615*R - 0.515*G - 0.100*B<br />

The input RGB contains the range [0 to 255]. The output Y contains the range [0 to 255]. The output U contains the range [16 to<br />

240], with 128 corresponding to zero. The output V ranges from [-157 to 157]. In order to fit the range [0 to 255], a constant value of<br />

128 is added and the values are saturated to the range [0 to 255].<br />

Versions of the functions that don't specify an ROI apply the conversion to the whole image buffer.<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 239 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 240 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

YUV420ToRGB<br />

Convert from YUV with 4:2:0 sampling to RGB<br />

Synopsis<br />

AplStatus apliYUV420ToRGB_8u_P3R ( const Apl8u* const pSrc[3] , int srcStep[3] , Apl8u* pDst[3] , int dstStep , ApliSize roiSize );<br />

AplStatus apliYUV420ToRGB_8u_P3 ( const Apl8u* const pSrc[3] , Apl8u* pDst[3] , ApliSize imgSize );<br />

AplStatus apliYUV420ToRGB_8u_P3C3R ( const Apl8u* const pSrc[3] , int srcStep[3] , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYUV420ToRGB_8u_P3AC4R ( const Apl8u* const pSrc[3] , int srcStep[3] , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYUV420ToRGB_8u_P3C3 ( const Apl8u* const pSrc[3] , Apl8u* pDst , ApliSize imgSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

imgSize Specifies the dimensions of an entire image.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep[3] Source three-channel planar buffer step size (array values define width of each plane in bytes).<br />

Description<br />

These functions convert data in an ROI in a source buffer from the YUV color space with 4:2:0 chroma subsampling to the RGB model,<br />

and write the converted data to a destination buffer. The repeating versions of the functions step through an ROI in a source buffer<br />

and write the converted data to a destination buffer.<br />

A YUV image with 4:2:0 chroma subsampling (pSrc) is converted to a gamma-corrected RGB image (pDst).<br />

The following conversion formulas are used:<br />

R = Y + 1.140*V<br />

G = Y - 0.394*U - 0.581*V<br />

B = Y + 2.032*U<br />

Versions of the functions that don't specify an ROI apply the conversion to the whole image buffer.<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 241 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 242 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

YUV420ToBGR<br />

Convert from YUV with 4:2:0 sampling to BGR<br />

Synopsis<br />

AplStatus apliYUV420ToBGR_8u_P3C3R ( const Apl8u* pSrc[3] , int srcStep[3] , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep[3] Source three-channel planar buffer step size (array values define width of each plane in bytes).<br />

Description<br />

This function steps through an ROI in a source buffer, converts the source data from the YUV color space with 4:2:0 chroma<br />

subsampling to the BGR model, and writes the converted data to a destination buffer.<br />

A YUV image with 4:2:0 chroma subsampling (pSrc) is converted to a gamma-corrected BGR image (pDst).<br />

The following conversion formulas are used:<br />

R = Y + 1.140*V<br />

G = Y - 0.394*U - 0.581*V<br />

B = Y + 2.032*U<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 243 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

YUV420ToRGB*<br />

Convert from YUV with 4:2:0 sampling to 16-bit RGB<br />

Synopsis<br />

AplStatus apliYUV420ToRGB565_8u16u_P3C3R ( const Apl8u* const pSrc[3] , int srcStep[3] , Apl16u* pDst , int dstStep , ApliSize roiSize<br />

);<br />

AplStatus apliYUV420ToRGB555_8u16u_P3C3R ( const Apl8u* const pSrc[3] , int srcStep[3] , Apl16u* pDst , int dstStep , ApliSize roiSize<br />

);<br />

AplStatus apliYUV420ToRGB444_8u16u_P3C3R ( const Apl8u* const pSrc[3] , int srcStep[3] , Apl16u* pDst , int dstStep , ApliSize roiSize<br />

);<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep[3] Source three-channel planar buffer step size (array values define width of each plane in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the YUV color space with 4:2:0 chroma<br />

subsampling to the 16-bit RGB model, and write the converted data to a destination buffer.<br />

A YUV image with 4:2:0 chroma subsampling (pSrc) is converted to a gamma-corrected RGB image (pDst).<br />

The following conversion formulas are used:<br />

R = Y + 1.140*V<br />

G = Y - 0.394*U - 0.581*V<br />

B = Y + 2.032*U<br />

*The destination image is a packed RGB 16-bit per pixel image with reduced bit depth. The three channel intensities are packed into<br />

two consecutive bytes. After the conversion is performed, the bit reduction discards the least significant bits in the image.<br />

There are 3 possible packed formats:<br />

RGB565 - 5 bits for Red, 6 bits for Green, 5 bits for Blue<br />

RGB555 - 5 bits for Red, 5 bits for Green, 5 bits for Blue<br />

RGB444 - 4 bits for Red, 4 bits for Green, 4 bits for Blue<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 244 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 245 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

YUV420ToBGR*<br />

Convert from YUV with 4:2:0 sampling to 16-bit BGR<br />

Synopsis<br />

AplStatus apliYUV420ToBGR565_8u16u_P3C3R ( const Apl8u* const pSrc[3] , int srcStep[3] , Apl16u* pDst , int dstStep , ApliSize roiSize<br />

);<br />

AplStatus apliYUV420ToBGR555_8u16u_P3C3R ( const Apl8u* const pSrc[3] , int srcStep[3] , Apl16u* pDst , int dstStep , ApliSize roiSize<br />

);<br />

AplStatus apliYUV420ToBGR444_8u16u_P3C3R ( const Apl8u* const pSrc[3] , int srcStep[3] , Apl16u* pDst , int dstStep , ApliSize roiSize<br />

);<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep[3] Source three-channel planar buffer step size (array values define width of each plane in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the YUV color space with 4:2:0 chroma<br />

subsampling to the 16-bit BGR model, and write the converted data to a destination buffer.<br />

A YUV image with 4:2:0 chroma subsampling (pSrc) is converted to a gamma-corrected BGR image (pDst).<br />

The following conversion formulas are used:<br />

R = Y + 1.140*V<br />

G = Y - 0.394*U - 0.581*V<br />

B = Y + 2.032*U<br />

*The destination image is a packed BGR 16-bit per pixel image, with reduced bit depth; the three channel intensities are packed into<br />

two consecutive bytes. After the conversion is performed, the bit reduction discards the least significant bits in the image.<br />

There are 3 possible packed formats:<br />

RGB565 - 5 bits for Red, 6 bits for Green, 5 bits for Blue<br />

RGB555 - 5 bits for Red, 5 bits for Green, 5 bits for Blue<br />

RGB444 - 4 bits for Red, 4 bits for Green, 4 bits for Blue<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 246 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 247 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

RGBToYCbCr<br />

Convert from RGB to YCbCr<br />

Synopsis<br />

AplStatus apliRGBToYCbCr_8u_C3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToYCbCr_8u_AC4R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToYCbCr_8u_P3R ( const Apl8u* const pSrc[3] , int srcStep , Apl8u* pDst[3] , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the RGB color model to the YCbCr color space,<br />

and write the converted data to a destination buffer.<br />

A gamma-corrected RGB image (pSrc) declared in the ROI (roiSize) is converted to a YCbCr image (pDst).<br />

The following conversion formulas are used:<br />

Y = 0.257*R + 0.504*G + 0.098*B + 16<br />

Cb = -0.148*R - 0.291*G + 0.439*B + 128<br />

Cr = 0.439*R - 0.368*G - 0.071*B + 128<br />

The input RGB contains the range [0 to 255]. The output Y nominally contains the range [16 to 235]. The output Cb and Cr contains<br />

the range [16 to 240], with 128 corresponding to zero.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 248 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

YCbCrToRGB<br />

Convert from YCbCr to RGB<br />

Synopsis<br />

AplStatus apliYCbCrToRGB_8u_C3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCrToRGB_8u_AC4R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCrToRGB_8u_P3R ( const Apl8u* const pSrc[3] , int srcStep , Apl8u* pDst[3] , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCrToRGB_8u_P3C3R ( const Apl8u* const pSrc[3] , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the YCbCr color space to the RGB model, and<br />

write the converted data to a destination buffer.<br />

A YUV image (pSrc) declared in the ROI (roiSize) is converted to a gamma-corrected RGB image (pDst).<br />

The following conversion formulas are used:<br />

R = 1.164*(Y-16) + 1.596*(Cr-128)<br />

G = 1.164*(Y-16) - 0.392*(Cb-128) - 0.813*(Cr-128)<br />

B = 1.164*(Y-16) + 2.017*(Cb-128)<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 249 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

YCbCrToRGB*<br />

Convert from YCbCr to 16-bit RGB<br />

Synopsis<br />

AplStatus apliYCbCrToRGB565_8u16u_C3R ( const Apl8u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCrToRGB555_8u16u_C3R ( const Apl8u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCrToRGB444_8u16u_C3R ( const Apl8u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCrToRGB565_8u16u_P3C3R ( const Apl8u* pSrc[3] , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCrToRGB555_8u16u_P3C3R ( const Apl8u* pSrc[3] , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCrToRGB444_8u16u_P3C3R ( const Apl8u* pSrc[3] , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the YCbCr color space to the 16-bit RGB model,<br />

and write the converted data to a destination buffer.<br />

A YCbCr image (pSrc) is converted to a gamma-corrected RGB image (pDst).<br />

The following conversion formulas are used:<br />

R = 1.164*(Y-16) + 1.596*(Cr-128)<br />

G = 1.164*(Y-16) - 0.392*(Cb-128) - 0.813*(Cr-128)<br />

B = 1.164*(Y-16) + 2.017*(Cb-128)<br />

*The destination image is a packed RGB 16-bit per pixel image, with reduced bit depth; the three channel intensities are packed into<br />

two consecutive bytes. After the conversion is performed, the bit reduction discards the least significant bits in the image.<br />

There are 3 possible packed formats:<br />

RGB565 - 5 bits for Red, 6 bits for Green, 5 bits for Blue<br />

RGB555 - 5 bits for Red, 5 bits for Green, 5 bits for Blue<br />

RGB444 - 4 bits for Red, 4 bits for Green, 4 bits for Blue<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 250 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 251 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

YCbCrToBGR*<br />

Convert from YCbCr to 16-bit BGR<br />

Synopsis<br />

AplStatus apliYCbCrToBGR565_8u16u_C3R ( const Apl8u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCrToBGR555_8u16u_C3R ( const Apl8u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCrToBGR444_8u16u_C3R ( const Apl8u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCrToBGR565_8u16u_P3C3R ( const Apl8u* pSrc[3] , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCrToBGR555_8u16u_P3C3R ( const Apl8u* pSrc[3] , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCrToBGR444_8u16u_P3C3R ( const Apl8u* pSrc[3] , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the YCbCr color space to the 16-bit BGR model,<br />

and write the converted data to a destination buffer.<br />

A YCbCr image (pSrc) is converted to a gamma-corrected BGR image (pDst).<br />

The following conversion formulas are used:<br />

R = 1.164*(Y-16) + 1.596*(Cr-128)<br />

G = 1.164*(Y-16) - 0.392*(Cb-128) - 0.813*(Cr-128)<br />

B = 1.164*(Y-16) + 2.017*(Cb-128)<br />

*The destination image is a packed RGB 16-bit per pixel image, with reduced bit depth; the three channel intensities are packed into<br />

two consecutive bytes. After the conversion is performed, the bit reduction discards the least significant bits in the image.<br />

There are 3 possible packed formats:<br />

RGB565 - 5 bits for Red, 6 bits for Green, 5 bits for Blue<br />

RGB555 - 5 bits for Red, 5 bits for Green, 5 bits for Blue<br />

RGB444 - 4 bits for Red, 4 bits for Green, 4 bits for Blue<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 252 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 253 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

RGBToYCbCr422<br />

Convert from RGB to YCbCr with 4:2:2 sampling<br />

Synopsis<br />

AplStatus apliRGBToYCbCr422_8u_C3C2R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToYCbCr422_8u_P3C2R ( const Apl8u* const pSrc[3] , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the RGB color model to the YCbCr color space<br />

with 4:2:2 chroma subsampling, and write the converted data to a destination buffer.<br />

A gamma-corrected RGB image (pSrc) is converted to a 16-bit per pixel YCbCr image with 4:2:2 chroma subsampling.<br />

The following conversion formulas are used:<br />

Y = 0.257*R + 0.504*G + 0.098*B + 16<br />

Cb = -0.148*R - 0.291*G + 0.439*B + 128<br />

Cr = 0.439*R - 0.368*G - 0.071*B + 128<br />

The input RGB contains the range [0 to 255]. The output Y nominally contains the range [16 to 235]. The output Cb and Cr contains<br />

the range [16 to 240], with 128 corresponding to zero.<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 254 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

YCbCr422ToRGB<br />

Convert from YCbCr with 4:2:2 sampling to RGB<br />

Synopsis<br />

AplStatus apliYCbCr422ToRGB_8u_C2C3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCr422ToRGB_8u_C2P3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst[3] , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCr422ToRGB_8u_P3C3R ( const Apl8u* const pSrc[3] , int srcStep[3] , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

srcStep[3] Source three-channel planar buffer step size (array values define width of each plane in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the YCbCr color space with 4:2:2 chroma<br />

subsampling to the RGB model, and write the converted data to a destination buffer.<br />

A 16-bit per pixel YCbCr image with 4:2:2 chroma subsampling (pSrc) is converted to a gamma-corrected RGB image (pDst).<br />

The following conversion formulas are used:<br />

R = 1.164*(Y-16) + 1.596*(Cr-128)<br />

G = 1.164*(Y-16) - 0.392*(Cb-128) - 0.813*(Cr-128)<br />

B = 1.164*(Y-16) + 2.017*(Cb-128)<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 255 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

RGBToCbYCr422*<br />

Convert from RGB to CbYCr with 4:2:2 sampling<br />

Synopsis<br />

AplStatus apliRGBToCbYCr422_8u_C3C2R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToCbYCr422Gamma_8u_C3C2R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the RGB color model to the CbYCr color space<br />

with 4:2:2 chroma subsampling, and write the converted data to a destination buffer.<br />

A gamma-corrected RGB image (pSrc) is converted to a 16-bit per pixel CbYCr image with 4:2:2 chroma subsampling.<br />

The following conversion formulas are used:<br />

Y = 0.257*R + 0.504*G + 0.098*B + 16<br />

Cb = -0.148*R - 0.291*G + 0.439*B + 128<br />

Cr = 0.439*R - 0.368*G - 0.071*B + 128<br />

The input RGB contains the range [0 to 255]. The output Y nominally contains the range [16 to 235]. The output Cb and Cr contains<br />

the range [16 to 240], with 128 corresponding to zero.<br />

*A version of this function supports CbYCr gamma correction.<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 256 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

CbYCr422ToRGB<br />

Convert from CbYCr with 4:2:2 sampling to RGB<br />

Synopsis<br />

AplStatus apliCbYCr422ToRGB_8u_C2C3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

This function steps through an ROI in a source buffer, converts the source data from the CbYCr color space with 4:2:2 chroma<br />

subsampling to the RGB model, and writes the converted data to a destination buffer.<br />

A 16-bit per pixel CbYCr image with 4:2:2 chroma subsampling (pSrc) is converted to a gamma-corrected RGB image (pDst).<br />

The following conversion formulas are used:<br />

R = 1.164*(Y-16) + 1.596*(Cr-128)<br />

G = 1.164*(Y-16) - 0.392*(Cb-128) - 0.813*(Cr-128)<br />

B = 1.164*(Y-16) + 2.017*(Cb-128)<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 257 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

BGRToCbYCr422<br />

Convert from BGR to CbYCr with 4:2:2 sampling<br />

Synopsis<br />

AplStatus apliBGRToCbYCr422_8u_AC4C2R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

This function steps through an ROI in a source buffer, converts the source data from the BGR color model to the CbYCr color space<br />

with 4:2:2 chroma subsampling, and writes the converted data to a destination buffer.<br />

A gamma-corrected BGR image (pSrc) is converted to a 16-bit per pixel CbYCr image with 4:2:2 chroma subsampling.<br />

The following conversion formulas are used:<br />

Y = 0.257*R + 0.504*G + 0.098*B + 16<br />

Cb = -0.148*R - 0.291*G + 0.439*B + 128<br />

Cr = 0.439*R - 0.368*G - 0.071*B + 128<br />

The input RGB contains the range [0 to 255]. The output Y nominally contains the range [16 to 235]. The output Cb and Cr contains<br />

the range [16 to 240], with 128 corresponding to zero.<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 258 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

CbYCr422ToBGR<br />

Convert from CbYCr with 4:2:2 sampling to BGR<br />

Synopsis<br />

AplStatus apliCbYCr422ToBGR_8u_C2C4R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize , Apl8u alpha );<br />

Parameters<br />

alpha Alpha (RGBA transparency) constant value.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

This function steps through an ROI in a source buffer, converts the source data from the CbYCr color space with 4:2:2 chroma<br />

subsampling to the BGR model, and writes the converted data to a destination buffer.<br />

A 16-bit per pixel CbYCr image with 4:2:2 chroma subsampling (pSrc) is converted to a gamma-corrected BGR image (pDst).<br />

The following conversion formulas are used:<br />

R = 1.164*(Y-16) + 1.596*(Cr-128)<br />

G = 1.164*(Y-16) - 0.392*(Cb-128) - 0.813*(Cr-128)<br />

B = 1.164*(Y-16) + 2.017*(Cb-128)<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 259 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

YCbCr422ToRGB*<br />

Convert from YCbCr with 4:2:2 sampling to 16-bit RGB<br />

Synopsis<br />

AplStatus apliYCbCr422ToRGB565_8u16u_C2C3R ( const Apl8u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCr422ToRGB555_8u16u_C2C3R ( const Apl8u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCr422ToRGB444_8u16u_C2C3R ( const Apl8u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCr422ToRGB565_8u16u_P3C3R ( const Apl8u* pSrc[3] , int srcStep[3] , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCr422ToRGB555_8u16u_P3C3R ( const Apl8u* pSrc[3] , int srcStep[3] , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCr422ToRGB444_8u16u_P3C3R ( const Apl8u* pSrc[3] , int srcStep[3] , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

srcStep[3] Source three-channel planar buffer step size (array values define width of each plane in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the YCbCr color space with 4:2:2 chroma<br />

subsampling to the 16-bit RGB model, and write the converted data to a destination buffer.<br />

A CbYCr image with 4:2:2 chroma subsampling (pSrc) is converted to a gamma-corrected RGB image (pDst).<br />

The following conversion formulas are used:<br />

R = 1.164*(Y-16) + 1.596*(Cr-128)<br />

G = 1.164*(Y-16) - 0.392*(Cb-128) - 0.813*(Cr-128)<br />

B = 1.164*(Y-16) + 2.017*(Cb-128)<br />

*The destination image is a packed RGB 16-bit per pixel image, with reduced bit depth; the three channel intensities are packed into<br />

two consecutive bytes. After the conversion is performed, the bit reduction discards the least significant bits in the image.<br />

There are 3 possible packed formats:<br />

RGB565 - 5 bits for Red, 6 bits for Green, 5 bits for Blue<br />

RGB555 - 5 bits for Red, 5 bits for Green, 5 bits for Blue<br />

RGB444 - 4 bits for Red, 4 bits for Green, 4 bits for Blue<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 260 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 261 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

YCbCr422ToBGR*<br />

Convert from YCbCr with 4:2:2 sampling to 16-bit BGR<br />

Synopsis<br />

AplStatus apliYCbCr422ToBGR565_8u16u_C2C3R ( const Apl8u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCr422ToBGR555_8u16u_C2C3R ( const Apl8u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCr422ToBGR444_8u16u_C2C3R ( const Apl8u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCr422ToBGR565_8u16u_P3C3R ( const Apl8u* pSrc[3] , int srcStep[3] , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCr422ToBGR555_8u16u_P3C3R ( const Apl8u* pSrc[3] , int srcStep[3] , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCr422ToBGR444_8u16u_P3C3R ( const Apl8u* pSrc[3] , int srcStep[3] , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

srcStep[3] Source three-channel planar buffer step size (array values define width of each plane in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the YCbCr color space with 4:2:2 chroma<br />

subsampling to the 16-bit BGR model, and write the converted data to a destination buffer.<br />

A CbYCr image with 4:2:2 chroma subsampling (pSrc) is converted to a gamma-corrected BGR image (pDst).<br />

The following conversion formulas are used:<br />

R = 1.164*(Y-16) + 1.596*(Cr-128)<br />

G = 1.164*(Y-16) - 0.392*(Cb-128) - 0.813*(Cr-128)<br />

B = 1.164*(Y-16) + 2.017*(Cb-128)<br />

*The destination image is a packed BGR 16-bit per pixel image, with reduced bit depth; the three channel intensities are packed into<br />

two consecutive bytes. After the conversion is performed, the bit reduction discards the least significant bits in the image.<br />

There are 3 possible packed formats:<br />

BGR565 - 5 bits for Blue, 6 bits for Green, 5 bits for Red<br />

BGR555 - 5 bits for Blue, 5 bits for Green, 5 bits for Red<br />

BGR444 - 4 bits for Blue, 4 bits for Green, 4 bits for Red<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 262 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 263 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

RGBToYCbCr420<br />

Convert from RGB to YCbCr with 4:2:0 sampling<br />

Synopsis<br />

AplStatus apliRGBToYCbCr420_8u_C3P3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst[3] , int dstStep[3] , ApliSize roiSize );<br />

Parameters<br />

dstStep[3] Destination three-channel planar buffer step size (array values define width of each plane in bytes).<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

This function steps through an ROI in a source buffer, converts the source data from the RGB color model to the YCbCr color space<br />

with 4:2:0 chroma subsampling, and writes the converted data to a destination buffer.<br />

A gamma-corrected RGB image (pSrc) is converted to a YCbCr image with 4:2:0 chroma subsampling.<br />

The following conversion formulas are used:<br />

Y = 0.257*R + 0.504*G + 0.098*B + 16<br />

Cb = -0.148*R - 0.291*G + 0.439*B + 128<br />

Cr = 0.439*R - 0.368*G - 0.071*B + 128<br />

The input RGB contains the range [0 to 255]. The output Y nominally contains the range [16 to 235]. The output Cb and Cr contains<br />

the range [16 to 240], with 128 corresponding to zero.<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 264 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

BGRToYCbCr420<br />

Convert from BGR to YCbCr with 4:2:0 sampling<br />

Synopsis<br />

AplStatus apliBGRToYCbCr420_8u_C3P3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst[3] , int dstStep[3] , ApliSize roiSize );<br />

AplStatus apliBGRToYCbCr420_8u_AC4P3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst[3] , int dstStep[3] , ApliSize roiSize );<br />

Parameters<br />

dstStep[3] Destination three-channel planar buffer step size (array values define width of each plane in bytes).<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the BGR color model to the YCbCr color space<br />

with 4:2:0 chroma subsampling, and writes the converted data to a destination buffer.<br />

A gamma-corrected BGR image (pSrc) is converted to a YCbCr image with 4:2:0 chroma subsampling.<br />

The following conversion formulas are used:<br />

Y = 0.257*R + 0.504*G + 0.098*B + 16<br />

Cb = -0.148*R - 0.291*G + 0.439*B + 128<br />

Cr = 0.439*R - 0.368*G - 0.071*B + 128<br />

The input RGB contains the range [0 to 255]. The output Y nominally contains the range [16 to 235]. The output Cb and Cr contains<br />

the range [16 to 240], with 128 corresponding to zero.<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 265 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

YCbCr420ToRGB<br />

Convert from YCbCr with 4:2:0 sampling to RGB<br />

Synopsis<br />

AplStatus apliYCbCr420ToRGB_8u_P3C3R ( const Apl8u* const pSrc[3] , int srcStep[3] , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep[3] Source three-channel planar buffer step size (array values define width of each plane in bytes).<br />

Description<br />

This function steps through an ROI in a source buffer, converts the source data from the YCbCr color space with 4:2:0 chroma<br />

subsampling to the RGB color model, and writes the converted data to a destination buffer.<br />

A YCbCr image with 4:2:0 chroma subsampling (pSrc) is converted to a gamma-corrected RGB image (pDst).<br />

The following conversion formulas are used:<br />

R = 1.164*(Y-16) + 1.596*(Cr-128)<br />

G = 1.164*(Y-16) - 0.392*(Cb-128) - 0.813*(Cr-128)<br />

B = 1.164*(Y-16) + 2.017*(Cb-128)<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 266 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

YCbCr420ToRGB*<br />

Convert from YCbCr with 4:2:0 sampling to 16-bit RGB<br />

Synopsis<br />

AplStatus apliYCbCr420ToRGB565_8u16u_P3C3R ( const Apl8u* pSrc[3] , int srcStep[3] , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCr420ToRGB555_8u16u_P3C3R ( const Apl8u* pSrc[3] , int srcStep[3] , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCr420ToRGB444_8u16u_P3C3R ( const Apl8u* pSrc[3] , int srcStep[3] , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep[3] Source three-channel planar buffer step size (array values define width of each plane in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the YCbCr color space with 4:2:0 chroma<br />

subsampling to the 16-bit RGB color model, and write the converted data to a destination buffer.<br />

A YCbCr image with 4:2:0 chroma subsampling (pSrc) is converted to a gamma-corrected RGB image (pDst).<br />

The following conversion formulas are used:<br />

R = 1.164*(Y-16) + 1.596*(Cr-128)<br />

G = 1.164*(Y-16) - 0.392*(Cb-128) - 0.813*(Cr-128)<br />

B = 1.164*(Y-16) + 2.017*(Cb-128)<br />

*The destination image is a packed RGB 16-bit per pixel image, with reduced bit depth; the three channel intensities are packed into<br />

two consecutive bytes. After the conversion is performed, the bit reduction discards the least significant bits in the image.<br />

There are 3 possible packed formats:<br />

RGB565 - 5 bits for Red, 6 bits for Green, 5 bits for Blue<br />

RGB555 - 5 bits for Red, 5 bits for Green, 5 bits for Blue<br />

RGB444 - 4 bits for Red, 4 bits for Green, 4 bits for Blue<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 267 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 268 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

YCbCr420ToBGR<br />

Convert from YCbCr with 4:2:0 sampling to BGR<br />

Synopsis<br />

AplStatus apliYCbCr420ToBGR_8u_P3C3R ( const Apl8u* const pSrc[3] , int srcStep[3] , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep[3] Source three-channel planar buffer step size (array values define width of each plane in bytes).<br />

Description<br />

This function steps through an ROI in a source buffer, converts the source data from the YCbCr color space with 4:2:0 chroma<br />

subsampling to the BGR color model with dithering, and writes the converted data to a destination buffer.<br />

A YCbCr image with 4:2:0 chroma subsampling (pSrc) is converted to a gamma-corrected BGR image (pDst).<br />

The following conversion formulas are used:<br />

R = 1.164*(Y-16) + 1.596*(Cr-128)<br />

G = 1.164*(Y-16) - 0.392*(Cb-128) - 0.813*(Cr-128)<br />

B = 1.164*(Y-16) + 2.017*(Cb-128)<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 269 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

YCbCr420ToBGR*<br />

Convert from YCbCr with 4:2:0 sampling to 16-bit BGR<br />

Synopsis<br />

AplStatus apliYCbCr420ToBGR565_8u16u_P3C3R ( const Apl8u* pSrc[3] , int srcStep[3] , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCr420ToBGR555_8u16u_P3C3R ( const Apl8u* pSrc[3] , int srcStep[3] , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCr420ToBGR444_8u16u_P3C3R ( const Apl8u* pSrc[3] , int srcStep[3] , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep[3] Source three-channel planar buffer step size (array values define width of each plane in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the YCbCr color space with 4:2:0 chroma<br />

subsampling to the 16-bit BGR color model, and write the converted data to a destination buffer.<br />

A YCbCr image with 4:2:0 chroma subsampling (pSrc) is converted to a gamma-corrected BGR image (pDst).<br />

The following conversion formulas are used:<br />

R = 1.164*(Y-16) + 1.596*(Cr-128)<br />

G = 1.164*(Y-16) - 0.392*(Cb-128) - 0.813*(Cr-128)<br />

B = 1.164*(Y-16) + 2.017*(Cb-128)<br />

*The destination image is a packed BGR 16-bit per pixel image, with reduced bit depth; the three channel intensities are packed into<br />

two consecutive bytes. After the conversion is performed, the bit reduction discards the least significant bits in the image.<br />

There are 3 possible packed formats:<br />

BGR565 - 5 bits for Blue, 6 bits for Green, 5 bits for Red<br />

BGR555 - 5 bits for Blue, 5 bits for Green, 5 bits for Red<br />

BGR444 - 4 bits for Blue, 4 bits for Green, 4 bits for Red<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 270 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 271 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

YCbCr411ToBGR<br />

Convert from YCbCr with 4:1:1 sampling to BGR<br />

Synopsis<br />

AplStatus apliYCbCr411ToBGR_8u_P3C3R ( const Apl8u* pSrc[3] , int srcStep[3] , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCbCr411ToBGR_8u_P3C4R ( const Apl8u* pSrc[3] , int srcStep[3] , Apl8u* pDst , int dstStep , ApliSize roiSize , Apl8u alpha<br />

);<br />

Parameters<br />

alpha Alpha (RGBA transparency) constant value.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep[3] Source three-channel planar buffer step size (array values define width of each plane in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the YCbCr color space with 4:1:1 chroma<br />

subsampling to the BGR color model, and write the converted data to a destination buffer.<br />

A YCbCr image with 4:1:1 chroma subsampling (pSrc) is converted to a gamma-corrected BGR image (pDst).<br />

The following conversion formulas are used:<br />

R = 1.164*(Y-16) + 1.596*(Cr-128)<br />

G = 1.164*(Y-16) - 0.392*(Cb-128) - 0.813*(Cr-128)<br />

B = 1.164*(Y-16) + 2.017*(Cb-128)<br />

Return Values<br />

aplStsDoubleSize Image size (height and/or width) is not a multiple of two warning status code.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 272 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

RGBToXYZ<br />

Convert from RGB to XYZ<br />

Synopsis<br />

AplStatus apliRGBToXYZ_8u_C3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToXYZ_8u_AC4R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToXYZ_16u_C3R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToXYZ_16u_AC4R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToXYZ_16s_C3R ( const Apl16s* pSrc , int srcStep , Apl16s* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToXYZ_16s_AC4R ( const Apl16s* pSrc , int srcStep , Apl16s* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToXYZ_32f_C3R ( const Apl32f* pSrc , int srcStep , Apl32f* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToXYZ_32f_AC4R ( const Apl32f* pSrc , int srcStep , Apl32f* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the RGB color model to the XYZ color space, and<br />

write the converted data to a destination buffer.<br />

A gamma-corrected RGB image (pSrc) declared in the ROI is converted to a CIE XYZ image (pDst).<br />

The following formulas are used:<br />

X = 0.412453*R + 0.35758 *G + 0.180423*B<br />

Y = 0.212671*R + 0.71516 *G + 0.072169*B<br />

Z = 0.019334*R + 0.119193*G + 0.950227*B<br />

The formulas assume that R, G, and B values are normalized to [0 to 1] for integer data types. For floating point data types, the data<br />

must already be in the range [0 to 1]. For integer data types, the converted image data is saturated to [0 to 1] and scaled to the data<br />

type range. For floating point data type, data is saturated to [0 to 1].<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 273 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 274 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

XYZToRGB<br />

Convert from XYZ to RGB<br />

Synopsis<br />

AplStatus apliXYZToRGB_8u_C3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliXYZToRGB_8u_AC4R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliXYZToRGB_16u_C3R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliXYZToRGB_16u_AC4R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliXYZToRGB_16s_C3R ( const Apl16s* pSrc , int srcStep , Apl16s* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliXYZToRGB_16s_AC4R ( const Apl16s* pSrc , int srcStep , Apl16s* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliXYZToRGB_32f_C3R ( const Apl32f* pSrc , int srcStep , Apl32f* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliXYZToRGB_32f_AC4R ( const Apl32f* pSrc , int srcStep , Apl32f* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the XYZ color space to the RGB color model, and<br />

write the converted data to a destination buffer.<br />

A CIE XYZ image (pSrc) declared in the ROI is converted to a gamma-corrected RGB image (pDst)<br />

The following conversion formulas are used:<br />

X = 3.240479*X - 1.53715 *Y - 0.498535*Z<br />

Y = -0.969256*X + 1.875991*Y + 0.041556*Z<br />

Z = 0.055648*X - 0.204043*Y + 1.057311*Z<br />

The formulas assume that X, Y, and Z values are normalized to [0 to 1] for integer data types. For floating point data types, the data<br />

must already be in the range [0 to 1]. For integer data types, the converted image data is saturated to [0 to 1] and scaled to the data<br />

type range. For floating point data type, data is simply saturated to [0 to 1].<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 275 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 276 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

RGBToLUV<br />

Convert from RGB to LUV<br />

Synopsis<br />

AplStatus apliRGBToLUV_8u_C3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToLUV_8u_AC4R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToLUV_16u_C3R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToLUV_16u_AC4R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToLUV_16s_C3R ( const Apl16s* pSrc , int srcStep , Apl16s* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToLUV_16s_AC4R ( const Apl16s* pSrc , int srcStep , Apl16s* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToLUV_32f_C3R ( const Apl32f* pSrc , int srcStep , Apl32f* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToLUV_32f_AC4R ( const Apl32f* pSrc , int srcStep , Apl32f* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the RGB color model to the LUV color space, and<br />

write the converted data to a destination buffer.<br />

A gamma-corrected RGB image (pSrc) declared in the ROI is converted to a CIE LUV image (pDst) in two steps.<br />

1. Convert( ) RGBToXYZ( ) using the following formulas.<br />

X = 0.412453*R + 0.35758 *G + 0.180423*B<br />

Y = 0.212671*R + 0.71516 *G + 0.072169*B<br />

Z = 0.019334*R + 0.119193*G + 0.950227*B<br />

The formulas assume that R, G, and B values are normalized to [0 to 1] for integer data types. For floating point data types, the data<br />

must already be in the range [0 to 1]. For integer data types, the converted image data is saturated to [0 to 1] and scaled to the data<br />

type range. For floating point data type, data is saturated to [0 to 1].<br />

2. Convert( ) XYZ to LUV as follows.<br />

D65 white point:<br />

CIE chromaticity coordinates:<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 277 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

xn = 0.312713<br />

yn = 0.329016<br />

CIE luminance:<br />

Yn = 1.0<br />

un = 4*xn / (-2*xn + 12*yn + 3)<br />

vn = 9*yn / (-2*xn + 12*yn + 3)<br />

u = 4*X / (X + 15*Y + 3*Z)<br />

v = 9*Y / (X + 15*Y + 3*Z)<br />

L = 116 * (Y/Yn)^(1/3) - 16<br />

U = 13*L*(u-un)<br />

V = 13*L*(v-vn)<br />

Computed L component values are in the range [0 to 100].<br />

Computed U component values are in the range [-124 to 220].<br />

Computed V component values are in the range [-140 to 116].<br />

The formulas assume that R, G, and B values are normalized to [0 to1] for integer data types. For floating point data types, the data<br />

must already be in the range [0 to 1]. For integer data types, the converted image data is saturated to [0 to 1] and scaled to the data<br />

type range.<br />

Scaling is performed as follows.<br />

8U data type:<br />

L = L * APL_MAX_8U / 100<br />

U = (U + 134) * APL_MAX_8U / 354<br />

V = (V + 140) * APL_MAX_8U / 256<br />

16U data type:<br />

L = L * APL_MAX_16U / 100<br />

U = (U + 134) * APL_MAX_16U / 354<br />

V = (V + 140) * APL_MAX_16U / 256<br />

16S data type:<br />

L = L * APL_MAX_16U / 100 + APL_MIN_16S<br />

U = (U + 134) * APL_MAX_16U / 354 + APL_MIN_16S<br />

V = (V + 140) * APL_MAX_16U / 256 + APL_MIN_16S<br />

32F data type:<br />

No conversion is applied, so the components remain in their ranges.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 278 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 279 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

LUVToRGB<br />

Convert from LUV to RGB<br />

Synopsis<br />

AplStatus apliLUVToRGB_8u_C3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLUVToRGB_8u_AC4R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLUVToRGB_16u_C3R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLUVToRGB_16u_AC4R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLUVToRGB_16s_C3R ( const Apl16s* pSrc , int srcStep , Apl16s* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLUVToRGB_16s_AC4R ( const Apl16s* pSrc , int srcStep , Apl16s* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLUVToRGB_32f_C3R ( const Apl32f* pSrc , int srcStep , Apl32f* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLUVToRGB_32f_AC4R ( const Apl32f* pSrc , int srcStep , Apl32f* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

A CIE LUV image (pSrc) declared in the ROI is converted to a gamma-corrected RGB image (pDst) in two steps.<br />

1. Convert( ) CIE LUV to XYZ as follows.<br />

Scale( ) data to the range [0 to 1]<br />

8U data type:<br />

L = L * 100 / APL_MAX_8U<br />

U = (U * 354 / APL_MAX_8U) - 134<br />

V = (V * 256 / APL_MAX_8U) - 140<br />

16U data type:<br />

L = L * 100 / APL_MAX_16U<br />

U = (U * 354 / APL_MAX_16U) - 134<br />

V = (V * 256 / APL_MAX_16U) - 140<br />

16S data type:<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 280 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

U = ((U - APL_MIN_16S) * 354 / APL_MAX_16U) - 134<br />

V = ((V - APL_MIN_16S) * 256 / APL_MAX_16U) - 140<br />

32F data type:<br />

L, U, and V must already be in the range [0...1]<br />

D65 white point:<br />

CIE chromaticity coordinates:<br />

xn = 0.312713<br />

yn = 0.329016<br />

CIE luminance:<br />

Yn = 1.0<br />

un = 4*xn / (-2*xn + 12*yn + 3)<br />

vn = 9*yn / (-2*xn + 12*yn + 3)<br />

u = U / (14 * L) + un<br />

v = V / (13 * L) + vn<br />

Y = Yn * ((L + 16) / 116) ^ 3<br />

X = -9 * Y * u / ((u - 4) * v - u * v) = (9 / 4) * Y * u / v<br />

Z = (9 * Y - 15 * v * Y - v * X) / (3 * v)<br />

2.Convert( ) XYZ to RGB using the following formulas:<br />

X = 3.240479*X - 1.53715 *Y - 0.498535*Z<br />

Y = -0.969256*X + 1.875991*Y + 0.041556*Z<br />

Z = 0.055648*X - 0.204043*Y + 1.057311*Z<br />

The formulas assume that X, Y, and Z values are normalized to [0 to 1] for integer data types. For floating point data types, the data<br />

must already be in the range [0 to 1]. For integer data types, the converted image data is saturated to [0 to 1] and scaled to the data<br />

type range. For floating point data type, data is simply saturated to [0 to 1].<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 281 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

BGRToLab<br />

Convert from BGR to Lab<br />

Synopsis<br />

AplStatus apliBGRToLab_8u_C3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliBGRToLab_8u16u_C3R ( const Apl8u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the BGR color model to the Lab color space, and<br />

write the converted data to a destination buffer.<br />

A gamma-corrected RGB image (pSrc) declared in the ROI is converted to a CIE Lab image (pDst) in two steps.<br />

1. Normalize the data to [0 to 1] and convert RGB to XYZ using the following formulas.<br />

X = 0.412453*R + 0.35758 *G + 0.180423*B<br />

Y = 0.212671*R + 0.71516 *G + 0.072169*B<br />

Z = 0.019334*R + 0.119193*G + 0.950227*B<br />

The formulas assume that R, G, and B values are normalized to [0 to 1] for integer data types. For floating point data types, the data<br />

must already be in the range [0 to 1]. For integer data types, the converted image data is saturated to [0 to 1] and scaled to the data<br />

type range. For floating point data type, data is saturated to [0 to 1].<br />

2) Convert( ) XYZ To Lab as follows.<br />

D65 white point:<br />

Xn = 0.950455<br />

Yn = 1.0<br />

Zn = 1.088753<br />

CIE chromaticity coordinates:<br />

xn = 0.312713<br />

yn = 0.329016<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 282 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

if ((Y / Yn) > 0.008856)<br />

L = 116 * (Y/Yn)^(1/3) - 16 else L = 903.3 * (Y/Yn)^(1/3)<br />

a = 500 * [f(X/Xn) - f(Y/Yn)]<br />

b = 200 * [f(Y/Yn) - f(Z/Zn)]<br />

where if (t > 0.008856) f(t) = t^(1/3) - 16 else f(t) = 7.787*t + 16/116<br />

The computed L, a, and b are in the range [0 to 100], [-128 to 127], and [-128b to 127], respectively.<br />

The computed image data is quantized and scaled to fit the 8-bit or 16-bit range.<br />

8U data type:<br />

L = L * 255/100<br />

a = a + 128<br />

b = b + 128<br />

16u data type:<br />

L = L * 65535 / 100<br />

a = (a+128) * 255<br />

b = (b+128) * 255<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 283 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

LabToBGR<br />

Convert from Lab to BGR<br />

Synopsis<br />

AplStatus apliLabToBGR_8u_C3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliLabToBGR_16u8u_C3R ( const Apl16u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the Lab color space to the BGR color model, and<br />

write the converted data to a destination buffer.<br />

A CIE Lab image (pSrc) declared in the ROI is converted to a gamma-corrected RGB image (pDst) in two steps.<br />

1. Transform the data to the correct range as follows.<br />

8U data type:<br />

L = L * 100 / 255<br />

a = a - 128<br />

b = b - 128<br />

16u data type:<br />

L = L * 100 / 65535<br />

a = a / 255 - 128<br />

b = b / 255 - 128<br />

Convert to XYZ:<br />

Y = Yn * P^3<br />

X = Xn * (P + a/500)^3<br />

Z = Zn * (P - b/200)^2<br />

where P = (L+16)/116<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 284 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

D65 white point:<br />

Xn = 0.950455<br />

Yn = 1.0 Zn = 1.088753<br />

2.Convert( ) XYZ to BGR using the following formulas:<br />

X = 3.240479*X - 1.53715 *Y - 0.498535*Z<br />

Y = -0.969256*X + 1.875991*Y + 0.041556*Z<br />

Z = 0.055648*X - 0.204043*Y + 1.057311*Z<br />

The formulas assume that X, Y, and Z values are normalized to [0 to 1] for integer data types. For floating point data types, the data<br />

must already be in the range [0 to 1]. For integer data types, the converted image data is saturated to [0 to 1] and scaled to the data<br />

type range. For floating point data type, data is simply saturated to [0 to 1].<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 285 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

RGBToYCC<br />

Convert from RGB to YCC<br />

Synopsis<br />

AplStatus apliRGBToYCC_8u_C3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToYCC_8u_AC4R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToYCC_16u_C3R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToYCC_16u_AC4R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToYCC_16s_C3R ( const Apl16s* pSrc , int srcStep , Apl16s* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToYCC_16s_AC4R ( const Apl16s* pSrc , int srcStep , Apl16s* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToYCC_32f_C3R ( const Apl32f* pSrc , int srcStep , Apl32f* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToYCC_32f_AC4R ( const Apl32f* pSrc , int srcStep , Apl32f* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the RGB color model to the YCC color space, and<br />

write the converted data to a destination buffer.<br />

A gamma-corrected RGB image (pSrc) declared in the ROI is converted to a Photo YCC image (pDst) in four steps.<br />

1.Normalize the input to the range [0 to 1] for all integer data types. Floating-point data must already be in the range [0...1].<br />

2.Apply the following formulas:<br />

Y = 0.299*R + 0.587*G + 0.114*B<br />

C1 = -0.299*R - 0.587*G + 0.886*B<br />

C2 = 0.701*R - 0.587*G - 0.114*B<br />

3. Quantize the color model and convert to the Photo YCC model. Data is in the range [0 to 1].<br />

Y = (1/1.402) * Y<br />

C1 = (111.4/255) * C1 + 156/255<br />

C2 = (135.64/255) * C2 + 137/255<br />

4. For integer destination data types, the Photo YCC color model is scaled to the full range.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 286 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 287 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

YCCToRGB<br />

Convert from YCC to RGB<br />

Synopsis<br />

AplStatus apliYCCToRGB_8u_C3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCCToRGB_8u_AC4R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCCToRGB_16u_C3R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCCToRGB_16u_AC4R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCCToRGB_16s_C3R ( const Apl16s* pSrc , int srcStep , Apl16s* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCCToRGB_16s_AC4R ( const Apl16s* pSrc , int srcStep , Apl16s* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCCToRGB_32f_C3R ( const Apl32f* pSrc , int srcStep , Apl32f* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliYCCToRGB_32f_AC4R ( const Apl32f* pSrc , int srcStep , Apl32f* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the YCC color space to the RGB color model, and<br />

write the converted data to a destination buffer.<br />

A Photo YCC image (pSrc) declared in the ROI is converted to a gamma-corrected RGB image (pDst) as follows.<br />

Restore normal YCC data:<br />

Y = 1.3584 * Y<br />

C1 = 2.2179 * (C1 - 156/255)<br />

C2 = 1.8215 * (C2 - 137/255)<br />

The formulas assume that Y, C1, and C2 are normalized to [0 to 1]. For floating point data type, the input must already be in the<br />

range [0 to 1].<br />

For integer data types, an internal conversion is performed. Then the restored YCC data values are transformed to RGB.<br />

The following conversion formulas are used:<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 288 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

R = Y + C2<br />

G = Y - 0.194*C1 - 0.509*C2<br />

B = Y + C1<br />

For integer destination data types, the result image data is scaled to the full range of the destination data type.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 289 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

RGBToHLS<br />

Convert from RGB to HLS<br />

Synopsis<br />

AplStatus apliRGBToHLS_8u_C3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToHLS_8u_AC4R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToHLS_16u_C3R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToHLS_16u_AC4R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToHLS_16s_C3R ( const Apl16s* pSrc , int srcStep , Apl16s* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToHLS_16s_AC4R ( const Apl16s* pSrc , int srcStep , Apl16s* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToHLS_32f_C3R ( const Apl32f* pSrc , int srcStep , Apl32f* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToHLS_32f_AC4R ( const Apl32f* pSrc , int srcStep , Apl32f* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the RGB color model to the HLS color space, and<br />

write the converted data to a destination buffer.<br />

A gamma-corrected RGB image (pSrc) declared in the ROI is converted to an HLS image (pDst) as follows.<br />

// Lightness:<br />

M1 = max(R, G, B)<br />

M2 = min(R, G, B)<br />

L = (M1+M2)/2<br />

// Saturation:<br />

If (M1 == M2)<br />

S = H = 0<br />

else // chromatics case<br />

{<br />

if (L


Publication # 40535 February 2007<br />

}<br />

else<br />

S = (M1-M2) / (M1+M2)<br />

S = (M1-M2) / (2-M1-M2)<br />

//Hue:<br />

Cr = (M1-R) / (M1-M2)<br />

Cg = (M1-G) / (M1-M2)<br />

Cb = (M1-B) / (M1-M2)<br />

if (M1 == R)<br />

H = Cb - Cg<br />

if (M1 == G)<br />

H = 2 + Cr - Cb<br />

if (M1 == B)<br />

H = 4 + Cg - Cr<br />

H = H*60<br />

if (H < 0)<br />

H += 360<br />

Theformulas assume that R, G, and B values are in the range [0 to 1]. For integer destination data type, the values are scaled to the<br />

full range of the data type.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 291 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

HLSToRGB<br />

Convert from HLS to RGB<br />

Synopsis<br />

AplStatus apliHLSToRGB_8u_C3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliHLSToRGB_8u_AC4R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliHLSToRGB_16u_C3R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliHLSToRGB_16u_AC4R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliHLSToRGB_16s_C3R ( const Apl16s* pSrc , int srcStep , Apl16s* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliHLSToRGB_16s_AC4R ( const Apl16s* pSrc , int srcStep , Apl16s* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliHLSToRGB_32f_C3R ( const Apl32f* pSrc , int srcStep , Apl32f* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliHLSToRGB_32f_AC4R ( const Apl32f* pSrc , int srcStep , Apl32f* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the HLS color space to the RGB color model, and<br />

write the converted data to a destination buffer.<br />

An HLS image (pSrc) declared in the ROI is converted to a gamma-corrected RGB image (pDst) as follows.<br />

if ( L


Publication # 40535 February 2007<br />

}<br />

if (h > 360)<br />

if (h < 60)<br />

h = h - 360<br />

R = (M1 + (M2 - M1)*h/60)<br />

else if (h < 180)<br />

R = M2<br />

else if (h < 240)<br />

else<br />

R = M1 + (M2 - M1)*(240 - h)/60<br />

R = M1<br />

h = H<br />

if (h < 60)<br />

G = (M1 + (M2 - M1)*h/60)<br />

else if (h < 180)<br />

G = M2<br />

else if (h < 240)<br />

G = M1 + (M2 - M1)*(240 - h)/60<br />

else<br />

G = M1<br />

h = H - 120<br />

if (h < 60)<br />

B = (M1 + (M2 - M1)*h/60)<br />

else if (h < 180)<br />

B = M2<br />

else if (h < 240)<br />

B = M1 + (M2 - M1)*(240 - h)/60<br />

else<br />

B = M1<br />

The formulas assume that H, L, and S values are in the range [0 to 1]. For integer destination data type, the values are scaled to the<br />

full range of the data type.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 293 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 294 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

BGRToHLS<br />

Convert from BGR to HLS<br />

Synopsis<br />

AplStatus apliBGRToHLS_8u_AC4R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliBGRToHLS_8u_C3P3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst[3] , int dstStep , ApliSize roiSize );<br />

AplStatus apliBGRToHLS_8u_AC4P4R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst[4] , int dstStep , ApliSize roiSize );<br />

AplStatus apliBGRToHLS_8u_AP4R ( const Apl8u* const pSrc[4] , int srcStep , Apl8u* pDst[4] , int dstStep , ApliSize roiSize );<br />

AplStatus apliBGRToHLS_8u_P3R ( const Apl8u* const pSrc[3] , int srcStep , Apl8u* pDst[3] , int dstStep , ApliSize roiSize );<br />

AplStatus apliBGRToHLS_8u_AP4C4R ( const Apl8u* const pSrc[4] , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliBGRToHLS_8u_P3C3R ( const Apl8u* const pSrc[3] , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the BGR color model to the HLS color space, and<br />

write the converted data to a destination buffer.<br />

A gamma-corrected BGR image (pSrc) declared in the ROI is converted to an HLS image (pDst) as follows.<br />

// Lightness:<br />

M1 = max(R, G, B)<br />

M2 = min(R, G, B)<br />

L = (M1+M2)/2<br />

// Saturation:<br />

If (M1 == M2)<br />

S = H = 0<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 295 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

else // chromatics case<br />

{<br />

if (L


Publication # 40535 February 2007<br />

HLSToBGR<br />

Convert from HLS to BGR<br />

Synopsis<br />

AplStatus apliHLSToBGR_8u_C3P3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst[3] , int dstStep , ApliSize roiSize );<br />

AplStatus apliHLSToBGR_8u_AC4P4R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst[4] , int dstStep , ApliSize roiSize );<br />

AplStatus apliHLSToBGR_8u_AP4R ( const Apl8u* const pSrc[4] , int srcStep , Apl8u* pDst[4] , int dstStep , ApliSize roiSize );<br />

AplStatus apliHLSToBGR_8u_P3R ( const Apl8u* const pSrc[3] , int srcStep , Apl8u* pDst[3] , int dstStep , ApliSize roiSize );<br />

AplStatus apliHLSToBGR_8u_AP4C4R ( const Apl8u* const pSrc[4] , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliHLSToBGR_8u_P3C3R ( const Apl8u* const pSrc[3] , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the HLS color space to the BGR color model, and<br />

write the converted data to a destination buffer.<br />

An HLS image (pSrc) declared in the ROI is converted to a gamma-corrected BGR image (pDst) as follows.<br />

An HLS image (pSrc) declared in the ROI is converted to a gamma-corrected RGB image (pDst) as follows.<br />

if ( L


Publication # 40535 February 2007<br />

else<br />

{<br />

h = H + 120<br />

if (h > 360)<br />

h = h - 360<br />

if (h < 60)<br />

R = (M1 + (M2 - M1)*h/60)<br />

else if (h < 180)<br />

R = M2<br />

else if (h < 240)<br />

R = M1 + (M2 - M1)*(240 - h)/60<br />

else<br />

R = M1<br />

h = H<br />

if (h < 60)<br />

G = (M1 + (M2 - M1)*h/60)<br />

else if (h < 180)<br />

G = M2<br />

else if (h < 240)<br />

G = M1 + (M2 - M1)*(240 - h)/60<br />

else<br />

G = M1<br />

h = H - 120<br />

if (h < 60)<br />

B = (M1 + (M2 - M1)*h/60)<br />

else if (h < 180)<br />

B = M2<br />

else if (h < 240)<br />

B = M1 + (M2 - M1)*(240 - h)/60<br />

else<br />

B = M1<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 298 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

}<br />

The formulas assume that H, L, and S values are in the range [0 to 1]. For integer destination data type, the values are scaled to the<br />

full range of the data type.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 299 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

RGBToHSV<br />

Convert from RGB to HSV<br />

Synopsis<br />

AplStatus apliRGBToHSV_8u_C3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToHSV_8u_AC4R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToHSV_16u_C3R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliRGBToHSV_16u_AC4R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the RGB color model to the HSV color space, and<br />

write the converted data to a destination buffer.<br />

A gamma-corrected RGB image (pSrc) declared in the ROI is converted to an HSV image (pDst) as follows.<br />

Value:<br />

V = max(R, G, B)<br />

Saturation:<br />

temp = min = (R, G, B)<br />

if (V == 0)<br />

achromatics case<br />

S = 0<br />

else<br />

chromatics case<br />

S = (V-temp)/V<br />

Hue:<br />

Cr = (V - R) / (V - temp)<br />

Cg = (V - G) / (V - temp)<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 300 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Cb = (V - B) / (V - temp)<br />

if (R==V)<br />

H = Cb - Cg<br />

if (G==V)<br />

H = 2 + Cr - Cb<br />

if (B==V)<br />

H = 4 + Cg - Cr<br />

H = H * 60<br />

if (H < 0)<br />

H = H + 360<br />

The formulas assume R, G, and B values are in the range [0 to 1].. For integer data types, the computed image data are scaled to the<br />

full range of the destination data type.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 301 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

HSVToRGB<br />

Convert from HSV to RGB<br />

Synopsis<br />

AplStatus apliHSVToRGB_8u_C3R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliHSVToRGB_8u_AC4R ( const Apl8u* pSrc , int srcStep , Apl8u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliHSVToRGB_16u_C3R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

AplStatus apliHSVToRGB_16u_AC4R ( const Apl16u* pSrc , int srcStep , Apl16u* pDst , int dstStep , ApliSize roiSize );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, convert the source data from the HSV color space to the RGB color model, and<br />

write the converted data to a destination buffer.<br />

An HSV image (pSrc) declared in the ROI is converted to a gamma-corrected RGB image (pDst) as follows.<br />

if (S==0)<br />

R = G = B = V<br />

else<br />

{<br />

if (H == 360)<br />

H = 0<br />

else<br />

H = H/60<br />

I = floor(H)<br />

F = H - I<br />

M = V * (1 - S)<br />

N = V * (1 - S * F)<br />

K = V * (1 - s * (1 - F))<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 302 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

}<br />

if (I == 0)<br />

R = V<br />

G = K<br />

B = M<br />

if (I == 1)<br />

R = N<br />

G = V<br />

B = M<br />

if (I == 2)<br />

R = M<br />

G = V<br />

B = K<br />

if (I == 3)<br />

R = M<br />

G = N<br />

B = V<br />

if (I == 4)<br />

R = K<br />

G = M<br />

B = V<br />

if (I == 5)<br />

R = V<br />

G = M<br />

B = V<br />

The computed image data is then scaled to the full range of the destination data type.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 303 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Threshold and Compare Functions<br />

This chapter describes functions that compare image data and manipulate image data based on compare operations.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 304 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Threshold<br />

Compare to a threshold, replace with threshold value (General)<br />

Synopsis<br />

AplStatus apliThreshold_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , Apl8u threshold ,<br />

AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , Apl16s threshold ,<br />

AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , Apl32f threshold ,<br />

AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u threshold[3] ,<br />

AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl16s<br />

threshold[3] , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl32f<br />

threshold[3] , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u threshold[3]<br />

, AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl16s<br />

threshold[3] , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl32f<br />

threshold[3] , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_8u_C1IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , Apl8u threshold , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_16s_C1IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , Apl16s threshold , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_32f_C1IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , Apl32f threshold , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_8u_C3IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl8u threshold[3] , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_16s_C3IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl16s threshold[3] , AplCmpOp aplCmpOp<br />

);<br />

AplStatus apliThreshold_32f_C3IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl32f threshold[3] , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_8u_AC4IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl8u threshold[3] , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_16s_AC4IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl16s threshold[3] , AplCmpOp aplCmpOp<br />

);<br />

AplStatus apliThreshold_32f_AC4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl32f threshold[3] , AplCmpOp aplCmpOp<br />

);<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 305 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

aplCmpOp Specifies a comparison operation to be performed (aplCmpLess, aplCmpGreater, aplCmpLessEq, aplCmpEq, or aplCmpGreaterEq).<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

threshold Threshold for each pixel.<br />

threshold[3] Three-channel threshold for each pixel.<br />

Description<br />

These functions step through an ROI in a source buffer and compare the source data to a specified threshold value using a specified<br />

compare operation. The compare operation can be "less than", "less than or equal", "equal", "greater than or equal" or "greater than".<br />

When the comparison evaluates as true, the output data is set to the threshold value. When the comparison evaluates as false, the<br />

output data is set to the same value as the source data. Output data is written back to the same buffer for in-place operation or to a<br />

destination buffer. .<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 306 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Threshold_GT<br />

Compare to a threshold, replace with threshold value (Greater Than)<br />

Synopsis<br />

AplStatus apliThreshold_GT_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , Apl8u threshold );<br />

AplStatus apliThreshold_GT_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , Apl16s threshold );<br />

AplStatus apliThreshold_GT_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , Apl32f threshold );<br />

AplStatus apliThreshold_GT_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u<br />

threshold[3] );<br />

AplStatus apliThreshold_GT_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl16s<br />

threshold[3] );<br />

AplStatus apliThreshold_GT_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl32f<br />

threshold[3] );<br />

AplStatus apliThreshold_GT_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u<br />

threshold[3] );<br />

AplStatus apliThreshold_GT_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl16s<br />

threshold[3] );<br />

AplStatus apliThreshold_GT_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl32f<br />

threshold[3] );<br />

AplStatus apliThreshold_GT_8u_C1IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , Apl8u threshold );<br />

AplStatus apliThreshold_GT_16s_C1IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , Apl16s threshold );<br />

AplStatus apliThreshold_GT_32f_C1IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , Apl32f threshold );<br />

AplStatus apliThreshold_GT_8u_C3IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl8u threshold[3] );<br />

AplStatus apliThreshold_GT_16s_C3IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl16s threshold[3] );<br />

AplStatus apliThreshold_GT_32f_C3IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl32f threshold[3] );<br />

AplStatus apliThreshold_GT_8u_AC4IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl8u threshold[3] );<br />

AplStatus apliThreshold_GT_16s_AC4IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl16s threshold[3] );<br />

AplStatus apliThreshold_GT_32f_AC4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl32f threshold[3] );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

threshold Threshold for each pixel.<br />

threshold[3] Three-channel threshold for each pixel.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 307 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through an ROI in a source buffer and compare source data to a specified threshold value. When the source data<br />

is greater than the threshold value, the output data is set to the threshold value. When the source data is less than or equal to the<br />

threshold value, the output data is set to the same value as the source data. Output data is written back to the same buffer for inplace<br />

operation or to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 308 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Threshold_LT<br />

Compare to a threshold, replace with threshold value (Less Than)<br />

Synopsis<br />

AplStatus apliThreshold_LT_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , Apl8u threshold );<br />

AplStatus apliThreshold_LT_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , Apl16s threshold );<br />

AplStatus apliThreshold_LT_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , Apl32f threshold );<br />

AplStatus apliThreshold_LT_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u<br />

threshold[3] );<br />

AplStatus apliThreshold_LT_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl16s<br />

threshold[3] );<br />

AplStatus apliThreshold_LT_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl32f<br />

threshold[3] );<br />

AplStatus apliThreshold_LT_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u<br />

threshold[3] );<br />

AplStatus apliThreshold_LT_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl16s<br />

threshold[3] );<br />

AplStatus apliThreshold_LT_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl32f<br />

threshold[3] );<br />

AplStatus apliThreshold_LT_8u_C1IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , Apl8u threshold );<br />

AplStatus apliThreshold_LT_16s_C1IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , Apl16s threshold );<br />

AplStatus apliThreshold_LT_32f_C1IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , Apl32f threshold );<br />

AplStatus apliThreshold_LT_8u_C3IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl8u threshold[3] );<br />

AplStatus apliThreshold_LT_16s_C3IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl16s threshold[3] );<br />

AplStatus apliThreshold_LT_32f_C3IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl32f threshold[3] );<br />

AplStatus apliThreshold_LT_8u_AC4IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl8u threshold[3] );<br />

AplStatus apliThreshold_LT_16s_AC4IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl16s threshold[3] );<br />

AplStatus apliThreshold_LT_32f_AC4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl32f threshold[3] );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

threshold Threshold for each pixel.<br />

threshold[3] Three-channel threshold for each pixel.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 309 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through an ROI in a source buffer and compare source data to a specified threshold value. When the source data<br />

is less than the threshold value, the output data is set to the threshold value. When the source data is more than or equal to the<br />

threshold value, the output data is set to the same value as the source data. Output data is written back to the same buffer for inplace<br />

operation or to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 310 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Threshold_Val<br />

Compare to a threshold, replace with specified value (General)<br />

Synopsis<br />

AplStatus apliThreshold_Val_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , Apl8u threshold ,<br />

Apl8u value , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_Val_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , Apl16s threshold ,<br />

Apl16s value , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_Val_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , Apl32f threshold ,<br />

Apl32f value , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_Val_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u<br />

threshold[3] , const Apl8u value[3] , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_Val_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl16s<br />

threshold[3] , const Apl16s value[3] , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_Val_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl32f<br />

threshold[3] , const Apl32f value[3] , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_Val_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u<br />

threshold[3] , const Apl8u value[3] , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_Val_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl16s<br />

threshold[3] , const Apl16s value[3] , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_Val_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl32f<br />

threshold[3] , const Apl32f value[3] , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_Val_8u_C1IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , Apl8u threshold , Apl8u value , AplCmpOp<br />

aplCmpOp );<br />

AplStatus apliThreshold_Val_16s_C1IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , Apl16s threshold , Apl16s value , AplCmpOp<br />

aplCmpOp );<br />

AplStatus apliThreshold_Val_32f_C1IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , Apl32f threshold , Apl32f value , AplCmpOp<br />

aplCmpOp );<br />

AplStatus apliThreshold_Val_8u_C3IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl8u threshold[3] , const Apl8u value[3]<br />

, AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_Val_16s_C3IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl16s threshold[3] , const Apl16s<br />

value[3] , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_Val_32f_C3IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl32f threshold[3] , const Apl32f<br />

value[3] , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_Val_8u_AC4IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl8u threshold[3] , const Apl8u<br />

value[3] , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_Val_16s_AC4IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl16s threshold[3] , const Apl16s<br />

value[3] , AplCmpOp aplCmpOp );<br />

AplStatus apliThreshold_Val_32f_AC4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl32f threshold[3] , const Apl32f<br />

value[3] , AplCmpOp aplCmpOp );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 311 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

aplCmpOp Specifies a comparison operation to be performed (aplCmpLess, aplCmpGreater, aplCmpLessEq, aplCmpEq, or aplCmpGreaterEq).<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

threshold Threshold for each pixel.<br />

threshold[3] Three-channel threshold for each pixel.<br />

value Specified value.<br />

value[3] An array of three specified values.<br />

Description<br />

These functions step through an ROI in a source buffer and compare source data to a specified threshold value using a specified<br />

compare operation. The compare operation can be "less than", "less than or equal", "equal", "greater than or equal" or "greater than".<br />

When the comparison evaluates as true, the output data is set to a specified value. When the comparison evaluates as false, the<br />

output data is set to the same value as the source data. Output data is written back to the same buffer for in-place operation or to a<br />

destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 312 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Threshold_GTVal<br />

Compare to a threshold, replace with specified value (Greater Than)<br />

Synopsis<br />

AplStatus apliThreshold_GTVal_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , Apl8u threshold ,<br />

Apl8u value );<br />

AplStatus apliThreshold_GTVal_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , Apl16s<br />

threshold , Apl16s value );<br />

AplStatus apliThreshold_GTVal_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , Apl32f threshold<br />

, Apl32f value );<br />

AplStatus apliThreshold_GTVal_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u<br />

threshold[3] , const Apl8u value[3] );<br />

AplStatus apliThreshold_GTVal_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl16s<br />

threshold[3] , const Apl16s value[3] );<br />

AplStatus apliThreshold_GTVal_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl32f<br />

threshold[3] , const Apl32f value[3] );<br />

AplStatus apliThreshold_GTVal_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u<br />

threshold[3] , const Apl8u value[3] );<br />

AplStatus apliThreshold_GTVal_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl16s<br />

threshold[3] , const Apl16s value[3] );<br />

AplStatus apliThreshold_GTVal_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl32f<br />

threshold[3] , const Apl32f value[3] );<br />

AplStatus apliThreshold_GTVal_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u<br />

threshold[4] , const Apl8u value[4] );<br />

AplStatus apliThreshold_GTVal_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl16s<br />

threshold[4] , const Apl16s value[4] );<br />

AplStatus apliThreshold_GTVal_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl32f<br />

threshold[4] , const Apl32f value[4] );<br />

AplStatus apliThreshold_GTVal_8u_C1IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , Apl8u threshold , Apl8u value );<br />

AplStatus apliThreshold_GTVal_16s_C1IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , Apl16s threshold , Apl16s value );<br />

AplStatus apliThreshold_GTVal_32f_C1IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , Apl32f threshold , Apl32f value );<br />

AplStatus apliThreshold_GTVal_8u_C3IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl8u threshold[3] , const Apl8u<br />

value[3] );<br />

AplStatus apliThreshold_GTVal_16s_C3IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl16s threshold[3] , const Apl16s<br />

value[3] );<br />

AplStatus apliThreshold_GTVal_32f_C3IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl32f threshold[3] , const Apl32f<br />

value[3] );<br />

AplStatus apliThreshold_GTVal_8u_AC4IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl8u threshold[3] , const Apl8u<br />

value[3] );<br />

AplStatus apliThreshold_GTVal_16s_AC4IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl16s threshold[3] , const Apl16s<br />

value[3] );<br />

AplStatus apliThreshold_GTVal_32f_AC4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl32f threshold[3] , const Apl32f<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 313 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

value[3] );<br />

AplStatus apliThreshold_GTVal_8u_C4IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl8u threshold[4] , const Apl8u<br />

value[4] );<br />

AplStatus apliThreshold_GTVal_16s_C4IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl16s threshold[4] , const Apl16s<br />

value[4] );<br />

AplStatus apliThreshold_GTVal_32f_C4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl32f threshold[4] , const Apl32f<br />

value[4] );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

threshold Threshold for each pixel.<br />

threshold[3] Three-channel threshold for each pixel.<br />

threshold[4] Four-channel threshold for each pixel.<br />

value Specified value.<br />

value[3] An array of three specified values.<br />

value[4] An array of four specified values.<br />

Description<br />

These functions step through an ROI in a source buffer and compare source data to a specified threshold value. When the source data<br />

is greater than the threshold value, the output data is set to a specified value. When the source data is less than or equal to the<br />

threshold value, the output data is set to the same value as the source data. Output data is written back to the same buffer for inplace<br />

operation or to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 314 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Threshold_LTVal<br />

Compare to a threshold, replace with specified value (Less Than)<br />

Synopsis<br />

AplStatus apliThreshold_LTVal_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , Apl8u threshold ,<br />

Apl8u value );<br />

AplStatus apliThreshold_LTVal_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , Apl16s<br />

threshold , Apl16s value );<br />

AplStatus apliThreshold_LTVal_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , Apl32f threshold<br />

, Apl32f value );<br />

AplStatus apliThreshold_LTVal_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u<br />

threshold[3] , const Apl8u value[3] );<br />

AplStatus apliThreshold_LTVal_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl16s<br />

threshold[3] , const Apl16s value[3] );<br />

AplStatus apliThreshold_LTVal_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl32f<br />

threshold[3] , const Apl32f value[3] );<br />

AplStatus apliThreshold_LTVal_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u<br />

threshold[3] , const Apl8u value[3] );<br />

AplStatus apliThreshold_LTVal_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl16s<br />

threshold[3] , const Apl16s value[3] );<br />

AplStatus apliThreshold_LTVal_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl32f<br />

threshold[3] , const Apl32f value[3] );<br />

AplStatus apliThreshold_LTVal_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u<br />

threshold[4] , const Apl8u value[4] );<br />

AplStatus apliThreshold_LTVal_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const Apl16s<br />

threshold[4] , const Apl16s value[4] );<br />

AplStatus apliThreshold_LTVal_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const Apl32f<br />

threshold[4] , const Apl32f value[4] );<br />

AplStatus apliThreshold_LTVal_8u_C1IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , Apl8u threshold , Apl8u value );<br />

AplStatus apliThreshold_LTVal_16s_C1IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , Apl16s threshold , Apl16s value );<br />

AplStatus apliThreshold_LTVal_32f_C1IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , Apl32f threshold , Apl32f value );<br />

AplStatus apliThreshold_LTVal_8u_C3IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl8u threshold[3] , const Apl8u<br />

value[3] );<br />

AplStatus apliThreshold_LTVal_16s_C3IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl16s threshold[3] , const Apl16s<br />

value[3] );<br />

AplStatus apliThreshold_LTVal_32f_C3IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl32f threshold[3] , const Apl32f<br />

value[3] );<br />

AplStatus apliThreshold_LTVal_8u_AC4IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl8u threshold[3] , const Apl8u<br />

value[3] );<br />

AplStatus apliThreshold_LTVal_16s_AC4IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl16s threshold[3] , const Apl16s<br />

value[3] );<br />

AplStatus apliThreshold_LTVal_32f_AC4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl32f threshold[3] , const Apl32f<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 315 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

value[3] );<br />

AplStatus apliThreshold_LTVal_8u_C4IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl8u threshold[4] , const Apl8u<br />

value[4] );<br />

AplStatus apliThreshold_LTVal_16s_C4IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl16s threshold[4] , const Apl16s<br />

value[4] );<br />

AplStatus apliThreshold_LTVal_32f_C4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl32f threshold[4] , const Apl32f<br />

value[4] );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

threshold Threshold for each pixel.<br />

threshold[3] Three-channel threshold for each pixel.<br />

threshold[4] Four-channel threshold for each pixel.<br />

value Specified value.<br />

value[3] An array of three specified values.<br />

value[4] An array of four specified values.<br />

Description<br />

These functions step through an ROI in a source buffer and compare source data to a specified threshold value. When the source data<br />

is less than the threshold value, the output data is set to a specified value. When the source data is more than or equal to the<br />

threshold value, the output data is set to the same value as the source data. Output data is written back to the same buffer for inplace<br />

operation or to a destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 316 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Threshold_LTValGTVal<br />

Compare to double threshold, replace with specified value (Less Than/Greater Than)<br />

Synopsis<br />

AplStatus apliThreshold_LTValGTVal_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , Apl8u<br />

thresholdLT , Apl8u valueLT , Apl8u thresholdGT , Apl8u valueGT );<br />

AplStatus apliThreshold_LTValGTVal_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , Apl16s<br />

thresholdLT , Apl16s valueLT , Apl16s thresholdGT , Apl16s valueGT );<br />

AplStatus apliThreshold_LTValGTVal_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , Apl32f<br />

thresholdLT , Apl32f valueLT , Apl32f thresholdGT , Apl32f valueGT );<br />

AplStatus apliThreshold_LTValGTVal_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const Apl8u<br />

thresholdLT[3] , const Apl8u valueLT[3] , const Apl8u thresholdGT[3] , const Apl8u valueGT[3] );<br />

AplStatus apliThreshold_LTValGTVal_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const<br />

Apl16s thresholdLT[3] , const Apl16s valueLT[3] , const Apl16s thresholdGT[3] , const Apl16s valueGT[3] );<br />

AplStatus apliThreshold_LTValGTVal_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const<br />

Apl32f thresholdLT[3] , const Apl32f valueLT[3] , const Apl32f thresholdGT[3] , const Apl32f valueGT[3] );<br />

AplStatus apliThreshold_LTValGTVal_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , const<br />

Apl8u thresholdLT[3] , const Apl8u valueLT[3] , const Apl8u thresholdGT[3] , const Apl8u valueGT[3] );<br />

AplStatus apliThreshold_LTValGTVal_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize roiSize , const<br />

Apl16s thresholdLT[3] , const Apl16s valueLT[3] , const Apl16s thresholdGT[3] , const Apl16s valueGT[3] );<br />

AplStatus apliThreshold_LTValGTVal_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , const<br />

Apl32f thresholdLT[3] , const Apl32f valueLT[3] , const Apl32f thresholdGT[3] , const Apl32f valueGT[3] );<br />

AplStatus apliThreshold_LTValGTVal_8u_C1IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , Apl8u thresholdLT , Apl8u valueLT ,<br />

Apl8u thresholdGT , Apl8u valueGT );<br />

AplStatus apliThreshold_LTValGTVal_16s_C1IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , Apl16s thresholdLT , Apl16s valueLT ,<br />

Apl16s thresholdGT , Apl16s valueGT );<br />

AplStatus apliThreshold_LTValGTVal_32f_C1IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , Apl32f thresholdLT , Apl32f valueLT ,<br />

Apl32f thresholdGT , Apl32f valueGT );<br />

AplStatus apliThreshold_LTValGTVal_8u_C3IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl8u thresholdLT[3] , const<br />

Apl8u valueLT[3] , const Apl8u thresholdGT[3] , const Apl8u valueGT[3] );<br />

AplStatus apliThreshold_LTValGTVal_16s_C3IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl16s thresholdLT[3] , const<br />

Apl16s valueLT[3] , const Apl16s thresholdGT[3] , const Apl16s valueGT[3] );<br />

AplStatus apliThreshold_LTValGTVal_32f_C3IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl32f thresholdLT[3] , const<br />

Apl32f valueLT[3] , const Apl32f thresholdGT[3] , const Apl32f valueGT[3] );<br />

AplStatus apliThreshold_LTValGTVal_8u_AC4IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl8u thresholdLT[3] , const<br />

Apl8u valueLT[3] , const Apl8u thresholdGT[3] , const Apl8u valueGT[3] );<br />

AplStatus apliThreshold_LTValGTVal_16s_AC4IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl16s thresholdLT[3] , const<br />

Apl16s valueLT[3] , const Apl16s thresholdGT[3] , const Apl16s valueGT[3] );<br />

AplStatus apliThreshold_LTValGTVal_32f_AC4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , const Apl32f thresholdLT[3] , const<br />

Apl32f valueLT[3] , const Apl32f thresholdGT[3] , const Apl32f valueGT[3] );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 317 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

thresholdGT Three-channel threshold for each pixel in greater-than operation.<br />

thresholdGT[3] Three-channel threshold for each pixel in greater-than operation.<br />

thresholdLT Threshold for each pixel in less-than operation.<br />

thresholdLT[3] Three-channel threshold for each pixel in less-than operation.<br />

valueGT Threshold for each pixel in greater-than operation.<br />

valueGT[3] Three-channel threshold for each pixel in greater-than operation.<br />

valueLT Threshold for each pixel in less-than operation.<br />

valueLT[3] Three-channel threshold for each pixel in less-than operation.<br />

Description<br />

These functions step through an ROI in a source buffer and compare source data to two specified threshold values. The value of<br />

thresholdLT must be less than the value of thresholdGT. When the source data is less than the value specified by thresholdLT, the<br />

output data is set to the value specified by valueLT. When the source data is greater than the value specified by thresholdGT, the<br />

output data is set to the value specified by valueLT. When the source data is within the range defined by thresholdLT and thresholdGT,<br />

the output data is set to same value as the source data. Output data is written back to the same buffer for in-place operation or to a<br />

destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsThresholdErr The less-than threshold is greater than the greater-than threshold.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 318 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Compare<br />

Compare source data<br />

Synopsis<br />

AplStatus apliCompare_8u_C1R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize , AplCmpOp aplCmpOp );<br />

AplStatus apliCompare_16s_C1R ( const Apl16s * pSrc1 , int src1Step , const Apl16s * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize , AplCmpOp aplCmpOp );<br />

AplStatus apliCompare_32f_C1R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize , AplCmpOp aplCmpOp );<br />

AplStatus apliCompare_8u_C3R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize , AplCmpOp aplCmpOp );<br />

AplStatus apliCompare_16s_C3R ( const Apl16s * pSrc1 , int src1Step , const Apl16s * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize , AplCmpOp aplCmpOp );<br />

AplStatus apliCompare_32f_C3R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize , AplCmpOp aplCmpOp );<br />

AplStatus apliCompare_8u_C4R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize , AplCmpOp aplCmpOp );<br />

AplStatus apliCompare_16s_C4R ( const Apl16s * pSrc1 , int src1Step , const Apl16s * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize , AplCmpOp aplCmpOp );<br />

AplStatus apliCompare_32f_C4R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize , AplCmpOp aplCmpOp );<br />

AplStatus apliCompare_8u_AC4R ( const Apl8u * pSrc1 , int src1Step , const Apl8u * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize , AplCmpOp aplCmpOp );<br />

AplStatus apliCompare_16s_AC4R ( const Apl16s * pSrc1 , int src1Step , const Apl16s * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize , AplCmpOp aplCmpOp );<br />

AplStatus apliCompare_32f_AC4R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize , AplCmpOp aplCmpOp );<br />

Parameters<br />

aplCmpOp Specifies a comparison operation to be performed (aplCmpLess, aplCmpGreater, aplCmpLessEq, aplCmpEq, or aplCmpGreaterEq).<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc1 Pointer to a location in source buffer one.<br />

pSrc2 Pointer to a location in source buffer two.<br />

roiSize Specifies the height and width of an ROI.<br />

src1Step Source buffer one step size (width of the buffer in bytes).<br />

src2Step Source buffer two step size (width of the buffer in bytes).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 319 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through ROIs in two source buffers and compare the data in buffer 1 to the data in buffer 2 using a specified<br />

compare operation. The compare operation can be "less than", "less than or equal, "equal", "greater than or equal" or "greater than".<br />

When the comparison evaluates as true, the output data is set to all ones. When the comparison evaluates as false, the output data is<br />

set to all zeroes. Output data is written to a 1-channel Apl8u destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 320 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

CompareC<br />

Compare to a constant<br />

Synopsis<br />

AplStatus apliCompareC_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u value , Apl8u * pDst , int dstStep , ApliSize roiSize , AplCmpOp<br />

aplCmpOp );<br />

AplStatus apliCompareC_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s value , Apl8u * pDst , int dstStep , ApliSize roiSize ,<br />

AplCmpOp aplCmpOp );<br />

AplStatus apliCompareC_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f value , Apl8u * pDst , int dstStep , ApliSize roiSize ,<br />

AplCmpOp aplCmpOp );<br />

AplStatus apliCompareC_8u_C3R ( const Apl8u * pSrc , int srcStep , const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize ,<br />

AplCmpOp aplCmpOp );<br />

AplStatus apliCompareC_16s_C3R ( const Apl16s * pSrc , int srcStep , const Apl16s value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize ,<br />

AplCmpOp aplCmpOp );<br />

AplStatus apliCompareC_32f_C3R ( const Apl32f * pSrc , int srcStep , const Apl32f value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize ,<br />

AplCmpOp aplCmpOp );<br />

AplStatus apliCompareC_8u_AC4R ( const Apl8u * pSrc , int srcStep , const Apl8u value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize ,<br />

AplCmpOp aplCmpOp );<br />

AplStatus apliCompareC_16s_AC4R ( const Apl16s * pSrc , int srcStep , const Apl16s value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize<br />

, AplCmpOp aplCmpOp );<br />

AplStatus apliCompareC_32f_AC4R ( const Apl32f * pSrc , int srcStep , const Apl32f value[3] , Apl8u * pDst , int dstStep , ApliSize roiSize ,<br />

AplCmpOp aplCmpOp );<br />

AplStatus apliCompareC_8u_C4R ( const Apl8u * pSrc , int srcStep , const Apl8u value[4] , Apl8u * pDst , int dstStep , ApliSize roiSize ,<br />

AplCmpOp aplCmpOp );<br />

AplStatus apliCompareC_16s_C4R ( const Apl16s * pSrc , int srcStep , const Apl16s value[4] , Apl8u * pDst , int dstStep , ApliSize roiSize ,<br />

AplCmpOp aplCmpOp );<br />

AplStatus apliCompareC_32f_C4R ( const Apl32f * pSrc , int srcStep , const Apl32f value[4] , Apl8u * pDst , int dstStep , ApliSize roiSize ,<br />

AplCmpOp aplCmpOp );<br />

Parameters<br />

aplCmpOp Specifies a comparison operation to be performed (aplCmpLess, aplCmpGreater, aplCmpLessEq, aplCmpEq, or aplCmpGreaterEq).<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

value Specified value.<br />

value[3] An array of three specified values.<br />

value[4] An array of four specified values.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 321 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through an ROI in a source buffer and compare the source data to a specified constant value using a specified<br />

compare operation. The compare operation can be "less than", "less than or equal, "equal", "greater than or equal" or "greater than".<br />

When the comparison evaluates as true, the output data is set to all ones. When the comparison evaluates as false, the output data is<br />

set to all zeroes. Output data is written to a 1-channel Apl8u destination buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 322 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

CompareEqualEps<br />

Compare floating-point data for equality<br />

Synopsis<br />

AplStatus apliCompareEqualEps_32f_C1R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl8u * pDst , int<br />

dstStep , ApliSize roiSize , Apl32f eps );<br />

AplStatus apliCompareEqualEps_32f_C3R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl8u * pDst , int<br />

dstStep , ApliSize roiSize , Apl32f eps );<br />

AplStatus apliCompareEqualEps_32f_C4R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl8u * pDst , int<br />

dstStep , ApliSize roiSize , Apl32f eps );<br />

AplStatus apliCompareEqualEps_32f_AC4R ( const Apl32f * pSrc1 , int src1Step , const Apl32f * pSrc2 , int src2Step , Apl8u * pDst , int<br />

dstStep , ApliSize roiSize , Apl32f eps );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

eps Tolerance value.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc1 Pointer to a location in source buffer one.<br />

pSrc2 Pointer to a location in source buffer two.<br />

roiSize Specifies the height and width of an ROI.<br />

src1Step Source buffer one step size (width of the buffer in bytes).<br />

src2Step Source buffer two step size (width of the buffer in bytes).<br />

Description<br />

These functions step through ROIs in two floating-point source buffers and compare the data in buffer 1 to the data in buffer 2 for<br />

equality within a specified tolerance. When the difference between the values is less than or equal to the specified tolerance, the<br />

output data is set to all ones. When the difference between the floating-point value and the constant is greater than the specified<br />

tolerance, the output data is set to all zeroes. Output data is written to a 1-channel Apl8u destination buffer.<br />

Return Values<br />

aplStsEpsValErr Eps is a negative value.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 323 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

CompareEqualEpsC<br />

Compare floating-point data to a constant<br />

Synopsis<br />

AplStatus apliCompareEqualEpsC_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f value , Apl8u * pDst , int dstStep , ApliSize roiSize ,<br />

Apl32f eps );<br />

AplStatus apliCompareEqualEpsC_32f_C3R ( const Apl32f * pSrc , int srcStep , const Apl32f value[3] , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize , Apl32f eps );<br />

AplStatus apliCompareEqualEpsC_32f_AC4R ( const Apl32f * pSrc , int srcStep , const Apl32f value[3] , Apl8u * pDst , int dstStep ,<br />

ApliSize roiSize , Apl32f eps );<br />

AplStatus apliCompareEqualEpsC_32f_C4R ( const Apl32f * pSrc , int srcStep , const Apl32f value[4] , Apl8u * pDst , int dstStep , ApliSize<br />

roiSize , Apl32f eps );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

eps Tolerance value.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

roiSize Specifies the height and width of an ROI.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

value Specified value.<br />

value[3] An array of three specified values.<br />

value[4] An array of four specified values.<br />

Description<br />

These functions step through an ROI in a source buffer and compare the source floating-point data for equality within a specified<br />

tolerance. When the difference between the floating-point value and the constant is less than or equal to the specified tolerance, the<br />

output data is set to all ones. When the difference between the floating-point value and the constant is greater than the specified<br />

tolerance, the output data is set to all zeroes. Output data is written to a 1-channel Apl8u destination buffer.<br />

Return Values<br />

aplStsEpsValErr Eps is a negative value.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 324 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Geometric Transform Functions<br />

This chapter describes functions that warp, shear, resize, mirror, and rotate images.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 325 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Resize<br />

Resize an image<br />

Synopsis<br />

AplStatus apliResize_8u_C1R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep , ApliSize<br />

dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

AplStatus apliResize_8u_C3R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep , ApliSize<br />

dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

AplStatus apliResize_8u_C4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep , ApliSize<br />

dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

AplStatus apliResize_8u_AC4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep , ApliSize<br />

dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

AplStatus apliResize_16u_C1R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep , ApliSize<br />

dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

AplStatus apliResize_16u_C3R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep , ApliSize<br />

dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

AplStatus apliResize_16u_C4R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep , ApliSize<br />

dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

AplStatus apliResize_16u_AC4R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep , ApliSize<br />

dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

AplStatus apliResize_32f_C1R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep , ApliSize<br />

dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

AplStatus apliResize_32f_C3R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep , ApliSize<br />

dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

AplStatus apliResize_32f_C4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep , ApliSize<br />

dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

AplStatus apliResize_32f_AC4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep , ApliSize<br />

dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

AplStatus apliResize_8u_P3R ( const Apl8u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[3] , int dstStep , ApliSize<br />

dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

AplStatus apliResize_16u_P3R ( const Apl16u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst[3] , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

AplStatus apliResize_32f_P3R ( const Apl32f* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[3] , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

AplStatus apliResize_8u_P4R ( const Apl8u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[4] , int dstStep , ApliSize<br />

dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

AplStatus apliResize_16u_P4R ( const Apl16u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst[4] , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

AplStatus apliResize_32f_P4R ( const Apl32f* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[4] , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 326 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

interpolation Specifies the method of interpolation.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

xFactor Factor value for X axis direction.<br />

yFactor Factor value for Y axis direction .<br />

Description<br />

These functions step through an ROI in a source buffer and map the source data into a destination ROI, using x-y scaling factors and a<br />

specified method of interpolation. A super-sampling interpolation option can be used when both the x and y scaling factors are less<br />

than 1.<br />

Return Values<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsResizeFactorErr The resize factor is less than or equal to zero.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsWrongIntersectROI The ROI does not intersect the source or destination image (no operation is performed).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 327 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

ResizeCenter<br />

Resize image relative to center pixel<br />

Synopsis<br />

AplStatus apliResizeCenter_8u_C1R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliResizeCenter_8u_C3R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliResizeCenter_8u_C4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliResizeCenter_8u_AC4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliResizeCenter_16u_C1R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliResizeCenter_16u_C3R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliResizeCenter_16u_C4R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliResizeCenter_16u_AC4R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliResizeCenter_32f_C1R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliResizeCenter_32f_C3R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliResizeCenter_32f_C4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliResizeCenter_32f_AC4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliResizeCenter_8u_P3R ( const Apl8u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[3] , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliResizeCenter_16u_P3R ( const Apl16u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst[3] , int<br />

dstStep , ApliSize dstRoiSize , double xFactor , double yFactor , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliResizeCenter_32f_P3R ( const Apl32f* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[3] , int dstStep<br />

, ApliSize dstRoiSize , double xFactor , double yFactor , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliResizeCenter_8u_P4R ( const Apl8u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[4] , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliResizeCenter_16u_P4R ( const Apl16u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst[4] , int<br />

dstStep , ApliSize dstRoiSize , double xFactor , double yFactor , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliResizeCenter_32f_P4R ( const Apl32f* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[4] , int dstStep<br />

, ApliSize dstRoiSize , double xFactor , double yFactor , double xCenter , double yCenter , int interpolation );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 328 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

interpolation Specifies the method of interpolation.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

xCenter X coordinate of center.<br />

xFactor Factor value for X axis direction.<br />

yCenter Y coordinate of center.<br />

yFactor Factor value for Y axis direction .<br />

Description<br />

These functions step through an ROI in a source buffer and map the source data into a destination ROI using x-y scaling factors and a<br />

specified method of interpolation. The coordinates of the center pixel in the destination image are the same as the center coordinates<br />

of the center pixel in the source image. A super-sampling interpolation option can be used when both the x and y scaling factors are<br />

less than 1. The Resize( ) function is actually a special case of the ResizeCenter( ) function with the image center set at (0,0).<br />

Return Values<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsResizeFactorErr The resize factor is less than or equal to zero.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsWrongIntersectROI The ROI does not intersect the source or destination image (no operation is performed).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 329 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

GetResizeFract<br />

Get resizing fraction<br />

Synopsis<br />

AplStatus apliGetResizeFract ( ApliSize srcSize , ApliRect srcRoi , double xFactor , double yFactor , double* xFr , double* yFr , int<br />

interpolation );<br />

Parameters<br />

interpolation Specifies the method of interpolation.<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

xFactor Factor value for X axis direction.<br />

xFr Inverse factor value for X axis direction.<br />

yFactor Factor value for Y axis direction .<br />

yFr Inverse factor value for Y axis direction .<br />

Description<br />

This function calculates the inverses of x and y scaling factors and checks whether parameters are correctly defined. It is typically used<br />

with the ResizeShift functions.<br />

Return Values<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsResizeFactorErr The resize factor is less than or equal to zero.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsWrongIntersectROI The ROI does not intersect the source or destination image (no operation is performed).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 330 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

ResizeShift<br />

Resize and shift an image<br />

Synopsis<br />

AplStatus apliResizeShift_8u_C1R ( const Apl8u * pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u * pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

AplStatus apliResizeShift_C1IRSfs ( const Apl16u * pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u * pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

AplStatus apliResizeShift_8u_C3R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep , ApliSize<br />

dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

AplStatus apliResizeShift_8u_C4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep , ApliSize<br />

dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

AplStatus apliResizeShift_8u_AC4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

AplStatus apliResizeShift_16u_C1R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

AplStatus apliResizeShift_16u_C3R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

AplStatus apliResizeShift_16u_C4R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

AplStatus apliResizeShift_16u_AC4R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

AplStatus apliResizeShift_32f_C1R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

AplStatus apliResizeShift_32f_C3R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

AplStatus apliResizeShift_32f_C4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

AplStatus apliResizeShift_32f_AC4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

AplStatus apliResizeShift_8u_P3R ( const Apl8u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[3] , int dstStep ,<br />

ApliSize dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

AplStatus apliResizeShift_16u_P3R ( const Apl16u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst[3] , int dstStep ,<br />

ApliSize dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

AplStatus apliResizeShift_32f_P3R ( const Apl32f* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[3] , int dstStep ,<br />

ApliSize dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

AplStatus apliResizeShift_8u_P4R ( const Apl8u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[4] , int dstStep ,<br />

ApliSize dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

AplStatus apliResizeShift_16u_P4R ( const Apl16u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst[4] , int dstStep ,<br />

ApliSize dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

AplStatus apliResizeShift_32f_P4R ( const Apl32f* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[4] , int dstStep ,<br />

ApliSize dstRoiSize , double xFr , double yFr , double xShift , double yShift , int interpolation );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 331 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

interpolation Specifies the method of interpolation.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

xFr Inverse factor value for X axis direction.<br />

xShift Shift value for X axis direction.<br />

yFr Inverse factor value for Y axis direction .<br />

yShift Shift value for Y axis direction.<br />

Description<br />

These functions step through an ROI in a source buffer, scale the source data using inverse x-y scaling factors and a specified method<br />

of interpolation, then shift the data to a destination ROI.<br />

The functions use the following equivalent mapping formulas.<br />

x=(x?-xShift)*xFr or x’=x*xFactor+xShift<br />

y=(y’-yShift)*yFr y’=y*yFactor+yShift<br />

Return Values<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsResizeFactorErr The resize factor is less than or equal to zero.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsWrongIntersectROI The ROI does not intersect the source or destination image (no operation is performed).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 332 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

ResizeSqrPixelGetBufSize<br />

Calculate external buffer size for ResizeSqrPixel function<br />

Synopsis<br />

AplStatus apliResizeSqrPixelGetBufSize ( ApliSize dstSize , int nChannel , int interpolation , int* pBufferSize );<br />

Parameters<br />

dstSize Destination image size.<br />

interpolation Specifies the method of interpolation.<br />

nChannel Number of channels in the image.<br />

pBufferSize Pointer to the size of a temporary buffer.<br />

Description<br />

This function is used before a ResizeSqrPixel function. It calculates external buffer size, acts as a buffer space placeholder, and checks<br />

whether parameters used by the ResizeSqrPixel function are defined correctly.<br />

Return Values<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsNumChannelErr The number of channels is incorrect.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 333 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

ResizeSqrPixel<br />

Resize and shift an image<br />

Synopsis<br />

AplStatus apliResizeSqrPixel_8u_C1R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , double xFactor , double yFactor , double xShift , double yShift , int interpolation , Apl8u* pBuffer );<br />

AplStatus apliResizeSqrPixel_8u_C3R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , double xFactor , double yFactor , double xShift , double yShift , int interpolation , Apl8u* pBuffer );<br />

AplStatus apliResizeSqrPixel_8u_C4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , double xFactor , double yFactor , double xShift , double yShift , int interpolation , Apl8u* pBuffer );<br />

AplStatus apliResizeSqrPixel_8u_AC4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , double xFactor , double yFactor , double xShift , double yShift , int interpolation , Apl8u* pBuffer );<br />

AplStatus apliResizeSqrPixel_16u_C1R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliRect dstRoi , double xFactor , double yFactor , double xShift , double yShift , int interpolation , Apl8u* pBuffer );<br />

AplStatus apliResizeSqrPixel_16u_C3R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliRect dstRoi , double xFactor , double yFactor , double xShift , double yShift , int interpolation , Apl8u* pBuffer );<br />

AplStatus apliResizeSqrPixel_16u_C4R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliRect dstRoi , double xFactor , double yFactor , double xShift , double yShift , int interpolation , Apl8u* pBuffer );<br />

AplStatus apliResizeSqrPixel_16u_AC4R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliRect dstRoi , double xFactor , double yFactor , double xShift , double yShift , int interpolation , Apl8u* pBuffer );<br />

AplStatus apliResizeSqrPixel_32f_C1R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , double xFactor , double yFactor , double xShift , double yShift , int interpolation , Apl8u* pBuffer );<br />

AplStatus apliResizeSqrPixel_32f_C3R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , double xFactor , double yFactor , double xShift , double yShift , int interpolation , Apl8u* pBuffer );<br />

AplStatus apliResizeSqrPixel_32f_C4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , double xFactor , double yFactor , double xShift , double yShift , int interpolation , Apl8u* pBuffer );<br />

AplStatus apliResizeSqrPixel_32f_AC4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , double xFactor , double yFactor , double xShift , double yShift , int interpolation , Apl8u* pBuffer );<br />

AplStatus apliResizeSqrPixel_8u_P3R ( const Apl8u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[3] , int dstStep ,<br />

ApliRect dstRoi , double xFactor , double yFactor , double xShift , double yShift , int interpolation , Apl8u* pBuffer );<br />

AplStatus apliResizeSqrPixel_8u_P4R ( const Apl8u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[4] , int dstStep ,<br />

ApliRect dstRoi , double xFactor , double yFactor , double xShift , double yShift , int interpolation , Apl8u* pBuffer );<br />

AplStatus apliResizeSqrPixel_16u_P3R ( const Apl16u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst[3] , int<br />

dstStep , ApliRect dstRoi , double xFactor , double yFactor , double xShift , double yShift , int interpolation , Apl8u* pBuffer );<br />

AplStatus apliResizeSqrPixel_16u_P4R ( const Apl16u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst[4] , int<br />

dstStep , ApliRect dstRoi , double xFactor , double yFactor , double xShift , double yShift , int interpolation , Apl8u* pBuffer );<br />

AplStatus apliResizeSqrPixel_32f_P3R ( const Apl32f* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[3] , int<br />

dstStep , ApliRect dstRoi , double xFactor , double yFactor , double xShift , double yShift , int interpolation , Apl8u* pBuffer );<br />

AplStatus apliResizeSqrPixel_32f_P4R ( const Apl32f* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[4] , int<br />

dstStep , ApliRect dstRoi , double xFactor , double yFactor , double xShift , double yShift , int interpolation , Apl8u* pBuffer );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 334 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstRoi Destination image ROI.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

interpolation Specifies the method of interpolation.<br />

pBuffer Pointer to the location of a temporary buffer.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

xFactor Factor value for X axis direction.<br />

xShift Shift value for X axis direction.<br />

yFactor Factor value for Y axis direction .<br />

yShift Shift value for Y axis direction.<br />

Description<br />

These functions step through an ROI in a source buffer, scale the source data using x-y scaling factors and a specified method of<br />

interpolation, then shift the data to a destination ROI. Unlike the ResizeShift( ) function, the ResizeSqrPixel( ) functions map the<br />

source ROI to a specified destination ROI and use noninverted x-y scaling factors.<br />

The functions use the following mapping formulas.<br />

x’=x*xFactor+xShift<br />

y’=y*yFactor+yShift<br />

Return Values<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsResizeFactorErr The resize factor is less than or equal to zero.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 335 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsWrongIntersectROI The ROI does not intersect the source or destination image (no operation is performed).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 336 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

ResizeYUV422<br />

Resize a YUV422 image<br />

Synopsis<br />

AplStatus apliResizeYUV422_8u_C2R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliSize dstRoiSize , double xFactor , double yFactor , int interpolation );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

interpolation Specifies the method of interpolation.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

xFactor Factor value for X axis direction.<br />

yFactor Factor value for Y axis direction .<br />

Description<br />

This function steps through an ROI in a source buffer, scales the source data using x-y scaling factors and a specified method of<br />

interpolation, then shifts the data to a destination ROI. The function is specialized for YUV color space data with 4:2:2 chroma subsampling.<br />

The source data has two channels in 4:2:2 sampled format with decoupled luminance and chrominance components. For<br />

example, the format could be in the form of alternating YUYVYUYV...<br />

Return Values<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsResizeFactorErr The resize factor is less than or equal to zero.<br />

aplStsResizeNoOperationErr A destination image dimension is less than one pixel.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 337 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Mirror<br />

Mirror an image<br />

Synopsis<br />

AplStatus apliMirror_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_16u_C1R ( const Apl16u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_16u_C3R ( const Apl16u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_16u_C4R ( const Apl16u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_16u_AC4R ( const Apl16u * pSrc , int srcStep , Apl16u * pDst , int dstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_32s_C1R ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_32s_C3R ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_32s_C4R ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_32s_AC4R ( const Apl32s * pSrc , int srcStep , Apl32s * pDst , int dstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_8u_C1IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_8u_C3IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_8u_C4IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_8u_AC4IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_16u_C1IR ( Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_16u_C3IR ( Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_16u_C4IR ( Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_16u_AC4IR ( Apl16u * pSrcDst , int srcDstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_32s_C1IR ( Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_32s_C3IR ( Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_32s_C4IR ( Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_32s_AC4IR ( Apl32s * pSrcDst , int srcDstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_32f_C1IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_32f_C3IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_32f_C4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , ApliAxis flip );<br />

AplStatus apliMirror_32f_AC4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize roiSize , ApliAxis flip );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 338 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

flip Image mirror flip mode.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

roiSize Specifies the height and width of an ROI.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer and mirror the source data about the vertical axis, the horizontal axis, or both<br />

axes. The mirrored data can be written to a destination buffer or written back to the source buffer.<br />

Return Values<br />

aplStsMirrorFlipErr The mirror flip value is invalid.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 339 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Remap<br />

Remap an image using table look-up<br />

Synopsis<br />

AplStatus apliRemap_8u_C1R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const Apl32f* pxMap , int xMapStep ,<br />

const Apl32f* pyMap , int yMapStep , Apl8u* pDst , int dstStep , ApliSize dstRoiSize , int interpolation );<br />

AplStatus apliRemap_8u_C3R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const Apl32f* pxMap , int xMapStep ,<br />

const Apl32f* pyMap , int yMapStep , Apl8u* pDst , int dstStep , ApliSize dstRoiSize , int interpolation );<br />

AplStatus apliRemap_8u_C4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const Apl32f* pxMap , int xMapStep ,<br />

const Apl32f* pyMap , int yMapStep , Apl8u* pDst , int dstStep , ApliSize dstRoiSize , int interpolation );<br />

AplStatus apliRemap_8u_AC4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const Apl32f* pxMap , int xMapStep ,<br />

const Apl32f* pyMap , int yMapStep , Apl8u* pDst , int dstStep , ApliSize dstRoiSize , int interpolation );<br />

AplStatus apliRemap_32f_C1R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const Apl32f* pxMap , int xMapStep ,<br />

const Apl32f* pyMap , int yMapStep , Apl32f* pDst , int dstStep , ApliSize dstRoiSize , int interpolation );<br />

AplStatus apliRemap_32f_C3R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const Apl32f* pxMap , int xMapStep ,<br />

const Apl32f* pyMap , int yMapStep , Apl32f* pDst , int dstStep , ApliSize dstRoiSize , int interpolation );<br />

AplStatus apliRemap_32f_C4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const Apl32f* pxMap , int xMapStep ,<br />

const Apl32f* pyMap , int yMapStep , Apl32f* pDst , int dstStep , ApliSize dstRoiSize , int interpolation );<br />

AplStatus apliRemap_32f_AC4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const Apl32f* pxMap , int xMapStep ,<br />

const Apl32f* pyMap , int yMapStep , Apl32f* pDst , int dstStep , ApliSize dstRoiSize , int interpolation );<br />

AplStatus apliRemap_8u_P3R ( const Apl8u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , const Apl32f* pxMap , int xMapStep ,<br />

const Apl32f* pyMap , int yMapStep , Apl8u* pDst[3] , int dstStep , ApliSize dstRoiSize , int interpolation );<br />

AplStatus apliRemap_8u_P4R ( const Apl8u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , const Apl32f* pxMap , int xMapStep ,<br />

const Apl32f* pyMap , int yMapStep , Apl8u* pDst[4] , int dstStep , ApliSize dstRoiSize , int interpolation );<br />

AplStatus apliRemap_32f_P3R ( const Apl32f* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , const Apl32f* pxMap , int xMapStep<br />

, const Apl32f* pyMap , int yMapStep , Apl32f* pDst[3] , int dstStep , ApliSize dstRoiSize , int interpolation );<br />

AplStatus apliRemap_32f_P4R ( const Apl32f* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , const Apl32f* pxMap , int xMapStep<br />

, const Apl32f* pyMap , int yMapStep , Apl32f* pDst[4] , int dstStep , ApliSize dstRoiSize , int interpolation );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 340 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

interpolation Specifies the method of interpolation.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

pxMap Pointer to X axis mapping table array.<br />

pyMap Pointer to Y axis mapping table array.<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

xMapStep X axis mapping table step size (width of the buffer in bytes).<br />

yMapStep Y axis mapping table step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, remap the source data using look-up tables for the x and y coordinates of each<br />

pixel and a specified method of interpolation, then write the data into a destination ROI.<br />

The mapping formula is<br />

dst_pixel[x,y] = src_pixel[pxMap[x,y], pyMap[x,y]],<br />

where pxMap[x,y] is the x-coordinate look up table and pyMap[x,y] is the y-coordinate look-up table.<br />

Return Values<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 341 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Rotate<br />

Rotate an image<br />

Synopsis<br />

AplStatus apliRotate_8u_C1R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep , ApliRect<br />

dstRoi , double angle , double xShift , double yShift , int interpolation );<br />

AplStatus apliRotate_8u_C3R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep , ApliRect<br />

dstRoi , double angle , double xShift , double yShift , int interpolation );<br />

AplStatus apliRotate_8u_C4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep , ApliRect<br />

dstRoi , double angle , double xShift , double yShift , int interpolation );<br />

AplStatus apliRotate_8u_AC4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep , ApliRect<br />

dstRoi , double angle , double xShift , double yShift , int interpolation );<br />

AplStatus apliRotate_16u_C1R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep , ApliRect<br />

dstRoi , double angle , double xShift , double yShift , int interpolation );<br />

AplStatus apliRotate_16u_C3R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep , ApliRect<br />

dstRoi , double angle , double xShift , double yShift , int interpolation );<br />

AplStatus apliRotate_16u_C4R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep , ApliRect<br />

dstRoi , double angle , double xShift , double yShift , int interpolation );<br />

AplStatus apliRotate_16u_AC4R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliRect dstRoi , double angle , double xShift , double yShift , int interpolation );<br />

AplStatus apliRotate_32f_C1R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep , ApliRect<br />

dstRoi , double angle , double xShift , double yShift , int interpolation );<br />

AplStatus apliRotate_32f_C3R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep , ApliRect<br />

dstRoi , double angle , double xShift , double yShift , int interpolation );<br />

AplStatus apliRotate_32f_C4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep , ApliRect<br />

dstRoi , double angle , double xShift , double yShift , int interpolation );<br />

AplStatus apliRotate_32f_AC4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep , ApliRect<br />

dstRoi , double angle , double xShift , double yShift , int interpolation );<br />

AplStatus apliRotate_8u_P3R ( const Apl8u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[3] , int dstStep ,<br />

ApliRect dstRoi , double angle , double xShift , double yShift , int interpolation );<br />

AplStatus apliRotate_8u_P4R ( const Apl8u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[4] , int dstStep ,<br />

ApliRect dstRoi , double angle , double xShift , double yShift , int interpolation );<br />

AplStatus apliRotate_16u_P3R ( const Apl16u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst[3] , int dstStep ,<br />

ApliRect dstRoi , double angle , double xShift , double yShift , int interpolation );<br />

AplStatus apliRotate_16u_P4R ( const Apl16u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst[4] , int dstStep ,<br />

ApliRect dstRoi , double angle , double xShift , double yShift , int interpolation );<br />

AplStatus apliRotate_32f_P3R ( const Apl32f* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[3] , int dstStep ,<br />

ApliRect dstRoi , double angle , double xShift , double yShift , int interpolation );<br />

AplStatus apliRotate_32f_P4R ( const Apl32f* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[4] , int dstStep ,<br />

ApliRect dstRoi , double angle , double xShift , double yShift , int interpolation );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 342 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

angle Specifies the rotation angle in degrees, counterclockwise.<br />

dstRoi Destination image ROI.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

interpolation Specifies the method of interpolation.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

xShift Shift value for X axis direction.<br />

yShift Shift value for Y axis direction.<br />

Description<br />

These functions step through an ROI in a source buffer, rotate the source data around (0,0) by a specified angle, shift the x-y<br />

coordinates according to the x and y shift values, and map the data into a destination ROI using a specified method of interpolation.<br />

The APLI_SMOOTH_EDGE option is available when the destination ROI contains the transformed image. Depending on the x-y<br />

coordinate values and the amount of rotation, the rotated image may be clipped by the destination ROI boundary. Note: A positive<br />

angle value indicates counterclockwise rotation when source data is ordered downward for height.<br />

Return Values<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsWrongIntersectQuad The quadrangle does not intersect the source or destination image (no operation is performed).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 343 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

GetRotateShift<br />

Get rotation shift values<br />

Synopsis<br />

AplStatus apliGetRotateShift ( double xCenter , double yCenter , double angle , double* xShift , double* yShift );<br />

Parameters<br />

angle Specifies the rotation angle in degrees, counterclockwise.<br />

xCenter X coordinate of center.<br />

xShift Shift value for X axis direction.<br />

yCenter Y coordinate of center.<br />

yShift Shift value for Y axis direction.<br />

Description<br />

This function computes shift values for the RotateCenter functions.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 344 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AddRotateShift<br />

Add new rotation shift values to existing shift values<br />

Synopsis<br />

AplStatus apliAddRotateShift ( double xCenter , double yCenter , double angle , double* xShift , double* yShift );<br />

Parameters<br />

angle Specifies the rotation angle in degrees, counterclockwise.<br />

xCenter X coordinate of center.<br />

xShift Shift value for X axis direction.<br />

yCenter Y coordinate of center.<br />

yShift Shift value for Y axis direction.<br />

Description<br />

This function adds specified shift values to existing shift values for the RotateCenter functions.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 345 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

GetRotateQuad<br />

Get rotation quadrangle vertices<br />

Synopsis<br />

AplStatus apliGetRotateQuad ( ApliRect srcRoi , double quad[4][2] , double angle , double xShift , double yShift );<br />

Parameters<br />

angle Specifies the rotation angle in degrees, counterclockwise.<br />

quad[4][2] Quadrangle vertex coordinates.<br />

srcRoi Source image ROI.<br />

xShift Shift value for X axis direction.<br />

yShift Shift value for Y axis direction.<br />

Description<br />

This function is used with the GetRotateBound function. It computes the vertex coordinates of the quadrangular destination ROI for the<br />

Rotate( ) functions. Quad[0] contains the top right x and y coordinates, Quad[1] contains the top left x and y coordinates, Quad[2]<br />

contains the bottom right x and y coordinates, and Quad[3] contains the bottom left x and y coordinates.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 346 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

GetRotateBound<br />

Get rotation boundary<br />

Synopsis<br />

AplStatus apliGetRotateBound ( ApliRect srcRoi , double bound[2][2] , double angle , double xShift , double yShift );<br />

Parameters<br />

angle Specifies the rotation angle in degrees, counterclockwise.<br />

bound[2][2] Boundary rectangle vertex coordinates for a transformed source ROI.<br />

srcRoi Source image ROI.<br />

xShift Shift value for X axis direction.<br />

yShift Shift value for Y axis direction.<br />

Description<br />

This function is used with the GetRotateQuad( ) function. It computes the boundaries of the source ROI for the Rotate( ) functions.<br />

Bound[0] contains the top right x and y coordinates; Bound[1] contains the bottom left x and y coordinates.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 347 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

RotateCenter<br />

Rotate around a specific center<br />

Synopsis<br />

AplStatus apliRotateCenter_8u_C1R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , double angle , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliRotateCenter_8u_C3R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , double angle , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliRotateCenter_8u_C4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , double angle , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliRotateCenter_8u_AC4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , double angle , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliRotateCenter_16u_C1R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliRect dstRoi , double angle , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliRotateCenter_16u_C3R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliRect dstRoi , double angle , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliRotateCenter_16u_C4R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliRect dstRoi , double angle , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliRotateCenter_16u_AC4R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliRect dstRoi , double angle , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliRotateCenter_32f_C1R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , double angle , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliRotateCenter_32f_C3R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , double angle , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliRotateCenter_32f_C4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , double angle , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliRotateCenter_32f_AC4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , double angle , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliRotateCenter_8u_P3R ( const Apl8u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[3] , int dstStep ,<br />

ApliRect dstRoi , double angle , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliRotateCenter_8u_P4R ( const Apl8u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[4] , int dstStep ,<br />

ApliRect dstRoi , double angle , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliRotateCenter_16u_P3R ( const Apl16u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst[3] , int<br />

dstStep , ApliRect dstRoi , double angle , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliRotateCenter_16u_P4R ( const Apl16u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst[4] , int<br />

dstStep , ApliRect dstRoi , double angle , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliRotateCenter_32f_P3R ( const Apl32f* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[3] , int dstStep<br />

, ApliRect dstRoi , double angle , double xCenter , double yCenter , int interpolation );<br />

AplStatus apliRotateCenter_32f_P4R ( const Apl32f* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[4] , int dstStep<br />

, ApliRect dstRoi , double angle , double xCenter , double yCenter , int interpolation );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 348 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

angle Specifies the rotation angle in degrees, counterclockwise.<br />

dstRoi Destination image ROI.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

interpolation Specifies the method of interpolation.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

xCenter X coordinate of center.<br />

yCenter Y coordinate of center.<br />

Description<br />

These functions step through a source ROI, rotate the source data around a specified center by a specified angle, apply a specified<br />

method of interpolation, then write the rotated data to a destination ROI. Positive angle parameter values specify counterclockwise<br />

rotation.<br />

Return Values<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsWrongIntersectQuad The quadrangle does not intersect the source or destination image (no operation is performed).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 349 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Shear<br />

Perform shear transform<br />

Synopsis<br />

AplStatus apliShear_8u_C1R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep , ApliRect<br />

dstRoi , double xShear , double yShear , double xShift , double yShift , int interpolation );<br />

AplStatus apliShear_8u_C3R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep , ApliRect<br />

dstRoi , double xShear , double yShear , double xShift , double yShift , int interpolation );<br />

AplStatus apliShear_8u_C4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep , ApliRect<br />

dstRoi , double xShear , double yShear , double xShift , double yShift , int interpolation );<br />

AplStatus apliShear_8u_AC4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep , ApliRect<br />

dstRoi , double xShear , double yShear , double xShift , double yShift , int interpolation );<br />

AplStatus apliShear_32f_C1R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep , ApliRect<br />

dstRoi , double xShear , double yShear , double xShift , double yShift , int interpolation );<br />

AplStatus apliShear_32f_C3R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep , ApliRect<br />

dstRoi , double xShear , double yShear , double xShift , double yShift , int interpolation );<br />

AplStatus apliShear_32f_C4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep , ApliRect<br />

dstRoi , double xShear , double yShear , double xShift , double yShift , int interpolation );<br />

AplStatus apliShear_32f_AC4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep , ApliRect<br />

dstRoi , double xShear , double yShear , double xShift , double yShift , int interpolation );<br />

AplStatus apliShear_8u_P3R ( const Apl8u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[3] , int dstStep , ApliRect<br />

dstRoi , double xShear , double yShear , double xShift , double yShift , int interpolation );<br />

AplStatus apliShear_8u_P4R ( const Apl8u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[4] , int dstStep , ApliRect<br />

dstRoi , double xShear , double yShear , double xShift , double yShift , int interpolation );<br />

AplStatus apliShear_32f_P3R ( const Apl32f* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[3] , int dstStep ,<br />

ApliRect dstRoi , double xShear , double yShear , double xShift , double yShift , int interpolation );<br />

AplStatus apliShear_32f_P4R ( const Apl32f* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[4] , int dstStep ,<br />

ApliRect dstRoi , double xShear , double yShear , double xShift , double yShift , int interpolation );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 350 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstRoi Destination image ROI.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

interpolation Specifies the method of interpolation.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

xShear Shear value for X axis in Shear transformation.<br />

xShift Shift value for X axis direction.<br />

yShear Shear value for Y axis in Shear transformation.<br />

yShift Shift value for Y axis direction.<br />

Description<br />

These functions step through a source ROI, perform the shear transform on the source data, apply a specified method of interpolation,<br />

and write the data to a destination ROI.<br />

The shear transform formula is as follows.<br />

x’ = xShear * y + x + xShift<br />

y’ = yShear * x + y + yShift<br />

Where x’ and y’ are the destination coordinates.<br />

The shear transform is a special case of the warp affine transform.<br />

Return Values<br />

aplStsCoeffErr The coefficient values have errors.<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 351 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsWrongIntersectQuad The quadrangle does not intersect the source or destination image (no operation is performed).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 352 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

GetShearQuad<br />

Get shear quadrangle vertices<br />

Synopsis<br />

AplStatus apliGetShearQuad ( ApliRect srcRoi , double quad[4][2] , double xShear , double yShear , double xShift , double yShift );<br />

Parameters<br />

quad[4][2] Quadrangle vertex coordinates.<br />

srcRoi Source image ROI.<br />

xShear Shear value for X axis in Shear transformation.<br />

xShift Shift value for X axis direction.<br />

yShear Shear value for Y axis in Shear transformation.<br />

yShift Shift value for Y axis direction.<br />

Description<br />

This function is used with the GetShearBound function. It computes the vertex coordinates of the quadrangular destination ROI for the<br />

Shear( ) functions. Quad[0] contains the top right x and y coordinates, Quad[1] contains the top left x and y coordinates, Quad[2]<br />

contains the bottom right x and y coordinates, and Quad[3] contains the bottom left x and y coordinates.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 353 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

GetShearBound<br />

Get shear boundary<br />

Synopsis<br />

AplStatus apliGetShearBound ( ApliRect srcRoi , double bound[2][2] , double xShear , double yShear , double xShift , double yShift );<br />

Parameters<br />

bound[2][2] Boundary rectangle vertex coordinates for a transformed source ROI.<br />

srcRoi Source image ROI.<br />

xShear Shear value for X axis in Shear transformation.<br />

xShift Shift value for X axis direction.<br />

yShear Shear value for Y axis in Shear transformation.<br />

yShift Shift value for Y axis direction.<br />

Description<br />

This function is used with the GetShearQuad( ) function. It computes the boundaries of the source ROI for the Shear( ) functions.<br />

Bound[0] contains the top right x and y coordinates; Bound[1] contains the bottom left x and y coordinates.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 354 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

WarpAffine<br />

Perform warp affine transform<br />

Synopsis<br />

AplStatus apliWarpAffine_8u_C1R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep , ApliRect<br />

dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffine_8u_C3R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep , ApliRect<br />

dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffine_8u_C4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep , ApliRect<br />

dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffine_8u_AC4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffine_16u_C1R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffine_16u_C3R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffine_16u_C4R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffine_16u_AC4R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffine_32f_C1R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffine_32f_C3R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffine_32f_C4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffine_32f_AC4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffine_8u_P3R ( const Apl8u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[3] , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffine_8u_P4R ( const Apl8u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[4] , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffine_16u_P3R ( const Apl16u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst[3] , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffine_16u_P4R ( const Apl16u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst[4] , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffine_32f_P3R ( const Apl32f* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[3] , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffine_32f_P4R ( const Apl32f* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[4] , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 355 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

coeffs[2][3] Coefficients for Warp Affine transform.<br />

dstRoi Destination image ROI.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

interpolation Specifies the method of interpolation.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through a source ROI, perform the warp affine transform on the source data, apply a specified method of<br />

interpolation, and write the data to a destination ROI.<br />

The transformation formula is as follows.<br />

x’ = c00*x + c01*y + c02<br />

y’ = c10*x + c11*y + c12<br />

Where x’ and y’ are the destination coordinates and Cij are the warp affine transform coefficients that are passed into the array. The<br />

warp affine transform is a general linear transformation that maps parallel lines to parallel lines.<br />

Return Values<br />

aplStsCoeffErr The coefficient values have errors.<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsWrongIntersectQuad The quadrangle does not intersect the source or destination image (no operation is performed).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 356 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

WarpAffineBack<br />

Perform inverse warp affine transform<br />

Synopsis<br />

AplStatus apliWarpAffineBack_8u_C1R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffineBack_8u_C3R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffineBack_8u_C4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffineBack_8u_AC4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffineBack_16u_C1R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffineBack_16u_C3R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffineBack_16u_C4R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffineBack_16u_AC4R ( const Apl16u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst , int dstStep<br />

, ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffineBack_32f_C1R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffineBack_32f_C3R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffineBack_32f_C4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffineBack_32f_AC4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffineBack_8u_P3R ( const Apl8u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[3] , int dstStep<br />

, ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffineBack_8u_P4R ( const Apl8u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[4] , int dstStep<br />

, ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffineBack_16u_P3R ( const Apl16u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst[3] , int<br />

dstStep , ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffineBack_16u_P4R ( const Apl16u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl16u* pDst[4] , int<br />

dstStep , ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffineBack_32f_P3R ( const Apl32f* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[3] , int<br />

dstStep , ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

AplStatus apliWarpAffineBack_32f_P4R ( const Apl32f* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[4] , int<br />

dstStep , ApliRect dstRoi , const double coeffs[2][3] , int interpolation );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 357 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

coeffs[2][3] Coefficients for Warp Affine transform.<br />

dstRoi Destination image ROI.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

interpolation Specifies the method of interpolation.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through a source ROI, perform an inverse warp affine transform on the source data, apply a specified method of<br />

interpolation, and write the data to a destination ROI.<br />

The transformation formula is as follows.<br />

c00*x’ + c01*y’ + c02 = x<br />

c10*x’ + c11*y’ + c12 = y<br />

Where cij represents the transform coefficients.<br />

Return Values<br />

aplStsCoeffErr The coefficient values have errors.<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsWrongIntersectQuad The quadrangle does not intersect the source or destination image (no operation is performed).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 358 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

WarpAffineQuad<br />

Perform quadrangular warp affine transform<br />

Synopsis<br />

AplStatus apliWarpAffineQuad_8u_C1R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double srcQuad[4][2] ,<br />

Apl8u* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpAffineQuad_8u_C3R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double srcQuad[4][2] ,<br />

Apl8u* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpAffineQuad_8u_C4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double srcQuad[4][2] ,<br />

Apl8u* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpAffineQuad_8u_AC4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double srcQuad[4][2] ,<br />

Apl8u* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpAffineQuad_32f_C1R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double srcQuad[4][2] ,<br />

Apl32f* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpAffineQuad_32f_C3R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double srcQuad[4][2] ,<br />

Apl32f* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpAffineQuad_32f_C4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double srcQuad[4][2] ,<br />

Apl32f* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpAffineQuad_32f_AC4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double srcQuad[4][2]<br />

, Apl32f* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpAffineQuad_8u_P3R ( const Apl8u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double srcQuad[4][2]<br />

, Apl8u* pDst[3] , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpAffineQuad_8u_P4R ( const Apl8u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double srcQuad[4][2]<br />

, Apl8u* pDst[4] , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpAffineQuad_32f_P3R ( const Apl32f* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl32f* pDst[3] , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpAffineQuad_32f_P4R ( const Apl32f* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl32f* pDst[4] , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 359 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstQuad[4][2] Destination quadrangle vertex coordinates.<br />

dstRoi Destination image ROI.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

interpolation Specifies the method of interpolation.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

srcQuad[4][2] Source quadrangle vertex coordinates.<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through a quadrangular source ROI, perform the warp affine transform on the source data, and map the<br />

transformed data into a quadrangular destination ROI using a specified method of interpolation. The warp affine coefficients are<br />

calculated using the quadrangle vertices. If the coefficients cannot be resolved consistently, the function returns errors.<br />

Return Values<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsQuadErr<br />

The source or destination quadrangle degenerates into a triangle, line, or points; or the destination quadrangle has<br />

conflicted vertex coordinates.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsWrongIntersectQuad The quadrangle does not intersect the source or destination image (no operation is performed).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 360 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

GetAffineQuad<br />

Get affine quadrangle vertices<br />

Synopsis<br />

AplStatus apliGetAffineQuad ( ApliRect srcRoi , double quad[4][2] , const double coeffs[2][3] );<br />

Parameters<br />

coeffs[2][3] Coefficients for Warp Affine transform.<br />

quad[4][2] Quadrangle vertex coordinates.<br />

srcRoi Source image ROI.<br />

Description<br />

This function is used with the GetAffineBound function. It computes the vertex coordinates of the quadrangular destination ROI for the<br />

WarpAffineQuad( ) functions. Quad[0] contains the top right x and y coordinates, Quad[1] contains the top left x and y coordinates,<br />

Quad[2] contains the bottom right x and y coordinates, and Quad[3] contains the bottom left x and y coordinates.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 361 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

GetAffineBound<br />

Get affine boundary<br />

Synopsis<br />

AplStatus apliGetAffineBound ( ApliRect srcRoi , double bound[2][2] , const double coeffs[2][3] );<br />

Parameters<br />

bound[2][2] Boundary rectangle vertex coordinates for a transformed source ROI.<br />

coeffs[2][3] Coefficients for Warp Affine transform.<br />

srcRoi Source image ROI.<br />

Description<br />

This function is used with the GetAffineQuad( ) function. It computes the boundaries of the source ROI for the WarpAffineQuad( )<br />

functions. Bound[0] contains the top right x and y coordinates; Bound[1] contains the bottom left x and y coordinates.<br />

Return Values<br />

aplStsCoeffErr The coefficient values have errors.<br />

aplStsNoErr No error detected.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 362 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

GetAffineTransform<br />

Get affine transform coefficients<br />

Synopsis<br />

AplStatus apliGetAffineTransform ( ApliRect srcRoi , const double quad[4][2] , double coeffs[2][3] );<br />

Parameters<br />

coeffs[2][3] Coefficients for Warp Affine transform.<br />

quad[4][2] Quadrangle vertex coordinates.<br />

srcRoi Source image ROI.<br />

Description<br />

This function computes affine transform coefficients for the WarpAffineQuad( ) functions. Quad[0] corresponds to the top right<br />

coordinates of the source ROI, Quad[1] corresponds to the top left coordinates of the source ROI, Quad[2] corresponds to the bottom<br />

right coordinates of the source ROI, and Quad[3] corresponds to the bottom left coordinates of the source ROI. The function returns<br />

aplstsCoeffErr if the mapping is incorrect.<br />

Return Values<br />

aplStsCoeffErr The coefficient values have errors.<br />

aplStsNoErr No error detected.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 363 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

WarpPerspective<br />

Perform warp perspective transform<br />

Synopsis<br />

AplStatus apliWarpPerspective_8u_C1R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspective_8u_C3R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspective_8u_C4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspective_8u_AC4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspective_32f_C1R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspective_32f_C3R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspective_32f_C4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspective_32f_AC4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep<br />

, ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspective_8u_P3R ( const Apl8u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[3] , int<br />

dstStep , ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspective_8u_P4R ( const Apl8u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[4] , int<br />

dstStep , ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspective_32f_P3R ( const Apl32f* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[3] , int<br />

dstStep , ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspective_32f_P4R ( const Apl32f* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[4] , int<br />

dstStep , ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 364 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

coeffs[3][3] Coefficients for Warp Affine Perspective transform.<br />

dstRoi Destination image ROI.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

interpolation Specifies the method of interpolation.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through a source ROI, perform the warp perspective transform on the source data, apply a specified method of<br />

interpolation, and write the data to a destination ROI.<br />

The transformation formula is as follows.<br />

x’ = (c00*x + c01*y + c02)/(c20*x + c21*y + c22)<br />

y’ = (c10*x + c11*y + c12)/(c20*x + c21*y + c22)<br />

Where x’ and y’ are the destination coordinates and Cij are transform coefficients that are passed into the array.<br />

Return Values<br />

aplStsCoeffErr The coefficient values have errors.<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsWrongIntersectQuad The quadrangle does not intersect the source or destination image (no operation is performed).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 365 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

WarpPerspectiveBack<br />

Perform inverse warp perspective transform<br />

Synopsis<br />

AplStatus apliWarpPerspectiveBack_8u_C1R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep<br />

, ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspectiveBack_8u_C3R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep<br />

, ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspectiveBack_8u_C4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep<br />

, ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspectiveBack_8u_AC4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int<br />

dstStep , ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspectiveBack_32f_C1R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int<br />

dstStep , ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspectiveBack_32f_C3R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int<br />

dstStep , ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspectiveBack_32f_C4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int<br />

dstStep , ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspectiveBack_32f_AC4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int<br />

dstStep , ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspectiveBack_8u_P3R ( const Apl8u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[3] , int<br />

dstStep , ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspectiveBack_8u_P4R ( const Apl8u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[4] , int<br />

dstStep , ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspectiveBack_32f_P3R ( const Apl32f* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[3] ,<br />

int dstStep , ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

AplStatus apliWarpPerspectiveBack_32f_P4R ( const Apl32f* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[4] ,<br />

int dstStep , ApliRect dstRoi , const double coeffs[3][3] , int interpolation );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 366 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

coeffs[3][3] Coefficients for Warp Affine Perspective transform.<br />

dstRoi Destination image ROI.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

interpolation Specifies the method of interpolation.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through a source ROI, perform an inverse warp perspective transform on the source data, apply a specified<br />

method of interpolation, and write the data to a destination ROI. Edge smoothing interpolation is applicable only when the destination<br />

quadrangle is completely within the destination image ROI.<br />

The transformation formula is as follows.<br />

(c00*x’ + c01*y’ + c02)/(c20*x’ + c21*y’ + c22) = x<br />

(c10*x’ + c11*y’ + c12)/(c20*x’ + c21*y’ + c22) = y<br />

Where cij represents the transform coefficients.<br />

Return Values<br />

aplStsCoeffErr The coefficient values have errors.<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsWrongIntersectQuad The quadrangle does not intersect the source or destination image (no operation is performed).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 367 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

WarpPerspectiveQuad<br />

Perform quadrangular warp perspective transform<br />

Synopsis<br />

AplStatus apliWarpPerspectiveQuad_8u_C1R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl8u* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpPerspectiveQuad_8u_C3R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl8u* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpPerspectiveQuad_8u_C4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl8u* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpPerspectiveQuad_8u_AC4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl8u* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpPerspectiveQuad_32f_C1R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl32f* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpPerspectiveQuad_32f_C3R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl32f* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpPerspectiveQuad_32f_C4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl32f* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpPerspectiveQuad_32f_AC4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl32f* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpPerspectiveQuad_8u_P3R ( const Apl8u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl8u* pDst[3] , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpPerspectiveQuad_8u_P4R ( const Apl8u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl8u* pDst[4] , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpPerspectiveQuad_32f_P3R ( const Apl32f* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl32f* pDst[3] , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpPerspectiveQuad_32f_P4R ( const Apl32f* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl32f* pDst[4] , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 368 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstQuad[4][2] Destination quadrangle vertex coordinates.<br />

dstRoi Destination image ROI.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

interpolation Specifies the method of interpolation.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

srcQuad[4][2] Source quadrangle vertex coordinates.<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through a quadrangular source ROI, perform the warp perspective transform on the source data, and map the<br />

transformed data into a quadrangular destination ROI using a specified method of interpolation. Edge smoothing interpolation is<br />

applicable only when the destination quadrangle is completely within the destination ROI. The warp perspective coefficients are<br />

calculated using the quadrangle vertices. If the coefficients cannot be resolved consistently, the function returns errors.<br />

Return Values<br />

aplStsCoeffErr The coefficient values have errors.<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsWrongIntersectQuad The quadrangle does not intersect the source or destination image (no operation is performed).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 369 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

GetPerspectiveQuad<br />

Get perspective quadrangle vertices<br />

Synopsis<br />

AplStatus apliGetPerspectiveQuad ( ApliRect srcRoi , double quad[4][2] , const double coeffs[3][3] );<br />

Parameters<br />

coeffs[3][3] Coefficients for Warp Affine Perspective transform.<br />

quad[4][2] Quadrangle vertex coordinates.<br />

srcRoi Source image ROI.<br />

Description<br />

This function is used with the GetPerspectiveBound function. It computes the vertex coordinates of the quadrangular destination ROI<br />

for the WarpPerspectiveQuad( ) functions. Quad[0] contains the top right x and y coordinates, Quad[1] contains the top left x and y<br />

coordinates, Quad[2] contains the bottom right x and y coordinates, and Quad[3] contains the bottom left x and y coordinates.<br />

Return Values<br />

aplStsCoeffErr The coefficient values have errors.<br />

aplStsNoErr No error detected.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 370 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

GetPerspectiveBound<br />

Get perspective boundary<br />

Synopsis<br />

AplStatus apliGetPerspectiveBound ( ApliRect srcRoi , double bound[2][2] , const double coeffs[3][3] );<br />

Parameters<br />

bound[2][2] Boundary rectangle vertex coordinates for a transformed source ROI.<br />

coeffs[3][3] Coefficients for Warp Affine Perspective transform.<br />

srcRoi Source image ROI.<br />

Description<br />

This function is used with the GetPerspectiveQuad( ) function. It computes the boundaries of the source ROI for the<br />

WarpPerspectiveQuad( ) functions. Bound[0] contains the top right x and y coordinates; Bound[1] contains the bottom left x and y<br />

coordinates.<br />

Return Values<br />

aplStsCoeffErr The coefficient values have errors.<br />

aplStsNoErr No error detected.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 371 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

GetPerspectiveTransform<br />

Get the perspective transform coefficients<br />

Synopsis<br />

AplStatus apliGetPerspectiveTransform ( ApliRect srcRoi , const double quad[4][2] , double coeffs[3][3] );<br />

Parameters<br />

coeffs[3][3] Coefficients for Warp Affine Perspective transform.<br />

quad[4][2] Quadrangle vertex coordinates.<br />

srcRoi Source image ROI.<br />

Description<br />

This function computes perspective transform coefficients for the WarpPerspectiveQuad( ) functions. Quad[0] corresponds to the<br />

top right coordinates of the source ROI, Quad[1] corresponds to the top left coordinates of the source ROI, Quad[2] corresponds to the<br />

bottom right coordinates of the source ROI, and Quad[3] corresponds to the bottom left coordinates of the source ROI. The function<br />

returns aplstsCoeffErr if the mapping is incorrect.<br />

Return Values<br />

aplStsCoeffErr The coefficient values have errors.<br />

aplStsNoErr No error detected.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 372 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

WarpBilinear<br />

Perform warp bilinear transform<br />

Synopsis<br />

AplStatus apliWarpBilinear_8u_C1R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinear_8u_C3R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinear_8u_C4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinear_8u_AC4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinear_32f_C1R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinear_32f_C3R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinear_32f_C4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinear_32f_AC4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinear_8u_P3R ( const Apl8u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[3] , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinear_8u_P4R ( const Apl8u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[4] , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinear_32f_P3R ( const Apl32f* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[3] , int dstStep<br />

, ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinear_32f_P4R ( const Apl32f* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[4] , int dstStep<br />

, ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 373 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

coeffs[2][4] Coefficients for Warp Affine Bilinear transform.<br />

dstRoi Destination image ROI.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

interpolation Specifies the method of interpolation.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through a source ROI, perform the warp bilinear transform on the source data, apply a specified method of<br />

interpolation, and write the data to a destination ROI.<br />

The transformation formula is as follows.<br />

x’ = c00*xy + c01*x + c02*y + c03<br />

y’ = c10*xy + c11*x + c12*y + c13<br />

Where x’ and y’ are the destination coordinates and Cij are transform coefficients that are passed into the array.<br />

Note: The warp bilinear transform is not a true linear transform. It does not preserve distance relationships.<br />

Return Values<br />

aplStsCoeffErr The coefficient values have errors.<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsWrongIntersectQuad The quadrangle does not intersect the source or destination image (no operation is performed).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 374 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

WarpBilinearBack<br />

Perform inverse warp bilinear transform<br />

Synopsis<br />

AplStatus apliWarpBilinearBack_8u_C1R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinearBack_8u_C3R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinearBack_8u_C4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinearBack_8u_AC4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinearBack_32f_C1R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinearBack_32f_C3R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinearBack_32f_C4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep ,<br />

ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinearBack_32f_AC4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst , int dstStep<br />

, ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinearBack_8u_P3R ( const Apl8u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[3] , int<br />

dstStep , ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinearBack_8u_P4R ( const Apl8u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl8u* pDst[4] , int<br />

dstStep , ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinearBack_32f_P3R ( const Apl32f* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[3] , int<br />

dstStep , ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

AplStatus apliWarpBilinearBack_32f_P4R ( const Apl32f* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , Apl32f* pDst[4] , int<br />

dstStep , ApliRect dstRoi , const double coeffs[2][4] , int interpolation );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 375 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

coeffs[2][4] Coefficients for Warp Affine Bilinear transform.<br />

dstRoi Destination image ROI.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

interpolation Specifies the method of interpolation.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through a source ROI, perform an inverse warp bilinear transform on the source data, apply a specified method of<br />

interpolation, and write the data to a destination ROI. Edge smoothing interpolation is applicable only when the destination quadrangle<br />

is completely within the destination image ROI.<br />

The transformation formula is as follows.<br />

c00*x’y’ + c01*x’ + c02*y’ + c03 = x<br />

c10*x’y’ + c11*x’ + c12*y’ + c13 = y<br />

Where cij represents the transform coefficients.<br />

Return Values<br />

aplStsCoeffErr The coefficient values have errors.<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsWrongIntersectQuad The quadrangle does not intersect the source or destination image (no operation is performed).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 376 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

WarpBilinearQuad<br />

Perform quadrangular warp bilinear transform<br />

Synopsis<br />

AplStatus apliWarpBilinearQuad_8u_C1R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double srcQuad[4][2]<br />

, Apl8u* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpBilinearQuad_8u_C3R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double srcQuad[4][2]<br />

, Apl8u* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpBilinearQuad_8u_C4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double srcQuad[4][2]<br />

, Apl8u* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpBilinearQuad_8u_AC4R ( const Apl8u* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl8u* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpBilinearQuad_32f_C1R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl32f* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpBilinearQuad_32f_C3R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl32f* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpBilinearQuad_32f_C4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl32f* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpBilinearQuad_32f_AC4R ( const Apl32f* pSrc , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl32f* pDst , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpBilinearQuad_8u_P3R ( const Apl8u* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl8u* pDst[3] , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpBilinearQuad_8u_P4R ( const Apl8u* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl8u* pDst[4] , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpBilinearQuad_32f_P3R ( const Apl32f* pSrc[3] , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl32f* pDst[3] , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

AplStatus apliWarpBilinearQuad_32f_P4R ( const Apl32f* pSrc[4] , ApliSize srcSize , int srcStep , ApliRect srcRoi , const double<br />

srcQuad[4][2] , Apl32f* pDst[4] , int dstStep , ApliRect dstRoi , const double dstQuad[4][2] , int interpolation );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 377 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstQuad[4][2] Destination quadrangle vertex coordinates.<br />

dstRoi Destination image ROI.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

interpolation Specifies the method of interpolation.<br />

pDst Pointer to a location in a destination buffer.<br />

pDst[3] Pointer to a location in a three-channel planar destination buffer (array values point to a location in each plane).<br />

pDst[4] Pointer to a location in a four-channel planar destination buffer (array values point to a location in each plane).<br />

pSrc Pointer to a location in a source buffer.<br />

pSrc[3] Pointer to a location in a three-channel planar source buffer (array values point to a location in each plane).<br />

pSrc[4] Pointer to a location in a four-channel planar source buffer (array values point to a location in each plane).<br />

srcQuad[4][2] Source quadrangle vertex coordinates.<br />

srcRoi Source image ROI.<br />

srcSize Source image size.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through a quadrangular source ROI, perform the warp bilinear transform on the source data, and map the<br />

transformed data into a quadrangular destination ROI using a specified method of interpolation. Edge smoothing interpolation is<br />

applicable only when the destination quadrangle is completely within the destination ROI. The warp perspective coefficients are<br />

calculated using the quadrangle vertices. If the coefficients cannot be resolved consistently, the function returns errors.<br />

Return Values<br />

aplStsCoeffErr The coefficient values have errors.<br />

aplStsInterpolationErr The interpolation value is incorrect or unsupported for the specified function.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

aplStsWrongIntersectQuad The quadrangle does not intersect the source or destination image (no operation is performed).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 378 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

GetBilinearQuad<br />

Get bilinear quadrangle vertices<br />

Synopsis<br />

AplStatus apliGetBilinearQuad ( ApliRect srcRoi , double quad[4][2] , const double coeffs[2][4] );<br />

Parameters<br />

coeffs[2][4] Coefficients for Warp Affine Bilinear transform.<br />

quad[4][2] Quadrangle vertex coordinates.<br />

srcRoi Source image ROI.<br />

Description<br />

This function is used with the GetBilinearBound function. It computes the vertex coordinates of the quadrangular destination ROI for<br />

the WarpBilinearQuad( ) functions. Quad[0] contains the top right x and y coordinates, Quad[1] contains the top left x and y<br />

coordinates, Quad[2] contains the bottom right x and y coordinates, and Quad[3] contains the bottom left x and y coordinates.<br />

Return Values<br />

aplStsCoeffErr The coefficient values have errors.<br />

aplStsNoErr No error detected.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 379 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

GetBilinearBound<br />

Get bilinear boundary<br />

Synopsis<br />

AplStatus apliGetBilinearBound ( ApliRect srcRoi , double bound[2][2] , const double coeffs[2][4] );<br />

Parameters<br />

bound[2][2] Boundary rectangle vertex coordinates for a transformed source ROI.<br />

coeffs[2][4] Coefficients for Warp Affine Bilinear transform.<br />

srcRoi Source image ROI.<br />

Description<br />

This function is used with the GetBilinearQuad( ) function. It computes the boundaries of the source ROI for the<br />

WarpBilinearQuad( ) functions. Bound[0] contains the top right x and y coordinates; Bound[1] contains the bottom left x and y<br />

coordinates.<br />

Return Values<br />

aplStsCoeffErr The coefficient values have errors.<br />

aplStsNoErr No error detected.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 380 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

GetBilinearTransform<br />

Get the bilinear transform coefficients<br />

Synopsis<br />

AplStatus apliGetBilinearTransform ( ApliRect srcRoi , const double quad[4][2] , double coeffs[2][4] );<br />

Parameters<br />

coeffs[2][4] Coefficients for Warp Affine Bilinear transform.<br />

quad[4][2] Quadrangle vertex coordinates.<br />

srcRoi Source image ROI.<br />

Description<br />

This function computes bilinear transform coefficients for the WarpBilinearQuad( ) functions. Quad[0] corresponds to the top right<br />

coordinates of the source ROI, Quad[1] corresponds to the top left coordinates of the source ROI, Quad[2] corresponds to the bottom<br />

right coordinates of the source ROI, and Quad[3] corresponds to the bottom left coordinates of the source ROI. The function returns<br />

aplstsCoeffErr if the mapping is incorrect.<br />

Return Values<br />

aplStsCoeffErr The coefficient values have errors.<br />

aplStsNoErr No error detected.<br />

aplStsRectErr The width or height of the source ROI has a value less than or equal to one.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 381 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Digital Filter Functions<br />

This chapter describes functions that alter frequency-related visual properties of images such as sharpness and contrast.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 382 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Sharpen<br />

Sharpen<br />

Synopsis<br />

AplStatus apliFilterSharpen_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSharpen_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSharpen_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSharpen_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSharpen_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSharpen_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSharpen_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSharpen_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSharpen_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSharpen_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSharpen_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSharpen_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, apply a sharpening filter to the source data, and write the result to a<br />

destination buffer. The functions use a fixed 3X3 mask.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 383 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterBox<br />

Blur<br />

Synopsis<br />

AplStatus apliFilterBox_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterBox_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterBox_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterBox_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterBox_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterBox_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterBox_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterBox_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterBox_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterBox_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterBox_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterBox_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

Parameters<br />

anchor A pixel locating the kernel (mask) according to source image.<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

maskSize Size of the mask used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 384 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through an ROI in a source buffer, apply a box blur filter to the source data, and write the filtered data to a<br />

destination buffer. The functions can use arbitrary mask sizes.<br />

Return Values<br />

aplStsAnchorErr The anchor is located out of the mask.<br />

aplStsMaskSizeErr The mask has an invalid value.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 385 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterBoxInplace<br />

Blur in place<br />

Synopsis<br />

AplStatus apliFilterBox_8u_C1IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize dstRoiSize , ApliSize maskSize , ApliPoint anchor );<br />

AplStatus apliFilterBox_8u_C3IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize dstRoiSize , ApliSize maskSize , ApliPoint anchor );<br />

AplStatus apliFilterBox_8u_C4IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize dstRoiSize , ApliSize maskSize , ApliPoint anchor );<br />

AplStatus apliFilterBox_8u_AC4IR ( Apl8u * pSrcDst , int srcDstStep , ApliSize dstRoiSize , ApliSize maskSize , ApliPoint anchor );<br />

AplStatus apliFilterBox_16s_C1IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize dstRoiSize , ApliSize maskSize , ApliPoint anchor );<br />

AplStatus apliFilterBox_16s_C3IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize dstRoiSize , ApliSize maskSize , ApliPoint anchor );<br />

AplStatus apliFilterBox_16s_C4IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize dstRoiSize , ApliSize maskSize , ApliPoint anchor );<br />

AplStatus apliFilterBox_16s_AC4IR ( Apl16s * pSrcDst , int srcDstStep , ApliSize dstRoiSize , ApliSize maskSize , ApliPoint anchor );<br />

AplStatus apliFilterBox_32f_C1IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize dstRoiSize , ApliSize maskSize , ApliPoint anchor );<br />

AplStatus apliFilterBox_32f_C3IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize dstRoiSize , ApliSize maskSize , ApliPoint anchor );<br />

AplStatus apliFilterBox_32f_C4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize dstRoiSize , ApliSize maskSize , ApliPoint anchor );<br />

AplStatus apliFilterBox_32f_AC4IR ( Apl32f * pSrcDst , int srcDstStep , ApliSize dstRoiSize , ApliSize maskSize , ApliPoint anchor );<br />

Parameters<br />

anchor A pixel locating the kernel (mask) according to source image.<br />

dstRoiSize Destination image ROI size.<br />

maskSize Size of the mask used in the calculations.<br />

pSrcDst Pointer to a location in a buffer that contains both the source and destination.<br />

srcDstStep Source and destination buffer step size in bytes (width of both buffers in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, apply a box blur filter to the source data, and write the filtered data back to<br />

the same location. The functions can use arbitrary mask sizes.<br />

Return Values<br />

aplStsAnchorErr The anchor is located out of the mask.<br />

aplStsMaskSizeErr The mask has an invalid value.<br />

aplStsMemAllocErr The function failed to allocate memory.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 386 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterMin<br />

Filter with minimum value in mask<br />

Synopsis<br />

AplStatus apliFilterMin_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMin_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMin_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMin_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMin_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMin_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMin_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMin_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMin_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMin_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMin_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMin_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

Parameters<br />

anchor A pixel locating the kernel (mask) according to source image.<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

maskSize Size of the mask used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 387 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through an ROI in a source buffer, replace each source pixel value with the smallest pixel value in the area<br />

defined by the mask size, and write the filtered data to a destination buffer. The functions decrease image contrast. The functions can<br />

use arbitrary mask sizes.<br />

Return Values<br />

aplStsAnchorErr The anchor is located out of the mask.<br />

aplStsMaskSizeErr The mask has an invalid value.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 388 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterMax<br />

Filter with maximum value in mask<br />

Synopsis<br />

AplStatus apliFilterMax_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMax_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMax_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMax_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMax_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMax_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMax_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMax_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize<br />

, ApliPoint anchor );<br />

AplStatus apliFilterMax_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMax_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMax_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMax_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

Parameters<br />

anchor A pixel locating the kernel (mask) according to source image.<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

maskSize Size of the mask used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 389 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through an ROI in a source buffer, replace each source pixel value with the largest pixel value in the area defined<br />

by the mask size, and write the filtered data to a destination buffer. The functions increase image contrast. The functions can use<br />

arbitrary mask sizes.<br />

Return Values<br />

aplStsAnchorErr The anchor is located out of the mask.<br />

aplStsMaskSizeErr The mask has an invalid value.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 390 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

SumWindowRow<br />

Sum pixel values in row mask<br />

Synopsis<br />

AplStatus apliSumWindowRow_8u32f_C1R ( const Apl8u * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , int<br />

maskSize , int anchor );<br />

AplStatus apliSumWindowRow_8u32f_C3R ( const Apl8u * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , int<br />

maskSize , int anchor );<br />

AplStatus apliSumWindowRow_8u32f_C4R ( const Apl8u * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , int<br />

maskSize , int anchor );<br />

AplStatus apliSumWindowRow_16s32f_C1R ( const Apl16s * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , int<br />

maskSize , int anchor );<br />

AplStatus apliSumWindowRow_16s32f_C3R ( const Apl16s * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , int<br />

maskSize , int anchor );<br />

AplStatus apliSumWindowRow_16s32f_C4R ( const Apl16s * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , int<br />

maskSize , int anchor );<br />

Parameters<br />

anchor A pixel locating the kernel (mask) according to source image.<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

maskSize Size of the mask used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, replace each source pixel value with the sum of the values of all pixels in the<br />

area defined by the mask, and write the filtered data to a destination buffer. The functions can use arbitrary horizontal row mask sizes.<br />

Return Values<br />

aplStsAnchorErr The anchor is located out of the mask.<br />

aplStsMaskSizeErr The mask has an invalid value.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 391 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

SumWindow<br />

Sum pixel values in column mask<br />

Synopsis<br />

AplStatus apliSumWindowColumn_8u32f_C1R ( const Apl8u * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , int<br />

maskSize , int anchor );<br />

AplStatus apliSumWindowColumn_8u32f_C3R ( const Apl8u * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , int<br />

maskSize , int anchor );<br />

AplStatus apliSumWindowColumn_8u32f_C4R ( const Apl8u * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , int<br />

maskSize , int anchor );<br />

AplStatus apliSumWindowColumn_16s32f_C1R ( const Apl16s * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , int<br />

maskSize , int anchor );<br />

AplStatus apliSumWindowColumn_16s32f_C3R ( const Apl16s * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , int<br />

maskSize , int anchor );<br />

AplStatus apliSumWindowColumn_16s32f_C4R ( const Apl16s * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , int<br />

maskSize , int anchor );<br />

Parameters<br />

anchor A pixel locating the kernel (mask) according to source image.<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

maskSize Size of the mask used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, replace each source pixel value with the sum of the values of all pixels in the<br />

area defined by the mask, and write the filtered data to a destination buffer. The functions can use arbitrary horizontal row mask sizes.<br />

Return Values<br />

aplStsAnchorErr The anchor is located out of the mask.<br />

aplStsMaskSizeErr The mask has an invalid value.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 392 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterMedian<br />

Filter with median value in mask<br />

Synopsis<br />

AplStatus apliFilterMedian_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMedian_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMedian_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize ,<br />

ApliPoint anchor );<br />

AplStatus apliFilterMedian_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliSize maskSize<br />

, ApliPoint anchor );<br />

AplStatus apliFilterMedian_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliSize<br />

maskSize , ApliPoint anchor );<br />

AplStatus apliFilterMedian_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliSize<br />

maskSize , ApliPoint anchor );<br />

AplStatus apliFilterMedian_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliSize<br />

maskSize , ApliPoint anchor );<br />

AplStatus apliFilterMedian_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliSize<br />

maskSize , ApliPoint anchor );<br />

Parameters<br />

anchor A pixel locating the kernel (mask) according to source image.<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

maskSize Size of the mask used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, replace each source pixel value with the median value of all pixels in the area<br />

defined by the mask, and write the filtered data to a destination buffer. The functions remove noise without decreasing image<br />

brightness, as averaging filters do.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 393 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsAnchorErr The anchor is located out of the mask.<br />

aplStsMaskSizeErr The mask has an invalid value.<br />

aplStsMemAllocErr The function failed to allocate memory.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 394 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterMedianHoriz<br />

Filter with median value in horizontal mask<br />

Synopsis<br />

AplStatus apliFilterMedianHoriz_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterMedianHoriz_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterMedianHoriz_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterMedianHoriz_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize maskSize );<br />

AplStatus apliFilterMedianHoriz_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize maskSize );<br />

AplStatus apliFilterMedianHoriz_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize maskSize );<br />

AplStatus apliFilterMedianHoriz_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize maskSize );<br />

AplStatus apliFilterMedianHoriz_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize maskSize );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

maskSize Size of the mask used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, replace each source pixel value with the median value of all pixels in the area<br />

defined by the horizontal mask, and write the filtered data to a destination buffer. The functions remove noise without decreasing<br />

image brightness, as averaging filters do. The functions can use arbitrary horizontal mask sizes.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 395 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsAnchorErr The anchor is located out of the mask.<br />

aplStsMaskSizeErr The mask has an invalid value.<br />

aplStsMemAllocErr The function failed to allocate memory.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 396 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterMedianVert<br />

Filter with median value in vertical mask<br />

Synopsis<br />

AplStatus apliFilterMedianVert_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterMedianVert_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterMedianVert_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterMedianVert_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterMedianVert_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize maskSize );<br />

AplStatus apliFilterMedianVert_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize maskSize );<br />

AplStatus apliFilterMedianVert_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize maskSize );<br />

AplStatus apliFilterMedianVert_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize maskSize );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

maskSize Size of the mask used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, replace each source pixel value with the median value of all pixels in the area<br />

defined by the vertical mask, and write the filtered data to a destination buffer. The functions remove noise without decreasing image<br />

brightness, as averaging filters do. The functions can use arbitrary vertical mask sizes.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 397 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsAnchorErr The anchor is located out of the mask.<br />

aplStsMaskSizeErr The mask has an invalid value.<br />

aplStsMemAllocErr The function failed to allocate memory.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 398 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterMedianCross<br />

Filter with median value in cross mask<br />

Synopsis<br />

AplStatus apliFilterMedianCross_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterMedianCross_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterMedianCross_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize maskSize );<br />

AplStatus apliFilterMedianCross_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize maskSize );<br />

AplStatus apliFilterMedianCross_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize maskSize );<br />

AplStatus apliFilterMedianCross_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize maskSize );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

maskSize Size of the mask used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, replace each source pixel value with the median value of all pixels in the area<br />

defined by the cross mask, and write the filtered data to a destination buffer. The functions remove noise without decreasing image<br />

brightness, as averaging filters do. The functions can use arbitrary cross mask sizes.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 399 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsAnchorErr The anchor is located out of the mask.<br />

aplStsMaskSizeErr The mask has an invalid value.<br />

aplStsMemAllocErr The function failed to allocate memory.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 400 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterMedianColor<br />

Filter color with median value in mask<br />

Synopsis<br />

AplStatus apliFilterMedianColor_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterMedianColor_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize maskSize );<br />

AplStatus apliFilterMedianColor_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize maskSize );<br />

AplStatus apliFilterMedianColor_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize maskSize );<br />

AplStatus apliFilterMedianColor_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize maskSize );<br />

AplStatus apliFilterMedianColor_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize maskSize );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

maskSize Size of the mask used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, replace each source pixel value with the value of the pixel nearest to the<br />

source pixel in the area defined by the mask, and write the filtered data to a destination buffer. The functions remove noise without<br />

decreasing image brightness, as averaging filters do, while preserving the correlation between color components.<br />

The distance between the source and mask pixels is calculated as a sum of absolute values using the following formula.<br />

bs(R(i)-R(j)) + abs(G(i)-G(j)) + abs(B(i)-B(j)).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 401 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsAnchorErr The anchor is located out of the mask.<br />

aplStsMaskSizeErr The mask has an invalid value.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 402 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Filter<br />

Filter with an integer rectangular kernel<br />

Synopsis<br />

AplStatus apliFilter_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s * pKernel ,<br />

ApliSize kernelSize , ApliPoint anchor , int divisor );<br />

AplStatus apliFilter_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s * pKernel ,<br />

ApliSize kernelSize , ApliPoint anchor , int divisor );<br />

AplStatus apliFilter_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s * pKernel ,<br />

ApliSize kernelSize , ApliPoint anchor , int divisor );<br />

AplStatus apliFilter_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s * pKernel ,<br />

ApliSize kernelSize , ApliPoint anchor , int divisor );<br />

AplStatus apliFilter_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s * pKernel ,<br />

ApliSize kernelSize , ApliPoint anchor , int divisor );<br />

AplStatus apliFilter_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s * pKernel ,<br />

ApliSize kernelSize , ApliPoint anchor , int divisor );<br />

AplStatus apliFilter_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s * pKernel ,<br />

ApliSize kernelSize , ApliPoint anchor , int divisor );<br />

AplStatus apliFilter_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s * pKernel<br />

, ApliSize kernelSize , ApliPoint anchor , int divisor );<br />

AplStatus apliFilter_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f * pKernel ,<br />

ApliSize kernelSize , ApliPoint anchor );<br />

AplStatus apliFilter_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f * pKernel ,<br />

ApliSize kernelSize , ApliPoint anchor );<br />

AplStatus apliFilter_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f * pKernel ,<br />

ApliSize kernelSize , ApliPoint anchor );<br />

AplStatus apliFilter_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f * pKernel ,<br />

ApliSize kernelSize , ApliPoint anchor );<br />

Parameters<br />

anchor A pixel locating the kernel (mask) according to source image.<br />

divisor An integer value by which the result is divided.<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

kernelSize Size of the kernel used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pKernel Pointer to the kernel array.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 403 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through an ROI in a source buffer, calculate the sum of products of the kernel values and the corresponding pixel<br />

values in an area defined by the kernel size and anchor coordinate, then divide by the divisor. The filtered data is written to a<br />

destination buffer. The kernel is an array of signed 32-bit integer values; the anchor coordinate location is relative to the bottom right<br />

corner of the kernel.<br />

Return Values<br />

aplStsAnchorErr The anchor is located out of the mask.<br />

aplStsMaskSizeErr The mask has an invalid value.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 404 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Filter32f<br />

Filter integer values with a floating-point rectangular kernel<br />

Synopsis<br />

AplStatus apliFilter32f_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f * pKernel ,<br />

ApliSize kernelSize , ApliPoint anchor );<br />

AplStatus apliFilter32f_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f * pKernel ,<br />

ApliSize kernelSize , ApliPoint anchor );<br />

AplStatus apliFilter32f_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f * pKernel ,<br />

ApliSize kernelSize , ApliPoint anchor );<br />

AplStatus apliFilter32f_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f * pKernel<br />

, ApliSize kernelSize , ApliPoint anchor );<br />

AplStatus apliFilter32f_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , ApliSize kernelSize , ApliPoint anchor );<br />

AplStatus apliFilter32f_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , ApliSize kernelSize , ApliPoint anchor );<br />

AplStatus apliFilter32f_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , ApliSize kernelSize , ApliPoint anchor );<br />

AplStatus apliFilter32f_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , ApliSize kernelSize , ApliPoint anchor );<br />

Parameters<br />

anchor A pixel locating the kernel (mask) according to source image.<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

kernelSize Size of the kernel used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pKernel Pointer to the kernel array.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, and calculate the sum of products of the kernel values and the corresponding<br />

pixel values in an area defined by the kernel size and anchor coordinate. The filtered data is written to a destination buffer. The kernel<br />

is an array of 32-bit single-precision floating point values; the anchor coordinate location is relative to the bottom right corner of the<br />

kernel.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 405 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsAnchorErr The anchor is located out of the mask.<br />

aplStsMaskSizeErr The mask has an invalid value.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 406 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterColumn<br />

Filter with an integer vertical column kernel<br />

Synopsis<br />

AplStatus apliFilterColumn_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s *<br />

pKernel , int kernelSize , int yAnchor , int divisor );<br />

AplStatus apliFilterColumn_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s *<br />

pKernel , int kernelSize , int yAnchor , int divisor );<br />

AplStatus apliFilterColumn_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s *<br />

pKernel , int kernelSize , int yAnchor , int divisor );<br />

AplStatus apliFilterColumn_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s *<br />

pKernel , int kernelSize , int yAnchor , int divisor );<br />

AplStatus apliFilterColumn_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s *<br />

pKernel , int kernelSize , int yAnchor , int divisor );<br />

AplStatus apliFilterColumn_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s *<br />

pKernel , int kernelSize , int yAnchor , int divisor );<br />

AplStatus apliFilterColumn_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s *<br />

pKernel , int kernelSize , int yAnchor , int divisor );<br />

AplStatus apliFilterColumn_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s<br />

* pKernel , int kernelSize , int yAnchor , int divisor );<br />

AplStatus apliFilterColumn_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int yAnchor );<br />

AplStatus apliFilterColumn_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int yAnchor );<br />

AplStatus apliFilterColumn_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int yAnchor );<br />

AplStatus apliFilterColumn_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int yAnchor );<br />

Parameters<br />

divisor An integer value by which the result is divided.<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

kernelSize Size of the kernel used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pKernel Pointer to the kernel array.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

yAnchor Anchor cell that specifies the vertical alignment of the kernel with respect to the input pixel.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 407 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through an ROI in a source buffer, calculate the sum of products of the kernel values and the corresponding pixel<br />

values in an area defined by the kernel size and anchor coordinate, then divide by the divisor. The filtered data is written to a<br />

destination buffer. The vertical column kernel is an array of signed 32-bit integer values; the anchor coordinate location is relative to<br />

the bottom of the kernel. Functions that operate on 8-bit unsigned data assume that the kernel values are small (in the -4096 to 4096<br />

range). The results of the intermediate calculations exceed 24 bits, calculation errors may occur. Also, for very small kernel values, the<br />

functions use very fast code, at the expense of accuracy (+/- 1.5).<br />

Return Values<br />

aplStsAnchorErr The anchor is located out of the mask.<br />

aplStsMaskSizeErr The mask has an invalid value.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 408 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterColumn32f<br />

Filter integer values with a floating-point vertical column kernel<br />

Synopsis<br />

AplStatus apliFilterColumn32f_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int yAnchor );<br />

AplStatus apliFilterColumn32f_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int yAnchor );<br />

AplStatus apliFilterColumn32f_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int yAnchor );<br />

AplStatus apliFilterColumn32f_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int yAnchor );<br />

AplStatus apliFilterColumn32f_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f<br />

* pKernel , int kernelSize , int yAnchor );<br />

AplStatus apliFilterColumn32f_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f<br />

* pKernel , int kernelSize , int yAnchor );<br />

AplStatus apliFilterColumn32f_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f<br />

* pKernel , int kernelSize , int yAnchor );<br />

AplStatus apliFilterColumn32f_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const<br />

Apl32f * pKernel , int kernelSize , int yAnchor );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

kernelSize Size of the kernel used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pKernel Pointer to the kernel array.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

yAnchor Anchor cell that specifies the vertical alignment of the kernel with respect to the input pixel.<br />

Description<br />

These functions step through an ROI in a source buffer, and calculate the sum of products of the kernel values and the corresponding<br />

pixel values in an area defined by the kernel size and anchor coordinate. The filtered data is written to a destination buffer. The<br />

vertical column kernel is an array of 32-bit single-precision floating point values; the anchor coordinate location is relative to the<br />

bottom of the kernel.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 409 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsAnchorErr The anchor is located out of the mask.<br />

aplStsMaskSizeErr The mask has an invalid value.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 410 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterRow<br />

Filter with an integer horizontal row kernel<br />

Synopsis<br />

AplStatus apliFilterRow_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s * pKernel<br />

, int kernelSize , int xAnchor , int divisor );<br />

AplStatus apliFilterRow_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s * pKernel<br />

, int kernelSize , int xAnchor , int divisor );<br />

AplStatus apliFilterRow_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s * pKernel<br />

, int kernelSize , int xAnchor , int divisor );<br />

AplStatus apliFilterRow_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s *<br />

pKernel , int kernelSize , int xAnchor , int divisor );<br />

AplStatus apliFilterRow_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s *<br />

pKernel , int kernelSize , int xAnchor , int divisor );<br />

AplStatus apliFilterRow_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s *<br />

pKernel , int kernelSize , int xAnchor , int divisor );<br />

AplStatus apliFilterRow_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s *<br />

pKernel , int kernelSize , int xAnchor , int divisor );<br />

AplStatus apliFilterRow_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32s *<br />

pKernel , int kernelSize , int xAnchor , int divisor );<br />

AplStatus apliFilterRow_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int xAnchor );<br />

AplStatus apliFilterRow_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int xAnchor );<br />

AplStatus apliFilterRow_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int xAnchor );<br />

AplStatus apliFilterRow_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int xAnchor );<br />

Parameters<br />

divisor An integer value by which the result is divided.<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

kernelSize Size of the kernel used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pKernel Pointer to the kernel array.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

xAnchor Anchor cell that specifies the horizontal alignment of the kernel with respect to the input pixel.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 411 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through an ROI in a source buffer, calculate the sum of products of the kernel values and the corresponding pixel<br />

values in an area defined by the kernel size and anchor coordinate, then divide by the divisor. The filtered data is written to a<br />

destination buffer. The horizontal row kernel is an array of signed 32-bit integer values; the anchor coordinate location is relative to<br />

the right side of the kernel. Functions that operate on 8-bit unsigned data assume that the kernel values are small. If the results of<br />

intermediate calculations exceed 24 bits, calculation errors may occur. Also, for very small kernel values, the functions use very fast<br />

code, at the expense of accuracy (+/- 1.5).<br />

Return Values<br />

aplStsAnchorErr The anchor is located out of the mask.<br />

aplStsMaskSizeErr The mask has an invalid value.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 412 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterRow32f<br />

Filter integer values with a floating-point horizontal row kernel<br />

Synopsis<br />

AplStatus apliFilterRow32f_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int xAnchor );<br />

AplStatus apliFilterRow32f_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int xAnchor );<br />

AplStatus apliFilterRow32f_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int xAnchor );<br />

AplStatus apliFilterRow32f_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int xAnchor );<br />

AplStatus apliFilterRow32f_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int xAnchor );<br />

AplStatus apliFilterRow32f_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int xAnchor );<br />

AplStatus apliFilterRow32f_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int xAnchor );<br />

AplStatus apliFilterRow32f_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , const Apl32f *<br />

pKernel , int kernelSize , int xAnchor );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

kernelSize Size of the kernel used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pKernel Pointer to the kernel array.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

xAnchor Anchor cell that specifies the horizontal alignment of the kernel with respect to the input pixel.<br />

Description<br />

These functions step through an ROI in a source buffer, and calculate the sum of products of the kernel values and the corresponding<br />

pixel values in an area defined by the kernel size and anchor coordinate. The filtered data is written to a destination buffer. The<br />

horizontal row kernel is an array of 32-bit single-precision floating point values; the anchor coordinate location is relative to the right<br />

side of the kernel.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 413 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsAnchorErr The anchor is located out of the mask.<br />

aplStsMaskSizeErr The mask has an invalid value.<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 414 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterPrewittHoriz<br />

Filter with a horizontal Prewitt kernel<br />

Synopsis<br />

AplStatus apliFilterPrewittHoriz_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittHoriz_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittHoriz_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittHoriz_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittHoriz_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittHoriz_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittHoriz_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittHoriz_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittHoriz_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittHoriz_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittHoriz_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittHoriz_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, apply a horizontal Prewitt operator to the source data, and write the filtered<br />

data to a destination buffer. The functions enhance the horizontal edges of an image.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 415 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FiltePrewittVert<br />

Filter with a vertical Prewitt kernel<br />

Synopsis<br />

AplStatus apliFilterPrewittVert_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittVert_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittVert_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittVert_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittVert_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittVert_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittVert_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittVert_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittVert_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittVert_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittVert_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterPrewittVert_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, apply a vertical Prewitt operator to the source data, and write the filtered data<br />

to a destination buffer. The functions enhance the vertical edges of an image.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 416 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterScharrHoriz<br />

Filter with a horizontal Scharr kernel<br />

Synopsis<br />

AplStatus apliFilterScharrHoriz_8u16s_C1R ( const Apl8u * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterScharrHoriz_8s16s_C1R ( const Apl8s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterScharrHoriz_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, apply a horizontal Scharr operator to the source data, and write the filtered<br />

data to a destination buffer. These functions enhance and smooth the horizontal edges of an image.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 417 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterScharrVert<br />

Filter with a vertical Scharr kernel<br />

Synopsis<br />

AplStatus apliFilterScharrVert_8u16s_C1R ( const Apl8u * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterScharrVert_8s16s_C1R ( const Apl8s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterScharrVert_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, apply a vertical Scharr operator to the source data, and write the filtered data<br />

to a destination buffer. These functions enhance and smooth the vertical edges of an image.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 418 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterSobelHoriz<br />

Filter with a horizontal Sobel kernel<br />

Synopsis<br />

AplStatus apliFilterSobelHoriz_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelHoriz_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelHoriz_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelHoriz_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelHoriz_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelHoriz_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelHoriz_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelHoriz_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelHoriz_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelHoriz_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelHoriz_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelHoriz_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelHoriz_8u16s_C1R ( const Apl8u * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize mask );<br />

AplStatus apliFilterSobelHoriz_8s16s_C1R ( const Apl8s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize mask );<br />

AplStatus apliFilterSobelHorizMask_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize mask );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

mask An analysis window (only non-zero mask array values are processed).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, apply a horizontal Sobel operator to the source data, and write the filtered<br />

data to a destination buffer. These functions enhance and smooth the horizontal edges of an image.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 419 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 420 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterSobelVert<br />

Filter with a vertical Sobel kernel<br />

Synopsis<br />

AplStatus apliFilterSobelVert_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelVert_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelVert_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelVert_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelVert_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelVert_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelVert_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelVert_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelVert_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelVert_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelVert_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelVert_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterSobelVert_8u16s_C1R ( const Apl8u * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize mask );<br />

AplStatus apliFilterSobelVert_8s16s_C1R ( const Apl8s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize mask );<br />

AplStatus apliFilterSobelVertMask_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize mask );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

mask An analysis window (only non-zero mask array values are processed).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, apply a vertical Sobel operator to the source data, and write the filtered data<br />

to a destination buffer. These functions enhance and smooth the horizontal edges of an image.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 421 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 422 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterSobelHorizSecond<br />

Filter with a second derivative horizontal Sobel kernel<br />

Synopsis<br />

AplStatus apliFilterSobelHorizSecond_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize mask );<br />

AplStatus apliFilterSobelHorizSecond_8s16s_C1R ( const Apl8s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize mask );<br />

AplStatus apliFilterSobelHorizSecond_8u16s_C1R ( const Apl8u * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize mask );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

mask An analysis window (only non-zero mask array values are processed).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, apply a second derivative horizontal Sobel operator to the source data, and<br />

write the filtered data to a destination buffer. These functions enhance and smooth the horizontal edges of an image.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 423 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterSobelVertSecond<br />

Filter with a second derivative vertical Sobel kernel<br />

Synopsis<br />

AplStatus apliFilterSobelVertSecond_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize mask );<br />

AplStatus apliFilterSobelVertSecond_8s16s_C1R ( const Apl8s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize mask );<br />

AplStatus apliFilterSobelVertSecond_8u16s_C1R ( const Apl8u * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize mask );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

mask An analysis window (only non-zero mask array values are processed).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, apply a second derivative vertical Sobel operator to the source data, and write<br />

the filtered data to a destination buffer. These functions enhance and smooth the horizontal edges of an image.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 424 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterSobelCross<br />

Filter with a second cross derivative Sobel kernel<br />

Synopsis<br />

AplStatus apliFilterSobelCross_8u16s_C1R ( const Apl8u * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize mask );<br />

AplStatus apliFilterSobelCross_8s16s_C1R ( const Apl8s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize ,<br />

ApliMaskSize mask );<br />

AplStatus apliFilterSobelCross_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

mask );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

mask An analysis window (only non-zero mask array values are processed).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, apply a second cross derivative Sobel operator to the source data, and write<br />

the filtered data to a destination buffer. The functions operate on either a 3X3 or 5X5 mask. These functions enhance and smooth the<br />

horizontal edges of an image.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 425 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterRobertsDown<br />

Filter with a horizontal Roberts kernel<br />

Synopsis<br />

AplStatus apliFilterRobertsDown_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterRobertsDown_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterRobertsDown_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterRobertsDown_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterRobertsDown_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterRobertsDown_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterRobertsDown_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterRobertsDown_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterRobertsDown_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, apply a horizontal Roberts operator to the source data, and write the filtered<br />

data to a destination buffer. These functions provide a gross approximation of the horizontal pixel gradient.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 426 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterRobertsUp<br />

Filter with a vertical Roberts kernel<br />

Synopsis<br />

AplStatus apliFilterRobertsUp_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterRobertsUp_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterRobertsUp_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterRobertsUp_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterRobertsUp_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterRobertsUp_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterRobertsUp_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterRobertsUp_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

AplStatus apliFilterRobertsUp_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, apply a vertical Roberts operator to the source data, and write the filtered data<br />

to a destination buffer. These functions provide a gross approximation of the vertical pixel gradient.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 427 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterLaplace<br />

Filter with a Laplace kernel<br />

Synopsis<br />

AplStatus apliFilterLaplace_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLaplace_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLaplace_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLaplace_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLaplace_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLaplace_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLaplace_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLaplace_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLaplace_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLaplace_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLaplace_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLaplace_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLaplace_8u16s_C1R ( const Apl8u * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLaplace_8s16s_C1R ( const Apl8s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

maskSize Size of the mask used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 428 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through an ROI in a source buffer, apply a high-pass Laplacian operator to the source data, and write the filtered<br />

data to a destination buffer. The functions use either a 3X3 or a 5X5 kernel.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 429 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterGauss<br />

Filter with a Gauss kernel<br />

Synopsis<br />

AplStatus apliFilterGauss_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterGauss_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterGauss_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterGauss_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterGauss_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterGauss_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterGauss_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterGauss_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterGauss_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterGauss_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterGauss_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterGauss_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

maskSize Size of the mask used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 430 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through an ROI in a source buffer, apply a low-pass Gaussian operator to the source data, and write the filtered<br />

data to a destination buffer. The functions use either a 3X3 or a 5X5 kernel.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 431 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterHipass<br />

Filter with a high-pass kernel<br />

Synopsis<br />

AplStatus apliFilterHipass_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterHipass_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterHipass_8u_C4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterHipass_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterHipass_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterHipass_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterHipass_16s_C4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterHipass_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterHipass_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterHipass_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterHipass_32f_C4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterHipass_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

maskSize Size of the mask used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 432 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Description<br />

These functions step through an ROI in a source buffer, apply a high-pass operator to the source data, and write the filtered data to a<br />

destination buffer. The functions use either a 3X3 or a 5X5 kernel.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 433 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

FilterLowpass<br />

Filter with a low-pass kernel<br />

Synopsis<br />

AplStatus apliFilterLowpass_8u_C1R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLowpass_8u_C3R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLowpass_8u_AC4R ( const Apl8u * pSrc , int srcStep , Apl8u * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLowpass_16s_C1R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLowpass_16s_C3R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLowpass_16s_AC4R ( const Apl16s * pSrc , int srcStep , Apl16s * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLowpass_32f_C1R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLowpass_32f_C3R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

AplStatus apliFilterLowpass_32f_AC4R ( const Apl32f * pSrc , int srcStep , Apl32f * pDst , int dstStep , ApliSize dstRoiSize , ApliMaskSize<br />

maskSize );<br />

Parameters<br />

dstRoiSize Destination image ROI size.<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

maskSize Size of the mask used in the calculations.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an ROI in a source buffer, apply a low-pass operator to the source data, and write the filtered data to a<br />

destination buffer. The functions use either a 3X3 or a 5X5 kernel.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 434 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

aplStsSizeErr The size is invalid (usually indicates negative or zero size).<br />

aplStsStepErr The step value for the buffer is invalid.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 435 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Video Coding Functions<br />

This chapter describes functions that are used to encode and decode moving images.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 436 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

GetDiff<br />

Block difference for motion estimation<br />

Synopsis<br />

AplStatus apliGetDiff16x16_8u16s_C1 ( const Apl8u* pSrcCur , Apl32s srcCurStep , const Apl8u* pSrcRef , Apl32s srcRefStep , Apl16s*<br />

pDstDiff , Apl32s dstDiffStep , Apl16s* pDstPredictor , Apl32s dstPredictorStep , Apl32s mcType , Apl32s roundControl );<br />

AplStatus apliGetDiff16x8_8u16s_C1 ( const Apl8u* pSrcCur , Apl32s srcCurStep , const Apl8u* pSrcRef , Apl32s srcRefStep , Apl16s*<br />

pDstDiff , Apl32s dstDiffStep , Apl16s* pDstPredictor , Apl32s dstPredictorStep , Apl32s mcType , Apl32s roundControl );<br />

AplStatus apliGetDiff8x8_8u16s_C1 ( const Apl8u* pSrcCur , Apl32s srcCurStep , const Apl8u* pSrcRef , Apl32s srcRefStep , Apl16s*<br />

pDstDiff , Apl32s dstDiffStep , Apl16s* pDstPredictor , Apl32s dstPredictorStep , Apl32s mcType , Apl32s roundControl );<br />

AplStatus apliGetDiff8x16_8u16s_C1 ( const Apl8u* pSrcCur , Apl32s srcCurStep , const Apl8u* pSrcRef , Apl32s srcRefStep , Apl16s*<br />

pDstDiff , Apl32s dstDiffStep , Apl16s* pDstPredictor , Apl32s dstPredictorStep , Apl32s mcType , Apl32s roundControl );<br />

AplStatus apliGetDiff8x4_8u16s_C1 ( const Apl8u* pSrcCur , Apl32s srcCurStep , const Apl8u* pSrcRef , Apl32s srcRefStep , Apl16s*<br />

pDstDiff , Apl32s dstDiffStep , Apl16s* pDstPredictor , Apl32s dstPredictorStep , Apl32s mcType , Apl32s roundControl );<br />

AplStatus apliGetDiff4x4_8u16s_C1 ( const Apl8u* pSrcCur , Apl32s srcCurStep , const Apl8u* pSrcRef , Apl32s srcRefStep , Apl16s*<br />

pDstDiff , Apl32s dstDiffStep , Apl16s* pDstPredictor , Apl32s dstPredictorStep , Apl32s mcType , Apl32s roundControl );<br />

AplStatus apliGetDiff16x16B_8u16s_C1 ( const Apl8u* pSrcCur , Apl32s srcCurStep , const Apl8u* pSrcRefF , Apl32s srcRefStepF , Apl32s<br />

mcTypeF , const Apl8u* pSrcRefB , Apl32s srcRefStepB , Apl32s mcTypeB , Apl16s* pDstDiff , Apl32s dstDiffStep , Apl32s roundControl );<br />

AplStatus apliGetDiff16x8B_8u16s_C1 ( const Apl8u* pSrcCur , Apl32s srcCurStep , const Apl8u* pSrcRefF , Apl32s srcRefStepF , Apl32s<br />

mcTypeF , const Apl8u* pSrcRefB , Apl32s srcRefStepB , Apl32s mcTypeB , Apl16s* pDstDiff , Apl32s dstDiffStep , Apl32s roundControl );<br />

AplStatus apliGetDiff8x8B_8u16s_C1 ( const Apl8u* pSrcCur , Apl32s srcCurStep , const Apl8u* pSrcRefF , Apl32s srcRefStepF , Apl32s<br />

mcTypeF , const Apl8u* pSrcRefB , Apl32s srcRefStepB , Apl32s mcTypeB , Apl16s* pDstDiff , Apl32s dstDiffStep , Apl32s roundControl );<br />

AplStatus apliGetDiff8x16B_8u16s_C1 ( const Apl8u* pSrcCur , Apl32s srcCurStep , const Apl8u* pSrcRefF , Apl32s srcRefStepF , Apl32s<br />

mcTypeF , const Apl8u* pSrcRefB , Apl32s srcRefStepB , Apl32s mcTypeB , Apl16s* pDstDiff , Apl32s dstDiffStep , Apl32s roundControl );<br />

AplStatus apliGetDiff8x4B_8u16s_C1 ( const Apl8u* pSrcCur , Apl32s srcCurStep , const Apl8u* pSrcRefF , Apl32s srcRefStepF , Apl32s<br />

mcTypeF , const Apl8u* pSrcRefB , Apl32s srcRefStepB , Apl32s mcTypeB , Apl16s* pDstDiff , Apl32s dstDiffStep , Apl32s roundControl );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 437 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Parameters<br />

dstDiffStep Destination block step baize (width of the block in bytes).<br />

dstPredictorStep Destination predictor block step size (width of the block in bytes).<br />

mcType Specifies the type of prediction used for motion compensation.<br />

mcTypeB Specifies the type of prediction used for backward frame motion compensation.<br />

mcTypeF Specifies the type of prediction used for forward frame motion compensation.<br />

pDstDiff Pointer to a block of size 16X16 in the destination plane which contains difference between the current and reference blocks.<br />

pDstPredictor Pointer to a destination predictor block.<br />

pSrcCur Pointer to a block in the current plane.<br />

pSrcRef Pointer to a block in the reference plane.<br />

pSrcRefB Pointer to a backward block in the reference plane.<br />

pSrcRefF Pointer to a forward block in the reference plane.<br />

roundControl Specifies the type of rounding used for half-pixel approximation.<br />

srcCurStep Source current block step baize (width of the block in bytes)<br />

srcRefStep Source reference block step size (width of the block in bytes)<br />

srcRefStepB Source backward reference block step size (width of the block in bytes)<br />

srcRefStepF Source forward reference block step size (width of the block in bytes)<br />

Description<br />

These functions step through the current block of predicted image data and either single or dual reference blocks of the same size,<br />

evaluate the differences between the values in the blocks, and store the results in a destination difference buffer. The result is encoded<br />

to half-pixel accuracy and a rounding value must be specified. There are functions for a number of different block sizes. For singlereference<br />

versions of the functions, the reference block is part of a previous frame, as defined by the type of motion compensation<br />

being used, and a second destination predictor buffer stores additional information that is used to encode subsequent blocks. Dualreference<br />

(bi-predicted) versions of the functions evaluate the difference between the current block and the mean of the values in the<br />

two reference blocks. The forward reference block is part of a previous frame, as defined by the type of motion compensation being<br />

used; the backward reference block is part of a following frame.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 438 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

SqrDiff<br />

Block difference sum of squares<br />

Synopsis<br />

AplStatus apliSqrDiff16x16_8u32s ( const Apl8u* pSrc , Apl32s srcStep , const Apl8u* pRef , Apl32s refStep , Apl32s mcType , Apl32s*<br />

pSqrDiff );<br />

AplStatus apliSqrDiff16x16B_8u32s ( const Apl8u* pSrc , Apl32s srcStep , const Apl8u* pRefF , Apl32s refStepF , Apl32s mcTypeF , const<br />

Apl8u* pRefB , Apl32s refStepB , Apl32s mcTypeB , Apl32s* pSqrDiff );<br />

Parameters<br />

mcType Specifies the type of prediction used for motion compensation.<br />

mcTypeB Specifies the type of prediction used for backward frame motion compensation.<br />

mcTypeF Specifies the type of prediction used for forward frame motion compensation.<br />

pRef Pointer to a prefetch buffer which contains previously decoded bits.<br />

pRefB Pointer to a backward reference block of specified size.<br />

pRefF Pointer to a forward reference block of specified size.<br />

pSqrDiff Pointer to a sum of square differences of all the elements in the current and reference blocks.<br />

pSrc Pointer to a location in a source buffer.<br />

refStep Reference block step size (width of the block in bytes).<br />

refStepB Backward reference frame reference block step size (width of the block in bytes).<br />

refStepF Forward reference frame reference block step size (width of the block in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through the current block of predicted image data and either single or dual reference blocks of the same size,<br />

evaluate the sum of the squares differences between the values in the blocks, and store the results in a destination difference buffer.<br />

For single-reference versions of the functions, the reference block is part of a previous frame, as defined by the type of motion<br />

compensation being used, and a second destination predictor buffer stores additional information that is used to encode subsequent<br />

blocks. Dual-reference (bi-predicted) versions of the functions evaluate the difference between the current block and the mean of the<br />

values in the two reference blocks. The forward reference block is part of a previous frame, as defined by the type of motion<br />

compensation being used; the backward reference block is part of a following frame.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 439 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

VarMean<br />

Block variance and mean<br />

Synopsis<br />

AplStatus apliVarMean8x8_8u32s_C1R ( const Apl8u* pSrc , Apl32s srcStep , Apl32s* pVar , Apl32s* pMean );<br />

AplStatus apliVarMean8x8_16s32s_C1R ( const Apl16s* pSrc , Apl32s srcStep , Apl32s* pVar , Apl32s* pMean );<br />

Parameters<br />

pMean Pointer to a computed mean of pixel values.<br />

pSrc Pointer to a location in a source buffer.<br />

pVar Pointer to a variance value.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through an 8X8 block of data in a source buffer, calculate the variance and mean, and write the results to two<br />

destination buffers.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 440 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

VarMeanDiff<br />

Block difference variance and mean<br />

Synopsis<br />

AplStatus apliVarMeanDiff16x16_8u32s_C1R ( const Apl8u* pSrc , Apl32s srcStep , const Apl8u* pRef , Apl32s refStep , Apl32s* pSrcSum<br />

, Apl32s* pVar , Apl32s* pMean , Apl32s mcType );<br />

AplStatus apliVarMeanDiff16x8_8u32s_C1R ( const Apl8u* pSrc , Apl32s srcStep , const Apl8u* pRef , Apl32s refStep , Apl32s* pSrcSum ,<br />

Apl32s* pVar , Apl32s* pMean , Apl32s mcType );<br />

Parameters<br />

mcType Specifies the type of prediction used for motion compensation.<br />

pMean Pointer to a computed mean of pixel values.<br />

pRef Pointer to a prefetch buffer which contains previously decoded bits.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcSum Pointer to a sum of pixel values for the current block.<br />

pVar Pointer to a variance value.<br />

refStep Reference block step size (width of the block in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through a block of data in a source buffer and a reference block of the same size, evaluate the differences and<br />

store them in an array of 8X8 difference blocks, then calculate the variances and means of the difference blocks, and write the results<br />

to two destination buffers. The pointer pSrcSum points to the array of difference blocks. There are variations for 16X8 and 16X16<br />

source data blocks.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 441 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Variance16X16<br />

Block variance<br />

Synopsis<br />

AplStatus apliVariance16x16_8u32s ( const Apl8u* pSrc , Apl32s srcStep , Apl32s* pVar );<br />

Parameters<br />

pSrc Pointer to a location in a source buffer.<br />

pVar Pointer to a variance value.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

This function steps through a 16X16 block of data in a source buffer, calculates the variance, and writes the result to a destination<br />

buffer.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 442 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

EdgesDetect<br />

Detect block edges<br />

Synopsis<br />

AplStatus apliEdgesDetect16x16_8u_C1R ( const Apl8u * pSrc , Apl32u srcStep , Apl8u EdgePelDifference , Apl8u EdgePelCount , Apl8u *<br />

pRes );<br />

Parameters<br />

EdgePelCount Specifies the minimum number of pairs of elements that differ by more than EdgePelDifference.<br />

EdgePelDifference Specifies the edge difference threshold between neighboring elements.<br />

pRes Pointer to a result value.<br />

pSrc Pointer to a location in a source buffer.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

This function steps through a 16x16 block of data in a source buffer, calculates the difference between adjacent pixels, and compares<br />

the difference to a threshold value to detect edge pixels. If the number of edge pixels is greater than a specified value, a results flag is<br />

set. The EdgePelDifference parameter specifies the threshold value, and the EdgePelCount parameter specifies the minimum number<br />

of edge pixels to detect. When the number of edge pixels detected is greater than the value of EdgePelCount, the location pointed to<br />

by pRes is set to 1.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 443 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

SAD<br />

Block difference sum of absolute difference<br />

Synopsis<br />

AplStatus apliSAD16x16_8u32s ( const Apl8u* pSrc , Apl32s srcStep , const Apl8u* pRef , Apl32s refStep , Apl32s* pSAD , Apl32s mcType<br />

);<br />

AplStatus apliSAD8x8_8u32s_C1R ( const Apl8u* pSrcCur , int srcCurStep , const Apl8u* pSrcRef , Apl32s srcRefStep , Apl32s * pDst ,<br />

Apl32s mcType );<br />

AplStatus apliSAD4x4_8u32s ( const Apl8u * pSrc , Apl32s srcStep , Apl8u * pRef , Apl32s refStep , Apl32s * pSAD , Apl32s mcType );<br />

AplStatus apliSAD16x16Blocks8x8_8u16u ( const Apl8u * pSrc , Apl32s srcStep , Apl8u * pRef , Apl32s refStep , Apl16u * pDstSAD ,<br />

Apl32s mcType );<br />

AplStatus apliSAD16x16Blocks4x4_8u16u ( const Apl8u * pSrc , Apl32s srcStep , Apl8u * pRef , Apl32s refStep , Apl16u * pDstSAD ,<br />

Apl32s mcType );<br />

Parameters<br />

mcType Specifies the type of prediction used for motion compensation.<br />

pDst Pointer to a location in a destination buffer.<br />

pDstSAD Pointer to a destination array of size 4 that stores SAD values.<br />

pRef Pointer to a prefetch buffer which contains previously decoded bits.<br />

pSAD Pointer to an SAD result.<br />

pSrc Pointer to a location in a source buffer.<br />

pSrcCur Pointer to a block in the current plane.<br />

pSrcRef Pointer to a block in the reference plane.<br />

refStep Reference block step size (width of the block in bytes).<br />

srcCurStep Source current block step baize (width of the block in bytes)<br />

srcRefStep Source reference block step size (width of the block in bytes)<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through a block of image data and a reference block of the same size, evaluate the sum of the differences<br />

between the absolute values in the blocks, and store the result in a destination buffer. The reference block is part of a previous frame,<br />

as defined by the type of motion compensation being used.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 444 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

SumsDiff<br />

Block difference sum of difference<br />

Synopsis<br />

AplStatus apliSumsDiff16x16Blocks4x4_8u16s_C1 ( Apl8u* pSrc , Apl32s srcStep , Apl8u* pPred , Apl32s predStep , Apl16s* pSums ,<br />

Apl16s* pDiff );<br />

AplStatus apliSumsDiff8x8Blocks4x4_8u16s_C1 ( Apl8u* pSrc , Apl32s srcStep , Apl8u* pPred , Apl32s predStep , Apl16s* pSums ,<br />

Apl16s* pDiff );<br />

Parameters<br />

pDiff Pointer to an array of size 16 that contains the sums of 4X4 difference block coefficients.<br />

pPred Pointer to a 16x16 predictor block in the reference plane.<br />

pSrc Pointer to a location in a source buffer.<br />

pSums Pointer to an array of size 256 that contains a sequence of 4X4 residual blocks.<br />

predStep Reference plane step size (in bytes).<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

Description<br />

These functions step through a block of image data and a reference block of the same size, evaluate the sum of the differences<br />

between the values in the blocks, and store the result in a destination buffer. The reference block is part of a previous frame, as<br />

defined by the type of motion compensation being used.<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 445 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

MC<br />

Motion compensation<br />

Synopsis<br />

AplStatus apliMC16x16_8u_C1 ( const Apl8u * pSrcRef , Apl32s srcStep , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst ,<br />

Apl32s dstStep , Apl32s mcType , Apl32s roundControl );<br />

AplStatus apliMC16x8_8u_C1 ( const Apl8u * pSrcRef , Apl32s srcStep , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst ,<br />

Apl32s dstStep , Apl32s mcType , Apl32s roundControl );<br />

AplStatus apliMC8x16_8u_C1 ( const Apl8u * pSrcRef , Apl32s srcStep , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst ,<br />

Apl32s dstStep , Apl32s mcType , Apl32s roundControl );<br />

AplStatus apliMC8x8_8u_C1 ( const Apl8u * pSrcRef , Apl32s srcStep , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst ,<br />

Apl32s dstStep , Apl32s mcType , Apl32s roundControl );<br />

AplStatus apliMC8x4_8u_C1 ( const Apl8u * pSrcRef , Apl32s srcStep , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst ,<br />

Apl32s dstStep , Apl32s mcType , Apl32s roundControl );<br />

AplStatus apliMC4x8_8u_C1 ( const Apl8u * pSrcRef , Apl32s srcStep , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst ,<br />

Apl32s dstStep , Apl32s mcType , Apl32s roundControl );<br />

AplStatus apliMC4x4_8u_C1 ( const Apl8u * pSrcRef , Apl32s srcStep , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst ,<br />

Apl32s dstStep , Apl32s mcType , Apl32s roundControl );<br />

AplStatus apliMC2x4_8u_C1 ( const Apl8u * pSrcRef , Apl32s srcStep , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst ,<br />

Apl32s dstStep , Apl32s mcType , Apl32s roundControl );<br />

AplStatus apliMC4x2_8u_C1 ( const Apl8u * pSrcRef , Apl32s srcStep , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst ,<br />

Apl32s dstStep , Apl32s mcType , Apl32s roundControl );<br />

AplStatus apliMC2x2_8u_C1 ( const Apl8u * pSrcRef , Apl32s srcStep , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst ,<br />

Apl32s dstStep , Apl32s mcType , Apl32s roundControl );<br />

AplStatus apliMC16x4_8u_C1 ( const Apl8u * pSrcRef , Apl32s srcStep , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst ,<br />

Apl32s dstStep , Apl32s mcType , Apl32s roundControl );<br />

AplStatus apliMC16x8UV_8u_C1 ( const Apl8u * pSrcRef , Apl32s srcStep , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst ,<br />

Apl32s dstStep , Apl32s mcType , Apl32s roundControl );<br />

AplStatus apliMC16x16B_8u_C1 ( const Apl8u * pSrcRefF , Apl32s srcStepF , Apl32s mcTypeF , const Apl8u * pSrcRefB , Apl32s srcStepB ,<br />

Apl32s mcTypeB , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst , Apl32s dstStep , Apl32s roundControl );<br />

AplStatus apliMC16x8B_8u_C1 ( const Apl8u * pSrcRefF , Apl32s srcStepF , Apl32s mcTypeF , const Apl8u * pSrcRefB , Apl32s srcStepB ,<br />

Apl32s mcTypeB , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst , Apl32s dstStep , Apl32s roundControl );<br />

AplStatus apliMC8x16B_8u_C1 ( const Apl8u * pSrcRefF , Apl32s srcStepF , Apl32s mcTypeF , const Apl8u * pSrcRefB , Apl32s srcStepB ,<br />

Apl32s mcTypeB , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst , Apl32s dstStep , Apl32s roundControl );<br />

AplStatus apliMC8x8B_8u_C1 ( const Apl8u * pSrcRefF , Apl32s srcStepF , Apl32s mcTypeF , const Apl8u * pSrcRefB , Apl32s srcStepB ,<br />

Apl32s mcTypeB , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst , Apl32s dstStep , Apl32s roundControl );<br />

AplStatus apliMC8x4B_8u_C1 ( const Apl8u * pSrcRefF , Apl32s srcStepF , Apl32s mcTypeF , const Apl8u * pSrcRefB , Apl32s srcStepB ,<br />

Apl32s mcTypeB , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst , Apl32s dstStep , Apl32s roundControl );<br />

AplStatus apliMC4x8B_8u_C1 ( const Apl8u * pSrcRefF , Apl32s srcStepF , Apl32s mcTypeF , const Apl8u * pSrcRefB , Apl32s srcStepB ,<br />

Apl32s mcTypeB , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst , Apl32s dstStep , Apl32s roundControl );<br />

AplStatus apliMC4x4B_8u_C1 ( const Apl8u * pSrcRefF , Apl32s srcStepF , Apl32s mcTypeF , const Apl8u * pSrcRefB , Apl32s srcStepB ,<br />

Apl32s mcTypeB , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst , Apl32s dstStep , Apl32s roundControl );<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 446 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

AplStatus apliMC2x4B_8u_C1 ( const Apl8u * pSrcRefF , Apl32s srcStepF , Apl32s mcTypeF , const Apl8u * pSrcRefB , Apl32s srcStepB ,<br />

Apl32s mcTypeB , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst , Apl32s dstStep , Apl32s roundControl );<br />

AplStatus apliMC4x2B_8u_C1 ( const Apl8u * pSrcRefF , Apl32s srcStepF , Apl32s mcTypeF , const Apl8u * pSrcRefB , Apl32s srcStepB ,<br />

Apl32s mcTypeB , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst , Apl32s dstStep , Apl32s roundControl );<br />

AplStatus apliMC2x2B_8u_C1 ( const Apl8u * pSrcRefF , Apl32s srcStepF , Apl32s mcTypeF , const Apl8u * pSrcRefB , Apl32s srcStepB ,<br />

Apl32s mcTypeB , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst , Apl32s dstStep , Apl32s roundControl );<br />

AplStatus apliMC16x4B_8u_C1 ( const Apl8u * pSrcRefF , Apl32s srcStepF , Apl32s mcTypeF , const Apl8u * pSrcRefB , Apl32s srcStepB ,<br />

Apl32s mcTypeB , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst , Apl32s dstStep , Apl32s roundControl );<br />

AplStatus apliMC16x8BUV_8u_C1 ( const Apl8u * pSrcRefF , Apl32s srcStepF , Apl32s mcTypeF , const Apl8u * pSrcRefB , Apl32s srcStepB<br />

, Apl32s mcTypeB , const Apl16s * pSrcYData , Apl32s srcYDataStep , Apl8u * pDst , Apl32s dstStep , Apl32s roundControl );<br />

Parameters<br />

dstStep Destination buffer step size (width of the buffer in bytes).<br />

mcType Specifies the type of prediction used for motion compensation.<br />

mcTypeB Specifies the type of prediction used for backward frame motion compensation.<br />

mcTypeF Specifies the type of prediction used for forward frame motion compensation.<br />

pDst Pointer to a location in a destination buffer.<br />

pSrcRef Pointer to a block in the reference plane.<br />

pSrcRefB Pointer to a backward block in the reference plane.<br />

pSrcRefF Pointer to a forward block in the reference plane.<br />

pSrcYData Pointer to a block of inverse DCT output data.<br />

roundControl Specifies the type of rounding used for half-pixel approximation.<br />

srcStep Source buffer step size (width of the buffer in bytes).<br />

srcStepB Source aligned backward reference frame step size (width in bytes).<br />

srcStepF Source aligned forward reference frame step size (width in bytes).<br />

srcYDataStep Source aligned DCT output data block step size (width of the block in bytes).<br />

Description<br />

These functions step through a block of image data obtained by reverse DCT and either single or dual reference blocks of the same<br />

size, add the values in the blocks, and store the results in a destination buffer. The result is encoded to half-pixel accuracy and a<br />

rounding value must be specified. There are functions for a number of different block sizes. For single-reference versions of the<br />

functions, the reference block is part of a previous frame, as defined by the type of motion compensation being used. Dual-reference<br />

(bi-predicted) versions of the functions add the values in the two reference blocks to the source data. The forward reference block is<br />

part of a previous frame, as defined by the type of motion compensation being used; the backward reference block is part of a<br />

following frame. The apliMC16x8UVB function uses a special UV block, which is an interleaved combination of an 8X8 block of U<br />

components and an 8X8 block of V components.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 447 Image Processing <strong>Library</strong>


Publication # 40535 February 2007<br />

Return Values<br />

aplStsNoErr No error detected.<br />

aplStsNullPtrErr A pointer passed to the function is null.<br />

<strong>AMD</strong> <strong>Performance</strong> <strong>Library</strong> User’s <strong>Manual</strong> 448 Image Processing <strong>Library</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!