mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Merge remote-tracking branch 'origin/2.4'
Pull requests: #943 from jet47:cuda-5.5-support #944 from jet47:cmake-2.8.11-cuda-fix #912 from SpecLad:contributing #934 from SpecLad:parallel-for #931 from jet47:gpu-test-fixes #932 from bitwangyaoyao:2.4_fixBFM #918 from bitwangyaoyao:2.4_samples #924 from pengx17:2.4_arithm_fix #925 from pengx17:2.4_canny_tmp_fix #927 from bitwangyaoyao:2.4_perf #930 from pengx17:2.4_haar_ext #928 from apavlenko:bugfix_3027 #920 from asmorkalov:android_move #910 from pengx17:2.4_oclgfft #913 from janm399:2.4 #916 from bitwangyaoyao:2.4_fixPyrLK #919 from abidrahmank:2.4 #923 from pengx17:2.4_macfix Conflicts: modules/calib3d/src/stereobm.cpp modules/features2d/src/detectors.cpp modules/gpu/src/error.cpp modules/gpu/src/precomp.hpp modules/imgproc/src/distransform.cpp modules/imgproc/src/morph.cpp modules/ocl/include/opencv2/ocl/ocl.hpp modules/ocl/perf/perf_color.cpp modules/ocl/perf/perf_imgproc.cpp modules/ocl/perf/perf_match_template.cpp modules/ocl/perf/precomp.cpp modules/ocl/perf/precomp.hpp modules/ocl/src/arithm.cpp modules/ocl/src/canny.cpp modules/ocl/src/filtering.cpp modules/ocl/src/haar.cpp modules/ocl/src/hog.cpp modules/ocl/src/imgproc.cpp modules/ocl/src/opencl/haarobjectdetect.cl modules/ocl/src/pyrlk.cpp modules/video/src/bgfg_gaussmix2.cpp modules/video/src/lkpyramid.cpp platforms/linux/scripts/cmake_arm_gnueabi_hardfp.sh platforms/linux/scripts/cmake_arm_gnueabi_softfp.sh platforms/scripts/ABI_compat_generator.py samples/ocl/facedetect.cpp
This commit is contained in:
@@ -1815,7 +1815,7 @@ const int ITUR_BT_601_CGV = -385875;
|
||||
const int ITUR_BT_601_CBV = -74448;
|
||||
|
||||
template<int bIdx, int uIdx>
|
||||
struct YUV420sp2RGB888Invoker
|
||||
struct YUV420sp2RGB888Invoker : ParallelLoopBody
|
||||
{
|
||||
Mat* dst;
|
||||
const uchar* my1, *muv;
|
||||
@@ -1824,10 +1824,10 @@ struct YUV420sp2RGB888Invoker
|
||||
YUV420sp2RGB888Invoker(Mat* _dst, int _stride, const uchar* _y1, const uchar* _uv)
|
||||
: dst(_dst), my1(_y1), muv(_uv), width(_dst->cols), stride(_stride) {}
|
||||
|
||||
void operator()(const BlockedRange& range) const
|
||||
void operator()(const Range& range) const
|
||||
{
|
||||
int rangeBegin = range.begin() * 2;
|
||||
int rangeEnd = range.end() * 2;
|
||||
int rangeBegin = range.start * 2;
|
||||
int rangeEnd = range.end * 2;
|
||||
|
||||
//R = 1.164(Y - 16) + 1.596(V - 128)
|
||||
//G = 1.164(Y - 16) - 0.813(V - 128) - 0.391(U - 128)
|
||||
@@ -1884,7 +1884,7 @@ struct YUV420sp2RGB888Invoker
|
||||
};
|
||||
|
||||
template<int bIdx, int uIdx>
|
||||
struct YUV420sp2RGBA8888Invoker
|
||||
struct YUV420sp2RGBA8888Invoker : ParallelLoopBody
|
||||
{
|
||||
Mat* dst;
|
||||
const uchar* my1, *muv;
|
||||
@@ -1893,10 +1893,10 @@ struct YUV420sp2RGBA8888Invoker
|
||||
YUV420sp2RGBA8888Invoker(Mat* _dst, int _stride, const uchar* _y1, const uchar* _uv)
|
||||
: dst(_dst), my1(_y1), muv(_uv), width(_dst->cols), stride(_stride) {}
|
||||
|
||||
void operator()(const BlockedRange& range) const
|
||||
void operator()(const Range& range) const
|
||||
{
|
||||
int rangeBegin = range.begin() * 2;
|
||||
int rangeEnd = range.end() * 2;
|
||||
int rangeBegin = range.start * 2;
|
||||
int rangeEnd = range.end * 2;
|
||||
|
||||
//R = 1.164(Y - 16) + 1.596(V - 128)
|
||||
//G = 1.164(Y - 16) - 0.813(V - 128) - 0.391(U - 128)
|
||||
@@ -1957,7 +1957,7 @@ struct YUV420sp2RGBA8888Invoker
|
||||
};
|
||||
|
||||
template<int bIdx>
|
||||
struct YUV420p2RGB888Invoker
|
||||
struct YUV420p2RGB888Invoker : ParallelLoopBody
|
||||
{
|
||||
Mat* dst;
|
||||
const uchar* my1, *mu, *mv;
|
||||
@@ -1967,19 +1967,19 @@ struct YUV420p2RGB888Invoker
|
||||
YUV420p2RGB888Invoker(Mat* _dst, int _stride, const uchar* _y1, const uchar* _u, const uchar* _v, int _ustepIdx, int _vstepIdx)
|
||||
: dst(_dst), my1(_y1), mu(_u), mv(_v), width(_dst->cols), stride(_stride), ustepIdx(_ustepIdx), vstepIdx(_vstepIdx) {}
|
||||
|
||||
void operator()(const BlockedRange& range) const
|
||||
void operator()(const Range& range) const
|
||||
{
|
||||
const int rangeBegin = range.begin() * 2;
|
||||
const int rangeEnd = range.end() * 2;
|
||||
const int rangeBegin = range.start * 2;
|
||||
const int rangeEnd = range.end * 2;
|
||||
|
||||
size_t uvsteps[2] = {width/2, stride - width/2};
|
||||
int usIdx = ustepIdx, vsIdx = vstepIdx;
|
||||
|
||||
const uchar* y1 = my1 + rangeBegin * stride;
|
||||
const uchar* u1 = mu + (range.begin() / 2) * stride;
|
||||
const uchar* v1 = mv + (range.begin() / 2) * stride;
|
||||
const uchar* u1 = mu + (range.start / 2) * stride;
|
||||
const uchar* v1 = mv + (range.start / 2) * stride;
|
||||
|
||||
if(range.begin() % 2 == 1)
|
||||
if(range.start % 2 == 1)
|
||||
{
|
||||
u1 += uvsteps[(usIdx++) & 1];
|
||||
v1 += uvsteps[(vsIdx++) & 1];
|
||||
@@ -2025,7 +2025,7 @@ struct YUV420p2RGB888Invoker
|
||||
};
|
||||
|
||||
template<int bIdx>
|
||||
struct YUV420p2RGBA8888Invoker
|
||||
struct YUV420p2RGBA8888Invoker : ParallelLoopBody
|
||||
{
|
||||
Mat* dst;
|
||||
const uchar* my1, *mu, *mv;
|
||||
@@ -2035,19 +2035,19 @@ struct YUV420p2RGBA8888Invoker
|
||||
YUV420p2RGBA8888Invoker(Mat* _dst, int _stride, const uchar* _y1, const uchar* _u, const uchar* _v, int _ustepIdx, int _vstepIdx)
|
||||
: dst(_dst), my1(_y1), mu(_u), mv(_v), width(_dst->cols), stride(_stride), ustepIdx(_ustepIdx), vstepIdx(_vstepIdx) {}
|
||||
|
||||
void operator()(const BlockedRange& range) const
|
||||
void operator()(const Range& range) const
|
||||
{
|
||||
int rangeBegin = range.begin() * 2;
|
||||
int rangeEnd = range.end() * 2;
|
||||
int rangeBegin = range.start * 2;
|
||||
int rangeEnd = range.end * 2;
|
||||
|
||||
size_t uvsteps[2] = {width/2, stride - width/2};
|
||||
int usIdx = ustepIdx, vsIdx = vstepIdx;
|
||||
|
||||
const uchar* y1 = my1 + rangeBegin * stride;
|
||||
const uchar* u1 = mu + (range.begin() / 2) * stride;
|
||||
const uchar* v1 = mv + (range.begin() / 2) * stride;
|
||||
const uchar* u1 = mu + (range.start / 2) * stride;
|
||||
const uchar* v1 = mv + (range.start / 2) * stride;
|
||||
|
||||
if(range.begin() % 2 == 1)
|
||||
if(range.start % 2 == 1)
|
||||
{
|
||||
u1 += uvsteps[(usIdx++) & 1];
|
||||
v1 += uvsteps[(vsIdx++) & 1];
|
||||
@@ -2102,48 +2102,40 @@ template<int bIdx, int uIdx>
|
||||
inline void cvtYUV420sp2RGB(Mat& _dst, int _stride, const uchar* _y1, const uchar* _uv)
|
||||
{
|
||||
YUV420sp2RGB888Invoker<bIdx, uIdx> converter(&_dst, _stride, _y1, _uv);
|
||||
#ifdef HAVE_TBB
|
||||
if (_dst.total() >= MIN_SIZE_FOR_PARALLEL_YUV420_CONVERSION)
|
||||
parallel_for(BlockedRange(0, _dst.rows/2), converter);
|
||||
parallel_for_(Range(0, _dst.rows/2), converter);
|
||||
else
|
||||
#endif
|
||||
converter(BlockedRange(0, _dst.rows/2));
|
||||
converter(Range(0, _dst.rows/2));
|
||||
}
|
||||
|
||||
template<int bIdx, int uIdx>
|
||||
inline void cvtYUV420sp2RGBA(Mat& _dst, int _stride, const uchar* _y1, const uchar* _uv)
|
||||
{
|
||||
YUV420sp2RGBA8888Invoker<bIdx, uIdx> converter(&_dst, _stride, _y1, _uv);
|
||||
#ifdef HAVE_TBB
|
||||
if (_dst.total() >= MIN_SIZE_FOR_PARALLEL_YUV420_CONVERSION)
|
||||
parallel_for(BlockedRange(0, _dst.rows/2), converter);
|
||||
parallel_for_(Range(0, _dst.rows/2), converter);
|
||||
else
|
||||
#endif
|
||||
converter(BlockedRange(0, _dst.rows/2));
|
||||
converter(Range(0, _dst.rows/2));
|
||||
}
|
||||
|
||||
template<int bIdx>
|
||||
inline void cvtYUV420p2RGB(Mat& _dst, int _stride, const uchar* _y1, const uchar* _u, const uchar* _v, int ustepIdx, int vstepIdx)
|
||||
{
|
||||
YUV420p2RGB888Invoker<bIdx> converter(&_dst, _stride, _y1, _u, _v, ustepIdx, vstepIdx);
|
||||
#ifdef HAVE_TBB
|
||||
if (_dst.total() >= MIN_SIZE_FOR_PARALLEL_YUV420_CONVERSION)
|
||||
parallel_for(BlockedRange(0, _dst.rows/2), converter);
|
||||
parallel_for_(Range(0, _dst.rows/2), converter);
|
||||
else
|
||||
#endif
|
||||
converter(BlockedRange(0, _dst.rows/2));
|
||||
converter(Range(0, _dst.rows/2));
|
||||
}
|
||||
|
||||
template<int bIdx>
|
||||
inline void cvtYUV420p2RGBA(Mat& _dst, int _stride, const uchar* _y1, const uchar* _u, const uchar* _v, int ustepIdx, int vstepIdx)
|
||||
{
|
||||
YUV420p2RGBA8888Invoker<bIdx> converter(&_dst, _stride, _y1, _u, _v, ustepIdx, vstepIdx);
|
||||
#ifdef HAVE_TBB
|
||||
if (_dst.total() >= MIN_SIZE_FOR_PARALLEL_YUV420_CONVERSION)
|
||||
parallel_for(BlockedRange(0, _dst.rows/2), converter);
|
||||
parallel_for_(Range(0, _dst.rows/2), converter);
|
||||
else
|
||||
#endif
|
||||
converter(BlockedRange(0, _dst.rows/2));
|
||||
converter(Range(0, _dst.rows/2));
|
||||
}
|
||||
|
||||
///////////////////////////////////// RGB -> YUV420p /////////////////////////////////////
|
||||
@@ -2227,7 +2219,7 @@ static void cvtRGBtoYUV420p(const Mat& src, Mat& dst)
|
||||
///////////////////////////////////// YUV422 -> RGB /////////////////////////////////////
|
||||
|
||||
template<int bIdx, int uIdx, int yIdx>
|
||||
struct YUV422toRGB888Invoker
|
||||
struct YUV422toRGB888Invoker : ParallelLoopBody
|
||||
{
|
||||
Mat* dst;
|
||||
const uchar* src;
|
||||
@@ -2236,10 +2228,10 @@ struct YUV422toRGB888Invoker
|
||||
YUV422toRGB888Invoker(Mat* _dst, int _stride, const uchar* _yuv)
|
||||
: dst(_dst), src(_yuv), width(_dst->cols), stride(_stride) {}
|
||||
|
||||
void operator()(const BlockedRange& range) const
|
||||
void operator()(const Range& range) const
|
||||
{
|
||||
int rangeBegin = range.begin();
|
||||
int rangeEnd = range.end();
|
||||
int rangeBegin = range.start;
|
||||
int rangeEnd = range.end;
|
||||
|
||||
const int uidx = 1 - yIdx + uIdx * 2;
|
||||
const int vidx = (2 + uidx) % 4;
|
||||
@@ -2273,7 +2265,7 @@ struct YUV422toRGB888Invoker
|
||||
};
|
||||
|
||||
template<int bIdx, int uIdx, int yIdx>
|
||||
struct YUV422toRGBA8888Invoker
|
||||
struct YUV422toRGBA8888Invoker : ParallelLoopBody
|
||||
{
|
||||
Mat* dst;
|
||||
const uchar* src;
|
||||
@@ -2282,10 +2274,10 @@ struct YUV422toRGBA8888Invoker
|
||||
YUV422toRGBA8888Invoker(Mat* _dst, int _stride, const uchar* _yuv)
|
||||
: dst(_dst), src(_yuv), width(_dst->cols), stride(_stride) {}
|
||||
|
||||
void operator()(const BlockedRange& range) const
|
||||
void operator()(const Range& range) const
|
||||
{
|
||||
int rangeBegin = range.begin();
|
||||
int rangeEnd = range.end();
|
||||
int rangeBegin = range.start;
|
||||
int rangeEnd = range.end;
|
||||
|
||||
const int uidx = 1 - yIdx + uIdx * 2;
|
||||
const int vidx = (2 + uidx) % 4;
|
||||
@@ -2326,24 +2318,20 @@ template<int bIdx, int uIdx, int yIdx>
|
||||
inline void cvtYUV422toRGB(Mat& _dst, int _stride, const uchar* _yuv)
|
||||
{
|
||||
YUV422toRGB888Invoker<bIdx, uIdx, yIdx> converter(&_dst, _stride, _yuv);
|
||||
#ifdef HAVE_TBB
|
||||
if (_dst.total() >= MIN_SIZE_FOR_PARALLEL_YUV422_CONVERSION)
|
||||
parallel_for(BlockedRange(0, _dst.rows), converter);
|
||||
parallel_for_(Range(0, _dst.rows), converter);
|
||||
else
|
||||
#endif
|
||||
converter(BlockedRange(0, _dst.rows));
|
||||
converter(Range(0, _dst.rows));
|
||||
}
|
||||
|
||||
template<int bIdx, int uIdx, int yIdx>
|
||||
inline void cvtYUV422toRGBA(Mat& _dst, int _stride, const uchar* _yuv)
|
||||
{
|
||||
YUV422toRGBA8888Invoker<bIdx, uIdx, yIdx> converter(&_dst, _stride, _yuv);
|
||||
#ifdef HAVE_TBB
|
||||
if (_dst.total() >= MIN_SIZE_FOR_PARALLEL_YUV422_CONVERSION)
|
||||
parallel_for(BlockedRange(0, _dst.rows), converter);
|
||||
parallel_for_(Range(0, _dst.rows), converter);
|
||||
else
|
||||
#endif
|
||||
converter(BlockedRange(0, _dst.rows));
|
||||
converter(Range(0, _dst.rows));
|
||||
}
|
||||
|
||||
/////////////////////////// RGBA <-> mRGBA (alpha premultiplied) //////////////
|
||||
|
||||
Reference in New Issue
Block a user