Added the missing setting of HAVE_FFMPEG to true on Windows.

While the FFmpeg video IO backend gets compiled even without it,
the tests (for both FFmpeg and video IO) don't. This should fix
that.
Decoupled test_ffmpeg.cpp from ffmpeg_codecs.hpp.

(cherry picked from commit 3f3ae33327270de87768a80a339b746441db6fec)
Changed MPEG-2 resolution in the FFmpeg test.

Newer FFmpeg prohibits 4096x4096 MPEG-2, presumably because it violates
the standard.

http://git.videolan.org/gitweb.cgi/ffmpeg.git/?p=ffmpeg.git;a=commit;h=7fb87bc5f24b1be13269109506c05e4c54695b5e

(cherry picked from commit 424a7b0ab0cf7da591f7f15fbd15b2fee8c84a41)

Conflicts:
	modules/highgui/test/test_ffmpeg.cpp
Added stupid hacks to make the video tests pass with FFmpeg 2.0.2.

Need to go back at some point and fix this for real.

(cherry picked from commit dfe07df87ba82216a6ed1b6677f4f525c851ec03)
Fixed indentation in CV_FFmpegWriteBigVideoTest::run.
Rewrite distanceToCenters.
It supports NORM_L1 distance types now and can
use user provided indices.
Also fixed a bug of kmeans where distance pointers should be float instead
 of double.

NORM_L2 changed to NORM_L2SQR, Accuracy and Perf tests are added

added ROI support in accuracy test of distanceToCenters
Another FFmpeg fix from master.

From commit dd74a851, to be exact. Now cap_ffmpeg.cpp should actually
build if HAVE_FFMPEG is true.

Also modified some gpu sources in a similar manner.
fixing typo
fixed tests for ocl::warpAffine and ocl::warpPerspective
ocl: Canny: replace unsafe buffer to oclMat
ocl: Canny: port CUDA-based implementation of edgesHysteresisLocal
Merge pull request #1696 from apavlenko:fix_typo_GpuMaterials
fix bug #1480
Merge pull request #1657 from KonstantinMatskevich:ocldistanceToCenters
fixed ocl::flip
ocl example typo
Merge pull request #1698 from ilya-lavrenov:ocl_warp
Merge pull request #1701 from alalek:ocl_fix_canny
Merge pull request #1703 from bitwangyaoyao:2.4_fix1480
Merge pull request #1705 from ilya-lavrenov:ocl_flip