mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-01-01 03:12:16 +08:00
Test yuv scaler with scale factor of 1
BUG=none TEST=ScaleDownBy1 R=gangji@google.com Review URL: https://webrtc-codereview.appspot.com/1592004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@715 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
parent
449eb230a2
commit
97c9626107
@ -109,8 +109,6 @@ extern "C" {
|
||||
#define HAS_ARGBBLENDROW_SSSE3
|
||||
#define HAS_ARGBCOLORMATRIXROW_SSSE3
|
||||
#define HAS_ARGBGRAYROW_SSSE3
|
||||
#define HAS_INTERPOLATEROW_SSE2
|
||||
#define HAS_INTERPOLATEROW_SSSE3
|
||||
#define HAS_ARGBMIRRORROW_SSSE3
|
||||
#define HAS_ARGBMULTIPLYROW_SSE2
|
||||
#define HAS_ARGBQUANTIZEROW_SSE2
|
||||
@ -120,6 +118,8 @@ extern "C" {
|
||||
#define HAS_ARGBUNATTENUATEROW_SSE2
|
||||
#define HAS_COMPUTECUMULATIVESUMROW_SSE2
|
||||
#define HAS_CUMULATIVESUMTOAVERAGEROW_SSE2
|
||||
#define HAS_INTERPOLATEROW_SSE2
|
||||
#define HAS_INTERPOLATEROW_SSSE3
|
||||
#define HAS_SOBELROW_SSE2
|
||||
#define HAS_SOBELXROW_SSSE3
|
||||
#define HAS_SOBELXYROW_SSE2
|
||||
|
||||
@ -4896,6 +4896,7 @@ void InterpolateRow_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
|
||||
);
|
||||
}
|
||||
|
||||
#ifdef HAS_INTERPOLATEROW_SSE2
|
||||
// Bilinear filter 16x2 -> 16x1
|
||||
void InterpolateRow_SSE2(uint8* dst_ptr, const uint8* src_ptr,
|
||||
ptrdiff_t src_stride, int dst_width,
|
||||
@ -5006,6 +5007,7 @@ void InterpolateRow_SSE2(uint8* dst_ptr, const uint8* src_ptr,
|
||||
#endif
|
||||
);
|
||||
}
|
||||
#endif // HAS_INTERPOLATEROW_SSE2
|
||||
|
||||
// Bilinear filter 16x2 -> 16x1
|
||||
void InterpolateRow_Unaligned_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
|
||||
@ -5110,6 +5112,7 @@ void InterpolateRow_Unaligned_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
|
||||
);
|
||||
}
|
||||
|
||||
#ifdef HAS_INTERPOLATEROW_SSE2
|
||||
// Bilinear filter 16x2 -> 16x1
|
||||
void InterpolateRow_Unaligned_SSE2(uint8* dst_ptr, const uint8* src_ptr,
|
||||
ptrdiff_t src_stride, int dst_width,
|
||||
@ -5220,6 +5223,7 @@ void InterpolateRow_Unaligned_SSE2(uint8* dst_ptr, const uint8* src_ptr,
|
||||
#endif
|
||||
);
|
||||
}
|
||||
#endif // HAS_INTERPOLATEROW_SSE2
|
||||
|
||||
void HalfRow_SSE2(const uint8* src_uv, int src_uv_stride,
|
||||
uint8* dst_uv, int pix) {
|
||||
|
||||
@ -6028,6 +6028,7 @@ void InterpolateRow_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAS_INTERPOLATEROW_SSE2
|
||||
// Bilinear filter 16x2 -> 16x1
|
||||
__declspec(naked) __declspec(align(16))
|
||||
void InterpolateRow_SSE2(uint8* dst_ptr, const uint8* src_ptr,
|
||||
@ -6138,6 +6139,7 @@ void InterpolateRow_SSE2(uint8* dst_ptr, const uint8* src_ptr,
|
||||
ret
|
||||
}
|
||||
}
|
||||
#endif // HAS_INTERPOLATEROW_SSE2
|
||||
|
||||
// Bilinear filter 16x2 -> 16x1
|
||||
__declspec(naked) __declspec(align(16))
|
||||
@ -6244,6 +6246,7 @@ void InterpolateRow_Unaligned_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAS_INTERPOLATEROW_SSE2
|
||||
// Bilinear filter 16x2 -> 16x1
|
||||
__declspec(naked) __declspec(align(16))
|
||||
void InterpolateRow_Unaligned_SSE2(uint8* dst_ptr, const uint8* src_ptr,
|
||||
@ -6354,6 +6357,7 @@ void InterpolateRow_Unaligned_SSE2(uint8* dst_ptr, const uint8* src_ptr,
|
||||
ret
|
||||
}
|
||||
}
|
||||
#endif // HAS_INTERPOLATEROW_SSE2
|
||||
|
||||
__declspec(naked) __declspec(align(16))
|
||||
void HalfRow_SSE2(const uint8* src_uv, int src_uv_stride,
|
||||
|
||||
@ -165,6 +165,45 @@ static int TestFilter(int src_width, int src_height,
|
||||
return max_diff;
|
||||
}
|
||||
|
||||
TEST_F(libyuvTest, ScaleDownBy1_None) {
|
||||
const int src_width = benchmark_width_;
|
||||
const int src_height = benchmark_height_;
|
||||
const int dst_width = Abs(src_width) / 1;
|
||||
const int dst_height = Abs(src_height) / 1;
|
||||
|
||||
int max_diff = TestFilter(src_width, src_height,
|
||||
dst_width, dst_height,
|
||||
kFilterNone,
|
||||
benchmark_iterations_);
|
||||
EXPECT_EQ(0, max_diff);
|
||||
}
|
||||
|
||||
TEST_F(libyuvTest, ScaleDownBy1_Bilinear) {
|
||||
const int src_width = benchmark_width_;
|
||||
const int src_height = benchmark_height_;
|
||||
const int dst_width = Abs(src_width) / 1;
|
||||
const int dst_height = Abs(src_height) / 1;
|
||||
|
||||
int max_diff = TestFilter(src_width, src_height,
|
||||
dst_width, dst_height,
|
||||
kFilterBilinear,
|
||||
benchmark_iterations_);
|
||||
EXPECT_LE(max_diff, 1);
|
||||
}
|
||||
|
||||
TEST_F(libyuvTest, ScaleDownBy1_Box) {
|
||||
const int src_width = benchmark_width_;
|
||||
const int src_height = benchmark_height_;
|
||||
const int dst_width = Abs(src_width) / 1;
|
||||
const int dst_height = Abs(src_height) / 1;
|
||||
|
||||
int max_diff = TestFilter(src_width, src_height,
|
||||
dst_width, dst_height,
|
||||
kFilterBox,
|
||||
benchmark_iterations_);
|
||||
EXPECT_LE(max_diff, 1);
|
||||
}
|
||||
|
||||
TEST_F(libyuvTest, ScaleDownBy2_None) {
|
||||
const int src_width = benchmark_width_;
|
||||
const int src_height = benchmark_height_;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user