Remove unused brow variable

This commit is contained in:
Letu Ren 2024-06-17 18:50:53 +08:00
parent 24907f35a3
commit b9d2ecb72f

View File

@ -593,10 +593,10 @@ class Bayer2Gray_Invoker :
public ParallelLoopBody public ParallelLoopBody
{ {
public: public:
Bayer2Gray_Invoker(const Mat& _srcmat, Mat& _dstmat, int _start_with_green, bool _brow, Bayer2Gray_Invoker(const Mat& _srcmat, Mat& _dstmat, int _start_with_green,
const Size& _size, int _bcoeff, int _rcoeff) : const Size& _size, int _bcoeff, int _rcoeff) :
ParallelLoopBody(), srcmat(_srcmat), dstmat(_dstmat), Start_with_green(_start_with_green), ParallelLoopBody(), srcmat(_srcmat), dstmat(_dstmat), Start_with_green(_start_with_green),
Brow(_brow), size(_size), Bcoeff(_bcoeff), Rcoeff(_rcoeff) size(_size), Bcoeff(_bcoeff), Rcoeff(_rcoeff)
{ {
} }
@ -612,13 +612,11 @@ public:
int dst_step = (int)(dstmat.step/sizeof(T)); int dst_step = (int)(dstmat.step/sizeof(T));
int bcoeff = Bcoeff, rcoeff = Rcoeff; int bcoeff = Bcoeff, rcoeff = Rcoeff;
int start_with_green = Start_with_green; int start_with_green = Start_with_green;
bool brow = Brow;
dst0 += dst_step + 1; dst0 += dst_step + 1;
if (range.start % 2) if (range.start % 2)
{ {
brow = !brow;
std::swap(bcoeff, rcoeff); std::swap(bcoeff, rcoeff);
start_with_green = !start_with_green; start_with_green = !start_with_green;
} }
@ -680,7 +678,6 @@ public:
dst0[-1] = dst0[0]; dst0[-1] = dst0[0];
dst0[size.width] = dst0[size.width-1]; dst0[size.width] = dst0[size.width-1];
brow = !brow;
std::swap(bcoeff, rcoeff); std::swap(bcoeff, rcoeff);
start_with_green = !start_with_green; start_with_green = !start_with_green;
} }
@ -690,7 +687,6 @@ private:
Mat srcmat; Mat srcmat;
Mat dstmat; Mat dstmat;
int Start_with_green; int Start_with_green;
bool Brow;
Size size; Size size;
int Bcoeff, Rcoeff; int Bcoeff, Rcoeff;
}; };
@ -704,11 +700,9 @@ static void Bayer2Gray_( const Mat& srcmat, Mat& dstmat, int code )
Size size = srcmat.size(); Size size = srcmat.size();
int bcoeff = B2Y, rcoeff = R2Y; int bcoeff = B2Y, rcoeff = R2Y;
int start_with_green = code == COLOR_BayerGB2GRAY || code == COLOR_BayerGR2GRAY; int start_with_green = code == COLOR_BayerGB2GRAY || code == COLOR_BayerGR2GRAY;
bool brow = true;
if( code != COLOR_BayerBG2GRAY && code != COLOR_BayerGB2GRAY ) if( code != COLOR_BayerBG2GRAY && code != COLOR_BayerGB2GRAY )
{ {
brow = false;
std::swap(bcoeff, rcoeff); std::swap(bcoeff, rcoeff);
} }
size.height -= 2; size.height -= 2;
@ -718,7 +712,7 @@ static void Bayer2Gray_( const Mat& srcmat, Mat& dstmat, int code )
{ {
Range range(0, size.height); Range range(0, size.height);
Bayer2Gray_Invoker<T, SIMDInterpolator> invoker(srcmat, dstmat, Bayer2Gray_Invoker<T, SIMDInterpolator> invoker(srcmat, dstmat,
start_with_green, brow, size, bcoeff, rcoeff); start_with_green, size, bcoeff, rcoeff);
parallel_for_(range, invoker, dstmat.total()/static_cast<double>(1<<16)); parallel_for_(range, invoker, dstmat.total()/static_cast<double>(1<<16));
} }