nareshmlx/opencv-pr huggingface dataset:
**File:** modules/core/src/nan_mask.simd.hpp
**Change Type:** added
**Context:** PR #23098: finiteMask() and doubles for patchNaNs()

**Code Changes:**
```diff
@@ -0,0 +1,440 @@
+// 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 "precomp.hpp"
+
+namespace cv {
+
```

Review comment:
Joined `v_check_any` gives about +20% to 32f performance and -10% to 64f performance, using it for 32f
**File:** modules/core/perf/opencl/perf_arithm.cpp
**Change Type:** modified
**Context:** PR #23098: finiteMask() and doubles for patchNaNs()

**Code Changes:**
```diff
@@ -41,6 +41,7 @@
 
 #include "../perf_precomp.hpp"
 #include "opencv2/ts/ocl_perf.hpp"
+#include "opencv2/core/softfloat.hpp"
 
 #ifdef HAVE_OPENCL
 
@@ -1038,14 +1039,40 @@ OCL_PERF_TEST_P(ConvertScaleAbsFixture, ConvertScaleAbs,
 
```

Review comment:
Since `theRNG()` depends on the order in which tests are being run, will use an `RNG(0)` to get deterministic sanity test data
**File:** modules/core/perf/opencl/perf_arithm.cpp
**Change Type:** modified
**Context:** PR #23098: finiteMask() and doubles for patchNaNs()

**Code Changes:**
```diff
@@ -41,6 +41,7 @@
 
 #include "../perf_precomp.hpp"
 #include "opencv2/ts/ocl_perf.hpp"
+#include "opencv2/core/softfloat.hpp"
 
 #ifdef HAVE_OPENCL
 
@@ -1038,14 +1039,40 @@ OCL_PERF_TEST_P(ConvertScaleAbsFixture, ConvertScaleAbs,
 
```

Review comment:
> Since theRNG() depends on the order in which tests are being run Example? This should be fixed for the last 5+ years.
**File:** modules/core/src/nan_mask.simd.hpp
**Change Type:** added
**Context:** PR #23098: finiteMask() and doubles for patchNaNs()
**Review Line:** 401

**Code Changes:**
```diff
+
+template <typename _Tp, int cn>
+void finiteMask_(const uchar *src, uchar *dst, size_t total)
+{
+    CV_INSTRUMENT_REGION();
+    size_t i = 0;
+    const _Tp* tsrc = (const _Tp*) src;
+
+#if (CV_SIMD || CV_SIMD_SCALABLE)
+    i = finiteMaskSIMD_<_Tp, cn>(tsrc, dst, total);
+#endif
```

Review comment:
This is externally exposed function (through `getFiniteMaskFunc`). `CV_INSTRUMENT_REGION()` is required here to inject `vzeroupper`.
**File:** modules/core/perf/opencl/perf_arithm.cpp
**Change Type:** modified
**Context:** PR #23098: finiteMask() and doubles for patchNaNs()

**Code Changes:**
```diff
@@ -41,6 +41,7 @@
 
 #include "../perf_precomp.hpp"
 #include "opencv2/ts/ocl_perf.hpp"
+#include "opencv2/core/softfloat.hpp"
 
 #ifdef HAVE_OPENCL
 
@@ -1038,14 +1039,40 @@ OCL_PERF_TEST_P(ConvertScaleAbsFixture, ConvertScaleAbs,
 
```

Review comment:
Checked, you're right. Changed this to `theRNG()`
**File:** modules/core/src/nan_mask.simd.hpp
**Change Type:** added
**Context:** PR #23098: finiteMask() and doubles for patchNaNs()

**Code Changes:**
```diff
@@ -0,0 +1,440 @@
+// 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 "precomp.hpp"
+
+namespace cv {
+
```

Review comment:
Backported to 4.x: #24480
**File:** modules/dnn/perf/perf_net.cpp
**Change Type:** modified
**Context:** PR #24298: Extend performance test models - **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance te...

**Code Changes:**
```diff
@@ -29,10 +29,7 @@ class DNNTestNetwork : public ::perf::TestBaseWithParam< tuple<Backend, Target>
     }
 
     void processNet(std::string weights, std::string proto, std::string halide_scheduler,
-                    const Mat& input, const std::string& outputLayer = "")
-    {
-        randu(input, 0.0f, 1.0f);
-
+                    const std::vector<std::tuple<Mat, std::string>>& inputs, const std::string& outputLayer = ""){
         weights = findDataFile(weights, false);
```

Review comment:
I'd recommend change method behavior instead of adding a new argument: ```cpp void processNet(std::string weights, std::string proto, std::string halide_scheduler, const Mat& input, const std::string& outputLayer = "") //... net.setInput(input); ``` and add an override: ```cpp void processNet(std::string weights, std::string proto, std::string halide_scheduler, Size inpSize, const std::string& outputLayer = "") Mat inp(inpSize, CV_32FC3); processNet(weights, halide_scheduler, inp, outputLayer); ```
**File:** modules/dnn/perf/perf_net.cpp
**Change Type:** modified
**Context:** PR #24298: Extend performance test models - **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance te...
**Review Line:** 32

**Code Changes:**
```diff
     void processNet(std::string weights, std::string proto, std::string halide_scheduler,
-                    const Mat& input, const std::string& outputLayer = "")
-    {
-        randu(input, 0.0f, 1.0f);
-
+                    const std::vector<std::tuple<Mat, std::string>>& inputs, const std::string& outputLayer = ""){
         weights = findDataFile(weights, false);
         if (!proto.empty())
             proto = findDataFile(proto);
@@ -44,18 +41,26 @@ class DNNTestNetwork : public ::perf::TestBaseWithParam< tuple<Backend, Target>
                 halide_scheduler = findDataFile(std::string("dnn/halide_scheduler_") + (target == DNN_TARGET_OPENCL ? "opencl_" : "") + halide_scheduler, true);
```

Review comment:
Why not `std::map`?
**File:** modules/dnn/perf/perf_net.cpp
**Change Type:** modified
**Context:** PR #24298: Extend performance test models - **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance te...

**Code Changes:**
```diff
@@ -29,10 +29,7 @@ class DNNTestNetwork : public ::perf::TestBaseWithParam< tuple<Backend, Target>
     }
 
     void processNet(std::string weights, std::string proto, std::string halide_scheduler,
-                    const Mat& input, const std::string& outputLayer = "")
-    {
-        randu(input, 0.0f, 1.0f);
-
+                    const std::vector<std::tuple<Mat, std::string>>& inputs, const std::string& outputLayer = ""){
         weights = findDataFile(weights, false);
```

Review comment:
I think if user passed specific input - it's expected to be initialized. Might be important for models which performance depend on data (like two-stage detectors).
**File:** modules/dnn/perf/perf_net.cpp
**Change Type:** modified
**Context:** PR #24298: Extend performance test models - **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance te...

**Code Changes:**
```diff
@@ -29,10 +29,7 @@ class DNNTestNetwork : public ::perf::TestBaseWithParam< tuple<Backend, Target>
     }
 
     void processNet(std::string weights, std::string proto, std::string halide_scheduler,
-                    const Mat& input, const std::string& outputLayer = "")
-    {
-        randu(input, 0.0f, 1.0f);
-
+                    const std::vector<std::tuple<Mat, std::string>>& inputs, const std::string& outputLayer = ""){
         weights = findDataFile(weights, false);
```

Review comment:
Same here. If input is provided, let's keep it as is.
**File:** modules/dnn/perf/perf_net.cpp
**Change Type:** modified
**Context:** PR #24298: Extend performance test models - **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance te...

**Code Changes:**
```diff
@@ -29,10 +29,7 @@ class DNNTestNetwork : public ::perf::TestBaseWithParam< tuple<Backend, Target>
     }
 
     void processNet(std::string weights, std::string proto, std::string halide_scheduler,
-                    const Mat& input, const std::string& outputLayer = "")
-    {
-        randu(input, 0.0f, 1.0f);
-
+                    const std::vector<std::tuple<Mat, std::string>>& inputs, const std::string& outputLayer = ""){
         weights = findDataFile(weights, false);
```

Review comment:
Just add an override which accepts a single input and make a single element map from it. Expected that old tests should remain unchanged.
**File:** modules/dnn/perf/perf_net.cpp
**Change Type:** modified
**Context:** PR #24298: Extend performance test models - **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance te...
**Review Line:** 32

**Code Changes:**
```diff
     void processNet(std::string weights, std::string proto, std::string halide_scheduler,
-                    const Mat& input, const std::string& outputLayer = "")
-    {
-        randu(input, 0.0f, 1.0f);
-
+                    const std::vector<std::tuple<Mat, std::string>>& inputs, const std::string& outputLayer = ""){
         weights = findDataFile(weights, false);
         if (!proto.empty())
             proto = findDataFile(proto);
@@ -44,18 +41,26 @@ class DNNTestNetwork : public ::perf::TestBaseWithParam< tuple<Backend, Target>
                 halide_scheduler = findDataFile(std::string("dnn/halide_scheduler_") + (target == DNN_TARGET_OPENCL ? "opencl_" : "") + halide_scheduler, true);
```

Review comment:
Because `net.getMemoryConsumption()` need the input shapes in order when multiple inputs are provided. Map will destroy the sequence.
**File:** modules/dnn/perf/perf_net.cpp
**Change Type:** modified
**Context:** PR #24298: Extend performance test models - **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance te...

**Code Changes:**
```diff
@@ -29,10 +29,7 @@ class DNNTestNetwork : public ::perf::TestBaseWithParam< tuple<Backend, Target>
     }
 
     void processNet(std::string weights, std::string proto, std::string halide_scheduler,
-                    const Mat& input, const std::string& outputLayer = "")
-    {
-        randu(input, 0.0f, 1.0f);
-
+                    const std::vector<std::tuple<Mat, std::string>>& inputs, const std::string& outputLayer = ""){
         weights = findDataFile(weights, false);
```

Review comment:
But in the original code, all inputs will be rand number. Should I change it? https://github.com/opencv/opencv/blob/865e7caccab087d633f9c1610616538c2cb4f066/modules/dnn/perf/perf_net.cpp#L31-L34
**File:** modules/dnn/perf/perf_net.cpp
**Change Type:** modified
**Context:** PR #24298: Extend performance test models - **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance te...

**Code Changes:**
```diff
@@ -29,10 +29,7 @@ class DNNTestNetwork : public ::perf::TestBaseWithParam< tuple<Backend, Target>
     }
 
     void processNet(std::string weights, std::string proto, std::string halide_scheduler,
-                    const Mat& input, const std::string& outputLayer = "")
-    {
-        randu(input, 0.0f, 1.0f);
-
+                    const std::vector<std::tuple<Mat, std::string>>& inputs, const std::string& outputLayer = ""){
         weights = findDataFile(weights, false);
```

Review comment:
Please do not add Halide related checks. It's not actual and won't be tested.
**File:** modules/videoio/src/cap_ffmpeg_impl.hpp
**Change Type:** modified
**Context:** PR #24363: videoio: Add raw encoded video stream encapsulation to `cv::VideoWriter` with `CAP_FFMPEG`

**Code Changes:**
```diff
@@ -1447,7 +1447,8 @@ bool CvCapture_FFMPEG::processRawPacket()
 #else
         AVCodecContext* ctx = ic->streams[video_stream]->codec;
         int err = av_bitstream_filter_filter(bsfc, ctx, NULL, &packet_filtered.data,
-            &packet_filtered.size, packet.data, packet.size, packet_filtered.flags & AV_PKT_FLAG_KEY);
+            &packet_filtered.size, packet.data, packet.size, packet.flags & AV_PKT_FLAG_KEY);
+        if (packet.flags & AV_PKT_FLAG_KEY) packet_filtered.flags |= AV_PKT_FLAG_KEY;
         if (err < 0)
         {
             CV_WARN("Packet filtering failed");
```

Review comment:
It makes sense to support case with w=1 and h=size. You can use Mat.total() in further steps to get buffer size. Also `[isContinuous](https://docs.opencv.org/4.x/d3/d63/classcv_1_1Mat.html#aa90cea495029c7d1ee0a41361ccecdf3)` is required.
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #24363: videoio: Add raw encoded video stream encapsulation to `cv::VideoWriter` with `CAP_FFMPEG`

**Code Changes:**
```diff
@@ -225,10 +225,13 @@ enum VideoWriterProperties {
   VIDEOWRITER_PROP_NSTRIPES = 3,   //!< Number of stripes for parallel encoding. -1 for auto detection.
   VIDEOWRITER_PROP_IS_COLOR = 4,   //!< If it is not zero, the encoder will expect and encode color frames, otherwise it
                                    //!< will work with grayscale frames.
-  VIDEOWRITER_PROP_DEPTH = 5,      //!< Defaults to CV_8U.
+  VIDEOWRITER_PROP_DEPTH = 5,      //!< Defaults to \ref CV_8U.
   VIDEOWRITER_PROP_HW_ACCELERATION = 6, //!< (**open-only**) Hardware acceleration type (see #VideoAccelerationType). Setting supported only via `params` parameter in VideoWriter constructor / .open() method. Default value is backend-specific.
   VIDEOWRITER_PROP_HW_DEVICE       = 7, //!< (**open-only**) Hardware device index (select GPU if multiple available). Device enumeration is acceleration type specific.
   VIDEOWRITER_PROP_HW_ACCELERATION_USE_OPENCL= 8, //!< (**open-only**) If non-zero, create new OpenCL context and bind it to current thread. The OpenCL context created with Video Acceleration context attached it (if not attached yet) for optimized GPU data copy between cv::UMat and HW accelerated encoder.
+  VIDEOWRITER_PROP_RAW_VIDEO = 9, //!< (**open-only**) Set to non-zero to enable encapsulation of an encoded raw video stream. Each raw encoded video frame should be passed to VideoWriter::write() as single row or column of a \ref CV_8UC1 Mat. \note If the key frame interval is not 1 then it must be manually specified by the user. This can either be performed during initialization passing \ref VIDEOWRITER_PROP_KEY_INTERVAL as one of the extra encoder params  to \ref VideoWriter::VideoWriter(const String &, int, double, const Size &, const std::vector< int > &params) or afterwards by setting the \ref VIDEOWRITER_PROP_KEY_FLAG with \ref VideoWriter::set() before writing each frame. FFMpeg backend only.
```

Review comment:
Please add note, that key frames should be marked on user side. E.g. I cannot just read N bytes from .h264 file and feed it to VideoWriter as is.
**File:** modules/videoio/src/cap_ffmpeg_impl.hpp
**Change Type:** modified
**Context:** PR #24363: videoio: Add raw encoded video stream encapsulation to `cv::VideoWriter` with `CAP_FFMPEG`

**Code Changes:**
```diff
@@ -1447,7 +1447,8 @@ bool CvCapture_FFMPEG::processRawPacket()
 #else
         AVCodecContext* ctx = ic->streams[video_stream]->codec;
         int err = av_bitstream_filter_filter(bsfc, ctx, NULL, &packet_filtered.data,
-            &packet_filtered.size, packet.data, packet.size, packet_filtered.flags & AV_PKT_FLAG_KEY);
+            &packet_filtered.size, packet.data, packet.size, packet.flags & AV_PKT_FLAG_KEY);
+        if (packet.flags & AV_PKT_FLAG_KEY) packet_filtered.flags |= AV_PKT_FLAG_KEY;
         if (err < 0)
         {
             CV_WARN("Packet filtering failed");
```

Review comment:
> You can use Mat.total() in further steps to get buffer size. Also `[isContinuous](https://docs.opencv.org/4.x/d3/d63/classcv_1_1Mat.html#aa90cea495029c7d1ee0a41361ccecdf3)` is required. I'm unable to user `Mat::total()` or `Mat::isContinous` here as the `Mat` has already been decomposed into `data,step,width,height,` etc. Do you agree it should be safe to imply `Mat::isContinous` if we have either a - single row, or a - single coloumn where the step is 1 e.g. ``` CV_Assert(cn == 1 && ((width > 0 && height == 1) || (width == 1 && height > 0 && step == 1))); ```
**File:** modules/videoio/src/cap_ffmpeg_impl.hpp
**Change Type:** modified
**Context:** PR #24363: videoio: Add raw encoded video stream encapsulation to `cv::VideoWriter` with `CAP_FFMPEG`

**Code Changes:**
```diff
@@ -1447,7 +1447,8 @@ bool CvCapture_FFMPEG::processRawPacket()
 #else
         AVCodecContext* ctx = ic->streams[video_stream]->codec;
         int err = av_bitstream_filter_filter(bsfc, ctx, NULL, &packet_filtered.data,
-            &packet_filtered.size, packet.data, packet.size, packet_filtered.flags & AV_PKT_FLAG_KEY);
+            &packet_filtered.size, packet.data, packet.size, packet.flags & AV_PKT_FLAG_KEY);
+        if (packet.flags & AV_PKT_FLAG_KEY) packet_filtered.flags |= AV_PKT_FLAG_KEY;
         if (err < 0)
         {
             CV_WARN("Packet filtering failed");
```

Review comment:
Yes, should work.
**File:** modules/imgcodecs/src/grfmt_avif.cpp
**Change Type:** modified
**Context:** PR #24438: Check the return value of avifDecoderSetIOMemory.
**Review Line:** 171

**Code Changes:**
```diff
+          decoder, reinterpret_cast<const uint8_t *>(signature.c_str()),
+          signature.size()),
+      decoder);
+  decoder->io->sizeHint = 1e9;
+  const avifResult status = avifDecoderParse(decoder);
+  avifDecoderDestroy(decoder);
+  return (status == AVIF_RESULT_OK || status == AVIF_RESULT_TRUNCATED_DATA);
+}
+
 ImageDecoder AvifDecoder::newDecoder() const { return makePtr<AvifDecoder>(); }
 
```

Review comment:
Won't `decoder` instance leak if we exit earlier due to failed `avifDecoderSetIOMemory` call?
**File:** modules/imgcodecs/src/grfmt_avif.cpp
**Change Type:** modified
**Context:** PR #24438: Check the return value of avifDecoderSetIOMemory.
**Review Line:** 171

**Code Changes:**
```diff
+          decoder, reinterpret_cast<const uint8_t *>(signature.c_str()),
+          signature.size()),
+      decoder);
+  decoder->io->sizeHint = 1e9;
+  const avifResult status = avifDecoderParse(decoder);
+  avifDecoderDestroy(decoder);
+  return (status == AVIF_RESULT_OK || status == AVIF_RESULT_TRUNCATED_DATA);
+}
+
 ImageDecoder AvifDecoder::newDecoder() const { return makePtr<AvifDecoder>(); }
 
```

Review comment:
You are totally right, I provided a fix in https://github.com/opencv/opencv/pull/24441. Thx !
**File:** modules/imgcodecs/test/test_avif.cpp
**Change Type:** added
**Context:** PR #23596: Add AVIF support through libavif.

**Code Changes:**
```diff
@@ -0,0 +1,355 @@
+// 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 <cstdint>
+#include <fstream>
+
+#include "test_precomp.hpp"
+
```

Review comment:
m. b. const int? Also I propose to use some odd size to be sure that tails are handled correctly.
**File:** modules/imgcodecs/test/test_avif.cpp
**Change Type:** added
**Context:** PR #23596: Add AVIF support through libavif.

**Code Changes:**
```diff
@@ -0,0 +1,355 @@
+// 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 <cstdint>
+#include <fstream>
+
+#include "test_precomp.hpp"
+
```

Review comment:
I propose to split imread-imwrite and imdecode-imencode sequences on two independent tests. It makes things simpler and in case of test failure, it's more obvious.
**File:** modules/imgcodecs/test/test_avif.cpp
**Change Type:** added
**Context:** PR #23596: Add AVIF support through libavif.

**Code Changes:**
```diff
@@ -0,0 +1,355 @@
+// 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 <cstdint>
+#include <fstream>
+
+#include "test_precomp.hpp"
+
```

Review comment:
It's very weak check. All cases should check image content. You can introduce non-zero tolerance for NORM_INF for example.
**File:** modules/imgcodecs/test/test_avif.cpp
**Change Type:** added
**Context:** PR #23596: Add AVIF support through libavif.

**Code Changes:**
```diff
@@ -0,0 +1,355 @@
+// 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 <cstdint>
+#include <fstream>
+
+#include "test_precomp.hpp"
+
```

Review comment:
The same remark on picture content check.
**File:** modules/imgcodecs/test/test_avif.cpp
**Change Type:** added
**Context:** PR #23596: Add AVIF support through libavif.
**Review Line:** 352

**Code Changes:**
```diff
+    ::testing::Combine(::testing::ValuesIn({8, 10, 12}),
+                       ::testing::ValuesIn({1, 3}), ::testing::ValuesIn({50}),
+                       ::testing::ValuesIn({IMREAD_UNCHANGED, IMREAD_GRAYSCALE,
+                                            IMREAD_COLOR})));
+
+}  // namespace
+}  // namespace opencv_test
+
+#endif  // HAVE_AVIF
```

Review comment:
Please add some test for rotation meta, if possible.
**File:** cmake/OpenCVFindLibsGrfmt.cmake
**Change Type:** modified
**Context:** PR #23596: Add AVIF support through libavif.
**Review Line:** 48

**Code Changes:**
```diff
+  ocv_clear_internal_cache_vars(AVIF_LIBRARY AVIF_INCLUDE_DIR)
+  include(cmake/OpenCVFindAVIF.cmake)
+  if(AVIF_FOUND)
+    set(HAVE_AVIF 1)
+  endif()
+endif()
+
 # --- libjpeg (optional) ---
 if(WITH_JPEG)
   if(BUILD_JPEG)
```

Review comment:
Please add also a flag to `cvconfig.h` See https://github.com/opencv/opencv/blob/4.x/cmake/templates/cvconfig.h.in
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #23596: Add AVIF support through libavif.

**Code Changes:**
```diff
@@ -240,6 +240,8 @@ OCV_OPTION(WITH_1394 "Include IEEE1394 support" ON
 OCV_OPTION(WITH_AVFOUNDATION "Use AVFoundation for Video I/O (iOS/Mac)" ON
   VISIBLE_IF APPLE
   VERIFY HAVE_AVFOUNDATION)
+OCV_OPTION(WITH_AVIF "Enable AVIF support" OFF
+  VERIFY HAVE_AVIF)
 OCV_OPTION(WITH_CAP_IOS "Enable iOS video capture" ON
   VISIBLE_IF IOS
   VERIFY HAVE_CAP_IOS)
@@ -1379,6 +1381,14 @@ if(WITH_WEBP OR HAVE_WEBP)
```

Review comment:
version is not detected on Ubuntu 22.04. CMake output: ``` AVIF: avif (ver ) ```
**File:** modules/imgcodecs/test/test_avif.cpp
**Change Type:** added
**Context:** PR #23596: Add AVIF support through libavif.
**Review Line:** 352

**Code Changes:**
```diff
+    ::testing::Combine(::testing::ValuesIn({8, 10, 12}),
+                       ::testing::ValuesIn({1, 3}), ::testing::ValuesIn({50}),
+                       ::testing::ValuesIn({IMREAD_UNCHANGED, IMREAD_GRAYSCALE,
+                                            IMREAD_COLOR})));
+
+}  // namespace
+}  // namespace opencv_test
+
+#endif  // HAVE_AVIF
```

Review comment:
That would require me to add an AVIF file. I can probably put a small one but that would be 500 bytes. Is that ok ?
**File:** cmake/OpenCVFindLibsGrfmt.cmake
**Change Type:** modified
**Context:** PR #23596: Add AVIF support through libavif.
**Review Line:** 48

**Code Changes:**
```diff
+  ocv_clear_internal_cache_vars(AVIF_LIBRARY AVIF_INCLUDE_DIR)
+  include(cmake/OpenCVFindAVIF.cmake)
+  if(AVIF_FOUND)
+    set(HAVE_AVIF 1)
+  endif()
+endif()
+
 # --- libjpeg (optional) ---
 if(WITH_JPEG)
   if(BUILD_JPEG)
```

Review comment:
Actually, there is no HAVE_WEBP, it is done through a compilation define: https://github.com/opencv/opencv/blob/6d3dd2462207791aaa10ef08fd63d5ca05081e03/modules/imgcodecs/CMakeLists.txt#L22 . Is that a mistake? (other libraries do appear in cvconfig.h).
**File:** cmake/OpenCVFindLibsGrfmt.cmake
**Change Type:** modified
**Context:** PR #23596: Add AVIF support through libavif.
**Review Line:** 48

**Code Changes:**
```diff
+  ocv_clear_internal_cache_vars(AVIF_LIBRARY AVIF_INCLUDE_DIR)
+  include(cmake/OpenCVFindAVIF.cmake)
+  if(AVIF_FOUND)
+    set(HAVE_AVIF 1)
+  endif()
+endif()
+
 # --- libjpeg (optional) ---
 if(WITH_JPEG)
   if(BUILD_JPEG)
```

Review comment:
I will fix that in a different pull request.