From 90310ddbb9342e399e9bb0d833d53189c5300b45 Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Thu, 8 Mar 2012 04:01:50 +0000 Subject: [PATCH] add environment variable to scale to override default filtering BUG=none TEST=none Review URL: https://webrtc-codereview.appspot.com/442001 git-svn-id: http://libyuv.googlecode.com/svn/trunk@209 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- README.chromium | 2 +- include/libyuv/version.h | 2 +- source/scale.cc | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.chromium b/README.chromium index d87a8190a..74f81d9ce 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 208 +Version: 209 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 579f72071..a1e2f0a62 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,7 +11,7 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 208 +#define LIBYUV_VERSION 209 #endif // INCLUDE_LIBYUV_VERSION_H_ diff --git a/source/scale.cc b/source/scale.cc index d0ebb075b..81ae53df8 100644 --- a/source/scale.cc +++ b/source/scale.cc @@ -12,6 +12,7 @@ #include #include +#include // For getenv() #include "libyuv/cpu_id.h" #include "libyuv/planar_functions.h" // For CopyPlane @@ -3636,6 +3637,13 @@ static void ScalePlane(const uint8* src, int src_stride, uint8* dst, int dst_stride, int dst_width, int dst_height, FilterMode filtering, bool use_ref) { +#ifdef CPU_X86 + // environment variable overrides for testing. + char *filter_override = getenv("LIBYUV_FILTER"); + if (filter_override) { + filtering = (FilterMode)atoi(filter_override); + } +#endif // Use specialized scales to improve performance for common resolutions. // For example, all the 1/2 scalings will use ScalePlaneDown2() if (dst_width == src_width && dst_height == src_height) {