mirror of
https://github.com/opencv/opencv.git
synced 2025-06-09 18:43:05 +08:00
Merge pull request #19812 from alalek:workaround_19634
This commit is contained in:
commit
6fa2bdd7f2
@ -1167,6 +1167,8 @@ public:
|
|||||||
fdct_qtab(_fdct_qtab),
|
fdct_qtab(_fdct_qtab),
|
||||||
cat_table(_cat_table)
|
cat_table(_cat_table)
|
||||||
{
|
{
|
||||||
|
#if 0 // disable parallel processing due to buffer overrun bug: https://github.com/opencv/opencv/issues/19634
|
||||||
|
|
||||||
//empirically found value. if number of pixels is less than that value there is no sense to parallelize it.
|
//empirically found value. if number of pixels is less than that value there is no sense to parallelize it.
|
||||||
const int min_pixels_count = 96*96;
|
const int min_pixels_count = 96*96;
|
||||||
|
|
||||||
@ -1176,6 +1178,7 @@ public:
|
|||||||
{
|
{
|
||||||
if(height*width > min_pixels_count)
|
if(height*width > min_pixels_count)
|
||||||
{
|
{
|
||||||
|
const int default_stripes_count = 4;
|
||||||
stripes_count = default_stripes_count;
|
stripes_count = default_stripes_count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1191,6 +1194,12 @@ public:
|
|||||||
|
|
||||||
stripes_count = std::min(stripes_count, max_stripes);
|
stripes_count = std::min(stripes_count, max_stripes);
|
||||||
|
|
||||||
|
#else
|
||||||
|
if (nstripes > 1)
|
||||||
|
CV_LOG_ONCE_WARNING(NULL, "VIDEOIO/MJPEG: parallel processing is disabled: https://github.com/opencv/opencv/issues/19634");
|
||||||
|
stripes_count = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
m_buffer_list.allocate_buffers(stripes_count, (height*width*2)/stripes_count);
|
m_buffer_list.allocate_buffers(stripes_count, (height*width*2)/stripes_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1370,11 +1379,8 @@ private:
|
|||||||
const short (&fdct_qtab)[2][64];
|
const short (&fdct_qtab)[2][64];
|
||||||
const uchar* cat_table;
|
const uchar* cat_table;
|
||||||
int stripes_count;
|
int stripes_count;
|
||||||
static const int default_stripes_count;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const int MjpegEncoder::default_stripes_count = 4;
|
|
||||||
|
|
||||||
void MotionJpegWriter::writeFrameData( const uchar* data, int step, int colorspace, int input_channels )
|
void MotionJpegWriter::writeFrameData( const uchar* data, int step, int colorspace, int input_channels )
|
||||||
{
|
{
|
||||||
//double total_cvt = 0, total_dct = 0;
|
//double total_cvt = 0, total_dct = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user