need help with FIR filter

need help with FIR filter

Аватар пользователя ndbecker

I tried a simple example and ran valgrind on it.  It reveals memory corruption.  So, I don't understand how to use FIR filter functions.  The complete main program is attached, but the problem occurs just constructing the filter.

I'm using:

...

boost::shared_ptr<Ipp8u> buf;
IppsFIRState_64f* pState;

if (ippsFIRGetStateSize_64f (coef.getShape()[0], &bufsize) != 0)
  throw std::runtime_error ("fir_double");

buf = boost::shared_ptr<Ipp8u> (new Ipp8u (bufsize*sizeof(double)));
if (ippsFIRInit_64f (&pState, &coef[0], coef.getShape()[0], 0, (Ipp8u*)(buf.get())) != 0)

throw std::runtime_error ("fir_double");
...

I suspect problem is, who allocated memory for pState?  I didn't.  But nothing in the docs explains this or shows an example.

ВложениеРазмер
Скачать test-ipp.cpp1.49 КБ
1 сообщение / 0 новое
Пожалуйста, обратитесь к странице Уведомление об оптимизации для более подробной информации относительно производительности и оптимизации в программных продуктах компании Intel.