mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 22:44:02 +08:00
added test for box filter 16u, fixed bug #2416
This commit is contained in:
parent
280ecb68bf
commit
925d0cc769
@ -556,7 +556,7 @@ template<> struct ColumnSum<int, ushort> : public BaseColumnFilter
|
||||
__m128i _res = _mm_cvtps_epi32(_mm_mul_ps(scale4, _mm_cvtepi32_ps(_s0)));
|
||||
|
||||
_res = _mm_sub_epi32(_res, delta0);
|
||||
_res = _mm_add_epi16(_mm_packs_epi16(_res, _res), delta1);
|
||||
_res = _mm_add_epi16(_mm_packs_epi32(_res, _res), delta1);
|
||||
|
||||
_mm_storel_epi64((__m128i*)(D+i), _res);
|
||||
_mm_storeu_si128((__m128i*)(SUM+i), _mm_sub_epi32(_s0,_sm));
|
||||
@ -586,7 +586,7 @@ template<> struct ColumnSum<int, ushort> : public BaseColumnFilter
|
||||
_mm_loadu_si128((const __m128i*)(Sp+i)));
|
||||
|
||||
__m128i _res = _mm_sub_epi32(_s0, delta0);
|
||||
_res = _mm_add_epi16(_mm_packs_epi16(_res, _res), delta1);
|
||||
_res = _mm_add_epi16(_mm_packs_epi32(_res, _res), delta1);
|
||||
|
||||
_mm_storel_epi64((__m128i*)(D+i), _res);
|
||||
_mm_storeu_si128((__m128i*)(SUM+i), _mm_sub_epi32(_s0,_sm));
|
||||
|
@ -110,6 +110,11 @@ void CV_FilterBaseTest::get_minmax_bounds( int i, int j, int type, Scalar& low,
|
||||
high = Scalar::all(2);
|
||||
}
|
||||
}
|
||||
else if( CV_MAT_DEPTH(type) == CV_16U )
|
||||
{
|
||||
low = Scalar::all(0.);
|
||||
high = Scalar::all(40000.);
|
||||
}
|
||||
else if( CV_MAT_DEPTH(type) == CV_32F )
|
||||
{
|
||||
low = Scalar::all(-10.);
|
||||
@ -678,10 +683,13 @@ void CV_BlurTest::get_test_array_types_and_sizes( int test_case_idx,
|
||||
{
|
||||
RNG& rng = ts->get_rng();
|
||||
CV_SmoothBaseTest::get_test_array_types_and_sizes( test_case_idx, sizes, types );
|
||||
int depth = cvtest::randInt(rng) % 4;
|
||||
int cn = (cvtest::randInt(rng) % 4) + 1;
|
||||
depth = depth == 0 ? CV_8U : depth == 1 ? CV_16U : depth == 2 ? CV_16S : CV_32F;
|
||||
types[OUTPUT][0] = types[REF_OUTPUT][0] = types[INPUT][0] = CV_MAKETYPE(depth, cn);
|
||||
normalize = cvtest::randInt(rng) % 2 != 0;
|
||||
if( !normalize )
|
||||
{
|
||||
int depth = CV_MAT_DEPTH(types[INPUT][0]);
|
||||
types[INPUT][0] = CV_MAKETYPE(depth, 1);
|
||||
types[OUTPUT][0] = types[REF_OUTPUT][0] = CV_MAKETYPE(depth==CV_8U?CV_16S:CV_32F,1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user