summaryrefslogtreecommitdiff
path: root/src/opus_demo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/opus_demo.c')
-rw-r--r--src/opus_demo.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/opus_demo.c b/src/opus_demo.c
index 9d5c7939..d73af551 100644
--- a/src/opus_demo.c
+++ b/src/opus_demo.c
@@ -243,7 +243,7 @@ int main(int argc, char *argv[])
int stop=0;
short *in, *out;
int application=OPUS_APPLICATION_AUDIO;
- double bits=0.0, bits_max=0.0, bits_act=0.0, bits2=0.0, nrg;
+ double bits=0.0, bits_max=0.0, bits_act=0.0, bits2=0.0, bits_act2=0.0, nrg;
double tot_samples=0;
opus_uint64 tot_in, tot_out;
int bandwidth=OPUS_AUTO;
@@ -849,6 +849,7 @@ int main(int argc, char *argv[])
nrg /= frame_size * channels;
if( nrg > 1e5 ) {
bits_act += len[toggle]*8;
+ bits_act2 += len[toggle]*len[toggle]*64;
count_act++;
}
}
@@ -867,9 +868,11 @@ int main(int argc, char *argv[])
1e-3*bits_max*sampling_rate/frame_size);
if (!decode_only)
fprintf (stderr, "active bitrate: %7.3f kb/s\n",
- 1e-3*bits_act*sampling_rate/(1e-15+frame_size*(double)count_act));
+ 1e-3*bits_act*sampling_rate/(frame_size*(double)count_act));
fprintf (stderr, "bitrate standard deviation: %7.3f kb/s\n",
1e-3*sqrt(bits2/count - bits*bits/(count*(double)count))*sampling_rate/frame_size);
+ fprintf (stderr, "active standard deviation: %7.3f kb/s\n",
+ 1e-3*sqrt(bits_act2/count_act - bits_act*bits_act/(count_act*(double)count_act))*sampling_rate/frame_size);
/* Close any files to which intermediate results were stored */
SILK_DEBUG_STORE_CLOSE_FILES
silk_TimerSave("opus_timing.txt");