mirror of
https://github.com/opencv/opencv.git
synced 2025-06-17 15:20:51 +08:00

hal_rvv: further optimized flip #27257 Checklist: - [x] flipX - [x] flipY - [x] flipXY ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
46 lines
1.3 KiB
C++
46 lines
1.3 KiB
C++
// This file is part of OpenCV project.
|
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
|
// of this distribution and at http://opencv.org/license.html.
|
|
|
|
#include "perf_precomp.hpp"
|
|
|
|
namespace opencv_test { namespace {
|
|
using namespace perf;
|
|
|
|
enum
|
|
{
|
|
FLIP_XY = 0,
|
|
FLIP_X = 1,
|
|
FLIP_Y = 2,
|
|
};
|
|
|
|
#define FLIP_SIZES szQVGA, szVGA, sz1080p
|
|
#define FLIP_TYPES CV_8UC1, CV_8UC2, CV_8UC3, CV_8UC4, CV_8SC1, CV_16SC1, CV_16SC2, CV_16SC3, CV_16SC4, CV_32SC1, CV_32FC1
|
|
#define FLIP_CODES FLIP_X, FLIP_Y, FLIP_XY
|
|
|
|
CV_FLAGS(FlipCode, FLIP_X, FLIP_Y, FLIP_XY);
|
|
typedef tuple<Size, MatType, FlipCode> Size_MatType_FlipCode_t;
|
|
typedef perf::TestBaseWithParam<Size_MatType_FlipCode_t> Size_MatType_FlipCode;
|
|
|
|
PERF_TEST_P(Size_MatType_FlipCode,
|
|
flip,
|
|
testing::Combine(testing::Values(FLIP_SIZES),
|
|
testing::Values(FLIP_TYPES),
|
|
testing::Values(FLIP_CODES)))
|
|
{
|
|
Size sz = get<0>(GetParam());
|
|
int matType = get<1>(GetParam());
|
|
int flipCode = get<2>(GetParam()) - 1;
|
|
|
|
Mat src(sz, matType);
|
|
Mat dst(sz, matType);
|
|
|
|
declare.in(src, WARMUP_RNG).out(dst);
|
|
|
|
TEST_CYCLE() cv::flip(src, dst, flipCode);
|
|
|
|
SANITY_CHECK_NOTHING();
|
|
}
|
|
|
|
}} // namespace opencv_test
|