From 701608f39c59b530f6cede66ec24e9ddda8beae6 Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 12 Sep 2005 15:34:25 +0000 Subject: *** empty log message *** --- src/libfame_wrapper.cc | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'src/libfame_wrapper.cc') diff --git a/src/libfame_wrapper.cc b/src/libfame_wrapper.cc index e17ed68..94989f1 100644 --- a/src/libfame_wrapper.cc +++ b/src/libfame_wrapper.cc @@ -47,7 +47,9 @@ LibFAMEWrapper::LibFAMEWrapper(Info *i) yuv.y = new unsigned char [w*h * 2]; yuv.u = new unsigned char [w*h];// [w*h/4] yuv.v = new unsigned char [w*h];// [w*h/4] - + + calc_bitrate = 0; + ////////////LIBDV STUFF/////////////// dvdecoder = NULL; // Initialize in encode method @@ -224,6 +226,8 @@ Frame *LibFAMEWrapper::encode(Frame *dvframe) // Allocate a new frame for the output Frame *output = new Frame(NULL, FAME_BUFFER_SIZE); + fame_frame_statistics_t stats; + // Init frame params dv_get_timestamp(dvdecoder, output->timecode); // Set timecode output->size = 0; // Init size (incremented as we read) @@ -238,7 +242,28 @@ Frame *LibFAMEWrapper::encode(Frame *dvframe) pt += written; output->size += written; } - fame_end_frame(fame_context,0); + fame_end_frame(fame_context, &stats); + /* + info->info("frame_number: %d, coding: %c, target_bits: %d, actual_bits: %d, spatial_activity: %d, quant_scale: %f", + stats.frame_number, + stats.coding, + stats.target_bits, + stats.actual_bits, + stats.spatial_activity, + stats.quant_scale); + */ + /* + fame_frame_statistics_t_ { + unsigned int frame_number; + char coding; + signed int target_bits; + unsigned int actual_bits; + unsigned int spatial_activity; + float quant_scale; + } + */ + calc_bitrate += stats.actual_bits; + output->bitrate = (unsigned int)(((double)calc_bitrate / (double)(stats.frame_number+1)) * 25.0); return output; } -- cgit v1.2.3