FilterColumnPipeline, FilterColumnPipeline_Low

Apply the filter to image columns.

Syntax

Case 1: Operation on integer data

IppStatus ippiFilterColumnPipeline_<mod>(const Ipp<srcDatatype>** ppSrc, Ipp<dstDatatype>* pDst, int dstStep, IppiSize dstRoiSize, const Ipp<srcDatatype>* pKernel, int kernelSize, int divisor, Ipp8u* pBuffer);

Supported values for mod:

16s_C1R 16s8u_C1R 16s8s_C1R
16s_C3R 16s8u_C3R 16s8s_C3R

IppStatus ippiFilterColumnPipeline_Low_16s_C1R(const Ipp16s** ppSrc, Ipp16s* pDst, int dstStep, IppiSize dstRoiSize, const Ipp16s* pKernel, int kernelSize, int divisor, Ipp8u* pBuffer);

IppStatus ippiFilterColumnPipeline_Low_16s_C3R(const Ipp16s** ppSrc, Ipp16s* pDst, int dstStep, IppiSize dstRoiSize, const Ipp16s* pKernel, int kernelSize, int divisor, Ipp8u* pBuffer);

Case 2: Operation on floating-point data

IppStatus ippiFilterColumnPipeline_<mod>(const Ipp<datatype>** ppSrc, Ipp<datatype>* pDst, int dstStep, IppiSize dstRoiSize, const Ipp<datatype>* pKernel, int kernelSize, Ipp8u* pBuffer);

Supported values for mod:

32f_C1R
32f_C3R

Parameters

ppSrc

Double pointer to the source image ROI.

pDst

Pointer to the destination image ROI.

dstStep

Distance in bytes between starts of consecutive lines in the destination image.

dstRoiSize

Size of the destination ROI in pixels.

pKernel

Pointer to the strow kernel values.

kernelSize

Size of the kernel in pixels.

divisor

Value by which the computed result is divided (for operations on integer data only).

pBuffer

Pointer to the working buffer.

Description

The functions ippiFilterColumnPipeline and ippiFilterColumnPipeline_Low are declared in the ippcv.h file. The operates with ROI (see Regions of Interest in Intel IPP).

The function ippiFilterColumnPipeline_Low performs calculation exclusively with the 16s-data, and the input data must be in the range ensuring that the overflow does not occur during calculation and the result can be represented by a 32-bit integer number.

These functions apply the column filter of the separable convolution kernel to the source image pSrc. The filter coefficients are placed in the reversed order. For integer data:


and for floating point data:


Here j = 0, ... dstRoiSize.width-1, i=0,... dstRoiSize.height-1.

The size of the source image is

(dstRoiSize.height + kernelSize - 1) * dstRoiSize.width.

The functions requires the external buffer pBuffer, its size should be previously computed by the functions ippiFilterColumnPipelineGetBufferSize and ippiFilterColumnPipelineGetBufferSize_Low respectively.

These functions can be used to organize the separable convolution as a step of image processing pipeline (see Example “Separable Convolution 3x3 by One Row”).

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error.

ippStsNullPtrErr

Indicates an error condition if one of the specified pointers is NULL.

ippStsSizeErr

Indicates an error condition if roiSize has a field with a zero or negative value.

ippStsStepErr

Indicates an error condition if srcStep or dstStep is less than roiSize.width * <pixelSize>

ippStsNotEvenStepErr

Indicates an error condition if one of the step values is not divisible by 4 for floating-point images, or by 2 for short-integer images.

ippStsBadArgErr

Indicates an error condition if divisor is equal to 0.

Separable Convolution 3x3 by One Row 

void Separable_3x3(const Ipp16s* pSrc, int srcStep, Ipp16s* pDst, int dstStep,
                              IppiSize roiSize, Ipp16s* pKerX, Ipp16s* pKerY) {
   Ipp16s **get, *dst=pDst;
   const Ipp16s *src=pSrc;
   IppiSize roi;
   int todo=roiSize.height,sizeRow,sizeCol,bufLen;
   int mStep=(roiSize.width+7)&(~7),sStep=srcStep>>1,dStep=dstStep>>1;
   Ipp8u *pBufRow, *pBufCol;
   ippiFilterRowBorderPipelineGetBufferSize_Low_16s_C1R(roiSize,3,&sizeRow);
   ippiFilterColumnPipelineGetBufferSize_Low_16s_C1R(roiSize,3,&sizeCol);
   bufLen = mStep*3*sizeof(Ipp16s)+4*sizeof(Ipp16s*);
   pBufRow = ippsMalloc_8u(sizeRow);
   pBufCol = ippsMalloc_8u(sizeCol);
   get = (Ipp16s**)ippsMalloc_8u(bufLen);
   get[0]=get[1]=(Ipp16s*)(get+4);
   get[2]=get[1]+mStep;
   get[3]=get[2]+mStep;
   roi.width  = roiSize.width;
   roi.height = 1;
   ippiFilterRowBorderPipeline_Low_16s_C1R(src, srcStep, get, roi, pKerX, 
      3, 1, ippBorderRepl, 0, 1, pBufRow);
   if (--todo) {
      get[2] = get[0];
   } else {
      get[2] = get[0] + mStep; get[3] = get[2] + mStep;
      for (; todo>0; src+=sStep, dst+=dStep, todo--) {
         ippiFilterRowBorderPipeline_Low_16s_C1R(src, srcStep, get+2, roi, pKerX,
            3, 1, ippBorderRepl, 0, 1, pBufRow);
         ippiFilterColumnPipeline_Low_16s_C1R(get, dst, dstStep, roi, pKerY,
            3, 1, pBufCol);
         get[0] = get[1]; get[1] = get[2]; get[2] = get[3]; get[3] = get[0];
      }
   }
   ippiFilterColumnPipeline_Low_16s_C1R(get, dst, dstStep, roi, pKerY, 
      3, 1, pBufCol);

   ippsFree(pBufRow);
   ippsFree(pBufCol);
   ippsFree(get);
}

Submit feedback on this help topic

Copyright © 2000 - 2010, Intel Corporation. All rights reserved.