nareshmlx/opencv-pr huggingface dataset:
**File:** modules/core/include/opencv2/core/softfloat.hpp
**Change Type:** added
**Context:** PR #8668: SoftFloat integrated - ### This PR changes [SoftFloat](http://www.jhauser.us/arithmetic/SoftFloat.html) is a software implementation of floa...

**Code Changes:**
```diff
@@ -0,0 +1,271 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
same comments as for softfloat32_t
**File:** modules/core/include/opencv2/core/softfloat.hpp
**Change Type:** added
**Context:** PR #8668: SoftFloat integrated - ### This PR changes [SoftFloat](http://www.jhauser.us/arithmetic/SoftFloat.html) is a software implementation of floa...

**Code Changes:**
```diff
@@ -0,0 +1,271 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
this is C++ with overloaded functions; use `muladd` and `sqrt`, do not use f32/f64 prefixes
**File:** modules/core/include/opencv2/core/softfloat.hpp
**Change Type:** added
**Context:** PR #8668: SoftFloat integrated - ### This PR changes [SoftFloat](http://www.jhauser.us/arithmetic/SoftFloat.html) is a software implementation of floa...

**Code Changes:**
```diff
@@ -0,0 +1,271 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
do not use f32/f64 prefixes
**File:** modules/core/include/opencv2/core/softfloat.hpp
**Change Type:** added
**Context:** PR #8668: SoftFloat integrated - ### This PR changes [SoftFloat](http://www.jhauser.us/arithmetic/SoftFloat.html) is a software implementation of floa...

**Code Changes:**
```diff
@@ -0,0 +1,271 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
`operator int() const` and `operator float() const` create ambiguity when casting to int, which is needed, for example, for GTEST checks. The problem could be solved with explicit casts but they are not allowed until C++11. That is why there will be no `operator int() const`. There will be separate `trunc()` function outside the classes.
**File:** modules/core/include/opencv2/core/softfloat.hpp
**Change Type:** added
**Context:** PR #8668: SoftFloat integrated - ### This PR changes [SoftFloat](http://www.jhauser.us/arithmetic/SoftFloat.html) is a software implementation of floa...

**Code Changes:**
```diff
@@ -0,0 +1,271 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Now round_near_even is used by in round() function and round_minMag which is supposed to be faster is used in trunc() function.
**File:** modules/core/include/opencv2/core/softfloat.hpp
**Change Type:** added
**Context:** PR #8668: SoftFloat integrated - ### This PR changes [SoftFloat](http://www.jhauser.us/arithmetic/SoftFloat.html) is a software implementation of floa...
**Review Line:** 111

**Code Changes:**
```diff
+    explicit softfloat( const int32_t );
+    explicit softfloat( const int64_t );
+    explicit softfloat( const float a ) { Cv32suf s; s.f = a; v = s.u; }
+
+    operator softdouble() const;
+    operator float() const { Cv32suf s; s.u = v; return s.f; }
+
+    softfloat operator + (const softfloat&) const;
+    softfloat operator - (const softfloat&) const;
+    softfloat operator * (const softfloat&) const;
+    softfloat operator / (const softfloat&) const;
```

Review comment:
operator int() is missing
**File:** modules/core/include/opencv2/core/softfloat.hpp
**Change Type:** added
**Context:** PR #8668: SoftFloat integrated - ### This PR changes [SoftFloat](http://www.jhauser.us/arithmetic/SoftFloat.html) is a software implementation of floa...

**Code Changes:**
```diff
@@ -0,0 +1,271 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
round and trunc should return int, not int_fast64_t. instead of trunc(), implement "operator int() const" inside the classes. floor() and ceil() would be also useful
**File:** modules/ts/include/opencv2/ts/ts_gtest.h
**Change Type:** modified
**Context:** PR #8668: SoftFloat integrated - ### This PR changes [SoftFloat](http://www.jhauser.us/arithmetic/SoftFloat.html) is a software implementation of floa...
**Review Line:** 10340

**Code Changes:**
```diff
   // given that it has no user-defined printer.
   static void PrintValue(const T& value, ::std::ostream* os) {
+    // MSVC warns about implicitly converting from double and float to int for
+    // possible loss of data, so we need to temporarily disable the
+    // warning.
+    GTEST_DISABLE_MSC_WARNINGS_PUSH_(4244)
     const internal::BiggestInt kBigInt = value;
+    GTEST_DISABLE_MSC_WARNINGS_POP_()
     *os << kBigInt;
   }
 };
```

Review comment:
This should be reverted. Implicit conversions in tests should be avoided. Use explicit conversions instead like other tests.
**File:** modules/core/include/opencv2/core/softfloat.hpp
**Change Type:** added
**Context:** PR #8668: SoftFloat integrated - ### This PR changes [SoftFloat](http://www.jhauser.us/arithmetic/SoftFloat.html) is a software implementation of floa...
**Review Line:** 43

**Code Changes:**
```diff
+// loss of use, data, or profits; or business interruption) however caused
+// and on any theory of liability, whether in contract, strict liability,
+// or tort (including negligence or otherwise) arising in any way out of
+// the use of this software, even if advised of the possibility of such damage.
+//
+//M*/
+
+/*============================================================================
+
+This C header file is part of the SoftFloat IEEE Floating-Point Arithmetic
+Package, Release 3c, by John R. Hauser.
```

Review comment:
Please avoid using of legacy OpenCV license headers. Original file license (below) should be placed unchanged. Example: ``` // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html // This file is based on files from package issued with the following license: ... original license ... ```
**File:** modules/core/include/opencv2/core/hal/intrin_sse.hpp
**Change Type:** modified
**Context:** PR #8907: added v_reduce_sum4() universal intrinsic; corrected the number of threads on Mac - this is helper PR for the corresponding PR in opencv_con...
**Review Line:** 1134

**Code Changes:**
```diff
+inline v_float32x4 v_reduce_sum4(const v_float32x4& a, const v_float32x4& b,
+                                 const v_float32x4& c, const v_float32x4& d)
+{
+    __m128 ab = _mm_hadd_ps(a.val, b.val);
+    __m128 cd = _mm_hadd_ps(c.val, d.val);
+    return v_float32x4(_mm_hadd_ps(ab, cd));
+}
+
 OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_uint32x4, unsigned, max, std::max)
 OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_uint32x4, unsigned, min, std::min)
 OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_int32x4, int, max, std::max)
```

Review comment:
These instructions are from [SSE3](https://msdn.microsoft.com/en-us/library/yd9wecaa(v=vs.120).aspx), so they should be guarded properly. Linux32 build (no SSE3 by default) is broken. Android SDK is broken too.
**File:** modules/java/generator/gen_java.py
**Change Type:** modified
**Context:** PR #8598: java: allow to wrap functions which take cv::Ptr - This PR enables wrapping of functions with prototypes like `dummy(cv::Ptr<cv::Algorithm>)...

**Code Changes:**
```diff
@@ -649,6 +649,7 @@ def libVersionBlock():
     protected final long nativeObj;
     protected $jname(long addr) { nativeObj = addr; }
 
+    public long getNativeObjAddr() { return nativeObj; }
 """
 
 T_JAVA_START_MODULE = """
@@ -1004,7 +1005,7 @@ def add_class(self, decl):
             classinfo.addImports(classinfo.base)
```

Review comment:
OpenCV already uses [getNativeObjAddr()](https://github.com/opencv/opencv/blob/c757d2863efb71035468de49c83a4ec22203cf8e/modules/core/misc/java/src/java/core%2BMat.java#L1094-L1096).
**File:** modules/java/generator/gen_java.py
**Change Type:** modified
**Context:** PR #8598: java: allow to wrap functions which take cv::Ptr - This PR enables wrapping of functions with prototypes like `dummy(cv::Ptr<cv::Algorithm>)...

**Code Changes:**
```diff
@@ -649,6 +649,7 @@ def libVersionBlock():
     protected final long nativeObj;
     protected $jname(long addr) { nativeObj = addr; }
 
+    public long getNativeObjAddr() { return nativeObj; }
 """
 
 T_JAVA_START_MODULE = """
@@ -1004,7 +1005,7 @@ def add_class(self, decl):
             classinfo.addImports(classinfo.base)
```

Review comment:
But it's for Mat only.
**File:** 3rdparty/ffmpeg/ffmpeg.cmake
**Change Type:** modified
**Context:** PR #8421: Modified cmake file download process - Coupled with opencv/opencv_contrib#1073 and opencv/opencv_extra#327 ### This pullrequest changes Upda...
**Review Line:** 6

**Code Changes:**
```diff
+  set(${script_var} "" PARENT_SCOPE)
 
-set(FFMPEG_DOWNLOAD_URL ${OPENCV_FFMPEG_URL};$ENV{OPENCV_FFMPEG_URL};https://raw.githubusercontent.com/opencv/opencv_3rdparty/${FFMPEG_BINARIES_COMMIT}/ffmpeg/)
+  set(ids BIN32 BIN64 CMAKE)
+  set(name_BIN32 "opencv_ffmpeg.dll")
+  set(name_BIN64 "opencv_ffmpeg_64.dll")
+  set(name_CMAKE "ffmpeg_version.cmake")
 
-ocv_download(PACKAGE opencv_ffmpeg.dll
-             HASH ${FFMPEG_FILE_HASH_BIN32}
-             URL ${FFMPEG_DOWNLOAD_URL}
```

Review comment:
Please don't touch these variables and their names. These strings are just copy-paste lines from the [update script](https://github.com/opencv/opencv_3rdparty/blob/ffmpeg/master_20161202/build_update.sh#L60-L65).
**File:** .gitignore
**Change Type:** modified
**Context:** PR #8421: Modified cmake file download process - Coupled with opencv/opencv_contrib#1073 and opencv/opencv_extra#327 ### This pullrequest changes Upda...
**Review Line:** 6

**Code Changes:**
```diff
@@ -3,6 +3,7 @@
 *.user
 *~
 .*.swp
+.cache
 .DS_Store
 .sw[a-z]
 Thumbs.db
```

Review comment:
We need PR with the same change into 2.4 branch too. Or we can add CMake code for creation of `.cache/.gitignore` with `*` content. So this line will not be needed at all in both branches. [Example](https://github.com/opencv/opencv_contrib/blob/3.2.0/modules/dnn/cmake/download_protobuf.cmake#L22)
**File:** 3rdparty/ffmpeg/ffmpeg.cmake
**Change Type:** modified
**Context:** PR #8421: Modified cmake file download process - Coupled with opencv/opencv_contrib#1073 and opencv/opencv_extra#327 ### This pullrequest changes Upda...

**Code Changes:**
```diff
@@ -1,25 +1,37 @@
-# Binary branch name: ffmpeg/master_20161202
-# Binaries were created for OpenCV: 594c136d1fcbb5816c57516e50f9cbeffbd90835
-set(FFMPEG_BINARIES_COMMIT "2a19d0006415955c79431116e4634f04d5eb5a74")
-set(FFMPEG_FILE_HASH_BIN32 "f081abd9d6ca7e425d340ce586f9c090")
-set(FFMPEG_FILE_HASH_BIN64 "a423363a6eb76d362ca6c406c96c8db6")
-set(FFMPEG_FILE_HASH_CMAKE "5346ae1854fc7aa569a722e85af480ec")
+function(download_win_ffmpeg script_var)
+  set(${script_var} "" PARENT_SCOPE)
 
```

Review comment:
Why did you drop URL override feature? It is used for local testing of non published binaries.
**File:** 3rdparty/ffmpeg/ffmpeg.cmake
**Change Type:** modified
**Context:** PR #8421: Modified cmake file download process - Coupled with opencv/opencv_contrib#1073 and opencv/opencv_extra#327 ### This pullrequest changes Upda...

**Code Changes:**
```diff
@@ -1,25 +1,37 @@
-# Binary branch name: ffmpeg/master_20161202
-# Binaries were created for OpenCV: 594c136d1fcbb5816c57516e50f9cbeffbd90835
-set(FFMPEG_BINARIES_COMMIT "2a19d0006415955c79431116e4634f04d5eb5a74")
-set(FFMPEG_FILE_HASH_BIN32 "f081abd9d6ca7e425d340ce586f9c090")
-set(FFMPEG_FILE_HASH_BIN64 "a423363a6eb76d362ca6c406c96c8db6")
-set(FFMPEG_FILE_HASH_CMAKE "5346ae1854fc7aa569a722e85af480ec")
+function(download_win_ffmpeg script_var)
+  set(${script_var} "" PARENT_SCOPE)
 
```

Review comment:
`status script` -> `status_var script_var`?
**File:** 3rdparty/ippicv/ippicv.cmake
**Change Type:** added
**Context:** PR #8421: Modified cmake file download process - Coupled with opencv/opencv_contrib#1073 and opencv/opencv_extra#327 ### This pullrequest changes Upda...

**Code Changes:**
```diff
@@ -0,0 +1,40 @@
+function(download_ippicv root_var)
+  set(${root_var} "" PARENT_SCOPE)
+
+  # Commit SHA in the opencv_3rdparty repo
+  set(IPPICV_COMMIT "81a676001ca8075ada498583e4166079e5744668")
+  # Define actual ICV versions
+  if(APPLE)
+    set(OPENCV_ICV_NAME "ippicv_macosx_20151201.tgz")
+    set(OPENCV_ICV_HASH "4ff1fde9a7cfdfe7250bfcd8334e0f2f")
```

Review comment:
The same note about URL override feature.
**File:** cmake/OpenCVDownload.cmake
**Change Type:** added
**Context:** PR #8421: Modified cmake file download process - Coupled with opencv/opencv_contrib#1073 and opencv/opencv_extra#327 ### This pullrequest changes Upda...

**Code Changes:**
```diff
@@ -0,0 +1,133 @@
+#
+#  Download and optionally unpack a file
+#
+#  ocv_download(FILENAME p HASH h URL u1 [u2 ...] DESTINATION_DIR d [STATUS s] [UNPACK] [RELATIVE])
+#    FILENAME - filename
+#    HASH - MD5 hash
+#    URL - full download url (first nonempty value will be chosen)
+#    DESTINATION_DIR - file will be copied to this directory
+#    STATUS - passed variable will be updated in parent scope,
```

Review comment:
Do we need these 3 lines?
**File:** cmake/OpenCVDownload.cmake
**Change Type:** added
**Context:** PR #8421: Modified cmake file download process - Coupled with opencv/opencv_contrib#1073 and opencv/opencv_extra#327 ### This pullrequest changes Upda...

**Code Changes:**
```diff
@@ -0,0 +1,133 @@
+#
+#  Download and optionally unpack a file
+#
+#  ocv_download(FILENAME p HASH h URL u1 [u2 ...] DESTINATION_DIR d [STATUS s] [UNPACK] [RELATIVE])
+#    FILENAME - filename
+#    HASH - MD5 hash
+#    URL - full download url (first nonempty value will be chosen)
+#    DESTINATION_DIR - file will be copied to this directory
+#    STATUS - passed variable will be updated in parent scope,
```

Review comment:
`CMakeDownloadLog.txt` -> `CMakeDownload.log`?
**File:** cmake/OpenCVDownload.cmake
**Change Type:** added
**Context:** PR #8421: Modified cmake file download process - Coupled with opencv/opencv_contrib#1073 and opencv/opencv_extra#327 ### This pullrequest changes Upda...

**Code Changes:**
```diff
@@ -0,0 +1,133 @@
+#
+#  Download and optionally unpack a file
+#
+#  ocv_download(FILENAME p HASH h URL u1 [u2 ...] DESTINATION_DIR d [STATUS s] [UNPACK] [RELATIVE])
+#    FILENAME - filename
+#    HASH - MD5 hash
+#    URL - full download url (first nonempty value will be chosen)
+#    DESTINATION_DIR - file will be copied to this directory
+#    STATUS - passed variable will be updated in parent scope,
```

Review comment:
OPENCV_DOWNLOAD_DIR -> OPENCV_DOWNLOAD_PATH? "Cache directory for downloaded files"?
**File:** cmake/OpenCVDownload.cmake
**Change Type:** added
**Context:** PR #8421: Modified cmake file download process - Coupled with opencv/opencv_contrib#1073 and opencv/opencv_extra#327 ### This pullrequest changes Upda...

**Code Changes:**
```diff
@@ -0,0 +1,133 @@
+#
+#  Download and optionally unpack a file
+#
+#  ocv_download(FILENAME p HASH h URL u1 [u2 ...] DESTINATION_DIR d [STATUS s] [UNPACK] [RELATIVE])
+#    FILENAME - filename
+#    HASH - MD5 hash
+#    URL - full download url (first nonempty value will be chosen)
+#    DESTINATION_DIR - file will be copied to this directory
+#    STATUS - passed variable will be updated in parent scope,
```

Review comment:
WRITE -> APPEND It is better to preserve download history from previous runs.
**File:** cmake/OpenCVDownload.cmake
**Change Type:** added
**Context:** PR #8421: Modified cmake file download process - Coupled with opencv/opencv_contrib#1073 and opencv/opencv_extra#327 ### This pullrequest changes Upda...

**Code Changes:**
```diff
@@ -0,0 +1,133 @@
+#
+#  Download and optionally unpack a file
+#
+#  ocv_download(FILENAME p HASH h URL u1 [u2 ...] DESTINATION_DIR d [STATUS s] [UNPACK] [RELATIVE])
+#    FILENAME - filename
+#    HASH - MD5 hash
+#    URL - full download url (first nonempty value will be chosen)
+#    DESTINATION_DIR - file will be copied to this directory
+#    STATUS - passed variable will be updated in parent scope,
```

Review comment:
IMHO, it is too verbose. All details are available in the log file.
**File:** cmake/OpenCVDownload.cmake
**Change Type:** added
**Context:** PR #8421: Modified cmake file download process - Coupled with opencv/opencv_contrib#1073 and opencv/opencv_extra#327 ### This pullrequest changes Upda...

**Code Changes:**
```diff
@@ -0,0 +1,133 @@
+#
+#  Download and optionally unpack a file
+#
+#  ocv_download(FILENAME p HASH h URL u1 [u2 ...] DESTINATION_DIR d [STATUS s] [UNPACK] [RELATIVE])
+#    FILENAME - filename
+#    HASH - MD5 hash
+#    URL - full download url (first nonempty value will be chosen)
+#    DESTINATION_DIR - file will be copied to this directory
+#    STATUS - passed variable will be updated in parent scope,
```

Review comment:
Probably this is default mode and widely used mode for almost all downloads. I believe this flag can be eliminated.
**File:** cmake/OpenCVDownload.cmake
**Change Type:** added
**Context:** PR #8421: Modified cmake file download process - Coupled with opencv/opencv_contrib#1073 and opencv/opencv_extra#327 ### This pullrequest changes Upda...
**Review Line:** 65

**Code Changes:**
```diff
+
+  # Copy mode: check if copy destination exists and is correct
+  if(NOT DL_UNPACK)
+    set(COPY_DESTINATION "${DL_DESTINATION_DIR}/${DL_FILENAME}")
+    if(EXISTS "${COPY_DESTINATION}")
+      file(MD5 "${COPY_DESTINATION}" target_md5)
+      if(target_md5 STREQUAL DL_HASH)
+        return()
+      endif()
+    endif()
+  endif()
```

Review comment:
This check can be improved (to prevent unnecessary file reads or unpacks), via CMake cache variables (like `${DL_STATUS}_CURRENT_HASH`). Should work fine for target files under CMAKE_BINARY_DIR (but it doesn't work good for target files in source directories).
**File:** cmake/OpenCVDownload.cmake
**Change Type:** added
**Context:** PR #8421: Modified cmake file download process - Coupled with opencv/opencv_contrib#1073 and opencv/opencv_extra#327 ### This pullrequest changes Upda...

**Code Changes:**
```diff
@@ -0,0 +1,133 @@
+#
+#  Download and optionally unpack a file
+#
+#  ocv_download(FILENAME p HASH h URL u1 [u2 ...] DESTINATION_DIR d [STATUS s] [UNPACK] [RELATIVE])
+#    FILENAME - filename
+#    HASH - MD5 hash
+#    URL - full download url (first nonempty value will be chosen)
+#    DESTINATION_DIR - file will be copied to this directory
+#    STATUS - passed variable will be updated in parent scope,
```

Review comment:
EXPECTED_MD5 parameter should be here. CMake behavior may be more adequate here in the fresh releases.
**File:** cmake/OpenCVDownload.cmake
**Change Type:** added
**Context:** PR #8421: Modified cmake file download process - Coupled with opencv/opencv_contrib#1073 and opencv/opencv_extra#327 ### This pullrequest changes Upda...

**Code Changes:**
```diff
@@ -0,0 +1,133 @@
+#
+#  Download and optionally unpack a file
+#
+#  ocv_download(FILENAME p HASH h URL u1 [u2 ...] DESTINATION_DIR d [STATUS s] [UNPACK] [RELATIVE])
+#    FILENAME - filename
+#    HASH - MD5 hash
+#    URL - full download url (first nonempty value will be chosen)
+#    DESTINATION_DIR - file will be copied to this directory
+#    STATUS - passed variable will be updated in parent scope,
```

Review comment:
Missed bailout code. We should not work with invalid files below. File should be removed/renamed (for future diagnostics).
**File:** cmake/OpenCVFindIPP.cmake
**Change Type:** modified
**Context:** PR #8421: Modified cmake file download process - Coupled with opencv/opencv_contrib#1073 and opencv/opencv_extra#327 ### This pullrequest changes Upda...

**Code Changes:**
```diff
@@ -233,17 +233,17 @@ endmacro()
 if(DEFINED ENV{OPENCV_IPP_PATH} AND NOT DEFINED IPPROOT)
   set(IPPROOT "$ENV{OPENCV_IPP_PATH}")
 endif()
+
 if(NOT DEFINED IPPROOT)
   if(IOS AND NOT x86_64)
     # 2016/10: There is an issue with MacOS binary .a file.
     # It is fat multiarch library, and can't be "merged" multiple times.
     # So try to ignore i386 version
```

Review comment:
OPENCV_ICV_NAME is used in the function scope only. Does this cleanup needed here?
**File:** 3rdparty/ippicv/ippicv.cmake
**Change Type:** added
**Context:** PR #8421: Modified cmake file download process - Coupled with opencv/opencv_contrib#1073 and opencv/opencv_extra#327 ### This pullrequest changes Upda...
**Review Line:** 23

**Code Changes:**
```diff
+    set(OPENCV_ICV_NAME "ippicv_windows_20151201.zip")
+    set(OPENCV_ICV_HASH "04e81ce5d0e329c3fbc606ae32cad44d")
+    set(OPENCV_ICV_PLATFORM "windows")
+    set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_win")
+  else()
+    return()
+  endif()
+
+  set(THE_ROOT "${OpenCV_BINARY_DIR}/3rdparty/ippicv")
+  ocv_download(FILENAME ${OPENCV_ICV_NAME}
+               HASH ${OPENCV_ICV_HASH}
```

Review comment:
``` else() ... set values of returned vars ... return() endif() ```
**File:** cmake/OpenCVFindIPP.cmake
**Change Type:** modified
**Context:** PR #8421: Modified cmake file download process - Coupled with opencv/opencv_contrib#1073 and opencv/opencv_extra#327 ### This pullrequest changes Upda...

**Code Changes:**
```diff
@@ -233,17 +233,17 @@ endmacro()
 if(DEFINED ENV{OPENCV_IPP_PATH} AND NOT DEFINED IPPROOT)
   set(IPPROOT "$ENV{OPENCV_IPP_PATH}")
 endif()
+
 if(NOT DEFINED IPPROOT)
   if(IOS AND NOT x86_64)
     # 2016/10: There is an issue with MacOS binary .a file.
     # It is fat multiarch library, and can't be "merged" multiple times.
     # So try to ignore i386 version
```

Review comment:
`res` and `root` can be combined into `root` (IPPROOT): ``` download_ippicv(IPPROOT) if(NOT IPPROOT) message(...) return() endif() ocv_assert(EXISTS "${IPPROOT}") ```
**File:** cmake/OpenCVFindLibsVideo.cmake
**Change Type:** modified
**Context:** PR #8421: Modified cmake file download process - Coupled with opencv/opencv_contrib#1073 and opencv/opencv_extra#327 ### This pullrequest changes Upda...

**Code Changes:**
```diff
@@ -217,7 +217,11 @@ ocv_clear_vars(HAVE_FFMPEG)
 if(WITH_FFMPEG)
   if(WIN32 AND NOT ARM)
     include("${OpenCV_SOURCE_DIR}/3rdparty/ffmpeg/ffmpeg.cmake")
-    set(HAVE_FFMPEG TRUE)
+    download_win_ffmpeg(FFMPEG_CMAKE_SCRIPT)
+    if(FFMPEG_CMAKE_SCRIPT)
+      set(HAVE_FFMPEG TRUE)
+      include("${FFMPEG_CMAKE_SCRIPT}")
+    endif()
```

Review comment:
same note about combined return vars. `script` is enough (probably renamed to `__ffmpeg_script`).