nareshmlx/opencv-pr huggingface dataset:
**File:** modules/3d/src/usac.hpp
**Change Type:** modified
**Context:** PR #22287: Disabled compiling warnings in case of symbols in cmake for 5.x
**Review Line:** 503

**Code Changes:**
```diff
 
      * epsilon:
-     * The probability p(1|Hg) = ε
-     * that any randomly chosen data point is consistent with a ‘good’ model
-     * is approximated by the fraction of inliers ε among the data
+     * The probability p(1|Hg) = epsilon
+     * that any randomly chosen data point is consistent with a 'good' model
+     * is approximated by the fraction of inliers epsilon among the data
      * points
 
      * A is the decision threshold, the only parameter of the Adapted SPRT
```

Review comment:
I think so, because we have symbols in Japanese, for example `こんにちは世界` in [`opencv\modules\objdetect\test\test_qrcode_encode.cpp`](https://github.com/opencv/opencv/blob/4.x/modules/objdetect/test/test_qrcode_encode.cpp#L331). We also can translate it and write something like `Hello world in Japanese`. What do you think? In addition, there are a lot of formulas (e.g. [`opencv/modules/calib3d/src/usac/termination.cpp`](https://github.com/opencv/opencv/blob/4.x/modules/calib3d/src/usac/termination.cpp#L136))
**File:** modules/3d/src/usac.hpp
**Change Type:** modified
**Context:** PR #22287: Disabled compiling warnings in case of symbols in cmake for 5.x
**Review Line:** 503

**Code Changes:**
```diff
 
      * epsilon:
-     * The probability p(1|Hg) = ε
-     * that any randomly chosen data point is consistent with a ‘good’ model
-     * is approximated by the fraction of inliers ε among the data
+     * The probability p(1|Hg) = epsilon
+     * that any randomly chosen data point is consistent with a 'good' model
+     * is approximated by the fraction of inliers epsilon among the data
      * points
 
      * A is the decision threshold, the only parameter of the Adapted SPRT
```

Review comment:
Update: removing `/wd4819` from cmake and defining `#pragma` doesn't disable these warnings. I would suggest to keep it there.
**File:** modules/objdetect/test/test_qrcode_encode.cpp
**Change Type:** modified
**Context:** PR #22287: Disabled compiling warnings in case of symbols in cmake for 5.x
**Review Line:** 323

**Code Changes:**
```diff
-    std::string input_infos[testing_versions] = {"\x82\xb1\x82\xf1\x82\xc9\x82\xbf\x82\xcd\x90\xa2\x8a\x45", // こんにちは世界
-                                                 "\x82\xa8\x95\xa0\x82\xaa\x8b\xf3\x82\xa2\x82\xc4\x82\xa2\x82\xdc\x82\xb7", // お腹が空いています
-                                                 "\x82\xb1\x82\xf1\x82\xc9\x82\xbf\x82\xcd\x81\x41\x8e\x84\x82\xcd\x8f\xad\x82\xb5\x93\xfa\x96\x7b\x8c\xea\x82\xf0\x98\x62\x82\xb5\x82\xdc\x82\xb7" // こんにちは、私は少し日本語を話します
+    std::string input_infos[testing_versions] = {"\x82\xb1\x82\xf1\x82\xc9\x82\xbf\x82\xcd\x90\xa2\x8a\x45", // "Hello World" in Japanese
+                                                 "\x82\xa8\x95\xa0\x82\xaa\x8b\xf3\x82\xa2\x82\xc4\x82\xa2\x82\xdc\x82\xb7", // "I am hungry" in Japanese
+                                                 "\x82\xb1\x82\xf1\x82\xc9\x82\xbf\x82\xcd\x81\x41\x8e\x84\x82\xcd\x8f\xad\x82\xb5\x93\xfa\x96\x7b\x8c\xea\x82\xf0\x98\x62\x82\xb5\x82\xdc\x82\xb7" // "Hello, I speak a little Japanese" in Japanese
                                                 };
 
     for (int i = 0; i < testing_versions; i++)
```

Review comment:
This has been done in case of https://github.com/opencv/opencv/pull/22452
**File:** 3rdparty/libjpeg-turbo/CMakeLists.txt
**Change Type:** modified
**Context:** PR #22566: Fix multiple sdtlib linkage warning on Windows with MSVS.

**Code Changes:**
```diff
@@ -146,22 +146,6 @@ if(WITH_ARITH_DEC)
   set(JPEG_SOURCES ${JPEG_SOURCES} jdarith.c)
 endif()
 
-if(MSVC)
-  option(WITH_CRT_DLL
-    "Link all ${CMAKE_PROJECT_NAME} libraries and executables with the C run-time DLL (msvcr*.dll) instead of the static C run-time library (libcmt*.lib.)  The default is to use the C run-time DLL only with the libraries and executables that need it."
-    FALSE)
-  if(NOT WITH_CRT_DLL)
-    # Use the static C library for all build types
```

Review comment:
`TRUE` is not a valid value too: - we have static builds too - e.g., `BUILD_SHARED_LIBS=OFF` - we have dedicated flag to control that - `BUILD_WITH_STATIC_CRT` We should drop this option from 3rdparty completely as we manage common flags on OpenCV level - see OpenCVCRTLinkage.cmake The similar note is about changing of other common flags.
**File:** modules/objdetect/test/test_qrcode_encode.cpp
**Change Type:** modified
**Context:** PR #22286: Disabled compiling warnings in case of symbols in cmake for 4.x
**Review Line:** 323

**Code Changes:**
```diff
-    std::string input_infos[testing_versions] = {"\x82\xb1\x82\xf1\x82\xc9\x82\xbf\x82\xcd\x90\xa2\x8a\x45", // こんにちは世界
-                                                 "\x82\xa8\x95\xa0\x82\xaa\x8b\xf3\x82\xa2\x82\xc4\x82\xa2\x82\xdc\x82\xb7", // お腹が空いています
-                                                 "\x82\xb1\x82\xf1\x82\xc9\x82\xbf\x82\xcd\x81\x41\x8e\x84\x82\xcd\x8f\xad\x82\xb5\x93\xfa\x96\x7b\x8c\xea\x82\xf0\x98\x62\x82\xb5\x82\xdc\x82\xb7" // こんにちは、私は少し日本語を話します
+    std::string input_infos[testing_versions] = {"\x82\xb1\x82\xf1\x82\xc9\x82\xbf\x82\xcd\x90\xa2\x8a\x45", // "Hello World" in Japanese
+                                                 "\x82\xa8\x95\xa0\x82\xaa\x8b\xf3\x82\xa2\x82\xc4\x82\xa2\x82\xdc\x82\xb7", // "I am hungry" in Japanese
+                                                 "\x82\xb1\x82\xf1\x82\xc9\x82\xbf\x82\xcd\x81\x41\x8e\x84\x82\xcd\x8f\xad\x82\xb5\x93\xfa\x96\x7b\x8c\xea\x82\xf0\x98\x62\x82\xb5\x82\xdc\x82\xb7" // "Hello, I speak a little Japanese" in Japanese
                                                 };
 
     for (int i = 0; i < testing_versions; i++)
```

Review comment:
This has been done in case of https://github.com/opencv/opencv/pull/22452
**File:** cmake/OpenCVCompilerOptions.cmake
**Change Type:** modified
**Context:** PR #22285: Disabled compiling warnings in case of symbols in cmake for 3.4

**Code Changes:**
```diff
@@ -426,6 +426,7 @@ if(MSVC)
     ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4275) # non dll-interface class 'std::exception' used as base for dll-interface class 'cv::Exception'
     ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4512) # Assignment operator could not be generated
     ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4589) # Constructor of abstract class 'cv::ORB' ignores initializer for virtual base class 'cv::Algorithm'
+    ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4819) # Symbols like delta or epsilon cannot be represented
   endif()
 
   if(CV_ICC AND NOT ENABLE_NOISY_WARNINGS)
```

Review comment:
> unreachable code We definitely should not disable such warning globally. Local `#pragma` should be used instead.
**File:** cmake/OpenCVCompilerOptions.cmake
**Change Type:** modified
**Context:** PR #22285: Disabled compiling warnings in case of symbols in cmake for 3.4

**Code Changes:**
```diff
@@ -426,6 +426,7 @@ if(MSVC)
     ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4275) # non dll-interface class 'std::exception' used as base for dll-interface class 'cv::Exception'
     ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4512) # Assignment operator could not be generated
     ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4589) # Constructor of abstract class 'cv::ORB' ignores initializer for virtual base class 'cv::Algorithm'
+    ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4819) # Symbols like delta or epsilon cannot be represented
   endif()
 
   if(CV_ICC AND NOT ENABLE_NOISY_WARNINGS)
```

Review comment:
Removed this line from `cmake/OpenCVCompilerOptions.cmake` and added `#pragma` to certain files.
**File:** modules/core/include/opencv2/core/matx.hpp
**Change Type:** modified
**Context:** PR #22285: Disabled compiling warnings in case of symbols in cmake for 3.4

**Code Changes:**
```diff
@@ -681,11 +681,19 @@ Matx<_Tp,m,n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp
     for(int i = 16; i < channels; i++) val[i] = _Tp(0);
 }
 
+// WARNING: unreachable code using Ninja
+#if defined _MSC_VER && _MSC_VER >= 1920
+#pragma warning(push)
+#pragma warning(disable: 4702)
+#endif
 template<typename _Tp, int m, int n> inline
```

Review comment:
Disabling in such way in a public header is a way similar to global disabling. Could you provide link on build logs with these warnings?
**File:** modules/core/include/opencv2/core/matx.hpp
**Change Type:** modified
**Context:** PR #22285: Disabled compiling warnings in case of symbols in cmake for 3.4

**Code Changes:**
```diff
@@ -681,11 +681,19 @@ Matx<_Tp,m,n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp
     for(int i = 16; i < channels; i++) val[i] = _Tp(0);
 }
 
+// WARNING: unreachable code using Ninja
+#if defined _MSC_VER && _MSC_VER >= 1920
+#pragma warning(push)
+#pragma warning(disable: 4702)
+#endif
 template<typename _Tp, int m, int n> inline
```

Review comment:
Yes, sure: https://github.com/opencv/opencv/runs/7454965078?check_suite_focus=true#step:13:584 Do you mean to disable each line with this warning?
**File:** modules/core/include/opencv2/core/matx.hpp
**Change Type:** modified
**Context:** PR #22285: Disabled compiling warnings in case of symbols in cmake for 3.4

**Code Changes:**
```diff
@@ -681,11 +681,19 @@ Matx<_Tp,m,n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp
     for(int i = 16; i < channels; i++) val[i] = _Tp(0);
 }
 
+// WARNING: unreachable code using Ninja
+#if defined _MSC_VER && _MSC_VER >= 1920
+#pragma warning(push)
+#pragma warning(disable: 4702)
+#endif
 template<typename _Tp, int m, int n> inline
```

Review comment:
Removed the global definition and put to certain places which happen during the build.
**File:** modules/core/include/opencv2/core/cuda.hpp
**Change Type:** modified
**Context:** PR #22285: Disabled compiling warnings in case of symbols in cmake for 3.4

**Code Changes:**
```diff
@@ -488,8 +488,16 @@ class CV_EXPORTS BufferPool
     //! Allocates a new GpuMat of given size and type.
     GpuMat getBuffer(int rows, int cols, int type);
 
+// WARNING: unreachable code using Ninja
+#if defined _MSC_VER && _MSC_VER >= 1920
+#pragma warning(push)
+#pragma warning(disable: 4702)
+#endif
     //! Allocates a new GpuMat of given size and type.
```

Review comment:
> 1928 Just 1920 (MSVS 2019 base version) as we probably have we same problem with 1927 etc. https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170
**File:** modules/core/include/opencv2/core/cuda.hpp
**Change Type:** modified
**Context:** PR #22285: Disabled compiling warnings in case of symbols in cmake for 3.4

**Code Changes:**
```diff
@@ -488,8 +488,16 @@ class CV_EXPORTS BufferPool
     //! Allocates a new GpuMat of given size and type.
     GpuMat getBuffer(int rows, int cols, int type);
 
+// WARNING: unreachable code using Ninja
+#if defined _MSC_VER && _MSC_VER >= 1920
+#pragma warning(push)
+#pragma warning(disable: 4702)
+#endif
     //! Allocates a new GpuMat of given size and type.
```

Review comment:
I just wanted to pin a version which caught a warning and I didn't test it on 1920, but updated changes according to your comment.
**File:** samples/cpp/calibration.cpp
**Change Type:** modified
**Context:** PR #22444: Add flag to pass initial guess for camera intrinsics into the calibration exe
**Review Line:** 173

**Code Changes:**
```diff
     if( flags & CALIB_FIX_ASPECT_RATIO )
         cameraMatrix.at<double>(0,0) = aspectRatio;
 
@@ -170,7 +172,7 @@ static bool runCalibration( vector<vector<Point2f> > imagePoints,
         iFixedPoint = boardSize.width - 1;
     rms = calibrateCameraRO(objectPoints, imagePoints, imageSize, iFixedPoint,
                             cameraMatrix, distCoeffs, rvecs, tvecs, newObjPoints,
-                            flags | CALIB_FIX_K3 | CALIB_USE_LU);
+                            flags | CALIB_USE_LU);
     printf("RMS error reported by calibrateCamera: %g\n", rms);
 
```

Review comment:
`CALIB_FIX_K3` flag is replaced by a command line parameter.
**File:** samples/cpp/calibration.cpp
**Change Type:** modified
**Context:** PR #22444: Add flag to pass initial guess for camera intrinsics into the calibration exe
**Review Line:** 379

**Code Changes:**
```diff
@@ -375,6 +375,8 @@ int main( int argc, char** argv )
         "{help ||}{w||}{h||}{pt|chessboard|}{n|10|}{d|1000|}{s|1|}{o|out_camera_data.yml|}"
         "{op||}{oe||}{zt||}{a||}{p||}{v||}{V||}{su||}"
         "{oo||}{ws|11|}{dt||}"
+        "{fx||}{fy||}{cx||}{cy||}"
+        "{imshow-scale|1|}{enable-k3|0|}"
         "{@input_data|0|}");
     if (parser.has("help"))
     {
@@ -419,6 +421,23 @@ int main( int argc, char** argv )
     else
```

Review comment:
By default `enable-k3=0` to keep the same behavior than before.
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #22504: Removes a broken link

**Code Changes:**
```diff
@@ -876,9 +876,11 @@ class CV_EXPORTS_W VideoWriter
     /** @overload
     @param filename Name of the output video file.
     @param fourcc 4-character code of codec used to compress the frames. For example,
-    VideoWriter::fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter::fourcc('M','J','P','G') is a
-    motion-jpeg codec etc. List of codes can be obtained at [Video Codecs by
-    FOURCC](http://www.fourcc.org/codecs.php) page. FFMPEG backend with MP4 container natively uses
+    VideoWriter::fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter::fourcc('M','J','P','G')
+    is a motion-jpeg codec etc. List of codes can be obtained at
+    [MSDN](https://docs.microsoft.com/en-us/windows/win32/medfound/video-fourccs) page
```

Review comment:
I propose to replace the link with some other long-living resource like MSDN: https://docs.microsoft.com/en-us/windows/win32/medfound/video-fourccs
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #22504: Removes a broken link

**Code Changes:**
```diff
@@ -876,9 +876,11 @@ class CV_EXPORTS_W VideoWriter
     /** @overload
     @param filename Name of the output video file.
     @param fourcc 4-character code of codec used to compress the frames. For example,
-    VideoWriter::fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter::fourcc('M','J','P','G') is a
-    motion-jpeg codec etc. List of codes can be obtained at [Video Codecs by
-    FOURCC](http://www.fourcc.org/codecs.php) page. FFMPEG backend with MP4 container natively uses
+    VideoWriter::fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter::fourcc('M','J','P','G')
+    is a motion-jpeg codec etc. List of codes can be obtained at
+    [MSDN](https://docs.microsoft.com/en-us/windows/win32/medfound/video-fourccs) page
```

Review comment:
> long-living resource There are tons of dead links from > microsoft.com --- Anyway, content is different. So this is a wrong way. With same effect we could place wiki page of FOURCC (which is wrong too).
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #22504: Removes a broken link

**Code Changes:**
```diff
@@ -876,9 +876,11 @@ class CV_EXPORTS_W VideoWriter
     /** @overload
     @param filename Name of the output video file.
     @param fourcc 4-character code of codec used to compress the frames. For example,
-    VideoWriter::fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter::fourcc('M','J','P','G') is a
-    motion-jpeg codec etc. List of codes can be obtained at [Video Codecs by
-    FOURCC](http://www.fourcc.org/codecs.php) page. FFMPEG backend with MP4 container natively uses
+    VideoWriter::fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter::fourcc('M','J','P','G')
+    is a motion-jpeg codec etc. List of codes can be obtained at
+    [MSDN](https://docs.microsoft.com/en-us/windows/win32/medfound/video-fourccs) page
```

Review comment:
What about adding both sources of info? Something like: ```suggestion motion-jpeg codec etc. List of codes can be obtained at [MSDN](https://docs.microsoft.com/en-us/windows/win32/medfound/video-fourccs) page (see also this [archived page](https://web.archive.org/web/20220316062600/http://www.fourcc.org/codecs.php) of the fourcc site for a more complete list). FFMPEG backend with MP4 container natively uses ``` --- For instance, for some reason the Microsoft site does not mention the `MJPG` codec while it should be a quite common codec I think? It is BTW mentioned in the `VideoWriter` doc: > VideoWriter::fourcc('M','J','P','G') is a motion-jpeg codec etc.
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #22504: Removes a broken link

**Code Changes:**
```diff
@@ -876,9 +876,11 @@ class CV_EXPORTS_W VideoWriter
     /** @overload
     @param filename Name of the output video file.
     @param fourcc 4-character code of codec used to compress the frames. For example,
-    VideoWriter::fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter::fourcc('M','J','P','G') is a
-    motion-jpeg codec etc. List of codes can be obtained at [Video Codecs by
-    FOURCC](http://www.fourcc.org/codecs.php) page. FFMPEG backend with MP4 container natively uses
+    VideoWriter::fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter::fourcc('M','J','P','G')
+    is a motion-jpeg codec etc. List of codes can be obtained at
+    [MSDN](https://docs.microsoft.com/en-us/windows/win32/medfound/video-fourccs) page
```

Review comment:
I think I will let you guys decide how you want your docs, but if I may comment on this. Since MSDN contains a subset of the other one it does not add much help to those who try to find their fourcc. Having two links means two links that might be changed or outdated. As far as I know does not microsoft guarantee that they will keep the same URLs. There are also several other sites that may be less reputable, but have a larger list of fourccs. E.g. [codecs.com](https://www.free-codecs.com/guides/fourcc.htm). I don't know who is behind that domain and I guess you prefer a well known source?
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #22372: [GSoC 2022] nasm/simd support for libjpeg-turbo

**Code Changes:**
```diff
@@ -1341,6 +1341,16 @@ if(WITH_JPEG OR HAVE_JPEG)
     status("    JPEG:" NO)
   elseif(BUILD_JPEG)
     status("    JPEG:" "build-${JPEG_LIBRARY} (ver ${JPEG_LIB_VERSION})")
+    if(ENABLE_LIBJPEG_TURBO_SIMD)
+      status("        SIMD Support Request:" "YES")
+      if(HAVE_LIBJPEG_TURBO_SIMD)
+        status("        SIMD Support:" "YES")
+      else()
+        status("        SIMD Support:" "NO")
```

Review comment:
Need this to set right status for SIMD Support in the line 1353
**File:** modules/imgcodecs/perf/perf_jpeg.cpp
**Change Type:** added
**Context:** PR #22372: [GSoC 2022] nasm/simd support for libjpeg-turbo

**Code Changes:**
```diff
@@ -0,0 +1,38 @@
+// 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
+#include "perf_precomp.hpp"
+
+namespace opencv_test
+{
+using namespace perf;
+
```

Review comment:
It makes sense to benchmark imdecode and imencode. They do not read from /write to disk and benchmarks shows pure time.
**File:** 3rdparty/libjpeg-turbo/CMakeLists.txt
**Change Type:** modified
**Context:** PR #22372: [GSoC 2022] nasm/simd support for libjpeg-turbo

**Code Changes:**
```diff
@@ -15,8 +15,55 @@ endif()
 
 message(STATUS "libjpeg-turbo: VERSION = ${VERSION}, BUILD = ${BUILD}")
 
+math(EXPR BITS "${CMAKE_SIZEOF_VOID_P} * 8")
+string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} CMAKE_SYSTEM_PROCESSOR_LC)
+
+if(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "x86_64" OR
+  CMAKE_SYSTEM_PROCESSOR_LC MATCHES "amd64" OR
+  CMAKE_SYSTEM_PROCESSOR_LC MATCHES "i[0-9]86" OR
```

Review comment:
The macro is not used in the patch.
**File:** 3rdparty/libjpeg-turbo/CMakeLists.txt
**Change Type:** modified
**Context:** PR #22372: [GSoC 2022] nasm/simd support for libjpeg-turbo

**Code Changes:**
```diff
@@ -15,8 +15,55 @@ endif()
 
 message(STATUS "libjpeg-turbo: VERSION = ${VERSION}, BUILD = ${BUILD}")
 
+math(EXPR BITS "${CMAKE_SIZEOF_VOID_P} * 8")
+string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} CMAKE_SYSTEM_PROCESSOR_LC)
+
+if(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "x86_64" OR
+  CMAKE_SYSTEM_PROCESSOR_LC MATCHES "amd64" OR
+  CMAKE_SYSTEM_PROCESSOR_LC MATCHES "i[0-9]86" OR
```

Review comment:
OpenCV already has processor options detector in CMake. Please reuse variables like X86_64, ARM, PPC64 and others from https://github.com/opencv/opencv/blob/4.x/cmake/OpenCVDetectCXXCompiler.cmake.
**File:** 3rdparty/libjpeg-turbo/CMakeLists.txt
**Change Type:** modified
**Context:** PR #22372: [GSoC 2022] nasm/simd support for libjpeg-turbo

**Code Changes:**
```diff
@@ -15,8 +15,55 @@ endif()
 
 message(STATUS "libjpeg-turbo: VERSION = ${VERSION}, BUILD = ${BUILD}")
 
+math(EXPR BITS "${CMAKE_SIZEOF_VOID_P} * 8")
+string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} CMAKE_SYSTEM_PROCESSOR_LC)
+
+if(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "x86_64" OR
+  CMAKE_SYSTEM_PROCESSOR_LC MATCHES "amd64" OR
+  CMAKE_SYSTEM_PROCESSOR_LC MATCHES "i[0-9]86" OR
```

Review comment:
Pay attention that NEON, AVX512, etc support are managed with dedicated flags.
**File:** 3rdparty/libjpeg-turbo/CMakeLists.txt
**Change Type:** modified
**Context:** PR #22372: [GSoC 2022] nasm/simd support for libjpeg-turbo

**Code Changes:**
```diff
@@ -15,8 +15,55 @@ endif()
 
 message(STATUS "libjpeg-turbo: VERSION = ${VERSION}, BUILD = ${BUILD}")
 
+math(EXPR BITS "${CMAKE_SIZEOF_VOID_P} * 8")
+string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} CMAKE_SYSTEM_PROCESSOR_LC)
+
+if(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "x86_64" OR
+  CMAKE_SYSTEM_PROCESSOR_LC MATCHES "amd64" OR
+  CMAKE_SYSTEM_PROCESSOR_LC MATCHES "i[0-9]86" OR
```

Review comment:
It is actually used by simd/CMakeLists.txt [here](https://github.com/opencv/opencv/blob/6aa3e9ff63fcf5e584d9366543005ed07cdc9908/3rdparty/libjpeg-turbo/src/simd/CMakeLists.txt#L363) . I did not want to modify that file. That is why I included it inside that CMakeList.
**File:** 3rdparty/libjpeg-turbo/CMakeLists.txt
**Change Type:** modified
**Context:** PR #22372: [GSoC 2022] nasm/simd support for libjpeg-turbo

**Code Changes:**
```diff
@@ -15,8 +15,55 @@ endif()
 
 message(STATUS "libjpeg-turbo: VERSION = ${VERSION}, BUILD = ${BUILD}")
 
+math(EXPR BITS "${CMAKE_SIZEOF_VOID_P} * 8")
+string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} CMAKE_SYSTEM_PROCESSOR_LC)
+
+if(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "x86_64" OR
+  CMAKE_SYSTEM_PROCESSOR_LC MATCHES "amd64" OR
+  CMAKE_SYSTEM_PROCESSOR_LC MATCHES "i[0-9]86" OR
```

Review comment:
> Pay attention that NEON, AVX512, etc support are managed with dedicated flags. Could you eloborate more this? I did not get it what you mean by that.
**File:** 3rdparty/libjpeg-turbo/CMakeLists.txt
**Change Type:** modified
**Context:** PR #22372: [GSoC 2022] nasm/simd support for libjpeg-turbo

**Code Changes:**
```diff
@@ -15,8 +15,55 @@ endif()
 
 message(STATUS "libjpeg-turbo: VERSION = ${VERSION}, BUILD = ${BUILD}")
 
+math(EXPR BITS "${CMAKE_SIZEOF_VOID_P} * 8")
+string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} CMAKE_SYSTEM_PROCESSOR_LC)
+
+if(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "x86_64" OR
+  CMAKE_SYSTEM_PROCESSOR_LC MATCHES "amd64" OR
+  CMAKE_SYSTEM_PROCESSOR_LC MATCHES "i[0-9]86" OR
```

Review comment:
I carried this into simd/CMakeList
**File:** 3rdparty/libjpeg-turbo/CMakeLists.txt
**Change Type:** modified
**Context:** PR #22372: [GSoC 2022] nasm/simd support for libjpeg-turbo

**Code Changes:**
```diff
@@ -15,8 +15,55 @@ endif()
 
 message(STATUS "libjpeg-turbo: VERSION = ${VERSION}, BUILD = ${BUILD}")
 
+math(EXPR BITS "${CMAKE_SIZEOF_VOID_P} * 8")
+string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} CMAKE_SYSTEM_PROCESSOR_LC)
+
+if(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "x86_64" OR
+  CMAKE_SYSTEM_PROCESSOR_LC MATCHES "amd64" OR
+  CMAKE_SYSTEM_PROCESSOR_LC MATCHES "i[0-9]86" OR
```

Review comment:
https://github.com/opencv/opencv/wiki/CPU-optimizations-build-options