cv::VideoWriter destroys an SSE register (Bug #3694)
Description
The following test fails in Windows 7 pro, Visual Studio 2012 Express with x64/Release configuration using the pre-built OpenCV 2.4.9, 2.4.8 and 2.4.5 (x64/vc11).
#include "opencv2/opencv.hpp" void EXPECT_EQ(double a, double b) { if (a != b) { std::cout << "failed" << std::endl; } } int main() { double current_time = 0.0; cv::Mat blank = cv::Mat::zeros(480, 640, CV_8UC3); cv::VideoWriter writer("output.avi", CV_FOURCC('M','J','P','G'), 50.0, blank.size(), true); current_time += 20.0; writer << blank; EXPECT_EQ(20.0, current_time); return 0; }
The variable current_time
is assigned to the xmm7 SEE register, which holds 00000000000000004034000000000000
before executing writer << blank;
, then turns to have 00070007000700070007000700070007
after that. This (seemingly SSE-generated ) value is written by codes in opencv_ffmpeg24x_64.dll.
This behavior is fragile and a small change to the code can make it disappear (See my post at http://answers.opencv.org/question/31357/writing-mjpg-file-by-videowriter-in-visual-studio/).
Although this problem reproduces only when we write MJPG format files as far as I tried the above particular code, very similar behaviors happen for many other video formats with a more complicated code.
Associated revisions
Merge pull request #3694 from Ashod:jp2
History
Updated by Vladislav Vinogradov almost 11 years ago
Shingo Kagami, thanks for your report!
Alxender, could you check this bug?
- Status changed from New to Open
- Assignee set to Alexander Smorkalov
- Target version set to 2.4.10
Updated by Vadim Pisarevsky almost 10 years ago
variable values in debugger in release mode mean nothing.
- Status changed from Open to Cancelled