nareshmlx/opencv-pr huggingface dataset:
**File:** cmake/OpenCVFindLibsVideo.cmake
**Change Type:** modified
**Context:** PR #2003: Add support Creative Senz3D camera by Intel Perceptual Computing SDK

**Code Changes:**
```diff
@@ -250,3 +250,8 @@ if (NOT IOS)
     set(HAVE_QTKIT YES)
   endif()
 endif()
+
+# --- Intel Perceptual Computing SDK ---
+if(WITH_INTELPERC)
+  include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindIntelPerCSDK.cmake")
+endif(WITH_INTELPERC)
```

Review comment:
I'd prefer if you would remove set it to false somewhere in `OpenCVFindIntelPerCSDK.cmake` (so that it always sets it to some value) and remove this line.
**File:** cmake/OpenCVFindIntelPerCSDK.cmake
**Change Type:** added
**Context:** PR #2003: Add support Creative Senz3D camera by Intel Perceptual Computing SDK

**Code Changes:**
```diff
@@ -0,0 +1,20 @@
+# Main variables:
+# INTELPERC_LIBRARIES and INTELPERC_INCLUDE to link Intel Perceptial Computing SDK modules
+# HAVE_INTELPERC for conditional compilation OpenCV with/without Intel Perceptial Computing SDK
+
+if(X86_64)
+    find_path(INTELPERC_INCLUDE_DIR "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Path to Intel Perceptual Computing SDK interface headers")
+    find_file(INTELPERC_LIBRARIES "libpxc.lib" PATHS "$ENV{PCSDK_DIR}lib/x64" DOC "Path to Intel Perceptual Computing SDK interface libraries")
+else()
+    find_path(INTELPERC_INCLUDE_DIR "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Path to Intel Perceptual Computing SDK interface headers")
```

Review comment:
Redundant comma and redundant spaces after the parenthesis and after the quote. Same thing a few lines below.
**File:** cmake/OpenCVFindIntelPerCSDK.cmake
**Change Type:** added
**Context:** PR #2003: Add support Creative Senz3D camera by Intel Perceptual Computing SDK

**Code Changes:**
```diff
@@ -0,0 +1,20 @@
+# Main variables:
+# INTELPERC_LIBRARIES and INTELPERC_INCLUDE to link Intel Perceptial Computing SDK modules
+# HAVE_INTELPERC for conditional compilation OpenCV with/without Intel Perceptial Computing SDK
+
+if(X86_64)
+    find_path(INTELPERC_INCLUDE_DIR "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Path to Intel Perceptual Computing SDK interface headers")
+    find_file(INTELPERC_LIBRARIES "libpxc.lib" PATHS "$ENV{PCSDK_DIR}lib/x64" DOC "Path to Intel Perceptual Computing SDK interface libraries")
+else()
+    find_path(INTELPERC_INCLUDE_DIR "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Path to Intel Perceptual Computing SDK interface headers")
```

Review comment:
I believe we have an `X86_64` variable for this.
**File:** cmake/OpenCVFindIntelPerCSDK.cmake
**Change Type:** added
**Context:** PR #2003: Add support Creative Senz3D camera by Intel Perceptual Computing SDK

**Code Changes:**
```diff
@@ -0,0 +1,20 @@
+# Main variables:
+# INTELPERC_LIBRARIES and INTELPERC_INCLUDE to link Intel Perceptial Computing SDK modules
+# HAVE_INTELPERC for conditional compilation OpenCV with/without Intel Perceptial Computing SDK
+
+if(X86_64)
+    find_path(INTELPERC_INCLUDE_DIR "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Path to Intel Perceptual Computing SDK interface headers")
+    find_file(INTELPERC_LIBRARIES "libpxc.lib" PATHS "$ENV{PCSDK_DIR}lib/x64" DOC "Path to Intel Perceptual Computing SDK interface libraries")
+else()
+    find_path(INTELPERC_INCLUDE_DIR "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Path to Intel Perceptual Computing SDK interface headers")
```

Review comment:
Isn't this always true, since this file can only be included on Windows?
**File:** cmake/OpenCVFindIntelPerCSDK.cmake
**Change Type:** added
**Context:** PR #2003: Add support Creative Senz3D camera by Intel Perceptual Computing SDK

**Code Changes:**
```diff
@@ -0,0 +1,20 @@
+# Main variables:
+# INTELPERC_LIBRARIES and INTELPERC_INCLUDE to link Intel Perceptial Computing SDK modules
+# HAVE_INTELPERC for conditional compilation OpenCV with/without Intel Perceptial Computing SDK
+
+if(X86_64)
+    find_path(INTELPERC_INCLUDE_DIR "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Path to Intel Perceptual Computing SDK interface headers")
+    find_file(INTELPERC_LIBRARIES "libpxc.lib" PATHS "$ENV{PCSDK_DIR}lib/x64" DOC "Path to Intel Perceptual Computing SDK interface libraries")
+else()
+    find_path(INTELPERC_INCLUDE_DIR "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Path to Intel Perceptual Computing SDK interface headers")
```

Review comment:
I'm not sure what all this `INTELPERC_INCLUDES` -> `INTELPERC_INCLUDE_DIR` -> `INTELPERC_INCLUDE_DIR_INTERNAL` dance is all about. What's wrong with just `find_file(INTELPERC_INCLUDE_DIR ...)`? Same comment for libraries. Also, the CMake convention for this sort of thing is `XXX_INCLUDE_DIRS` and `XXX_LIBRARIES` - in case multiple directories/libraries are needed in the future.
**File:** cmake/OpenCVFindIntelPerCSDK.cmake
**Change Type:** added
**Context:** PR #2003: Add support Creative Senz3D camera by Intel Perceptual Computing SDK

**Code Changes:**
```diff
@@ -0,0 +1,20 @@
+# Main variables:
+# INTELPERC_LIBRARIES and INTELPERC_INCLUDE to link Intel Perceptial Computing SDK modules
+# HAVE_INTELPERC for conditional compilation OpenCV with/without Intel Perceptial Computing SDK
+
+if(X86_64)
+    find_path(INTELPERC_INCLUDE_DIR "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Path to Intel Perceptual Computing SDK interface headers")
+    find_file(INTELPERC_LIBRARIES "libpxc.lib" PATHS "$ENV{PCSDK_DIR}lib/x64" DOC "Path to Intel Perceptual Computing SDK interface libraries")
+else()
+    find_path(INTELPERC_INCLUDE_DIR "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Path to Intel Perceptual Computing SDK interface headers")
```

Review comment:
This lacks a slash before "include". Also, this line is the same in both branches. Is `PCSDK_DIR` set by the SDK installer?
**File:** modules/highgui/include/opencv2/highgui/highgui_c.h
**Change Type:** modified
**Context:** PR #2003: Add support Creative Senz3D camera by Intel Perceptual Computing SDK

**Code Changes:**
```diff
@@ -312,7 +312,9 @@ enum
 
     CV_CAP_AVFOUNDATION = 1200,  // AVFoundation framework for iOS (OS X Lion will have the same API)
 
-    CV_CAP_GIGANETIX = 1300  // Smartek Giganetix GigEVisionSDK
+    CV_CAP_GIGANETIX = 1300,  // Smartek Giganetix GigEVisionSDK
+
+    CV_CAP_INTELPERC = 1500 // Intel Perceptual Computing SDK
 };
 
```

Review comment:
That's a rather strangely placed comma...
**File:** cmake/OpenCVFindLibsVideo.cmake
**Change Type:** modified
**Context:** PR #2003: Add support Creative Senz3D camera by Intel Perceptual Computing SDK

**Code Changes:**
```diff
@@ -250,3 +250,8 @@ if (NOT IOS)
     set(HAVE_QTKIT YES)
   endif()
 endif()
+
+# --- Intel Perceptual Computing SDK ---
+if(WITH_INTELPERC)
+  include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindIntelPerCSDK.cmake")
+endif(WITH_INTELPERC)
```

Review comment:
may be SDK instead of SSDK?
**File:** cmake/OpenCVFindIntelPerCSDK.cmake
**Change Type:** added
**Context:** PR #2003: Add support Creative Senz3D camera by Intel Perceptual Computing SDK
**Review Line:** 7

**Code Changes:**
```diff
+# INTELPERC_LIBRARIES and INTELPERC_INCLUDE to link Intel Perceptial Computing SDK modules
+# HAVE_INTELPERC for conditional compilation OpenCV with/without Intel Perceptial Computing SDK
+
+if(X86_64)
+    find_path(INTELPERC_INCLUDE_DIR "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Path to Intel Perceptual Computing SDK interface headers")
+    find_file(INTELPERC_LIBRARIES "libpxc.lib" PATHS "$ENV{PCSDK_DIR}lib/x64" DOC "Path to Intel Perceptual Computing SDK interface libraries")
+else()
+    find_path(INTELPERC_INCLUDE_DIR "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Path to Intel Perceptual Computing SDK interface headers")
+    find_file(INTELPERC_LIBRARIES "libpxc.lib" PATHS "$ENV{PCSDK_DIR}lib/Win32" DOC "Path to Intel Perceptual Computing SDK interface libraries")
+endif()
+
```

Review comment:
We also need to look for the debug version of the library (libpxc_d.lib)
**File:** modules/highgui/src/cap_intelperc.cpp
**Change Type:** added
**Context:** PR #2003: Add support Creative Senz3D camera by Intel Perceptual Computing SDK

**Code Changes:**
```diff
@@ -0,0 +1,714 @@
+#include "precomp.hpp"
+
+#ifdef HAVE_INTELPERC
+
+#include "pxcsession.h"
+#include "pxcsmartptr.h"
+#include "pxccapture.h"
+
+class CvIntelPerCStreamBase
```

Review comment:
TBB is not used in this file, so, I believe that the macros can be removed.
**File:** modules/calib3d/src/opencl/stereobm.cl
**Change Type:** modified
**Context:** PR #3284: OCL: Optimize OpenCL version of StereoBM function - 1. Fix problems on NVidia devices. 2. Move some arguments to build options 3. Refactorin...
**Review Line:** 190

**Code Changes:**
```diff
+                left = leftptr + idx;
+                right = rightptr + (idx - disp_idx);
+                short costdiff = 0;
+                for(int j = 0; j < WSZ; j++)
+                {
+                    costdiff += abs( left[0] - right[0] );
+                    left += cols;
+                    right += cols;
+                }
+                costbuf[i] = costdiff;
             }
```

Review comment:
byte read is very inefficient. could you try to unroll this loop by 4 and use uchar4 or vload4?
**File:** modules/calib3d/src/opencl/stereobm.cl
**Change Type:** modified
**Context:** PR #3284: OCL: Optimize OpenCL version of StereoBM function - 1. Fix problems on NVidia devices. 2. Move some arguments to build options 3. Refactorin...
**Review Line:** 208

**Code Changes:**
```diff
+                left = leftptr + idx;
+                right = rightptr + (idx - disp_idx);
+                short costdiff = 0;
+                for (int j = 0; j < WSZ; j++)
+                {
+                    costdiff += abs( left[j] - right[j]);
+                }
                 tempcost += costdiff;
+                costbuf[i] = costdiff;
             }
-            costbuf[head] = costdiff;
```

Review comment:
could you try to read at least 4 bytes at once?
**File:** modules/calib3d/src/opencl/stereobm.cl
**Change Type:** modified
**Context:** PR #3284: OCL: Optimize OpenCL version of StereoBM function - 1. Fix problems on NVidia devices. 2. Move some arguments to build options 3. Refactorin...
**Review Line:** 190

**Code Changes:**
```diff
+                left = leftptr + idx;
+                right = rightptr + (idx - disp_idx);
+                short costdiff = 0;
+                for(int j = 0; j < WSZ; j++)
+                {
+                    costdiff += abs( left[0] - right[0] );
+                    left += cols;
+                    right += cols;
+                }
+                costbuf[i] = costdiff;
             }
```

Review comment:
Sorry may be i don't undestand this idea. Now we sum i-th column to the `costbuf[i]`, i can change definition of the `costbuf` to `short4 costbuf[(WSZ + 3) / 4]` (4 is for example) and sum them. Then i need to acces to the `i-th` element, if i use `short` i can do this by `costbuf[i]`, if i use vectors how can i do this? And another small problem: `WSZ` is arbitrary and isn't divisible to `4` or `8`. Thus if i will use a vectors in a sum i need additional code for work with tails.
**File:** modules/calib3d/src/opencl/stereobm.cl
**Change Type:** modified
**Context:** PR #3284: OCL: Optimize OpenCL version of StereoBM function - 1. Fix problems on NVidia devices. 2. Move some arguments to build options 3. Refactorin...
**Review Line:** 190

**Code Changes:**
```diff
+                left = leftptr + idx;
+                right = rightptr + (idx - disp_idx);
+                short costdiff = 0;
+                for(int j = 0; j < WSZ; j++)
+                {
+                    costdiff += abs( left[0] - right[0] );
+                    left += cols;
+                    right += cols;
+                }
+                costbuf[i] = costdiff;
             }
```

Review comment:
I commented all calculation in `if (x < cols - WSZ2 - MIN_DISP && y < rows - WSZ2) ... else ...` and checked time. Perfomance increase around 2-5%.
**File:** modules/calib3d/src/opencl/stereobm.cl
**Change Type:** modified
**Context:** PR #3284: OCL: Optimize OpenCL version of StereoBM function - 1. Fix problems on NVidia devices. 2. Move some arguments to build options 3. Refactorin...
**Review Line:** 190

**Code Changes:**
```diff
+                left = leftptr + idx;
+                right = rightptr + (idx - disp_idx);
+                short costdiff = 0;
+                for(int j = 0; j < WSZ; j++)
+                {
+                    costdiff += abs( left[0] - right[0] );
+                    left += cols;
+                    right += cols;
+                }
+                costbuf[i] = costdiff;
             }
```

Review comment:
I see. I am not familiar with algorithm. what is the main bottleneck code place from you point of view?
**File:** modules/calib3d/src/opencl/stereobm.cl
**Change Type:** modified
**Context:** PR #3284: OCL: Optimize OpenCL version of StereoBM function - 1. Fix problems on NVidia devices. 2. Move some arguments to build options 3. Refactorin...

**Code Changes:**
```diff
@@ -44,231 +44,265 @@
 ////////////////////////////////////////// stereoBM //////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////////////////////////////
 
-#ifdef csize
-
 #define MAX_VAL 32767
 
-void calcDisp(__local short * cost, __global short * disp, int uniquenessRatio, int mindisp, int ndisp, int w,
-              __local int * bestDisp, __local int * bestCost, int d, int x, int y, int cols, int rows, int wsz2)
```

Review comment:
For multiple kernels you can use this approach: ``` ... common code (WSZ2?) ... #ifdef DEFINE_KERNEL_stereoBM __kernel stereoBM(...) ... #endif #ifdef DEFINE_KERNEL_prefilter_norm ... code without any BLOCK_SIZE_X/Y ... #endif ```
**File:** modules/core/src/opencl/convert.cl
**Change Type:** modified
**Context:** PR #4210: OCL: [UMat::convertTo]It is unnecessary to use fma() if no scaling. - Signed-off-by: Yan Wang yan.wang@linux.intel.com

**Code Changes:**
```diff
@@ -53,7 +53,10 @@
 
 __kernel void convertTo(__global const uchar * srcptr, int src_step, int src_offset,
                         __global uchar * dstptr, int dst_step, int dst_offset, int dst_rows, int dst_cols,
-                        WT alpha, WT beta, int rowsPerWI)
+#ifndef NO_SCALE
+                        WT alpha, WT beta,
+#endif
+                        int rowsPerWI)
 {
```

Review comment:
`convertToDT` can include rounding policy (_rte, _sat) that may differ from the default type cast: https://github.com/Itseez/opencv/blob/c0b544af705eb058642cd8387abf3d9536eaa32a/modules/core/src/ocl.cpp#L5585-L5603
**File:** modules/core/src/opencl/convert.cl
**Change Type:** modified
**Context:** PR #4210: OCL: [UMat::convertTo]It is unnecessary to use fma() if no scaling. - Signed-off-by: Yan Wang yan.wang@linux.intel.com

**Code Changes:**
```diff
@@ -53,7 +53,10 @@
 
 __kernel void convertTo(__global const uchar * srcptr, int src_step, int src_offset,
                         __global uchar * dstptr, int dst_step, int dst_offset, int dst_rows, int dst_cols,
-                        WT alpha, WT beta, int rowsPerWI)
+#ifndef NO_SCALE
+                        WT alpha, WT beta,
+#endif
+                        int rowsPerWI)
 {
```

Review comment:
agree, convertToDT needs to be retained
**File:** cmake/OpenCVModule.cmake
**Change Type:** modified
**Context:** PR #4064: Adding test support for WINRT - Adding test support for Windows RT. Some unused highgui #include's were removed ([sample](https://github.com...

**Code Changes:**
```diff
@@ -684,6 +684,28 @@ macro(ocv_create_module)
     _ocv_create_module(${ARGN})
     set(the_module_target ${the_module})
   endif()
+
+  if(WINRT)
+    # removing APPCONTAINER from modules to run from console
+    # in case of usual starting of WinRT test apps output is missing
+    # so starting of console version w/o APPCONTAINER is required to get test results
+    # also this allows to use opencv_extra test data for these tests
```

Review comment:
May be set empty `OPENCV_DEBUG_POSTFIX` directly in the other place?
**File:** modules/ts/src/ts.cpp
**Change Type:** modified
**Context:** PR #4064: Adding test support for WINRT - Adding test support for Windows RT. Some unused highgui #include's were removed ([sample](https://github.com...
**Review Line:** 692

**Code Changes:**
```diff
@@ -684,7 +688,11 @@ void parseCustomOptions(int argc, char **argv)
 
     test_ipp_check = parser.get<bool>("test_ipp_check");
     if (!test_ipp_check)
+#ifndef WINRT
         test_ipp_check = getenv("OPENCV_IPP_CHECK") != NULL;
+#else
+        test_ipp_check = false;
+#endif
 }
 
```

Review comment:
Is file system accessible on WINRT? What is about command line parameter to specify "test_env.conf" and transparent replace `getenv` to read this file? What is about to pass `--env MY_ENV_VAR=MY_ENV_VALUE` via command line?
**File:** modules/ts/src/ts_gtest.cpp
**Change Type:** modified
**Context:** PR #4064: Adding test support for WINRT - Adding test support for Windows RT. Some unused highgui #include's were removed ([sample](https://github.com...
**Review Line:** 4057

**Code Changes:**
```diff
@@ -4054,7 +4054,7 @@ enum GTestColor {
   COLOR_YELLOW
 };
 
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && !defined WINRT
 
 // Returns the character attribute for the given color.
 WORD GetColorAttribute(GTestColor color) {
@@ -4122,7 +4122,7 @@ static void ColoredPrintf(GTestColor color, const char* fmt, ...) {
   va_list args;
```

Review comment:
I believe you can add this code near GTEST_OS_WINDOWS_MOBILE detection: ``` #ifdef WINRT // It is not the same things, but it makes GTest happy #define GTEST_OS_WINDOWS_MOBILE 1 #endif ``` Is there exist fresh GTest package that supports WINRT?
**File:** modules/ts/src/ts_perf.cpp
**Change Type:** modified
**Context:** PR #4064: Adding test support for WINRT - Adding test support for Windows RT. Some unused highgui #include's were removed ([sample](https://github.com...
**Review Line:** 672

**Code Changes:**
```diff
@@ -185,7 +185,11 @@ void Regression::init(const std::string& testSuitName, const std::string& ext)
         return;
     }
 
+#ifndef WINRT
     const char *data_path_dir = getenv("OPENCV_TEST_DATA_PATH");
+#else
+    const char *data_path_dir = OPENCV_TEST_DATA_PATH;
+#endif
     const char *path_separator = "/";
 
     if (data_path_dir)
@@ -814,7 +818,12 @@ void TestBase::Init(const std::vector<std::string> & availableImpls,
     param_force_samples = args.get<unsigned int>("perf_force_samples");
     param_write_sanity  = args.has("perf_write_sanity");
```

Review comment:
You definitelly should fix/emulate ifstream/ofstream for WINRT. This part of code is unmaintanable.
**File:** platforms/winrt/readme.txt
**Change Type:** modified
**Context:** PR #4064: Adding test support for WINRT - Adding test support for Windows RT. Some unused highgui #include's were removed ([sample](https://github.com...

**Code Changes:**
```diff
@@ -119,3 +119,41 @@ To generate Windows Phone 8.1 x86 project files in the opencv/bin dir
 mkdir bin
 cd bin
 cmake -G "Visual Studio 12 2013" -DCMAKE_SYSTEM_NAME=WindowsPhone -DCMAKE_SYSTEM_VERSION=8.1 ../
+
+Running tests for Windows Store
+===============================
+1. You might need to install this if you haven't already: http://www.microsoft.com/en-US/download/details.aspx?id=40784
+
+2. Set OPENCV_TEST_DATA_PATH environment variable to location of opencv_extra/testdata (cloning of https://github.com/Itseez/opencv_extra repo required) to get tests work correctly. Also, set OPENCV_PERF_VALIDATION_DIR environment variable in case you are planning to have place where to store performance test results and compare them with the future test runs.
```

Review comment:
`OPENCV_PERF_VALIDATION_DIR` is **not required** to succesfully run performance tests. It is additional check for changed performance results.
**File:** cmake/OpenCVModule.cmake
**Change Type:** modified
**Context:** PR #4064: Adding test support for WINRT - Adding test support for Windows RT. Some unused highgui #include's were removed ([sample](https://github.com...

**Code Changes:**
```diff
@@ -684,6 +684,28 @@ macro(ocv_create_module)
     _ocv_create_module(${ARGN})
     set(the_module_target ${the_module})
   endif()
+
+  if(WINRT)
+    # removing APPCONTAINER from modules to run from console
+    # in case of usual starting of WinRT test apps output is missing
+    # so starting of console version w/o APPCONTAINER is required to get test results
+    # also this allows to use opencv_extra test data for these tests
```

Review comment:
Updated this. Please note that empty `OPENCV_DEBUG_POSTFIX` is not required and shouldn't be set for modules to keep possibility to build and install them in Debug/Release both. This modification is for tests only so the flag is not set in the global place.
**File:** platforms/winrt/readme.txt
**Change Type:** modified
**Context:** PR #4064: Adding test support for WINRT - Adding test support for Windows RT. Some unused highgui #include's were removed ([sample](https://github.com...

**Code Changes:**
```diff
@@ -119,3 +119,41 @@ To generate Windows Phone 8.1 x86 project files in the opencv/bin dir
 mkdir bin
 cd bin
 cmake -G "Visual Studio 12 2013" -DCMAKE_SYSTEM_NAME=WindowsPhone -DCMAKE_SYSTEM_VERSION=8.1 ../
+
+Running tests for Windows Store
+===============================
+1. You might need to install this if you haven't already: http://www.microsoft.com/en-US/download/details.aspx?id=40784
+
+2. Set OPENCV_TEST_DATA_PATH environment variable to location of opencv_extra/testdata (cloning of https://github.com/Itseez/opencv_extra repo required) to get tests work correctly. Also, set OPENCV_PERF_VALIDATION_DIR environment variable in case you are planning to have place where to store performance test results and compare them with the future test runs.
```

Review comment:
Updated readme
**File:** modules/ts/src/ts_gtest.cpp
**Change Type:** modified
**Context:** PR #4064: Adding test support for WINRT - Adding test support for Windows RT. Some unused highgui #include's were removed ([sample](https://github.com...
**Review Line:** 4057

**Code Changes:**
```diff
@@ -4054,7 +4054,7 @@ enum GTestColor {
   COLOR_YELLOW
 };
 
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && !defined WINRT
 
 // Returns the character attribute for the given color.
 WORD GetColorAttribute(GTestColor color) {
@@ -4122,7 +4122,7 @@ static void ColoredPrintf(GTestColor color, const char* fmt, ...) {
   va_list args;
```

Review comment:
This should work however this may be confusing as these are two different OS. Also this eliminate possibility to differ WINRT and WINDOWS_MOBILE if required in future updates. Current GTest version supports WINRT and WP now ([one of related revisions](https://code.google.com/p/googletest/source/detail?r=690)). There is also some work in progress [there](https://github.com/MSOpenTech/opencv/tree/test_gtest_upd). Could you please clarify reasons why OpenCV doesn't use GTest as external library to have possibility of continuous updates? And are there any reasons that GTest-related files were not updated for a long time?