shithub: opus

Download patch

ref: 583a14ac9649eddc2e3c4a69115464d8e3a12f1a
parent: f2d5aed8a58992d1084040d0ee0dfd68e7bc14bc
author: Jean-Marc Valin <[email protected]>
date: Tue Feb 19 12:34:02 EST 2008

Remove leading zeros in testcelt

--- a/libcelt/testcelt.c
+++ b/libcelt/testcelt.c
@@ -51,7 +51,7 @@
    int rate, overlap;
    double rmsd = 0;
    int count = 0;
-   
+   int skip;
    if (argc != 8)
    {
       fprintf (stderr, "Usage: testcelt <rate> <channels> <frame size> <overlap> <bytes per packet> <input> <output>\n");
@@ -62,7 +62,7 @@
    channels = atoi(argv[2]);
    frame_size = atoi(argv[3]);
    overlap = atoi(argv[4]);
-   
+   skip = overlap;
    mode = celt_mode_create(rate, channels, frame_size, overlap, NULL);
    
    if (mode == NULL)
@@ -128,7 +128,8 @@
       for (i=0;i<frame_size*channels;i++)
          rmsd += (in[i]-out[i])*1.0*(in[i]-out[i]);
       count++;
-      fwrite(out, sizeof(short), frame_size*channels, fout);
+      fwrite(out, sizeof(short), (frame_size-skip)*channels, fout);
+      skip = 0;
    }
    celt_encoder_destroy(enc);
    celt_decoder_destroy(dec);