shithub: opus

Download patch

ref: 4a7ce81fb3224169005b5d9f7aa37de5ae031141
parent: c5a17a0716c7d9e0df4f0b8ae93d0706578bf92b
author: Jean-Marc Valin <jmvalin@amazon.com>
date: Sun Oct 3 23:04:20 EDT 2021

Re-enabling quantized feature dump

--- a/dnn/dump_data.c
+++ b/dnn/dump_data.c
@@ -270,15 +270,19 @@
     if (fpcm) {
         compute_noise(&noisebuf[st->pcount*FRAME_SIZE], noise_std);
     }
-    process_single_frame(st, ffeat);
-    if (fpcm) write_audio(st, pcm, &noisebuf[st->pcount*FRAME_SIZE], fpcm, 1);
-
+    
+    if (!quantize) {
+      process_single_frame(st, ffeat);
+      if (fpcm) write_audio(st, pcm, &noisebuf[st->pcount*FRAME_SIZE], fpcm, 1);
+    }
     st->pcount++;
     /* Running on groups of 4 frames. */
     if (st->pcount == 4) {
-      //unsigned char buf[8];
-      //process_superframe(st, buf, ffeat, encode, quantize);
-      //if (fpcm) write_audio(st, pcmbuf, noisebuf, fpcm, 4);
+      if (quantize) {
+        unsigned char buf[8];
+        process_superframe(st, buf, ffeat, encode, quantize);
+        if (fpcm) write_audio(st, pcmbuf, noisebuf, fpcm, 4);
+      }
       st->pcount = 0;
     }
     //if (fpcm) fwrite(pcm, sizeof(short), FRAME_SIZE, fpcm);
--