summaryrefslogtreecommitdiffstats
path: root/third_party/aom/av1/common/convolve.h
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-10-15 21:45:30 -0500
committertrav90 <travawine@palemoon.org>2018-10-15 21:45:30 -0500
commit68569dee1416593955c1570d638b3d9250b33012 (patch)
treed960f017cd7eba3f125b7e8a813789ee2e076310 /third_party/aom/av1/common/convolve.h
parent07c17b6b98ed32fcecff15c083ab0fd878de3cf0 (diff)
downloadUXP-68569dee1416593955c1570d638b3d9250b33012.tar
UXP-68569dee1416593955c1570d638b3d9250b33012.tar.gz
UXP-68569dee1416593955c1570d638b3d9250b33012.tar.lz
UXP-68569dee1416593955c1570d638b3d9250b33012.tar.xz
UXP-68569dee1416593955c1570d638b3d9250b33012.zip
Import aom library
This is the reference implementation for the Alliance for Open Media's av1 video code. The commit used was 4d668d7feb1f8abd809d1bca0418570a7f142a36.
Diffstat (limited to 'third_party/aom/av1/common/convolve.h')
-rw-r--r--third_party/aom/av1/common/convolve.h119
1 files changed, 119 insertions, 0 deletions
diff --git a/third_party/aom/av1/common/convolve.h b/third_party/aom/av1/common/convolve.h
new file mode 100644
index 000000000..4a4dd8cdb
--- /dev/null
+++ b/third_party/aom/av1/common/convolve.h
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2016, Alliance for Open Media. All rights reserved
+ *
+ * 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.
+ */
+
+#ifndef AV1_COMMON_AV1_CONVOLVE_H_
+#define AV1_COMMON_AV1_CONVOLVE_H_
+#include "av1/common/filter.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum CONVOLVE_OPT {
+ // indicate the results in dst buf is rounded by FILTER_BITS or not
+ CONVOLVE_OPT_ROUND,
+ CONVOLVE_OPT_NO_ROUND,
+} CONVOLVE_OPT;
+
+typedef int32_t CONV_BUF_TYPE;
+
+typedef struct ConvolveParams {
+ int ref;
+ CONVOLVE_OPT round;
+ CONV_BUF_TYPE *dst;
+ int dst_stride;
+ int round_0;
+ int round_1;
+ int plane;
+} ConvolveParams;
+
+static INLINE ConvolveParams get_conv_params(int ref, int plane) {
+ ConvolveParams conv_params;
+ conv_params.ref = ref;
+ conv_params.round = CONVOLVE_OPT_ROUND;
+ conv_params.plane = plane;
+ return conv_params;
+}
+struct AV1Common;
+void av1_convolve_init(struct AV1Common *cm);
+#if CONFIG_CONVOLVE_ROUND
+void av1_convolve_2d(const uint8_t *src, int src_stride, CONV_BUF_TYPE *dst,
+ int dst_stride, int w, int h,
+ InterpFilterParams *filter_params_x,
+ InterpFilterParams *filter_params_y, const int subpel_x_q4,
+ const int subpel_y_q4, ConvolveParams *conv_params);
+
+void av1_convolve_2d_facade(const uint8_t *src, int src_stride, uint8_t *dst,
+ int dst_stride, int w, int h,
+ const InterpFilter *interp_filter,
+ const int subpel_x_q4, int x_step_q4,
+ const int subpel_y_q4, int y_step_q4,
+ ConvolveParams *conv_params);
+
+static INLINE ConvolveParams get_conv_params_no_round(int ref, int plane,
+ int32_t *dst,
+ int dst_stride) {
+ ConvolveParams conv_params;
+ conv_params.ref = ref;
+ conv_params.round = CONVOLVE_OPT_NO_ROUND;
+#if CONFIG_COMPOUND_ROUND
+ conv_params.round_0 = FILTER_BITS;
+#else
+ conv_params.round_0 = 5;
+#endif
+ conv_params.round_1 = 0;
+ conv_params.dst = dst;
+ conv_params.dst_stride = dst_stride;
+ conv_params.plane = plane;
+ return conv_params;
+}
+
+void av1_convolve_rounding(const int32_t *src, int src_stride, uint8_t *dst,
+ int dst_stride, int w, int h, int bits);
+#endif // CONFIG_CONVOLVE_ROUND
+
+void av1_convolve(const uint8_t *src, int src_stride, uint8_t *dst,
+ int dst_stride, int w, int h,
+#if CONFIG_DUAL_FILTER
+ const InterpFilter *interp_filter,
+#else
+ const InterpFilter interp_filter,
+#endif
+ const int subpel_x, int xstep, const int subpel_y, int ystep,
+ ConvolveParams *conv_params);
+
+void av1_convolve_c(const uint8_t *src, int src_stride, uint8_t *dst,
+ int dst_stride, int w, int h,
+#if CONFIG_DUAL_FILTER
+ const InterpFilter *interp_filter,
+#else
+ const InterpFilter interp_filter,
+#endif
+ const int subpel_x, int xstep, const int subpel_y,
+ int ystep, ConvolveParams *conv_params);
+
+#if CONFIG_HIGHBITDEPTH
+void av1_highbd_convolve(const uint8_t *src, int src_stride, uint8_t *dst,
+ int dst_stride, int w, int h,
+#if CONFIG_DUAL_FILTER
+ const InterpFilter *interp_filter,
+#else
+ const InterpFilter interp_filter,
+#endif
+ const int subpel_x, int xstep, const int subpel_y,
+ int ystep, int avg, int bd);
+#endif // CONFIG_HIGHBITDEPTH
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // AV1_COMMON_AV1_CONVOLVE_H_