shithub: aubio

Download patch

ref: 03df4dcfd8dec47de94f34239855b56da2e33266
parent: 2e5c52e98735a1722d858300835097dc7e9dd47c
author: Paul Brossier <piem@piem.org>
date: Wed Oct 4 09:12:02 EDT 2017

src/spectral/dct_ipp.c: share buffers for Fwd and Inv

--- a/src/spectral/dct_ipp.c
+++ b/src/spectral/dct_ipp.c
@@ -52,9 +52,6 @@
   Ipp8u* pSpec;
   Ipp8u* pSpecBuffer;
   Ipp8u* pBuffer;
-  Ipp8u* pSpecInv;
-  Ipp8u* pSpecBufferInv;
-  Ipp8u* pBufferInv;
   aubio_ippsDCTFwdSpec* pFwdDCTSpec;
   aubio_ippsDCTInvSpec* pInvDCTSpec;
 };
@@ -100,14 +97,6 @@
   //AUBIO_INF("dct: inv initialized with %d %d %d\n", pSpecSize, pSpecBufferSize,
   //    pBufferSize);
 
-  s->pSpecInv = ippsMalloc_8u(pSpecSize);
-  if (pSpecSize > 0) {
-    s->pSpecBufferInv = ippsMalloc_8u(pSpecBufferSize);
-  } else {
-    s->pSpecBufferInv = NULL;
-  }
-  s->pBufferInv = ippsMalloc_8u(pBufferSize);
-
   status = aubio_ippsDCTFwdInit(&(s->pFwdDCTSpec), size, qualityHint, s->pSpec,
       s->pSpecBuffer);
   if (status != ippStsNoErr) {
@@ -115,8 +104,8 @@
     goto beach;
   }
 
-  status = aubio_ippsDCTInvInit(&(s->pInvDCTSpec), size, qualityHint,
-      s->pSpecInv, s->pSpecBufferInv);
+  status = aubio_ippsDCTInvInit(&(s->pInvDCTSpec), size, qualityHint, s->pSpec,
+      s->pSpecBuffer);
   if (status != ippStsNoErr) {
     AUBIO_ERR("dct: failed to initialize inv dct. IPP error: %d\n", status);
     goto beach;
@@ -135,9 +124,6 @@
   ippFree(s->pSpec);
   ippFree(s->pSpecBuffer);
   ippFree(s->pBuffer);
-  ippFree(s->pSpecInv);
-  ippFree(s->pSpecBufferInv);
-  ippFree(s->pBufferInv);
   AUBIO_FREE(s);
 }