Intel® Integrated Performance Primitives (Intel® IPP) Developer Guide and Reference
ResizeBatchGetSize_L
Computes the size of the specification structure and the size of the temporary initialization buffer for the batch resize.
Syntax
IppStatus ippiResizeBatchGetSize_L(const IppiBatchItem* pSrcBatch, const IppiBatchItem* pDstBatch, IppSizeL nBatchSize, IppDataType dataType, int numChannels, int interpolation, int batchType, IppSizeL* pSpecSize, IppSizeL* pInitBufSize);
Threading Layer (TL) flavor:
IppStatus ippiResizeBatchGetSize_LT(const IppiBatchItem* pSrcBatch, const IppiBatchItem* pDstBatch, IppSizeL nBatchSize, IppDataType dataType, int numChannels, int interpolation, int batchType, IppSizeL* pSpecSize, IppSizeL* pInitBufSize);
Include Files
ippi_l.h
Flavors with the _LT suffix: ippi_tl.h
Domain Dependencies
Headers: ippcore.h, ippvm.h, ipps.h
Libraries: ippcore.lib, ippvm.lib, ipps.lib
Flavors with the _LT suffix additionally require ippcore_tl.h and ippcore_tl.lib.
Parameters
pSrcBatch |
Pointer to the descriptors of the source images of the batch. For a non-uniform batch it points to the array of nBatchSize elements. For a uniform batch, that is when batchType carries ippBatchUniformSrc, it points to a single descriptor whose pMem pointer addresses the memory of the entire batch, without gaps. |
pDstBatch |
Pointer to the descriptors of the destination images of the batch. For a non-uniform batch it points to the array of nBatchSize elements. For a uniform batch, that is when batchType carries ippBatchUniformDst, it points to a single descriptor whose pMem pointer addresses the memory of the entire batch, without gaps. |
nBatchSize |
Number of the images of the batch. Must not be negative. A batch of one image is legal, that image is simply the only one that is processed. An empty batch, that is nBatchSize equal to zero, is legal as well: no image is processed and the function returns the ippStsNoOperation warning. |
dataType |
Data type of the source and destination images. It is shared by the whole batch. Supported values: ipp8u and ipp32f. Pass the same value to the Init function of the batch. |
numChannels |
Number of the channels of the images of the batch. All the images of the batch have the same number of the channels. Supported values: 1 and 3. Pass the same value to the Init function of the batch. |
interpolation |
Interpolation method combined with the antialiasing flag by the bitwise OR. The method is one of IPPI_INTER_NN, IPPI_INTER_LINEAR, IPPI_INTER_CUBIC, IPPI_INTER_CUBIC2P_BSPLINE, IPPI_INTER_CUBIC2P_CATMULLROM, IPPI_INTER_CUBIC2P_B05C03, IPPI_INTER_LANCZOS, IPPI_INTER_LANCZOS3, and IPPI_INTER_SUPER. The four cubic methods are the same two-parameter cubic filter: IPPI_INTER_CUBIC uses the B and C parameters of the Init function, and each of the IPPI_INTER_CUBIC2P_ methods uses its own predefined kernel, that is B = 1.0 and C = 0.0 for IPPI_INTER_CUBIC2P_BSPLINE, B = 0.0 and C = 0.5 for IPPI_INTER_CUBIC2P_CATMULLROM, and B = 0.5 and C = 0.3 for IPPI_INTER_CUBIC2P_B05C03. The number of lobes of the Lanczos filter is carried by the method: IPPI_INTER_LANCZOS is the Lanczos filter of two lobes (4x4 kernel) and IPPI_INTER_LANCZOS3 the Lanczos filter of three lobes (6x6 kernel). Add IPPI_ANTIALIASING to switch the antialiasing on, for example IPPI_INTER_LINEAR | IPPI_ANTIALIASING. The IPPI_INTER_NN and the IPPI_INTER_SUPER methods have no antialiasing flavor, the flag is ignored for them. Pass the same value to the Init function of the batch. |
batchType |
Bitmask of the directions of the batch that are uniform, that is that are one contiguous tensor of images of equal size described by a single descriptor: the ippBatchUniformSrc flag for the sources, the ippBatchUniformDst flag for the destinations, ippBatchUniformSrc | ippBatchUniformDst when both directions are, and ippBatchNonUniform when neither is. It tells this function how many descriptors each of pSrcBatch and pDstBatch holds. See the description of the ResizeBatchInit_L function and pass the same value to it. |
pSpecSize |
Pointer to the size, in bytes, of the IppiResizeBatchSpec specification structure of the batch. The structure is opaque, and the returned size covers the whole memory block: the parameters that are shared by the batch and the single image specification structure that is a part of it. |
pInitBufSize |
Pointer to the size, in bytes, of the temporary initialization buffer. That buffer is the scratch space of the ResizeBatchGetBufferSize_L function only, the resize functions of the batch take the work buffer alone. |
Description
This function computes the size of the IppiResizeBatchSpec specification structure that all images of the batch share and the size of the temporary initialization buffer that the ResizeBatchGetBufferSize_L function needs. The structure is opaque and the single image specification structure is a part of the same memory block, so the returned size does not depend on the filter parameters of the batch, which the ResizeBatchInit_L function stores and the BatchSetCubicArgs function replaces.
The size of the specification structure depends on the sizes of an image, and the sizes of the images of a batch differ, so the function scans the whole batch and returns the maximum over all images. Because of that, the size field of every descriptor must be set before the call. A uniform direction is one tensor of images of equal size, so its single descriptor gives the size of every image of it and this function reads that descriptor alone.
The dataType, the numChannels, the interpolation, and the batchType parameters are shared by the whole batch, and the Init function stores them in the specification structure, so the remaining functions of the batch take no parameter of the batch besides the descriptors. They are arguments of this function because it is called before that structure exists: the returned size depends on the first three of them and the number of the descriptors that are read on the last one.
Call this function first in the batch processing sequence. Then allocate the memory, initialize the specification structure with the ResizeBatchInit_L function, and get the size of the work buffer with the ResizeBatchGetBufferSize_L function, which needs the initialized structure sized by this one.
For the flavor with the _LT suffix, the returned sizes cover all the threads that the Threading Layer uses: the specification structure holds a private single image specification structure for every thread, so the sizes grow with the number of threads. The layout of that structure is not the layout of the single threaded flavor, so the two sets of sizes are not comparable and memory for the ippiResizeBatch_<mod>_LT functions must be sized by this flavor. The sizes depend on the number of threads reported by ippGetNumThreads_LT, so call the function again after changing the number of threads with ippSetNumThreads_LT.
Return Values
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error when one of the specified pointers is NULL. |
ippStsSizeErr |
Indicates an error when nBatchSize is negative, when one of the sizes is negative, when a source image is smaller than the filter of the chosen interpolation method, or when a source image is smaller than the destination one for the IPPI_INTER_SUPER method. |
ippStsDataTypeErr |
Indicates an error when dataType has an illegal value. |
ippStsNumChannelsErr |
Indicates an error when numChannels is neither 1 nor 3. |
ippStsInterpolationErr |
Indicates an error when the interpolation method has an illegal value. |
ippStsBadArgErr |
Indicates an error when batchType has a bit outside the flags of the IppBatchType enumeration. |
ippStsExceededSizeErr |
Indicates an error when one of the computed sizes exceeds the maximum positive value of the IppSizeL data type. |
ippStsNoAntialiasing |
Indicates a warning when the IPPI_ANTIALIASING flag is set and the method is IPPI_INTER_NN or IPPI_INTER_SUPER. The antialiasing is ignored; the returned sizes are the ones of the transform without it. |
ippStsNoOperation |
Indicates a warning when nBatchSize is zero, or when the width or the height of one of the images is zero. |
See Also
Using Intel IPP Batch Resize Functions
ResizeBatchGetBufferSize_L Computes the size of the work buffer for the batch resize.
ResizeBatchInit_L Initializes the specification structure of a resize batch with the default filter parameters.
BatchSetCubicArgs Sets the parameters of the cubic filter in an initialized specification structure of a resize batch.
ResizeBatch_L Resizes a batch of images of different sizes with a single call.
ResizeGetSize Computes the size of the specification structure and the size of the external buffer for the resize transform.