[xiph-commits] r9320 - trunk/speex/libspeex

jm at motherfish-iii.xiph.org jm at motherfish-iii.xiph.org
Fri May 27 11:05:07 PDT 2005


Author: jm
Date: 2005-05-27 11:05:05 -0700 (Fri, 27 May 2005)
New Revision: 9320

Modified:
   trunk/speex/libspeex/nb_celp.c
   trunk/speex/libspeex/testenc.c
Log:
Proper de-allocation


Modified: trunk/speex/libspeex/nb_celp.c
===================================================================
--- trunk/speex/libspeex/nb_celp.c	2005-05-27 17:40:32 UTC (rev 9319)
+++ trunk/speex/libspeex/nb_celp.c	2005-05-27 18:05:05 UTC (rev 9320)
@@ -222,7 +222,35 @@
    EncState *st=(EncState *)state;
    /* Free all allocated memory */
 
+   speex_free (st->inBuf);
+   speex_free (st->excBuf);
+   speex_free (st->innov);
+   speex_free (st->interp_qlpc);
+   speex_free (st->qlsp);
+   speex_free (st->old_qlsp);
+   speex_free (st->interp_qlsp);
+   speex_free (st->swBuf);
+
+   speex_free (st->window);
+   speex_free (st->lagWindow);
+   speex_free (st->autocorr);
+   speex_free (st->lpc);
+   speex_free (st->lsp);
+
+   speex_free (st->interp_lpc);
+   speex_free (st->bw_lpc1);
+   speex_free (st->bw_lpc2);
+   speex_free (st->old_lsp);
+   speex_free (st->interp_lsp);
+   speex_free (st->mem_sp);
+   speex_free (st->mem_sw);
+   speex_free (st->mem_sw_whole);
+   speex_free (st->mem_exc);
+   speex_free (st->pi_gain);
+   speex_free (st->pitch);
+
    vbr_destroy(st->vbr);
+   speex_free (st->vbr);
 
    /*Free state memory... should be last*/
    speex_free(st);
@@ -1028,6 +1056,17 @@
    DecState *st;
    st=(DecState*)state;
    
+   speex_free (st->inBuf);
+   speex_free (st->excBuf);
+   speex_free (st->innov);
+   speex_free (st->interp_qlpc);
+   speex_free (st->qlsp);
+   speex_free (st->old_qlsp);
+   speex_free (st->interp_qlsp);
+   speex_free (st->mem_sp);
+   speex_free (st->comb_mem);
+   speex_free (st->pi_gain);
+
    speex_free(state);
 }
 

Modified: trunk/speex/libspeex/testenc.c
===================================================================
--- trunk/speex/libspeex/testenc.c	2005-05-27 17:40:32 UTC (rev 9319)
+++ trunk/speex/libspeex/testenc.c	2005-05-27 18:05:05 UTC (rev 9320)
@@ -103,6 +103,7 @@
    fprintf (stderr, "Total encoded size: %d bits\n", bitCount);
    speex_encoder_destroy(st);
    speex_decoder_destroy(dec);
+   speex_bits_destroy(&bits);
 
    rewind(fin);
    rewind(fout);



More information about the commits mailing list