Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

New antialiasing resizers

pvonkaenel
New Contributor III
673 Views

Hi,

I was very happy to see the addition of the antialiasing Linear, Cubic, and Lanzcos resizers.  Thanks for adding them.  However, the antialiasing init calls (such as ResizeAntialiasingLinearInit) do not have specific versions for 8u, 16u, 16s, and 32f.  Does this init call handle all data types, or is it 8u only?

Thanks,

Peter

0 Kudos
6 Replies
Valentin_K_Intel
Employee
673 Views

Hi Peter,

Yes, this init call handles all data types (8u, 16u, 16s, 32f).

Best regards, Valentin

0 Kudos
pvonkaenel
New Contributor III
673 Views

Hi Valentin,

That's great, thanks for the quick reply.

Peter

0 Kudos
Raul_L_
Beginner
673 Views

Since the Antialiasing versions do not specify which Algorithm to use, I am assuming that the Init function takes care of that:

ippi.h:

IPPAPI (IppStatus, ippiResizeAntialiasingLanczosInit, (

IPPAPI (IppStatus, ippiResizeAntialiasing_8u_C1R, (
IPPAPI (IppStatus, ippiResizeAntialiasing_8u_C3R, (
IPPAPI (IppStatus, ippiResizeAntialiasing_8u_C4R, (

===========================

I replaced the Lanczos call in ipp_resize_mt:

========================

oneredcar:src raulizahi$ diff ipp_resize_mt.cpp.orig ipp_resize_mt.cpp
152c152
<             ippSts = ippiResizeLanczosInit_8u(srcSize, dstSize, m_iLobes, m_pSpec, m_pInitBuffer);
---
>             ippSts = ippiResizeAntialiasingLanczosInit(srcSize, dstSize, m_iLobes, m_pSpec, m_pInitBuffer);
252c252
<                 ippSts = ippiResizeLanczos_8u_C1R(pSrcPtr, pSrcImage->m_iStep, pDstPtr, pDstImage->m_iStep, dstRoiOffset, dstRoiSize, border, 0, m_pSpec, pBuffer);
---
>                 ippSts = ippiResizeAntialiasing_8u_C1R(pSrcPtr, pSrcImage->m_iStep, pDstPtr, pDstImage->m_iStep, dstRoiOffset, dstRoiSize, border, 0, m_pSpec, pBuffer);
254c254
<                 ippSts = ippiResizeLanczos_8u_C3R(pSrcPtr, pSrcImage->m_iStep, pDstPtr, pDstImage->m_iStep, dstRoiOffset, dstRoiSize, border, 0, m_pSpec, pBuffer);
---
>                 ippSts = ippiResizeAntialiasing_8u_C3R(pSrcPtr, pSrcImage->m_iStep, pDstPtr, pDstImage->m_iStep, dstRoiOffset, dstRoiSize, border, 0, m_pSpec, pBuffer);
256c256
<                 ippSts = ippiResizeLanczos_8u_C4R(pSrcPtr, pSrcImage->m_iStep, pDstPtr, pDstImage->m_iStep, dstRoiOffset, dstRoiSize, border, 0, m_pSpec, pBuffer);
---
>                 ippSts = ippiResizeAntialiasing_8u_C4R(pSrcPtr, pSrcImage->m_iStep, pDstPtr, pDstImage->m_iStep, dstRoiOffset, dstRoiSize, border, 0, m_pSpec, pBuffer);

====================

and it worked when downscaling:

===========

oneredcar:release raulizahi$ ./ipp_resize_mt -i BQTerrace_1920x1080_60_0.bmp -o ipp_8_AA_BQ_Terrace_half.bmp -r 960 540 -p 3

Intel(R) IPP:
  ippCore 8.0.1 (r40318) Jul 11 2013
  ippSP AVX (e9) 8.0.1 (r40318) Jul 11 2013
  ippIP AVX (e9) 8.0.1 (r40318) Jul 11 2013

Input file: BQTerrace_1920x1080_60_0.bmp
Input info: 1920x1080 BGR

Output file: ipp_8_AA_BQ_Terrace_half.bmp
Output info: 960x540 BGR

TBB resize
Threads: 4

Interpolation: Lanczos (L = 3)

Loops:      1
Time total: 0.007539s
Loop avg:   0.007539s
CPE total:  2908.459684
CPE avg:    2908.459684

====================

but it does not work when upscaling back:

=======================

oneredcar:release raulizahi$ ./ipp_resize_mt -i ipp_8_AA_BQ_Terrace_half.bmp -o ipp_8_AA_BQ_Terrace_half_double.bmp -r 1920 1080 -p 3

Intel(R) IPP:
  ippCore 8.0.1 (r40318) Jul 11 2013
  ippSP AVX (e9) 8.0.1 (r40318) Jul 11 2013
  ippIP AVX (e9) 8.0.1 (r40318) Jul 11 2013

Input file: ipp_8_AA_BQ_Terrace_half.bmp
Input info: 960x540 BGR

Output file: ipp_8_AA_BQ_Terrace_half_double.bmp
Output info: 1920x1080 BGR

TBB resize
Segmentation fault: 11

========================

Would anybody know why?

The regular Lanczos does work well downscaling and upscaling but the quality is not good compared to other Lanczos implementations (3 Lobes).

RAUL

0 Kudos
Raul_L_
Beginner
673 Views

gdb output:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x0000000103175900 in e9_ownLanczos3KernelAA ()

 

0 Kudos
Thomas_Jensen1
Beginner
673 Views

Also take a look of the IPP 8 manual at:
http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-documentation/

I usually download all the PDF files and put them in a folder IPP 8 Manuals.

Reading ippi.pdf, you'll see that ippiResizeGetSize_<mod> has supported values 8u 16u 16s 32f 64f.

As for your access violation, such are usually caused be bad step parameters. The Step parameter must always be the width of a pixel row (scan lines) in BYTES, not in PIXELS. Since buffers allocated by IPP are always padded to 32 bytes (or so), you must consider this fact when passing step to IPP functions.

0 Kudos
Valentin_K_Intel
Employee
673 Views

Hi Raul,

The fourth parameter of the function ippiResizeGetSize is an antialiasing flag. It must be equal to 1, if resize operation performs with antialiasing. The function ippiResizeGetSize computes sizes of the spec structure and the external temporary buffer for the resize transform initialization. If antialiasing flag is 0, the computed sizes can be insufficient for antialiasing mode. That is the possible reason of memory access violation.

Best regards, Valentin

0 Kudos
Reply