diff options
-rw-r--r-- | media/base/yuv_row.h | 5 | ||||
-rw-r--r-- | media/tools/media_bench/media_bench.cc | 41 |
2 files changed, 28 insertions, 18 deletions
diff --git a/media/base/yuv_row.h b/media/base/yuv_row.h index 262d9a0..0a2990b 100644 --- a/media/base/yuv_row.h +++ b/media/base/yuv_row.h @@ -53,7 +53,6 @@ void DoubleYUVToRGB32Row(const uint8* y_buf, // Handles arbitrary scaling up or down. // Mirroring is supported, but not 90 or 270 degree rotation. // Chroma is under sampled every 2 pixels for performance. -// This is the slowest of the scalers. void ScaleYUVToRGB32Row(const uint8* y_buf, const uint8* u_buf, const uint8* v_buf, @@ -61,6 +60,10 @@ void ScaleYUVToRGB32Row(const uint8* y_buf, int width, int source_dx); +// Handles arbitrary scaling up or down with bilinear filtering. +// Mirroring is supported, but not 90 or 270 degree rotation. +// Chroma is under sampled every 2 pixels for performance. +// This is the slowest of the scalers. void LinearScaleYUVToRGB32Row(const uint8* y_buf, const uint8* u_buf, const uint8* v_buf, diff --git a/media/tools/media_bench/media_bench.cc b/media/tools/media_bench/media_bench.cc index 5809470..86833b1 100644 --- a/media/tools/media_bench/media_bench.cc +++ b/media/tools/media_bench/media_bench.cc @@ -528,20 +528,12 @@ int main(int argc, const char** argv) { sum += decode_times[i]; } - // Print our results. - log_out->setf(std::ios::fixed); - log_out->precision(2); - *log_out << std::endl; - *log_out << " Frames:" << std::setw(11) << frames - << std::endl; - *log_out << " Total:" << std::setw(11) << total.InMillisecondsF() - << " ms" << std::endl; - *log_out << " Summation:" << std::setw(11) << sum - << " ms" << std::endl; - + double average = 0; + double stddev = 0; + double fps = 0; if (frames > 0) { // Calculate the average time per frame. - double average = sum / frames; + average = sum / frames; // Calculate the sum of the squared differences. // Standard deviation will only be accurate if no threads are used. @@ -553,13 +545,28 @@ int main(int argc, const char** argv) { } // Calculate the standard deviation (jitter). - double stddev = sqrt(squared_sum / frames); + stddev = sqrt(squared_sum / frames); - *log_out << " Average:" << std::setw(11) << average - << " ms" << std::endl; - *log_out << " StdDev:" << std::setw(11) << stddev - << " ms" << std::endl; + // Calculate frames per second. + fps = frames * 1000.0 / sum; } + + // Print our results. + log_out->setf(std::ios::fixed); + log_out->precision(2); + *log_out << std::endl; + *log_out << " Frames:" << std::setw(11) << frames + << std::endl; + *log_out << " Total:" << std::setw(11) << total.InMillisecondsF() + << " ms" << std::endl; + *log_out << " Summation:" << std::setw(11) << sum + << " ms" << std::endl; + *log_out << " Average:" << std::setw(11) << average + << " ms" << std::endl; + *log_out << " StdDev:" << std::setw(11) << stddev + << " ms" << std::endl; + *log_out << " FPS:" << std::setw(11) << fps + << std::endl; if (hash_djb2) { *log_out << " DJB2 Hash:" << std::setw(11) << hash_value << " " << in_path.value() << std::endl; |