3 * Copyright 2010 Google Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 * 3. The name of the author may not be used to endorse or promote products
14 * derived from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #include "libyuv/cpu_id.h"
31 #include "libyuv/scale.h"
32 #include "talk/media/base/testutils.h"
33 #include "webrtc/base/basictypes.h"
34 #include "webrtc/base/flags.h"
35 #include "webrtc/base/gunit.h"
36 #include "webrtc/base/scoped_ptr.h"
39 #define ALIGN16(var) __declspec(align(16)) var
41 #define ALIGN16(var) var __attribute__((aligned(16)))
44 using cricket::LoadPlanarYuvTestImage;
45 using cricket::DumpPlanarYuvTestImage;
46 using rtc::scoped_ptr;
48 DEFINE_bool(yuvscaler_dump, false,
49 "whether to write out scaled images for inspection");
50 DEFINE_int(yuvscaler_repeat, 1,
51 "how many times to perform each scaling operation (for perf testing)");
53 static const int kAlignment = 16;
55 // TEST_UNCACHED flushes cache to test real memory performance.
56 // TEST_RSTSC uses cpu cycles for more accurate benchmark of the scale function.
58 // #define TEST_UNCACHED 1
59 // #define TEST_RSTSC 1
62 #if defined(TEST_UNCACHED) || defined(TEST_RSTSC)
64 #include <emmintrin.h> // NOLINT
67 #if defined(__GNUC__) && defined(__i386__)
68 static inline uint64 __rdtsc(void) {
70 __asm__ volatile("rdtsc" : "=a" (a), "=d" (d));
71 return (reinterpret_cast<uint64>(d) << 32) + a;
74 static inline void _mm_clflush(volatile void *__p) {
75 asm volatile("clflush %0" : "+m" (*(volatile char *)__p));
79 static void FlushCache(uint8* dst, int count) {
88 class YuvScalerTest : public testing::Test {
90 virtual void SetUp() {
91 dump_ = *rtc::FlagList::Lookup("yuvscaler_dump")->bool_variable();
92 repeat_ = *rtc::FlagList::Lookup("yuvscaler_repeat")->int_variable();
95 // Scale an image and compare against a Lanczos-filtered test image.
96 // Lanczos is considered to be the "ideal" image resampling method, so we try
97 // to get as close to that as possible, while being as fast as possible.
98 bool TestScale(int iw, int ih, int ow, int oh, int offset, bool usefile,
99 bool optimize, int cpuflags, bool interpolate,
100 int memoffset, double* error) {
102 size_t isize = I420_SIZE(iw, ih);
103 size_t osize = I420_SIZE(ow, oh);
104 scoped_ptr<uint8[]> ibuffer(new uint8[isize + kAlignment + memoffset]());
105 scoped_ptr<uint8[]> obuffer(new uint8[osize + kAlignment + memoffset]());
106 scoped_ptr<uint8[]> xbuffer(new uint8[osize + kAlignment + memoffset]());
108 uint8 *ibuf = ALIGNP(ibuffer.get(), kAlignment) + memoffset;
109 uint8 *obuf = ALIGNP(obuffer.get(), kAlignment) + memoffset;
110 uint8 *xbuf = ALIGNP(xbuffer.get(), kAlignment) + memoffset;
113 if (!LoadPlanarYuvTestImage("faces", iw, ih, ibuf) ||
114 !LoadPlanarYuvTestImage("faces", ow, oh, xbuf)) {
115 LOG(LS_ERROR) << "Failed to load image";
119 // These are used to test huge images.
120 memset(ibuf, 213, isize); // Input is constant color.
121 memset(obuf, 100, osize); // Output set to something wrong for now.
122 memset(xbuf, 213, osize); // Expected result.
126 FlushCache(ibuf, isize);
127 FlushCache(obuf, osize);
128 FlushCache(xbuf, osize);
132 // If cpu true, disable cpu optimizations. Else allow auto detect
133 // TODO(fbarchard): set flags for libyuv
134 libyuv::MaskCpuFlags(cpuflags);
138 for (int i = 0; i < repeat_; ++i) {
140 FlushCache(ibuf, isize);
141 FlushCache(obuf, osize);
144 uint64 t1 = __rdtsc();
146 EXPECT_EQ(0, libyuv::ScaleOffset(ibuf, iw, ih, obuf, ow, oh,
147 offset, interpolate));
149 uint64 t2 = __rdtsc();
155 LOG(LS_INFO) << "Time: " << std::setw(9) << t;
159 const testing::TestInfo* const test_info =
160 testing::UnitTest::GetInstance()->current_test_info();
161 std::string test_name(test_info->name());
162 DumpPlanarYuvTestImage(test_name, obuf, ow, oh);
165 double sse = cricket::ComputeSumSquareError(obuf, xbuf, osize);
166 *error = sse / osize; // Mean Squared Error.
167 double PSNR = cricket::ComputePSNR(sse, osize);
168 LOG(LS_INFO) << "Image MSE: " <<
169 std::setw(6) << std::setprecision(4) << *error <<
170 " Image PSNR: " << PSNR;
174 // Returns the index of the first differing byte. Easier to debug than memcmp.
175 static int FindDiff(const uint8* buf1, const uint8* buf2, int len) {
177 while (i < len && buf1[i] == buf2[i]) {
180 return (i < len) ? i : -1;
188 // Tests straight copy of data.
189 TEST_F(YuvScalerTest, TestCopy) {
190 const int iw = 640, ih = 360;
191 const int ow = 640, oh = 360;
192 ALIGN16(uint8 ibuf[I420_SIZE(iw, ih)]);
193 ALIGN16(uint8 obuf[I420_SIZE(ow, oh)]);
195 // Load the frame, scale it, check it.
196 ASSERT_TRUE(LoadPlanarYuvTestImage("faces", iw, ih, ibuf));
197 for (int i = 0; i < repeat_; ++i) {
198 libyuv::ScaleOffset(ibuf, iw, ih, obuf, ow, oh, 0, false);
200 if (dump_) DumpPlanarYuvTestImage("TestCopy", obuf, ow, oh);
201 EXPECT_EQ(-1, FindDiff(obuf, ibuf, sizeof(ibuf)));
204 // Tests copy from 4:3 to 16:9.
205 TEST_F(YuvScalerTest, TestOffset16_10Copy) {
206 const int iw = 640, ih = 360;
207 const int ow = 640, oh = 480;
208 const int offset = (480 - 360) / 2;
209 scoped_ptr<uint8[]> ibuffer(new uint8[I420_SIZE(iw, ih) + kAlignment]);
210 scoped_ptr<uint8[]> obuffer(new uint8[I420_SIZE(ow, oh) + kAlignment]);
212 uint8 *ibuf = ALIGNP(ibuffer.get(), kAlignment);
213 uint8 *obuf = ALIGNP(obuffer.get(), kAlignment);
215 // Load the frame, scale it, check it.
216 ASSERT_TRUE(LoadPlanarYuvTestImage("faces", iw, ih, ibuf));
218 // Clear to black, which is Y = 0 and U and V = 128
219 memset(obuf, 0, ow * oh);
220 memset(obuf + ow * oh, 128, ow * oh / 2);
221 for (int i = 0; i < repeat_; ++i) {
222 libyuv::ScaleOffset(ibuf, iw, ih, obuf, ow, oh, offset, false);
224 if (dump_) DumpPlanarYuvTestImage("TestOffsetCopy16_9", obuf, ow, oh);
225 EXPECT_EQ(-1, FindDiff(obuf + ow * offset,
228 EXPECT_EQ(-1, FindDiff(obuf + ow * oh + ow * offset / 4,
231 EXPECT_EQ(-1, FindDiff(obuf + ow * oh * 5 / 4 + ow * offset / 4,
232 ibuf + iw * ih * 5 / 4,
236 // The following are 'cpu' flag values:
237 // Allow all SIMD optimizations
239 // Disable SSSE3 but allow other forms of SIMD (SSE2)
240 #define NOSSSE3 ~libyuv::kCpuHasSSSE3
241 // Disable SSE2 and SSSE3
242 #define NOSSE ~libyuv::kCpuHasSSE2 & ~libyuv::kCpuHasSSSE3
244 // TEST_M scale factor with variations of opt, align, int
245 #define TEST_M(name, iwidth, iheight, owidth, oheight, mse) \
246 TEST_F(YuvScalerTest, name##Ref) { \
248 EXPECT_TRUE(TestScale(iwidth, iheight, owidth, oheight, \
249 0, true, false, ALLFLAGS, false, 0, &error)); \
250 EXPECT_LE(error, mse); \
252 TEST_F(YuvScalerTest, name##OptAligned) { \
254 EXPECT_TRUE(TestScale(iwidth, iheight, owidth, oheight, \
255 0, true, true, ALLFLAGS, false, 0, &error)); \
256 EXPECT_LE(error, mse); \
258 TEST_F(YuvScalerTest, name##OptUnaligned) { \
260 EXPECT_TRUE(TestScale(iwidth, iheight, owidth, oheight, \
261 0, true, true, ALLFLAGS, false, 1, &error)); \
262 EXPECT_LE(error, mse); \
264 TEST_F(YuvScalerTest, name##OptSSE2) { \
266 EXPECT_TRUE(TestScale(iwidth, iheight, owidth, oheight, \
267 0, true, true, NOSSSE3, false, 0, &error)); \
268 EXPECT_LE(error, mse); \
270 TEST_F(YuvScalerTest, name##OptC) { \
272 EXPECT_TRUE(TestScale(iwidth, iheight, owidth, oheight, \
273 0, true, true, NOSSE, false, 0, &error)); \
274 EXPECT_LE(error, mse); \
276 TEST_F(YuvScalerTest, name##IntRef) { \
278 EXPECT_TRUE(TestScale(iwidth, iheight, owidth, oheight, \
279 0, true, false, ALLFLAGS, true, 0, &error)); \
280 EXPECT_LE(error, mse); \
282 TEST_F(YuvScalerTest, name##IntOptAligned) { \
284 EXPECT_TRUE(TestScale(iwidth, iheight, owidth, oheight, \
285 0, true, true, ALLFLAGS, true, 0, &error)); \
286 EXPECT_LE(error, mse); \
288 TEST_F(YuvScalerTest, name##IntOptUnaligned) { \
290 EXPECT_TRUE(TestScale(iwidth, iheight, owidth, oheight, \
291 0, true, true, ALLFLAGS, true, 1, &error)); \
292 EXPECT_LE(error, mse); \
294 TEST_F(YuvScalerTest, name##IntOptSSE2) { \
296 EXPECT_TRUE(TestScale(iwidth, iheight, owidth, oheight, \
297 0, true, true, NOSSSE3, true, 0, &error)); \
298 EXPECT_LE(error, mse); \
300 TEST_F(YuvScalerTest, name##IntOptC) { \
302 EXPECT_TRUE(TestScale(iwidth, iheight, owidth, oheight, \
303 0, true, true, NOSSE, true, 0, &error)); \
304 EXPECT_LE(error, mse); \
307 #define TEST_H(name, iwidth, iheight, owidth, oheight, opt, cpu, intr, mse) \
308 TEST_F(YuvScalerTest, name) { \
310 EXPECT_TRUE(TestScale(iwidth, iheight, owidth, oheight, \
311 0, false, opt, cpu, intr, 0, &error)); \
312 EXPECT_LE(error, mse); \
315 // Test 4x3 aspect ratio scaling
317 // Tests 1/1x scale down.
318 TEST_M(TestScale4by3Down11, 640, 480, 640, 480, 0)
320 // Tests 3/4x scale down.
321 TEST_M(TestScale4by3Down34, 640, 480, 480, 360, 60)
323 // Tests 1/2x scale down.
324 TEST_M(TestScale4by3Down12, 640, 480, 320, 240, 60)
326 // Tests 3/8x scale down.
327 TEST_M(TestScale4by3Down38, 640, 480, 240, 180, 60)
329 // Tests 1/4x scale down..
330 TEST_M(TestScale4by3Down14, 640, 480, 160, 120, 60)
332 // Tests 3/16x scale down.
333 TEST_M(TestScale4by3Down316, 640, 480, 120, 90, 120)
335 // Tests 1/8x scale down.
336 TEST_M(TestScale4by3Down18, 640, 480, 80, 60, 150)
338 // Tests 2/3x scale down.
339 TEST_M(TestScale4by3Down23, 480, 360, 320, 240, 60)
341 // Tests 4/3x scale up.
342 TEST_M(TestScale4by3Up43, 480, 360, 640, 480, 60)
344 // Tests 2/1x scale up.
345 TEST_M(TestScale4by3Up21, 320, 240, 640, 480, 60)
347 // Tests 4/1x scale up.
348 TEST_M(TestScale4by3Up41, 160, 120, 640, 480, 80)
350 // Test 16x10 aspect ratio scaling
352 // Tests 1/1x scale down.
353 TEST_M(TestScale16by10Down11, 640, 400, 640, 400, 0)
355 // Tests 3/4x scale down.
356 TEST_M(TestScale16by10Down34, 640, 400, 480, 300, 60)
358 // Tests 1/2x scale down.
359 TEST_M(TestScale16by10Down12, 640, 400, 320, 200, 60)
361 // Tests 3/8x scale down.
362 TEST_M(TestScale16by10Down38, 640, 400, 240, 150, 60)
364 // Tests 1/4x scale down..
365 TEST_M(TestScale16by10Down14, 640, 400, 160, 100, 60)
367 // Tests 3/16x scale down.
368 TEST_M(TestScale16by10Down316, 640, 400, 120, 75, 120)
370 // Tests 1/8x scale down.
371 TEST_M(TestScale16by10Down18, 640, 400, 80, 50, 150)
373 // Tests 2/3x scale down.
374 TEST_M(TestScale16by10Down23, 480, 300, 320, 200, 60)
376 // Tests 4/3x scale up.
377 TEST_M(TestScale16by10Up43, 480, 300, 640, 400, 60)
379 // Tests 2/1x scale up.
380 TEST_M(TestScale16by10Up21, 320, 200, 640, 400, 60)
382 // Tests 4/1x scale up.
383 TEST_M(TestScale16by10Up41, 160, 100, 640, 400, 80)
385 // Test 16x9 aspect ratio scaling
387 // Tests 1/1x scale down.
388 TEST_M(TestScaleDown11, 640, 360, 640, 360, 0)
390 // Tests 3/4x scale down.
391 TEST_M(TestScaleDown34, 640, 360, 480, 270, 60)
393 // Tests 1/2x scale down.
394 TEST_M(TestScaleDown12, 640, 360, 320, 180, 60)
396 // Tests 3/8x scale down.
397 TEST_M(TestScaleDown38, 640, 360, 240, 135, 60)
399 // Tests 1/4x scale down..
400 TEST_M(TestScaleDown14, 640, 360, 160, 90, 60)
402 // Tests 3/16x scale down.
403 TEST_M(TestScaleDown316, 640, 360, 120, 68, 120)
405 // Tests 1/8x scale down.
406 TEST_M(TestScaleDown18, 640, 360, 80, 45, 150)
408 // Tests 2/3x scale down.
409 TEST_M(TestScaleDown23, 480, 270, 320, 180, 60)
411 // Tests 4/3x scale up.
412 TEST_M(TestScaleUp43, 480, 270, 640, 360, 60)
414 // Tests 2/1x scale up.
415 TEST_M(TestScaleUp21, 320, 180, 640, 360, 60)
417 // Tests 4/1x scale up.
418 TEST_M(TestScaleUp41, 160, 90, 640, 360, 80)
420 // Test HD 4x3 aspect ratio scaling
422 // Tests 1/1x scale down.
423 TEST_M(TestScaleHD4x3Down11, 1280, 960, 1280, 960, 0)
425 // Tests 3/4x scale down.
426 TEST_M(TestScaleHD4x3Down34, 1280, 960, 960, 720, 60)
428 // Tests 1/2x scale down.
429 TEST_M(TestScaleHD4x3Down12, 1280, 960, 640, 480, 60)
431 // Tests 3/8x scale down.
432 TEST_M(TestScaleHD4x3Down38, 1280, 960, 480, 360, 60)
434 // Tests 1/4x scale down..
435 TEST_M(TestScaleHD4x3Down14, 1280, 960, 320, 240, 60)
437 // Tests 3/16x scale down.
438 TEST_M(TestScaleHD4x3Down316, 1280, 960, 240, 180, 120)
440 // Tests 1/8x scale down.
441 TEST_M(TestScaleHD4x3Down18, 1280, 960, 160, 120, 150)
443 // Tests 2/3x scale down.
444 TEST_M(TestScaleHD4x3Down23, 960, 720, 640, 480, 60)
446 // Tests 4/3x scale up.
447 TEST_M(TestScaleHD4x3Up43, 960, 720, 1280, 960, 60)
449 // Tests 2/1x scale up.
450 TEST_M(TestScaleHD4x3Up21, 640, 480, 1280, 960, 60)
452 // Tests 4/1x scale up.
453 TEST_M(TestScaleHD4x3Up41, 320, 240, 1280, 960, 80)
455 // Test HD 16x10 aspect ratio scaling
457 // Tests 1/1x scale down.
458 TEST_M(TestScaleHD16x10Down11, 1280, 800, 1280, 800, 0)
460 // Tests 3/4x scale down.
461 TEST_M(TestScaleHD16x10Down34, 1280, 800, 960, 600, 60)
463 // Tests 1/2x scale down.
464 TEST_M(TestScaleHD16x10Down12, 1280, 800, 640, 400, 60)
466 // Tests 3/8x scale down.
467 TEST_M(TestScaleHD16x10Down38, 1280, 800, 480, 300, 60)
469 // Tests 1/4x scale down..
470 TEST_M(TestScaleHD16x10Down14, 1280, 800, 320, 200, 60)
472 // Tests 3/16x scale down.
473 TEST_M(TestScaleHD16x10Down316, 1280, 800, 240, 150, 120)
475 // Tests 1/8x scale down.
476 TEST_M(TestScaleHD16x10Down18, 1280, 800, 160, 100, 150)
478 // Tests 2/3x scale down.
479 TEST_M(TestScaleHD16x10Down23, 960, 600, 640, 400, 60)
481 // Tests 4/3x scale up.
482 TEST_M(TestScaleHD16x10Up43, 960, 600, 1280, 800, 60)
484 // Tests 2/1x scale up.
485 TEST_M(TestScaleHD16x10Up21, 640, 400, 1280, 800, 60)
487 // Tests 4/1x scale up.
488 TEST_M(TestScaleHD16x10Up41, 320, 200, 1280, 800, 80)
490 // Test HD 16x9 aspect ratio scaling
492 // Tests 1/1x scale down.
493 TEST_M(TestScaleHDDown11, 1280, 720, 1280, 720, 0)
495 // Tests 3/4x scale down.
496 TEST_M(TestScaleHDDown34, 1280, 720, 960, 540, 60)
498 // Tests 1/2x scale down.
499 TEST_M(TestScaleHDDown12, 1280, 720, 640, 360, 60)
501 // Tests 3/8x scale down.
502 TEST_M(TestScaleHDDown38, 1280, 720, 480, 270, 60)
504 // Tests 1/4x scale down..
505 TEST_M(TestScaleHDDown14, 1280, 720, 320, 180, 60)
507 // Tests 3/16x scale down.
508 TEST_M(TestScaleHDDown316, 1280, 720, 240, 135, 120)
510 // Tests 1/8x scale down.
511 TEST_M(TestScaleHDDown18, 1280, 720, 160, 90, 150)
513 // Tests 2/3x scale down.
514 TEST_M(TestScaleHDDown23, 960, 540, 640, 360, 60)
516 // Tests 4/3x scale up.
517 TEST_M(TestScaleHDUp43, 960, 540, 1280, 720, 60)
519 // Tests 2/1x scale up.
520 TEST_M(TestScaleHDUp21, 640, 360, 1280, 720, 60)
522 // Tests 4/1x scale up.
523 TEST_M(TestScaleHDUp41, 320, 180, 1280, 720, 80)
525 // Tests 1366x768 resolution for comparison to chromium scaler_bench
526 TEST_M(TestScaleHDUp1366, 1280, 720, 1366, 768, 10)
528 // Tests odd source/dest sizes. 3 less to make chroma odd as well.
529 TEST_M(TestScaleHDUp1363, 1277, 717, 1363, 765, 10)
531 // Tests 1/2x scale down, using optimized algorithm.
532 TEST_M(TestScaleOddDown12, 180, 100, 90, 50, 50)
534 // Tests bilinear scale down
535 TEST_M(TestScaleOddDownBilin, 160, 100, 90, 50, 120)
537 // Test huge buffer scales that are expected to use a different code path
538 // that avoids stack overflow but still work using point sampling.
539 // Max output size is 640 wide.
541 // Tests interpolated 1/8x scale down, using optimized algorithm.
542 TEST_H(TestScaleDown18HDOptInt, 6144, 48, 768, 6, true, ALLFLAGS, true, 1)
544 // Tests interpolated 1/8x scale down, using c_only optimized algorithm.
545 TEST_H(TestScaleDown18HDCOnlyOptInt, 6144, 48, 768, 6, true, NOSSE, true, 1)
547 // Tests interpolated 3/8x scale down, using optimized algorithm.
548 TEST_H(TestScaleDown38HDOptInt, 2048, 16, 768, 6, true, ALLFLAGS, true, 1)
550 // Tests interpolated 3/8x scale down, using no SSSE3 optimized algorithm.
551 TEST_H(TestScaleDown38HDNoSSSE3OptInt, 2048, 16, 768, 6, true, NOSSSE3, true, 1)
553 // Tests interpolated 3/8x scale down, using c_only optimized algorithm.
554 TEST_H(TestScaleDown38HDCOnlyOptInt, 2048, 16, 768, 6, true, NOSSE, true, 1)
556 // Tests interpolated 3/16x scale down, using optimized algorithm.
557 TEST_H(TestScaleDown316HDOptInt, 4096, 32, 768, 6, true, ALLFLAGS, true, 1)
559 // Tests interpolated 3/16x scale down, using no SSSE3 optimized algorithm.
560 TEST_H(TestScaleDown316HDNoSSSE3OptInt, 4096, 32, 768, 6, true, NOSSSE3, true,
563 // Tests interpolated 3/16x scale down, using c_only optimized algorithm.
564 TEST_H(TestScaleDown316HDCOnlyOptInt, 4096, 32, 768, 6, true, NOSSE, true, 1)
566 // Test special sizes dont crash
567 // Tests scaling down to 1 pixel width
568 TEST_H(TestScaleDown1x6OptInt, 3, 24, 1, 6, true, ALLFLAGS, true, 4)
570 // Tests scaling down to 1 pixel height
571 TEST_H(TestScaleDown6x1OptInt, 24, 3, 6, 1, true, ALLFLAGS, true, 4)
573 // Tests scaling up from 1 pixel width
574 TEST_H(TestScaleUp1x6OptInt, 1, 6, 3, 24, true, ALLFLAGS, true, 4)
576 // Tests scaling up from 1 pixel height
577 TEST_H(TestScaleUp6x1OptInt, 6, 1, 24, 3, true, ALLFLAGS, true, 4)
579 // Test performance of a range of box filter scale sizes
581 // Tests interpolated 1/2x scale down, using optimized algorithm.
582 TEST_H(TestScaleDown2xHDOptInt, 1280, 720, 1280 / 2, 720 / 2, true, ALLFLAGS,
585 // Tests interpolated 1/3x scale down, using optimized algorithm.
586 TEST_H(TestScaleDown3xHDOptInt, 1280, 720, 1280 / 3, 720 / 3, true, ALLFLAGS,
589 // Tests interpolated 1/4x scale down, using optimized algorithm.
590 TEST_H(TestScaleDown4xHDOptInt, 1280, 720, 1280 / 4, 720 / 4, true, ALLFLAGS,
593 // Tests interpolated 1/5x scale down, using optimized algorithm.
594 TEST_H(TestScaleDown5xHDOptInt, 1280, 720, 1280 / 5, 720 / 5, true, ALLFLAGS,
597 // Tests interpolated 1/6x scale down, using optimized algorithm.
598 TEST_H(TestScaleDown6xHDOptInt, 1280, 720, 1280 / 6, 720 / 6, true, ALLFLAGS,
601 // Tests interpolated 1/7x scale down, using optimized algorithm.
602 TEST_H(TestScaleDown7xHDOptInt, 1280, 720, 1280 / 7, 720 / 7, true, ALLFLAGS,
605 // Tests interpolated 1/8x scale down, using optimized algorithm.
606 TEST_H(TestScaleDown8xHDOptInt, 1280, 720, 1280 / 8, 720 / 8, true, ALLFLAGS,
609 // Tests interpolated 1/8x scale down, using optimized algorithm.
610 TEST_H(TestScaleDown9xHDOptInt, 1280, 720, 1280 / 9, 720 / 9, true, ALLFLAGS,
613 // Tests interpolated 1/8x scale down, using optimized algorithm.
614 TEST_H(TestScaleDown10xHDOptInt, 1280, 720, 1280 / 10, 720 / 10, true, ALLFLAGS,