Create api/video/corruption_detection directory.

This CL adds a new corruption_detection subdirector in api/video and
moves corruption_detection_filter_settings.h there.

The intent is to expose more parts of the corruption detection code in
this directory to make integration in external systems easier.

Bug: webrtc:358039777
Change-Id: I4dc8fc8b1d146616aeebfc6bd845a880944b4449
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/403700
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45314}
diff --git a/api/video/BUILD.gn b/api/video/BUILD.gn
index e621f9c..cd74281 100644
--- a/api/video/BUILD.gn
+++ b/api/video/BUILD.gn
@@ -144,9 +144,11 @@
   deps = [ "../../rtc_base/system:rtc_export" ]
 }
 
+# TODO: bugs.webrtc.org/358039777 - Remove when safe.
 rtc_source_set("corruption_detection_filter_settings") {
   visibility = [ "*" ]
   sources = [ "corruption_detection_filter_settings.h" ]
+  deps = [ "corruption_detection:filter_settings" ]
 }
 
 rtc_library("encoded_image") {
@@ -156,7 +158,6 @@
     "encoded_image.h",
   ]
   deps = [
-    ":corruption_detection_filter_settings",
     ":video_codec_constants",
     ":video_frame",
     ":video_frame_type",
@@ -171,6 +172,7 @@
     "../../rtc_base:refcount",
     "../../rtc_base/system:rtc_export",
     "../units:timestamp",
+    "corruption_detection:filter_settings",
   ]
 }
 
diff --git a/api/video/corruption_detection/BUILD.gn b/api/video/corruption_detection/BUILD.gn
new file mode 100644
index 0000000..3b87763
--- /dev/null
+++ b/api/video/corruption_detection/BUILD.gn
@@ -0,0 +1,14 @@
+# Copyright (c) 2025 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+
+import("../../../webrtc.gni")
+
+rtc_source_set("filter_settings") {
+  visibility = [ "*" ]
+  sources = [ "corruption_detection_filter_settings.h" ]
+}
diff --git a/api/video/corruption_detection/corruption_detection_filter_settings.h b/api/video/corruption_detection/corruption_detection_filter_settings.h
new file mode 100644
index 0000000..a6c2146
--- /dev/null
+++ b/api/video/corruption_detection/corruption_detection_filter_settings.h
@@ -0,0 +1,31 @@
+/*
+ *  Copyright (c) 2024 The WebRTC project authors. All Rights Reserved.
+ *
+ *  Use of this source code is governed by a BSD-style license
+ *  that can be found in the LICENSE file in the root of the source
+ *  tree. An additional intellectual property rights grant can be found
+ *  in the file PATENTS.  All contributing project authors may
+ *  be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef API_VIDEO_CORRUPTION_DETECTION_CORRUPTION_DETECTION_FILTER_SETTINGS_H_
+#define API_VIDEO_CORRUPTION_DETECTION_CORRUPTION_DETECTION_FILTER_SETTINGS_H_
+
+#include <stdint.h>
+
+namespace webrtc {
+
+// Filter settings for automatic corruption detection. See
+// http://www.webrtc.org/experiments/rtp-hdrext/corruption-detection for more
+// information.
+struct CorruptionDetectionFilterSettings {
+  // Size of the blur kernel used.
+  double std_dev = 0.0;
+  // Allowed error thresholds (maps to `Y err` and `UV err` respectively).
+  int luma_error_threshold = 0;
+  int chroma_error_threshold = 0;
+};
+
+}  // namespace webrtc
+
+#endif  // API_VIDEO_CORRUPTION_DETECTION_CORRUPTION_DETECTION_FILTER_SETTINGS_H_
diff --git a/api/video/corruption_detection_filter_settings.h b/api/video/corruption_detection_filter_settings.h
index 080a88e..0d8acc0 100644
--- a/api/video/corruption_detection_filter_settings.h
+++ b/api/video/corruption_detection_filter_settings.h
@@ -11,21 +11,8 @@
 #ifndef API_VIDEO_CORRUPTION_DETECTION_FILTER_SETTINGS_H_
 #define API_VIDEO_CORRUPTION_DETECTION_FILTER_SETTINGS_H_
 
-#include <stdint.h>
+#include "api/video/corruption_detection/corruption_detection_filter_settings.h"
 
-namespace webrtc {
-
-// Filter settings for automatic corruption detection. See
-// http://www.webrtc.org/experiments/rtp-hdrext/corruption-detection for more
-// information.
-struct CorruptionDetectionFilterSettings {
-  // Size of the blur kernel used.
-  double std_dev = 0.0;
-  // Allowed error thresholds (maps to `Y err` and `UV err` respectively).
-  int luma_error_threshold = 0;
-  int chroma_error_threshold = 0;
-};
-
-}  // namespace webrtc
+// TODO: bugs.webrtc.org/358039777 - Remove this file when safe to do so.
 
 #endif  // API_VIDEO_CORRUPTION_DETECTION_FILTER_SETTINGS_H_
diff --git a/api/video/encoded_image.h b/api/video/encoded_image.h
index b8400c0..095c4ff 100644
--- a/api/video/encoded_image.h
+++ b/api/video/encoded_image.h
@@ -23,7 +23,7 @@
 #include "api/scoped_refptr.h"
 #include "api/units/timestamp.h"
 #include "api/video/color_space.h"
-#include "api/video/corruption_detection_filter_settings.h"
+#include "api/video/corruption_detection/corruption_detection_filter_settings.h"
 #include "api/video/video_codec_constants.h"
 #include "api/video/video_content_type.h"
 #include "api/video/video_frame_type.h"
diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn
index b0dd698..2ef666d 100644
--- a/modules/video_coding/BUILD.gn
+++ b/modules/video_coding/BUILD.gn
@@ -444,7 +444,6 @@
     "../../api/task_queue",
     "../../api/units:data_rate",
     "../../api/units:time_delta",
-    "../../api/video:corruption_detection_filter_settings",
     "../../api/video:encoded_frame",
     "../../api/video:encoded_image",
     "../../api/video:video_adaptation",
@@ -453,6 +452,7 @@
     "../../api/video:video_codec_constants",
     "../../api/video:video_frame",
     "../../api/video:video_frame_type",
+    "../../api/video/corruption_detection:filter_settings",
     "../../api/video_codecs:video_codecs_api",
     "../../common_video",
     "../../modules/rtp_rtcp",
@@ -1297,7 +1297,6 @@
       "../../api/units:time_delta",
       "../../api/units:timestamp",
       "../../api/video:builtin_video_bitrate_allocator_factory",
-      "../../api/video:corruption_detection_filter_settings",
       "../../api/video:encoded_frame",
       "../../api/video:encoded_image",
       "../../api/video:frame_buffer",
@@ -1310,6 +1309,7 @@
       "../../api/video:video_frame",
       "../../api/video:video_frame_type",
       "../../api/video:video_rtp_headers",
+      "../../api/video/corruption_detection:filter_settings",
       "../../api/video_codecs:scalability_mode",
       "../../api/video_codecs:video_codecs_api",
       "../../api/video_codecs:vp8_temporal_layers_factory",
diff --git a/modules/video_coding/utility/corruption_detection_settings_generator.cc b/modules/video_coding/utility/corruption_detection_settings_generator.cc
index fedf268..0666c3e 100644
--- a/modules/video_coding/utility/corruption_detection_settings_generator.cc
+++ b/modules/video_coding/utility/corruption_detection_settings_generator.cc
@@ -14,7 +14,7 @@
 #include <cmath>
 #include <variant>
 
-#include "api/video/corruption_detection_filter_settings.h"
+#include "api/video/corruption_detection/corruption_detection_filter_settings.h"
 #include "rtc_base/checks.h"
 
 namespace webrtc {
diff --git a/modules/video_coding/utility/corruption_detection_settings_generator.h b/modules/video_coding/utility/corruption_detection_settings_generator.h
index 53ba169..ab71a60 100644
--- a/modules/video_coding/utility/corruption_detection_settings_generator.h
+++ b/modules/video_coding/utility/corruption_detection_settings_generator.h
@@ -14,7 +14,7 @@
 #include <optional>
 #include <variant>
 
-#include "api/video/corruption_detection_filter_settings.h"
+#include "api/video/corruption_detection/corruption_detection_filter_settings.h"
 
 namespace webrtc {
 
diff --git a/modules/video_coding/utility/corruption_detection_settings_generator_unittest.cc b/modules/video_coding/utility/corruption_detection_settings_generator_unittest.cc
index 59cc95f..ce56cb0 100644
--- a/modules/video_coding/utility/corruption_detection_settings_generator_unittest.cc
+++ b/modules/video_coding/utility/corruption_detection_settings_generator_unittest.cc
@@ -10,7 +10,7 @@
 
 #include "modules/video_coding/utility/corruption_detection_settings_generator.h"
 
-#include "api/video/corruption_detection_filter_settings.h"
+#include "api/video/corruption_detection/corruption_detection_filter_settings.h"
 #include "test/gmock.h"
 #include "test/gtest.h"
 
diff --git a/video/corruption_detection/BUILD.gn b/video/corruption_detection/BUILD.gn
index 5aaa283..bac0dde 100644
--- a/video/corruption_detection/BUILD.gn
+++ b/video/corruption_detection/BUILD.gn
@@ -48,10 +48,10 @@
     ":generic_mapping_functions",
     ":halton_frame_sampler",
     "../../api:scoped_refptr",
-    "../../api/video:corruption_detection_filter_settings",
     "../../api/video:encoded_image",
     "../../api/video:video_frame",
     "../../api/video:video_frame_type",
+    "../../api/video/corruption_detection:filter_settings",
     "../../api/video_codecs:video_codecs_api",
     "../../common_video:frame_instrumentation_data",
     "../../modules:module_api_public",
@@ -75,8 +75,8 @@
     ":halton_frame_sampler",
     ":utils",
     "../../api:scoped_refptr",
-    "../../api/video:corruption_detection_filter_settings",
     "../../api/video:video_frame",
+    "../../api/video/corruption_detection:filter_settings",
     "../../rtc_base:checks",
     "//third_party/abseil-cpp/absl/strings:string_view",
   ]
@@ -88,8 +88,8 @@
     "generic_mapping_functions.h",
   ]
   deps = [
-    "../../api/video:corruption_detection_filter_settings",
     "../../api/video:video_frame",
+    "../../api/video/corruption_detection:filter_settings",
     "../../api/video_codecs:video_codecs_api",
     "../../rtc_base:checks",
   ]
@@ -176,10 +176,10 @@
       ":frame_instrumentation_generator",
       "../../api:make_ref_counted",
       "../../api:scoped_refptr",
-      "../../api/video:corruption_detection_filter_settings",
       "../../api/video:encoded_image",
       "../../api/video:video_frame",
       "../../api/video:video_frame_type",
+      "../../api/video/corruption_detection:filter_settings",
       "../../common_video:frame_instrumentation_data",
       "../../rtc_base:refcount",
       "../../test:test_support",
diff --git a/video/corruption_detection/frame_instrumentation_generator.cc b/video/corruption_detection/frame_instrumentation_generator.cc
index ba1c60c..6c4c70d 100644
--- a/video/corruption_detection/frame_instrumentation_generator.cc
+++ b/video/corruption_detection/frame_instrumentation_generator.cc
@@ -19,7 +19,7 @@
 #include <vector>
 
 #include "absl/algorithm/container.h"
-#include "api/video/corruption_detection_filter_settings.h"
+#include "api/video/corruption_detection/corruption_detection_filter_settings.h"
 #include "api/video/encoded_image.h"
 #include "api/video/video_codec_type.h"
 #include "api/video/video_frame.h"
diff --git a/video/corruption_detection/frame_instrumentation_generator_unittest.cc b/video/corruption_detection/frame_instrumentation_generator_unittest.cc
index fff4cb4..e1684f0 100644
--- a/video/corruption_detection/frame_instrumentation_generator_unittest.cc
+++ b/video/corruption_detection/frame_instrumentation_generator_unittest.cc
@@ -18,7 +18,7 @@
 
 #include "api/make_ref_counted.h"
 #include "api/scoped_refptr.h"
-#include "api/video/corruption_detection_filter_settings.h"
+#include "api/video/corruption_detection/corruption_detection_filter_settings.h"
 #include "api/video/encoded_image.h"
 #include "api/video/i420_buffer.h"
 #include "api/video/video_codec_type.h"
diff --git a/video/corruption_detection/frame_pair_corruption_score.cc b/video/corruption_detection/frame_pair_corruption_score.cc
index 0e2d7c9..f861bfb 100644
--- a/video/corruption_detection/frame_pair_corruption_score.cc
+++ b/video/corruption_detection/frame_pair_corruption_score.cc
@@ -15,7 +15,7 @@
 
 #include "absl/strings/string_view.h"
 #include "api/scoped_refptr.h"
-#include "api/video/corruption_detection_filter_settings.h"
+#include "api/video/corruption_detection/corruption_detection_filter_settings.h"
 #include "api/video/video_frame.h"
 #include "api/video/video_frame_buffer.h"
 #include "rtc_base/checks.h"
diff --git a/video/corruption_detection/generic_mapping_functions.cc b/video/corruption_detection/generic_mapping_functions.cc
index 7dcbfed..5215f15 100644
--- a/video/corruption_detection/generic_mapping_functions.cc
+++ b/video/corruption_detection/generic_mapping_functions.cc
@@ -12,7 +12,7 @@
 
 #include <cmath>
 
-#include "api/video/corruption_detection_filter_settings.h"
+#include "api/video/corruption_detection/corruption_detection_filter_settings.h"
 #include "api/video/video_codec_type.h"
 #include "api/video_codecs/video_codec.h"
 #include "rtc_base/checks.h"
diff --git a/video/corruption_detection/generic_mapping_functions.h b/video/corruption_detection/generic_mapping_functions.h
index 191c229..74ab393 100644
--- a/video/corruption_detection/generic_mapping_functions.h
+++ b/video/corruption_detection/generic_mapping_functions.h
@@ -11,7 +11,7 @@
 #ifndef VIDEO_CORRUPTION_DETECTION_GENERIC_MAPPING_FUNCTIONS_H_
 #define VIDEO_CORRUPTION_DETECTION_GENERIC_MAPPING_FUNCTIONS_H_
 
-#include "api/video/corruption_detection_filter_settings.h"
+#include "api/video/corruption_detection/corruption_detection_filter_settings.h"
 #include "api/video/video_codec_type.h"
 
 namespace webrtc {