Sarah Parker | 4dc0f1b | 2016-08-09 17:40:53 -0700 | [diff] [blame] | 1 | /* |
James Zern | b7c05bd | 2024-06-11 19:15:10 -0700 | [diff] [blame] | 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved. |
Sarah Parker | 4dc0f1b | 2016-08-09 17:40:53 -0700 | [diff] [blame] | 3 | * |
Yaowu Xu | bde4ac8 | 2016-11-28 15:26:06 -0800 | [diff] [blame] | 4 | * This source code is subject to the terms of the BSD 2 Clause License and |
| 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License |
| 6 | * was not distributed with this source code in the LICENSE file, you can |
| 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open |
| 8 | * Media Patent License 1.0 was not distributed with this source code in the |
| 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. |
Sarah Parker | 4dc0f1b | 2016-08-09 17:40:53 -0700 | [diff] [blame] | 10 | */ |
Rachel Barker | 53e3a69 | 2022-11-30 15:45:11 +0000 | [diff] [blame] | 11 | |
| 12 | #ifndef AOM_AOM_DSP_FLOW_ESTIMATION_CORNER_MATCH_H_ |
| 13 | #define AOM_AOM_DSP_FLOW_ESTIMATION_CORNER_MATCH_H_ |
Sarah Parker | 4dc0f1b | 2016-08-09 17:40:53 -0700 | [diff] [blame] | 14 | |
Rachel Barker | a02796a | 2023-03-02 20:06:47 +0000 | [diff] [blame] | 15 | #include <stdbool.h> |
Sarah Parker | 4dc0f1b | 2016-08-09 17:40:53 -0700 | [diff] [blame] | 16 | #include <stdio.h> |
| 17 | #include <stdlib.h> |
| 18 | #include <memory.h> |
| 19 | |
Rachel Barker | 2722ce6 | 2022-12-19 15:38:55 +0000 | [diff] [blame] | 20 | #include "aom_dsp/flow_estimation/corner_detect.h" |
Rachel Barker | 53e3a69 | 2022-11-30 15:45:11 +0000 | [diff] [blame] | 21 | #include "aom_dsp/flow_estimation/flow_estimation.h" |
| 22 | #include "aom_scale/yv12config.h" |
| 23 | |
| 24 | #ifdef __cplusplus |
| 25 | extern "C" { |
| 26 | #endif |
| 27 | |
Rachel Barker | 3d09825 | 2023-04-28 03:08:08 +0000 | [diff] [blame] | 28 | #define MATCH_SZ 16 |
David Barker | ee67432 | 2017-05-10 15:43:02 +0100 | [diff] [blame] | 29 | #define MATCH_SZ_BY2 ((MATCH_SZ - 1) / 2) |
| 30 | #define MATCH_SZ_SQ (MATCH_SZ * MATCH_SZ) |
| 31 | |
Rachel Barker | 3d09825 | 2023-04-28 03:08:08 +0000 | [diff] [blame] | 32 | // Minimum threshold for the variance of a patch, in order for it to be |
| 33 | // considered useful for matching. |
| 34 | // This is evaluated against the scaled variance MATCH_SZ_SQ * sigma^2, |
| 35 | // so a setting of 1 * MATCH_SZ_SQ corresponds to an unscaled variance of 1 |
| 36 | #define MIN_FEATURE_VARIANCE (1 * MATCH_SZ_SQ) |
| 37 | |
Rachel Barker | a02796a | 2023-03-02 20:06:47 +0000 | [diff] [blame] | 38 | bool av1_compute_global_motion_feature_match( |
Rachel Barker | 2722ce6 | 2022-12-19 15:38:55 +0000 | [diff] [blame] | 39 | TransformationType type, YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *ref, |
Rachel Barker | a55ceb1 | 2024-02-13 14:56:53 +0000 | [diff] [blame] | 40 | int bit_depth, int downsample_level, MotionModel *motion_models, |
| 41 | int num_motion_models, bool *mem_alloc_failed); |
Rachel Barker | 53e3a69 | 2022-11-30 15:45:11 +0000 | [diff] [blame] | 42 | |
| 43 | #ifdef __cplusplus |
| 44 | } |
| 45 | #endif |
| 46 | |
| 47 | #endif // AOM_AOM_DSP_FLOW_ESTIMATION_CORNER_MATCH_H_ |