Merge branch '2.4' into master

Commits:
67fe57a add fixed video
db0ae2c Restore 2.4 source branch for bug fix 6317.
97ac59c Fix a memory leak indirectly caused by cvDestroyWindow
eb40afa Add a workaround for FFmpeg's color conversion accessing past the end of the buffer
421fcf9 Rearrange CvVideoWriter_FFMPEG::writeFrame for better readability
912592d Remove "INSTALL_NAME_DIR lib" target property
bb1c2d7 fix bug on border at pyrUp
This commit is contained in:
Alexander Alekhin
2016-04-21 20:10:51 +03:00
10 changed files with 86 additions and 75 deletions

View File

@@ -1010,7 +1010,7 @@ pyrUp_( const Mat& _src, Mat& _dst, int)
for( ; sy <= y + 1; sy++ )
{
WT* row = buf + ((sy - sy0) % PU_SZ)*bufstep;
int _sy = borderInterpolate(sy*2, dsize.height, BORDER_REFLECT_101)/2;
int _sy = borderInterpolate(sy*2, ssize.height*2, BORDER_REFLECT_101)/2;
const T* src = _src.ptr<T>(_sy);
if( ssize.width == cn )
@@ -1031,6 +1031,11 @@ pyrUp_( const Mat& _src, Mat& _dst, int)
t0 = src[sx - cn] + src[sx]*7;
t1 = src[sx]*8;
row[dx] = t0; row[dx + cn] = t1;
if (dsize.width > ssize.width*2)
{
row[(_dst.cols-1) + x] = row[dx + cn];
}
}
for( x = cn; x < ssize.width - cn; x++ )
@@ -1057,6 +1062,17 @@ pyrUp_( const Mat& _src, Mat& _dst, int)
dst1[x] = t1; dst0[x] = t0;
}
}
if (dsize.height > ssize.height*2)
{
T* dst0 = _dst.ptr<T>(ssize.height*2-2);
T* dst2 = _dst.ptr<T>(ssize.height*2);
for(x = 0; x < dsize.width ; x++ )
{
dst2[x] = dst0[x];
}
}
}
typedef void (*PyrFunc)(const Mat&, Mat&, int);