Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: source/libvpx/examples/vp8_multi_resolution_encoder.c

Issue 181493009: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/examples/twopass_encoder.c ('k') | source/libvpx/examples/vp8_set_maps.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/examples/vp8_multi_resolution_encoder.c
===================================================================
--- source/libvpx/examples/vp8_multi_resolution_encoder.c (revision 254565)
+++ source/libvpx/examples/vp8_multi_resolution_encoder.c (working copy)
@@ -18,11 +18,12 @@
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
-#include "math.h"
+#include <math.h>
#define VPX_CODEC_DISABLE_COMPAT 1
#include "vpx/vpx_encoder.h"
#include "vpx/vp8cx.h"
#include "vpx_ports/mem_ops.h"
+#include "./tools_common.h"
#define interface (vpx_codec_vp8_cx())
#define fourcc 0x30385056
@@ -44,21 +45,6 @@
#include "third_party/libyuv/include/libyuv/scale.h"
#include "third_party/libyuv/include/libyuv/cpu_id.h"
-static double vp8_mse2psnr(double Samples, double Peak, double Mse)
-{
- double psnr;
-
- if ((double)Mse > 0.0)
- psnr = 10.0 * log10(Peak * Peak * Samples / Mse);
- else
- psnr = 60; // Limit to prevent / 0
-
- if (psnr > 60)
- psnr = 60;
-
- return psnr;
-}
-
static void die(const char *fmt, ...) {
va_list ap;
@@ -454,8 +440,8 @@
if ( (show_psnr) && (psnr_count[i]>0) )
{
int j;
- double ovpsnr = vp8_mse2psnr(psnr_samples_total[i], 255.0,
- psnr_sse_total[i]);
+ double ovpsnr = sse_to_psnr(psnr_samples_total[i], 255.0,
+ psnr_sse_total[i]);
fprintf(stderr, "\n ENC%d PSNR (Overall/Avg/Y/U/V)", i);
« no previous file with comments | « source/libvpx/examples/twopass_encoder.c ('k') | source/libvpx/examples/vp8_set_maps.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698