blob: 36af17b81e9b335a90d4417442c6e4f1c483680b [file] [log] [blame]
Sarah Parker4dc0f1b2016-08-09 17:40:53 -07001/*
James Zernb7c05bd2024-06-11 19:15:10 -07002 * Copyright (c) 2016, Alliance for Open Media. All rights reserved.
Sarah Parker4dc0f1b2016-08-09 17:40:53 -07003 *
Yaowu Xubde4ac82016-11-28 15:26:06 -08004 * 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 Parker4dc0f1b2016-08-09 17:40:53 -070010 */
Rachel Barker53e3a692022-11-30 15:45:11 +000011
12#ifndef AOM_AOM_DSP_FLOW_ESTIMATION_CORNER_MATCH_H_
13#define AOM_AOM_DSP_FLOW_ESTIMATION_CORNER_MATCH_H_
Sarah Parker4dc0f1b2016-08-09 17:40:53 -070014
Rachel Barkera02796a2023-03-02 20:06:47 +000015#include <stdbool.h>
Sarah Parker4dc0f1b2016-08-09 17:40:53 -070016#include <stdio.h>
17#include <stdlib.h>
18#include <memory.h>
19
Rachel Barker2722ce62022-12-19 15:38:55 +000020#include "aom_dsp/flow_estimation/corner_detect.h"
Rachel Barker53e3a692022-11-30 15:45:11 +000021#include "aom_dsp/flow_estimation/flow_estimation.h"
22#include "aom_scale/yv12config.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
Rachel Barker3d098252023-04-28 03:08:08 +000028#define MATCH_SZ 16
David Barkeree674322017-05-10 15:43:02 +010029#define MATCH_SZ_BY2 ((MATCH_SZ - 1) / 2)
30#define MATCH_SZ_SQ (MATCH_SZ * MATCH_SZ)
31
Rachel Barker3d098252023-04-28 03:08:08 +000032// 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 Barkera02796a2023-03-02 20:06:47 +000038bool av1_compute_global_motion_feature_match(
Rachel Barker2722ce62022-12-19 15:38:55 +000039 TransformationType type, YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *ref,
Rachel Barkera55ceb12024-02-13 14:56:53 +000040 int bit_depth, int downsample_level, MotionModel *motion_models,
41 int num_motion_models, bool *mem_alloc_failed);
Rachel Barker53e3a692022-11-30 15:45:11 +000042
43#ifdef __cplusplus
44}
45#endif
46
47#endif // AOM_AOM_DSP_FLOW_ESTIMATION_CORNER_MATCH_H_