From d4e6364e08813dd7dc6dd5609250a1685c82d634 Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Sun, 5 Jun 2016 10:45:54 +0200 Subject: vp9: cleanup --- modules/vp9/decode.c | 16 +++++++--------- modules/vp9/encode.c | 21 +++++++-------------- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/modules/vp9/decode.c b/modules/vp9/decode.c index 38b2bbc..84f0d49 100644 --- a/modules/vp9/decode.c +++ b/modules/vp9/decode.c @@ -48,11 +48,12 @@ static void destructor(void *arg) { struct viddec_state *vds = arg; - re_printf("vp9: decoder: total frames %u, total bytes %zu\n", - vds->n_frames, vds->n_bytes); + if (vds->ctxup) { + debug("vp9: decoder stats: frames=%u, bytes=%zu\n", + vds->n_frames, vds->n_bytes); - if (vds->ctxup) vpx_codec_destroy(&vds->ctx); + } mem_deref(vds->mb); } @@ -187,12 +188,9 @@ int vp9_decode(struct viddec_state *vds, struct vidframe *frame, if (err) return err; -#if 1 - debug("vp9: [%c] header: i=%u start=%u end=%u " - "picid=%u \n", - marker ? 'M' : ' ', - hdr.i, hdr.b, hdr.e, - hdr.picid); +#if 0 + debug("vp9: [%c] header: i=%u start=%u end=%u picid=%u \n", + marker ? 'M' : ' ', hdr.i, hdr.b, hdr.e, hdr.picid); #endif if (hdr.b) { diff --git a/modules/vp9/encode.c b/modules/vp9/encode.c index 7e81b51..faef958 100644 --- a/modules/vp9/encode.c +++ b/modules/vp9/encode.c @@ -33,25 +33,23 @@ struct videnc_state { unsigned n_frames; unsigned n_key_frames; size_t n_bytes; - - uint64_t ts_start; }; static void destructor(void *arg) { struct videnc_state *ves = arg; - uint64_t now = tmr_jiffies(); - re_printf("vp9: encoder: total frames %u, total bytes %zu\n", - ves->n_frames, ves->n_bytes); - re_printf(" key frames %u\n", ves->n_key_frames); + if (ves->ctxup) { - re_printf(" average frame rate: %.1f fps\n", - ves->n_frames / (.001 * (now - ves->ts_start))); + debug("vp9: encoder stats:" + " frames=%u, key_frames=%u, bytes=%zu\n", + ves->n_frames, + ves->n_key_frames, + ves->n_bytes); - if (ves->ctxup) vpx_codec_destroy(&ves->ctx); + } } @@ -132,9 +130,6 @@ static int open_encoder(struct videnc_state *ves, const struct vidsz *size) cfg.g_bit_depth = 8; cfg.g_input_bit_depth = 8; - re_printf("vp9: encoder: rc_target_bitrate %d\n", - cfg.rc_target_bitrate); - if (ves->ctxup) { debug("vp9: re-opening encoder\n"); vpx_codec_destroy(&ves->ctx); @@ -245,8 +240,6 @@ int vp9_encode(struct videnc_state *ves, bool update, return err; ves->size = frame->size; - - ves->ts_start = tmr_jiffies(); } ++ves->n_frames; -- cgit v1.2.3