Commit 095f33d8 authored by fbarchard@google.com's avatar fbarchard@google.com

Coalesce rows by changing width/height and dropping into code instead of…

Coalesce rows by changing width/height and dropping into code instead of recursing.  Improve coalesce by setting stride to 0 so it can be used even on odd width images.  Reduce unittests to improve time to run emulators.
BUG=277
TEST=unittests all build and pass
R=ryanpetrie@google.com

Review URL: https://webrtc-codereview.appspot.com/2589004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@819 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 8be4b289
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 818
Version: 819
License: BSD
License File: LICENSE
......
......@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 818
#define LIBYUV_VERSION 819
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
......@@ -148,7 +148,9 @@ LIBYUV_API
uint64 ComputeSumSquareErrorPlane(const uint8* src_a, int stride_a,
const uint8* src_b, int stride_b,
int width, int height) {
if (stride_a == width && stride_b == width) {
// Coalesce rows.
if (stride_a == width &&
stride_b == width) {
return ComputeSumSquareError(src_a, src_b, width * height);
}
uint32 (*SumSquareError)(const uint8* src_a, const uint8* src_b, int count) =
......
......@@ -369,20 +369,23 @@ static int X420ToI420(const uint8* src_y,
dst_stride_u = -dst_stride_u;
dst_stride_v = -dst_stride_v;
}
// Coalesce contiguous rows.
// Coalesce rows.
int halfwidth = (width + 1) >> 1;
int halfheight = (height + 1) >> 1;
if (src_stride_y0 == width &&
src_stride_y1 == width &&
dst_stride_y == width) {
width = width * height;
width *= height;
height = 1;
src_stride_y0 = src_stride_y1 = dst_stride_y = 0;
}
if (src_stride_uv == width &&
dst_stride_u * 2 == width &&
dst_stride_v * 2 == width) {
halfwidth = halfwidth * halfheight;
// Coalesce rows.
if (src_stride_uv == halfwidth * 2 &&
dst_stride_u * 2 == halfwidth &&
dst_stride_v * 2 == halfwidth) {
halfwidth *= halfheight;
halfheight = 1;
src_stride_uv = dst_stride_u = dst_stride_v = 0;
}
void (*SplitUVRow)(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix) =
SplitUVRow_C;
......
......@@ -63,16 +63,14 @@ int I444ToARGB(const uint8* src_y, int src_stride_y,
dst_argb = dst_argb + (height - 1) * dst_stride_argb;
dst_stride_argb = -dst_stride_argb;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_y == width &&
src_stride_u == width &&
src_stride_v == width &&
dst_stride_argb == width * 4) {
return I444ToARGB(src_y, 0,
src_u, 0,
src_v, 0,
dst_argb, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_y = src_stride_u = src_stride_v = dst_stride_argb = 0;
}
void (*I444ToARGBRow)(const uint8* y_buf,
const uint8* u_buf,
......@@ -126,16 +124,14 @@ int I422ToARGB(const uint8* src_y, int src_stride_y,
dst_argb = dst_argb + (height - 1) * dst_stride_argb;
dst_stride_argb = -dst_stride_argb;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_y == width &&
src_stride_u * 2 == width &&
src_stride_v * 2 == width &&
dst_stride_argb == width * 4) {
return I422ToARGB(src_y, 0,
src_u, 0,
src_v, 0,
dst_argb, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_y = src_stride_u = src_stride_v = dst_stride_argb = 0;
}
void (*I422ToARGBRow)(const uint8* y_buf,
const uint8* u_buf,
......@@ -207,16 +203,14 @@ int I411ToARGB(const uint8* src_y, int src_stride_y,
dst_argb = dst_argb + (height - 1) * dst_stride_argb;
dst_stride_argb = -dst_stride_argb;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_y == width &&
src_stride_u * 4 == width &&
src_stride_v * 4 == width &&
dst_stride_argb == width * 4) {
return I411ToARGB(src_y, 0,
src_u, 0,
src_v, 0,
dst_argb, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_y = src_stride_u = src_stride_v = dst_stride_argb = 0;
}
void (*I411ToARGBRow)(const uint8* y_buf,
const uint8* u_buf,
......@@ -267,12 +261,12 @@ int I400ToARGB_Reference(const uint8* src_y, int src_stride_y,
dst_argb = dst_argb + (height - 1) * dst_stride_argb;
dst_stride_argb = -dst_stride_argb;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_y == width &&
dst_stride_argb == width * 4) {
return I400ToARGB_Reference(src_y, 0,
dst_argb, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_y = dst_stride_argb = 0;
}
void (*YToARGBRow)(const uint8* y_buf,
uint8* rgb_buf,
......@@ -317,12 +311,12 @@ int I400ToARGB(const uint8* src_y, int src_stride_y,
src_y = src_y + (height - 1) * src_stride_y;
src_stride_y = -src_stride_y;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_y == width &&
dst_stride_argb == width * 4) {
return I400ToARGB(src_y, 0,
dst_argb, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_y = dst_stride_argb = 0;
}
void (*I400ToARGBRow)(const uint8* src_y, uint8* dst_argb, int pix) =
I400ToARGBRow_C;
......@@ -415,12 +409,12 @@ int RGB24ToARGB(const uint8* src_rgb24, int src_stride_rgb24,
src_rgb24 = src_rgb24 + (height - 1) * src_stride_rgb24;
src_stride_rgb24 = -src_stride_rgb24;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_rgb24 == width * 3 &&
dst_stride_argb == width * 4) {
return RGB24ToARGB(src_rgb24, 0,
dst_argb, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_rgb24 = dst_stride_argb = 0;
}
void (*RGB24ToARGBRow)(const uint8* src_rgb, uint8* dst_argb, int pix) =
RGB24ToARGBRow_C;
......@@ -464,12 +458,12 @@ int RAWToARGB(const uint8* src_raw, int src_stride_raw,
src_raw = src_raw + (height - 1) * src_stride_raw;
src_stride_raw = -src_stride_raw;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_raw == width * 3 &&
dst_stride_argb == width * 4) {
return RAWToARGB(src_raw, 0,
dst_argb, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_raw = dst_stride_argb = 0;
}
void (*RAWToARGBRow)(const uint8* src_rgb, uint8* dst_argb, int pix) =
RAWToARGBRow_C;
......@@ -513,12 +507,12 @@ int RGB565ToARGB(const uint8* src_rgb565, int src_stride_rgb565,
src_rgb565 = src_rgb565 + (height - 1) * src_stride_rgb565;
src_stride_rgb565 = -src_stride_rgb565;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_rgb565 == width * 2 &&
dst_stride_argb == width * 4) {
return RGB565ToARGB(src_rgb565, 0,
dst_argb, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_rgb565 = dst_stride_argb = 0;
}
void (*RGB565ToARGBRow)(const uint8* src_rgb565, uint8* dst_argb, int pix) =
RGB565ToARGBRow_C;
......@@ -562,12 +556,12 @@ int ARGB1555ToARGB(const uint8* src_argb1555, int src_stride_argb1555,
src_argb1555 = src_argb1555 + (height - 1) * src_stride_argb1555;
src_stride_argb1555 = -src_stride_argb1555;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_argb1555 == width * 2 &&
dst_stride_argb == width * 4) {
return ARGB1555ToARGB(src_argb1555, 0,
dst_argb, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_argb1555 = dst_stride_argb = 0;
}
void (*ARGB1555ToARGBRow)(const uint8* src_argb1555, uint8* dst_argb,
int pix) = ARGB1555ToARGBRow_C;
......@@ -611,12 +605,12 @@ int ARGB4444ToARGB(const uint8* src_argb4444, int src_stride_argb4444,
src_argb4444 = src_argb4444 + (height - 1) * src_stride_argb4444;
src_stride_argb4444 = -src_stride_argb4444;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_argb4444 == width * 2 &&
dst_stride_argb == width * 4) {
return ARGB4444ToARGB(src_argb4444, 0,
dst_argb, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_argb4444 = dst_stride_argb = 0;
}
void (*ARGB4444ToARGBRow)(const uint8* src_argb4444, uint8* dst_argb,
int pix) = ARGB4444ToARGBRow_C;
......@@ -812,13 +806,13 @@ int YUY2ToARGB(const uint8* src_yuy2, int src_stride_yuy2,
src_yuy2 = src_yuy2 + (height - 1) * src_stride_yuy2;
src_stride_yuy2 = -src_stride_yuy2;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (width * height <= kMaxStride &&
src_stride_yuy2 == width * 2 &&
dst_stride_argb == width * 4) {
return YUY2ToARGB(src_yuy2, 0,
dst_argb, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_yuy2 = dst_stride_argb = 0;
}
void (*YUY2ToARGBRow)(const uint8* src_yuy2, uint8* dst_argb, int pix) =
YUY2ToARGBRow_C;
......@@ -865,13 +859,13 @@ int UYVYToARGB(const uint8* src_uyvy, int src_stride_uyvy,
src_uyvy = src_uyvy + (height - 1) * src_stride_uyvy;
src_stride_uyvy = -src_stride_uyvy;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (width * height <= kMaxStride &&
src_stride_uyvy == width * 2 &&
dst_stride_argb == width * 4) {
return UYVYToARGB(src_uyvy, 0,
dst_argb, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_uyvy = dst_stride_argb = 0;
}
void (*UYVYToARGBRow)(const uint8* src_uyvy, uint8* dst_argb, int pix) =
UYVYToARGBRow_C;
......
......@@ -237,16 +237,14 @@ int I422ToYUY2(const uint8* src_y, int src_stride_y,
dst_yuy2 = dst_yuy2 + (height - 1) * dst_stride_yuy2;
dst_stride_yuy2 = -dst_stride_yuy2;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_y == width &&
src_stride_u * 2 == width &&
src_stride_v * 2 == width &&
dst_stride_yuy2 == width * 2) {
return I422ToYUY2(src_y, 0,
src_u, 0,
src_v, 0,
dst_yuy2, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_y = src_stride_u = src_stride_v = dst_stride_yuy2 = 0;
}
void (*I422ToYUY2Row)(const uint8* src_y, const uint8* src_u,
const uint8* src_v, uint8* dst_yuy2, int width) =
......@@ -343,16 +341,14 @@ int I422ToUYVY(const uint8* src_y, int src_stride_y,
dst_uyvy = dst_uyvy + (height - 1) * dst_stride_uyvy;
dst_stride_uyvy = -dst_stride_uyvy;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_y == width &&
src_stride_u * 2 == width &&
src_stride_v * 2 == width &&
dst_stride_uyvy == width * 2) {
return I422ToUYVY(src_y, 0,
src_u, 0,
src_v, 0,
dst_uyvy, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_y = src_stride_u = src_stride_v = dst_stride_uyvy = 0;
}
void (*I422ToUYVYRow)(const uint8* src_y, const uint8* src_u,
const uint8* src_v, uint8* dst_uyvy, int width) =
......@@ -453,19 +449,22 @@ int I420ToNV12(const uint8* src_y, int src_stride_y,
dst_stride_y = -dst_stride_y;
dst_stride_uv = -dst_stride_uv;
}
// Coalesce contiguous rows.
// Coalesce rows.
int halfwidth = (width + 1) >> 1;
int halfheight = (height + 1) >> 1;
if (src_stride_y == width &&
dst_stride_y == width) {
width = width * height;
width *= height;
height = 1;
src_stride_y = dst_stride_y = 0;
}
if (src_stride_u * 2 == width &&
src_stride_v * 2 == width &&
dst_stride_uv == width) {
halfwidth = halfwidth * halfheight;
// Coalesce rows.
if (src_stride_u == halfwidth &&
src_stride_v == halfwidth &&
dst_stride_uv == halfwidth * 2) {
halfwidth *= halfheight;
halfheight = 1;
src_stride_u = src_stride_v = dst_stride_uv = 0;
}
void (*MergeUVRow_)(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
int width) = MergeUVRow_C;
......
......@@ -36,16 +36,14 @@ int ARGBToI444(const uint8* src_argb, int src_stride_argb,
src_argb = src_argb + (height - 1) * src_stride_argb;
src_stride_argb = -src_stride_argb;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_argb == width * 4 &&
dst_stride_y == width &&
dst_stride_u == width &&
dst_stride_v == width) {
return ARGBToI444(src_argb, 0,
dst_y, 0,
dst_u, 0,
dst_v, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_argb = dst_stride_y = dst_stride_u = dst_stride_v = 0;
}
void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int pix) =
ARGBToYRow_C;
......@@ -111,16 +109,14 @@ int ARGBToI422(const uint8* src_argb, int src_stride_argb,
src_argb = src_argb + (height - 1) * src_stride_argb;
src_stride_argb = -src_stride_argb;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_argb == width * 4 &&
dst_stride_y == width &&
dst_stride_u * 2 == width &&
dst_stride_v * 2 == width) {
return ARGBToI422(src_argb, 0,
dst_y, 0,
dst_u, 0,
dst_v, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_argb = dst_stride_y = dst_stride_u = dst_stride_v = 0;
}
void (*ARGBToUV422Row)(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
int pix) = ARGBToUV422Row_C;
......@@ -190,16 +186,14 @@ int ARGBToI411(const uint8* src_argb, int src_stride_argb,
src_argb = src_argb + (height - 1) * src_stride_argb;
src_stride_argb = -src_stride_argb;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_argb == width * 4 &&
dst_stride_y == width &&
dst_stride_u * 4 == width &&
dst_stride_v * 4 == width) {
return ARGBToI411(src_argb, 0,
dst_y, 0,
dst_u, 0,
dst_v, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_argb = dst_stride_y = dst_stride_u = dst_stride_v = 0;
}
void (*ARGBToUV411Row)(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
int pix) = ARGBToUV411Row_C;
......@@ -470,13 +464,13 @@ int ARGBToYUY2(const uint8* src_argb, int src_stride_argb,
dst_yuy2 = dst_yuy2 + (height - 1) * dst_stride_yuy2;
dst_stride_yuy2 = -dst_stride_yuy2;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (width * height <= kMaxStride &&
src_stride_argb == width * 4 &&
dst_stride_yuy2 == width * 2) {
return ARGBToYUY2(src_argb, 0,
dst_yuy2, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_argb = dst_stride_yuy2 = 0;
}
void (*ARGBToUV422Row)(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
int pix) = ARGBToUV422Row_C;
......@@ -566,13 +560,13 @@ int ARGBToUYVY(const uint8* src_argb, int src_stride_argb,
dst_uyvy = dst_uyvy + (height - 1) * dst_stride_uyvy;
dst_stride_uyvy = -dst_stride_uyvy;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (width * height <= kMaxStride &&
src_stride_argb == width * 4 &&
dst_stride_uyvy == width * 2) {
return ARGBToUYVY(src_argb, 0,
dst_uyvy, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_argb = dst_stride_uyvy = 0;
}
void (*ARGBToUV422Row)(const uint8* src_argb, uint8* dst_u, uint8* dst_v,
int pix) = ARGBToUV422Row_C;
......@@ -659,12 +653,12 @@ int ARGBToI400(const uint8* src_argb, int src_stride_argb,
src_argb = src_argb + (height - 1) * src_stride_argb;
src_stride_argb = -src_stride_argb;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_argb == width * 4 &&
dst_stride_y == width) {
return ARGBToI400(src_argb, 0,
dst_y, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_argb = dst_stride_y = 0;
}
void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int pix) =
ARGBToYRow_C;
......@@ -734,12 +728,12 @@ int ARGBToRGB24(const uint8* src_argb, int src_stride_argb,
src_argb = src_argb + (height - 1) * src_stride_argb;
src_stride_argb = -src_stride_argb;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_argb == width * 4 &&
dst_stride_rgb24 == width * 3) {
return ARGBToRGB24(src_argb, 0,
dst_rgb24, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_argb = dst_stride_rgb24 = 0;
}
void (*ARGBToRGB24Row)(const uint8* src_argb, uint8* dst_rgb, int pix) =
ARGBToRGB24Row_C;
......@@ -780,12 +774,12 @@ int ARGBToRAW(const uint8* src_argb, int src_stride_argb,
src_argb = src_argb + (height - 1) * src_stride_argb;
src_stride_argb = -src_stride_argb;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_argb == width * 4 &&
dst_stride_raw == width * 3) {
return ARGBToRAW(src_argb, 0,
dst_raw, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_argb = dst_stride_raw = 0;
}
void (*ARGBToRAWRow)(const uint8* src_argb, uint8* dst_rgb, int pix) =
ARGBToRAWRow_C;
......@@ -826,12 +820,12 @@ int ARGBToRGB565(const uint8* src_argb, int src_stride_argb,
src_argb = src_argb + (height - 1) * src_stride_argb;
src_stride_argb = -src_stride_argb;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_argb == width * 4 &&
dst_stride_rgb565 == width * 2) {
return ARGBToRGB565(src_argb, 0,
dst_rgb565, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_argb = dst_stride_rgb565 = 0;
}
void (*ARGBToRGB565Row)(const uint8* src_argb, uint8* dst_rgb, int pix) =
ARGBToRGB565Row_C;
......@@ -873,12 +867,12 @@ int ARGBToARGB1555(const uint8* src_argb, int src_stride_argb,
src_argb = src_argb + (height - 1) * src_stride_argb;
src_stride_argb = -src_stride_argb;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_argb == width * 4 &&
dst_stride_argb1555 == width * 2) {
return ARGBToARGB1555(src_argb, 0,
dst_argb1555, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_argb = dst_stride_argb1555 = 0;
}
void (*ARGBToARGB1555Row)(const uint8* src_argb, uint8* dst_rgb, int pix) =
ARGBToARGB1555Row_C;
......@@ -920,12 +914,12 @@ int ARGBToARGB4444(const uint8* src_argb, int src_stride_argb,
src_argb = src_argb + (height - 1) * src_stride_argb;
src_stride_argb = -src_stride_argb;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_argb == width * 4 &&
dst_stride_argb4444 == width * 2) {
return ARGBToARGB4444(src_argb, 0,
dst_argb4444, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_argb = dst_stride_argb4444 = 0;
}
void (*ARGBToARGB4444Row)(const uint8* src_argb, uint8* dst_rgb, int pix) =
ARGBToARGB4444Row_C;
......@@ -1044,12 +1038,12 @@ int ARGBToJ400(const uint8* src_argb, int src_stride_argb,
src_argb = src_argb + (height - 1) * src_stride_argb;
src_stride_argb = -src_stride_argb;
}
// Coalesce contiguous rows.
// Coalesce rows.
if (src_stride_argb == width * 4 &&
dst_stride_yj == width) {
return ARGBToJ400(src_argb, 0,
dst_yj, 0,
width * height, 1);
width *= height;
height = 1;
src_stride_argb = dst_stride_yj = 0;
}
void (*ARGBToYJRow)(const uint8* src_argb, uint8* dst_yj, int pix) =
ARGBToYJRow_C;
......
This diff is collapsed.
......@@ -322,7 +322,7 @@ TEST_F(libyuvTest, Psnr) {
free_aligned_buffer_64(src_b)
}
TEST_F(libyuvTest, BenchmarkSsim_Opt) {
TEST_F(libyuvTest, DISABLED_BenchmarkSsim_Opt) {
align_buffer_64(src_a, benchmark_width_ * benchmark_height_)
align_buffer_64(src_b, benchmark_width_ * benchmark_height_)
for (int i = 0; i < benchmark_width_ * benchmark_height_; ++i) {
......
......@@ -987,7 +987,6 @@ TESTINTERPOLATE(64)
TESTINTERPOLATE(128)
TESTINTERPOLATE(192)
TESTINTERPOLATE(255)
TESTINTERPOLATE(85)
static int TestBlend(int width, int height, int benchmark_iterations,
int invert, int off) {
......
......@@ -213,20 +213,18 @@ static int ARGBClipTestFilter(int src_width, int src_height,
// Test a scale factor with 2 filters. Expect unfiltered to be exact, but
// filtering is different fixed point implementations for SSSE3, Neon and C.
#define TEST_FACTOR(name, hfactor, vfactor) \
TEST_FACTOR1(name, None, hfactor, vfactor, 0) \
TEST_FACTOR1(name, Bilinear, hfactor, vfactor, 2)
// TODO(fbarchard): ScaleDownBy1 should be lossless, but Box has error of 2.
TEST_FACTOR(1, 1 / 1, 1 / 1)
//TEST_FACTOR(1, 1 / 1, 1 / 1)
TEST_FACTOR(2, 1 / 2, 1 / 2)
TEST_FACTOR(4, 1 / 4, 1 / 4)
TEST_FACTOR(5, 1 / 5, 1 / 5)
TEST_FACTOR(8, 1 / 8, 1 / 8)
TEST_FACTOR(16, 1 / 16, 1 / 16)
TEST_FACTOR(2by3, 2 / 3, 2 / 3)
//TEST_FACTOR(8, 1 / 8, 1 / 8)
//TEST_FACTOR(16, 1 / 16, 1 / 16)
//TEST_FACTOR(2by3, 2 / 3, 2 / 3)
TEST_FACTOR(3by4, 3 / 4, 3 / 4)
TEST_FACTOR(3by8, 3 / 8, 3 / 8)
TEST_FACTOR(Vertical2by3, 1, 2 / 3)
//TEST_FACTOR(3by8, 3 / 8, 3 / 8)
//TEST_FACTOR(Vertical2by3, 1, 2 / 3)
#undef TEST_FACTOR1
#undef TEST_FACTOR
......@@ -259,11 +257,10 @@ TEST_FACTOR(Vertical2by3, 1, 2 / 3)
// Test scale to a specified size with all 3 filters.
#define TEST_SCALETO(name, width, height) \
TEST_SCALETO1(name, width, height, None, 0) \
TEST_SCALETO1(name, width, height, Bilinear, 2) \
TEST_SCALETO1(name, width, height, Box, 2)
TEST_SCALETO1(name, width, height, Bilinear, 2)
TEST_SCALETO(DISABLED_ARGBScale, 640, 360)
TEST_SCALETO(ARGBScale, 853, 480)
TEST_SCALETO(ARGBScale, 640, 360)
TEST_SCALETO(DISABLED_ARGBScale, 853, 480)
TEST_SCALETO(DISABLED_ARGBScale, 1280, 720)
TEST_SCALETO(DISABLED_ARGBScale, 1280, 800)
TEST_SCALETO(DISABLED_ARGBScale, 1366, 768)
......
......@@ -149,16 +149,15 @@ static int TestFilter(int src_width, int src_height,
TEST_FACTOR1(name, Box, hfactor, vfactor, 2) \
// TODO(fbarchard): ScaleDownBy1 should be lossless, but Box has error of 2.
TEST_FACTOR(1, 1 / 1, 1 / 1)
//TEST_FACTOR(1, 1 / 1, 1 / 1)
TEST_FACTOR(2, 1 / 2, 1 / 2)
TEST_FACTOR(4, 1 / 4, 1 / 4)
TEST_FACTOR(5, 1 / 5, 1 / 5)
TEST_FACTOR(8, 1 / 8, 1 / 8)
TEST_FACTOR(16, 1 / 16, 1 / 16)
TEST_FACTOR(2by3, 2 / 3, 2 / 3)
//TEST_FACTOR(8, 1 / 8, 1 / 8)
//TEST_FACTOR(16, 1 / 16, 1 / 16)
//TEST_FACTOR(2by3, 2 / 3, 2 / 3)
TEST_FACTOR(3by4, 3 / 4, 3 / 4)
TEST_FACTOR(3by8, 3 / 8, 3 / 8)
TEST_FACTOR(Vertical2by3, 1, 2 / 3)
//TEST_FACTOR(3by8, 3 / 8, 3 / 8)
//TEST_FACTOR(Vertical2by3, 1, 2 / 3)
#undef TEST_FACTOR1
#undef TEST_FACTOR
......@@ -179,11 +178,10 @@ TEST_FACTOR(Vertical2by3, 1, 2 / 3)
// Test scale to a specified size with all 3 filters.
#define TEST_SCALETO(name, width, height) \
TEST_SCALETO1(name, width, height, None, 0) \
TEST_SCALETO1(name, width, height, Bilinear, 2) \
TEST_SCALETO1(name, width, height, Box, 2)
TEST_SCALETO(DISABLED_Scale, 640, 360)
TEST_SCALETO(Scale, 853, 480)
TEST_SCALETO(Scale, 640, 360)
TEST_SCALETO(DISABLED_Scale, 853, 480)
TEST_SCALETO(DISABLED_Scale, 1280, 720)
TEST_SCALETO(DISABLED_Scale, 1280, 800)
TEST_SCALETO(DISABLED_Scale, 1366, 768)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment