Intel® Integrated Performance Primitives (Intel® IPP) Developer Guide and Reference
ResizeBatchGetBufferSize_L
Computes the size of the work buffer for the batch resize.
Syntax
IppStatus ippiResizeBatchGetBufferSize_L(const IppiBatchItem* pSrcBatch, const IppiBatchItem* pDstBatch, IppSizeL nBatchSize, IppiResizeBatchSpec* pSpec, Ipp8u* pInitBuf, IppSizeL* pBufSize);
Threading Layer (TL) flavor:
IppStatus ippiResizeBatchGetBufferSize_LT(const IppiBatchItem* pSrcBatch, const IppiBatchItem* pDstBatch, IppSizeL nBatchSize, IppiResizeBatchSpec* pSpec, Ipp8u* pInitBuf, IppSizeL* pBufSize);
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 the batchType that pSpec was initialized with 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 the batchType that pSpec was initialized with 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. |
pSpec |
Pointer to the IppiResizeBatchSpec specification structure of the batch, sized by the ResizeBatchGetSize_L function and initialized by the ResizeBatchInit_L function. The single image specification structure inside it is used as a scratch space. |
pInitBuf |
Pointer to the temporary initialization buffer, sized by the ResizeBatchGetSize_L function. May be NULL if that function returned a zero size. |
pBufSize |
Pointer to the size, in bytes, of the single work buffer that the resize function of the batch takes. |
Description
This function computes the size of the work buffer that the ResizeBatch_L function needs. All images of the batch share one work buffer.
The size of the work buffer is a property of an initialized single image specification structure, which is why this function is separate from the ResizeBatchGetSize_L function and takes the specification structure of the batch as a parameter. The function builds the single image structure inside pSpec with the sizes of every descriptor in turn and with the shared parameters of pSpec, queries the buffer size of that image, and returns the maximum over the batch. A uniform direction of the batch 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; when both the flags of the batchType parameter that pSpec was initialized with are set, all the images of the batch have the same sizes, so the single image structure is built once. The single image structure and the temporary buffer are used as a scratch space only: their content after the call is undefined, so the resize function itself does not depend on it. The parameters that the Init function stores are not modified.
The data type and the interpolation method of the batch are members of pSpec, so no parameter of the batch besides the descriptors is an argument of this function. Because the resize function builds the single image specification structure in its work buffer instead of a temporary buffer of its own, the returned size is the maximum of the work buffer size of the batch and of the pInitBufSize value that the ResizeBatchGetSize_L function returned: one buffer of that size covers both roles. The temporary buffer can therefore be released as soon as this call has returned.
Call this function after the specification structure has been sized by the ResizeBatchGetSize_L function and initialized by the ResizeBatchInit_L function, and before the ResizeBatch_L function.
For the flavor with the _LT suffix, the returned size covers all the threads that the Threading Layer uses: every thread gets a private slice of the work buffer, so the size grows with the number of threads. The pSpec and pInitBuf parameters of the _LT flavor must be sized by ippiResizeBatchGetSize_LT; only the slice of the first thread is written to. The size depends 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. |
ippStsContextMatchErr |
Indicates an error when pSpec was not initialized by the ResizeBatchInit_L function. |
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 interpolation method of pSpec, or when a source image is smaller than the destination one for the IPPI_INTER_SUPER method. |
ippStsInterpolationErr |
Indicates an error when the interpolation method of pSpec has an illegal value. |
ippStsExceededSizeErr |
Indicates an error when the computed size exceeds the maximum positive value of the IppSizeL data type. |
ippStsNoAntialiasing |
Indicates a warning when the IPPI_ANTIALIASING flag of the interpolation of pSpec is set and its method is IPPI_INTER_NN or IPPI_INTER_SUPER. The antialiasing is ignored; the returned size is the one 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
ResizeBatchGetSize_L Computes the sizes of the specification structure and of the temporary initialization 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.
ResizeGetBufferSize Computes the size of the external buffer for the resize transform.