2015-06-05 19:54:19 +03:00
|
|
|
/*
|
2016-09-02 00:32:49 +03:00
|
|
|
* Copyright (c) 2016, Alliance for Open Media. All rights reserved
|
2015-06-05 19:54:19 +03:00
|
|
|
*
|
2016-09-02 00:32:49 +03:00
|
|
|
* This source code is subject to the terms of the BSD 2 Clause License and
|
|
|
|
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
|
|
|
|
* was not distributed with this source code in the LICENSE file, you can
|
|
|
|
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
|
|
|
|
* Media Patent License 1.0 was not distributed with this source code in the
|
|
|
|
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
|
2015-06-05 19:54:19 +03:00
|
|
|
*/
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#ifndef AOM_DSP_VARIANCE_H_
|
|
|
|
#define AOM_DSP_VARIANCE_H_
|
2015-06-05 19:54:19 +03:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#include "./aom_config.h"
|
2015-06-05 19:54:19 +03:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#include "aom/aom_integer.h"
|
2015-06-05 19:54:19 +03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define FILTER_BITS 7
|
|
|
|
#define FILTER_WEIGHT 128
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
typedef unsigned int (*aom_sad_fn_t)(const uint8_t *a, int a_stride,
|
2016-08-09 08:59:08 +03:00
|
|
|
const uint8_t *b, int b_stride);
|
2015-06-05 19:54:19 +03:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
typedef unsigned int (*aom_sad_avg_fn_t)(const uint8_t *a, int a_stride,
|
2016-08-09 08:59:08 +03:00
|
|
|
const uint8_t *b, int b_stride,
|
|
|
|
const uint8_t *second_pred);
|
2015-06-05 19:54:19 +03:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
typedef void (*aom_copy32xn_fn_t)(const uint8_t *a, int a_stride, uint8_t *b,
|
2016-08-09 08:59:08 +03:00
|
|
|
int b_stride, int n);
|
2015-06-05 19:54:19 +03:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
typedef void (*aom_sad_multi_fn_t)(const uint8_t *a, int a_stride,
|
2015-06-05 19:54:19 +03:00
|
|
|
const uint8_t *b, int b_stride,
|
|
|
|
unsigned int *sad_array);
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
typedef void (*aom_sad_multi_d_fn_t)(const uint8_t *a, int a_stride,
|
2015-06-05 19:54:19 +03:00
|
|
|
const uint8_t *const b_array[],
|
2016-08-09 08:59:08 +03:00
|
|
|
int b_stride, unsigned int *sad_array);
|
2015-06-05 19:54:19 +03:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
typedef unsigned int (*aom_variance_fn_t)(const uint8_t *a, int a_stride,
|
2015-06-05 19:54:19 +03:00
|
|
|
const uint8_t *b, int b_stride,
|
|
|
|
unsigned int *sse);
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
typedef unsigned int (*aom_subpixvariance_fn_t)(const uint8_t *a, int a_stride,
|
2015-06-05 19:54:19 +03:00
|
|
|
int xoffset, int yoffset,
|
|
|
|
const uint8_t *b, int b_stride,
|
|
|
|
unsigned int *sse);
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
typedef unsigned int (*aom_subp_avg_variance_fn_t)(
|
2016-08-09 08:59:08 +03:00
|
|
|
const uint8_t *a, int a_stride, int xoffset, int yoffset, const uint8_t *b,
|
|
|
|
int b_stride, unsigned int *sse, const uint8_t *second_pred);
|
2015-06-05 19:54:19 +03:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AV1 && CONFIG_EXT_INTER
|
|
|
|
typedef unsigned int (*aom_masked_sad_fn_t)(const uint8_t *src, int src_stride,
|
2016-08-09 08:59:08 +03:00
|
|
|
const uint8_t *ref, int ref_stride,
|
|
|
|
const uint8_t *msk_ptr,
|
|
|
|
int msk_stride);
|
2016-08-31 00:01:10 +03:00
|
|
|
typedef unsigned int (*aom_masked_variance_fn_t)(
|
2016-08-09 08:59:08 +03:00
|
|
|
const uint8_t *src, int src_stride, const uint8_t *ref, int ref_stride,
|
|
|
|
const uint8_t *msk, int msk_stride, unsigned int *sse);
|
2016-08-31 00:01:10 +03:00
|
|
|
typedef unsigned int (*aom_masked_subpixvariance_fn_t)(
|
2016-08-09 08:59:08 +03:00
|
|
|
const uint8_t *src, int src_stride, int xoffset, int yoffset,
|
|
|
|
const uint8_t *ref, int ref_stride, const uint8_t *msk, int msk_stride,
|
|
|
|
unsigned int *sse);
|
2016-08-31 00:01:10 +03:00
|
|
|
#endif // CONFIG_AV1 && CONFIG_EXT_INTER
|
2016-03-01 03:08:07 +03:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#if CONFIG_AV1 && CONFIG_OBMC
|
|
|
|
typedef unsigned int (*aom_obmc_sad_fn_t)(const uint8_t *pred, int pred_stride,
|
2016-08-09 08:59:08 +03:00
|
|
|
const int32_t *wsrc,
|
|
|
|
const int32_t *msk);
|
2016-08-31 00:01:10 +03:00
|
|
|
typedef unsigned int (*aom_obmc_variance_fn_t)(const uint8_t *pred,
|
2016-04-23 01:09:12 +03:00
|
|
|
int pred_stride,
|
2016-07-04 13:47:19 +03:00
|
|
|
const int32_t *wsrc,
|
|
|
|
const int32_t *msk,
|
2016-04-23 01:09:12 +03:00
|
|
|
unsigned int *sse);
|
2016-08-31 00:01:10 +03:00
|
|
|
typedef unsigned int (*aom_obmc_subpixvariance_fn_t)(
|
2016-08-09 08:59:08 +03:00
|
|
|
const uint8_t *pred, int pred_stride, int xoffset, int yoffset,
|
|
|
|
const int32_t *wsrc, const int32_t *msk, unsigned int *sse);
|
2016-08-31 00:01:10 +03:00
|
|
|
#endif // CONFIG_AV1 && CONFIG_OBMC
|
|
|
|
|
|
|
|
#if CONFIG_AV1
|
|
|
|
typedef struct aom_variance_vtable {
|
|
|
|
aom_sad_fn_t sdf;
|
|
|
|
aom_sad_avg_fn_t sdaf;
|
|
|
|
aom_variance_fn_t vf;
|
|
|
|
aom_subpixvariance_fn_t svf;
|
|
|
|
aom_subp_avg_variance_fn_t svaf;
|
|
|
|
aom_sad_multi_fn_t sdx3f;
|
|
|
|
aom_sad_multi_fn_t sdx8f;
|
|
|
|
aom_sad_multi_d_fn_t sdx4df;
|
2016-03-01 03:08:07 +03:00
|
|
|
#if CONFIG_EXT_INTER
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_masked_sad_fn_t msdf;
|
|
|
|
aom_masked_variance_fn_t mvf;
|
|
|
|
aom_masked_subpixvariance_fn_t msvf;
|
2016-03-01 03:08:07 +03:00
|
|
|
#endif // CONFIG_EXT_INTER
|
2016-04-23 01:09:12 +03:00
|
|
|
#if CONFIG_OBMC
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_obmc_sad_fn_t osdf;
|
|
|
|
aom_obmc_variance_fn_t ovf;
|
|
|
|
aom_obmc_subpixvariance_fn_t osvf;
|
2016-04-23 01:09:12 +03:00
|
|
|
#endif // CONFIG_OBMC
|
2016-08-31 00:01:10 +03:00
|
|
|
} aom_variance_fn_ptr_t;
|
|
|
|
#endif // CONFIG_AV1
|
2015-06-05 19:54:19 +03:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
void aom_highbd_var_filter_block2d_bil_first_pass(
|
2016-08-09 08:59:08 +03:00
|
|
|
const uint8_t *src_ptr8, uint16_t *output_ptr,
|
|
|
|
unsigned int src_pixels_per_line, int pixel_step,
|
|
|
|
unsigned int output_height, unsigned int output_width,
|
2016-04-02 01:50:17 +03:00
|
|
|
const uint8_t *filter);
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
void aom_highbd_var_filter_block2d_bil_second_pass(
|
2016-08-09 08:59:08 +03:00
|
|
|
const uint16_t *src_ptr, uint16_t *output_ptr,
|
|
|
|
unsigned int src_pixels_per_line, unsigned int pixel_step,
|
|
|
|
unsigned int output_height, unsigned int output_width,
|
2016-04-02 01:50:17 +03:00
|
|
|
const uint8_t *filter);
|
|
|
|
|
2015-06-05 19:54:19 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
} // extern "C"
|
|
|
|
#endif
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#endif // AOM_DSP_VARIANCE_H_
|