Fix dump_modes for the api change and move it into a subdirectory
authorGregory Maxwell <greg@xiph.org>
Thu, 1 Sep 2011 18:17:26 +0000 (14:17 -0400)
committerGregory Maxwell <greg@xiph.org>
Thu, 1 Sep 2011 18:17:26 +0000 (14:17 -0400)
with a trivial makefile.

.gitignore
libcelt/dump_modes/Makefile [new file with mode: 0644]
libcelt/dump_modes/dump_modes.c [moved from libcelt/dump_modes.c with 98% similarity]

index cabeba6..7f9475f 100644 (file)
@@ -30,4 +30,4 @@ tools/celtdec
 tools/celtenc
 celt.pc
 libcelt.spec
-libcelt/dump_modes
+libcelt/dump_modes/dump_modes
diff --git a/libcelt/dump_modes/Makefile b/libcelt/dump_modes/Makefile
new file mode 100644 (file)
index 0000000..3993f53
--- /dev/null
@@ -0,0 +1,10 @@
+CFLAGS=-O2 -Wall -Wextra -DHAVE_CONFIG_H
+INCLUDES=-I../ -I../../
+
+all: dump_modes
+
+dump_modes:
+       $(CC) $(CFLAGS) $(INCLUDES) -DCUSTOM_MODES dump_modes.c ../modes.c ../cwrs.c ../rate.c ../entenc.c ../entdec.c ../mathops.c ../mdct.c ../kiss_fft.c -o dump_modes -lm 
+
+clean:
+       rm -f dump_modes
similarity index 98%
rename from libcelt/dump_modes.c
rename to libcelt/dump_modes/dump_modes.c
index 359ced9..ab37ac7 100644 (file)
@@ -299,9 +299,9 @@ int main(int argc, char **argv)
    int i, nb;
    FILE *file;
    CELTMode **m;
-   if (argc%2 != 1)
+   if (argc%2 != 1 || argc<3)
    {
-      fprintf (stderr, "must have a multiple of 2 arguments\n");
+      fprintf (stderr, "Usage: %s rate frame_size [rate frame_size] [rate frame_size]...\n",argv[0]);
       return 1;
    }
    nb = (argc-1)/2;
@@ -311,7 +311,7 @@ int main(int argc, char **argv)
       int Fs, frame;
       Fs      = atoi(argv[2*i+1]);
       frame   = atoi(argv[2*i+2]);
-      m[i] = celt_mode_create(Fs, frame, NULL);
+      m[i] = opus_custom_mode_create(Fs, frame, NULL);
       if (m[i]==NULL)
       {
          fprintf(stderr,"Error creating mode with Fs=%s, frame_size=%s\n",
@@ -323,7 +323,7 @@ int main(int argc, char **argv)
    dump_modes(file, m, nb);
    fclose(file);
    for (i=0;i<nb;i++)
-      celt_mode_destroy(m[i]);
+      opus_custom_mode_destroy(m[i]);
    free(m);
    return 0;
 }