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

ippsResamplePolyphaseFixedInitAlloc_16s problem when static linking?

klend
Beginner
560 Views
Hi,

I encounter the following problem (IPP5.0 @ ia32).

Based on the audio_codec_con_so and sources from the media examples and the polyphase example on page 8-215 of the ippsman.pdf, I am working on a resampling application from mp3 to wav. I use the ippsResamplePolyphaseFixed* routines and static linking.

(For the record, using dynamic linking all works as expected, but static linkage is a needed in this case)

The problem is that when the inRate/outRate division is not integral, the following call does not return:


result = ippsResamplePolyphaseFixedInitAlloc_16s(
&state, inRate, outRate, 2*window,
0.95f,9.0f, ippAlgHintAccurate);

When running this through gdb I get this backtrace:

resample_Init inRate: 88200 outRate: 8000

Program received signal SIGINT, Interrupt.
[Switching to Thread 1124096 (LWP 19364)]
0x0807a3c1 in Bessel ()
(gdb) bt
#0 0x0807a3c1 in Bessel ()
#1 0x0807cd47 in initResample_64f_2d_In ()
#2 0x0807b311 in ownsResampleFixedInitAlloc_32f ()
#3 0x41100000 in ?? ()
#4 0x00001401 in ?? ()
#5 0x087b2d00 in ?? ()
#6 0xbf9e037f in ?? ()
#7 0x0805b004 in UMC::MediaData::TryWeakCasting ()

Now, if I make sure that the inRate/outRate is integral by somehow taking the floor or the ceil, the function returns and everything works as expected (with a slightly different result in resampling
ofcourse)

Furthermore, if I program this using the 'nonFixed' polyphase routines, all works good as well, but the performance is very poor in comparison.

Is there any solution to this?

I would appreciate any feedback, help or information.

Thanks in advance,
Hendrik
0 Kudos
6 Replies
klend
Beginner
560 Views
Hi,

I have built a small program that shows this behaviour.
When statically linked the call does not return with the following input and output rates:
44100 8000
44100 6511

But it does return when the rates are:
inRate outRate
44100 6510
44100 6512
44100 8001

I have attached a small tar file to demonstrate the behaviour.
If someone could be so kind as to build the program and see why there is no return in some cases I would be very greatful.
It might be my own inexperience with the IPP libraries (in a way, I hope so).

Thanks in advance for the efforts.

(To build the program, unpack the Makefile and the polytest.c file and run make. Two programs are built: polytest and polytest-static. The Makefile might be modificated to set the proper IPPROOT include files.)

Message Edited by klend on 02-27-2006 10:45 AM

0 Kudos
Intel_C_Intel
Employee
560 Views

Hi,

About polytest.c file - it misuses "size" variable that is the size of polyphase resampling structure in bytes. Please see the corrected version, it passes as for dll as for static lib. I think it should crash all the time but sometimes the memory layout prevents it.

Please answer if error continues

thanks,

Alexander

0 Kudos
klend
Beginner
560 Views
Hi Alexander




akibkal1 wrote:

Hi,

About polytest.c file - it misuses "size" variable that is the size of polyphase resampling structure in bytes. Please see the corrected version, it passes as for dll as for static lib. I think it should crash all the time but sometimes the memory layout prevents it.

Please answer if error continues



Thanks for helping out, however, the problem still persists.

When I build your version of polytest.c and run the static version like this: ./polytest_static 44100 8000 the program does not return and spends its time in the ippsResamplePolyphaseFixedInitAlloc_16s routine.

This is on Linux only (I can't test under windows).

The problem is not a segmentation violation or a crash, but the problem is not returning from a ipp function call.

Regards,
Hendrik

0 Kudos
Intel_C_Intel
Employee
560 Views

Hi, Hendrik,

We found this bug, the reason is -0.0 sqrt argumentin the static library for Linux. Itwill becorrected in IPP 6.0.

Thanks,

Alexander

Message Edited by vdudnik on 03-15-2006 10:25 AM

0 Kudos
mathijn
Beginner
560 Views
Hi,



is there a work-around for this bug when using the static libraries? The mentioned 'nonFixed' polyphase workaround seems to have the same problen and hangs in the same Bessel function. Is there a public release date for version 6.0?



Thanks.



Mathijn
0 Kudos
Intel_C_Intel
Employee
560 Views
Hi, Hendrik,
We already correctedsuch bug (negative sqrt argument in Bessel function evaluation) in IPP 5.1. We'll take a look does your case found a new one and answer.
Non-fixed resampling is definitely much slower then fiexed because it require to interpolate filter coefficient on the fly for each pixel. In fixed resampling filters are precalculated for all phases of output pixels.
So, non-fixed resampling is better to use when the factor is notr rational, is changed with the time or when LCD of input and output frequencies is very big
Alexander
0 Kudos
Reply