summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2016-03-04 08:41:42 +0000
committerBenny Prijono <bennylp@teluu.com>2016-03-04 08:41:42 +0000
commit3e3ec82e1a43ba8cafa4ccaea98f51f1f282063b (patch)
tree4680c31c6b6617b6d25a270d4c5bb12b2e404a12
parent9367f52454076bf60dc4efa8b87f488807dee95a (diff)
Misc (Re #1882): encdec print the bitrate
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5253 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip-apps/src/samples/encdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/pjsip-apps/src/samples/encdec.c b/pjsip-apps/src/samples/encdec.c
index 757cef84..74e26d7c 100644
--- a/pjsip-apps/src/samples/encdec.c
+++ b/pjsip-apps/src/samples/encdec.c
@@ -99,6 +99,7 @@ static pj_status_t enc_dec_test(const char *codec_id,
pj_str_t tmp;
pjmedia_port *wavin, *wavout;
unsigned lost_pct;
+ unsigned bitstream_size = 0;
pj_status_t status;
#define T file_msec_duration/1000, file_msec_duration%1000
@@ -175,6 +176,8 @@ static pj_status_t enc_dec_test(const char *codec_id,
continue;
}
+ bitstream_size += frm_bit.size;
+
/* Parse the bitstream (not really necessary for this case
* since we always decode 1 frame, but it's still good
* for testing)
@@ -217,6 +220,8 @@ static pj_status_t enc_dec_test(const char *codec_id,
/* Release pool */
pj_pool_release(pool);
+ printf("Total encoded size: %u bytes\n", bitstream_size);
+ printf("Bitrate: %.3fKbps\n", bitstream_size*8.0/file_msec_duration);
return PJ_SUCCESS;
}