16fefe538d859300e7febe78271828198c10f1b52fgalligan@chromium.org/*
26fefe538d859300e7febe78271828198c10f1b52fgalligan@chromium.org *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
36fefe538d859300e7febe78271828198c10f1b52fgalligan@chromium.org *
46fefe538d859300e7febe78271828198c10f1b52fgalligan@chromium.org *  Use of this source code is governed by a BSD-style license
56fefe538d859300e7febe78271828198c10f1b52fgalligan@chromium.org *  that can be found in the LICENSE file in the root of the source
66fefe538d859300e7febe78271828198c10f1b52fgalligan@chromium.org *  tree. An additional intellectual property rights grant can be found
76fefe538d859300e7febe78271828198c10f1b52fgalligan@chromium.org *  in the file PATENTS.  All contributing project authors may
86fefe538d859300e7febe78271828198c10f1b52fgalligan@chromium.org *  be found in the AUTHORS file in the root of the source tree.
96fefe538d859300e7febe78271828198c10f1b52fgalligan@chromium.org */
106fefe538d859300e7febe78271828198c10f1b52fgalligan@chromium.org
116fefe538d859300e7febe78271828198c10f1b52fgalligan@chromium.org#ifndef VP9_COMMON_VP9_RECONINTER_H_
126fefe538d859300e7febe78271828198c10f1b52fgalligan@chromium.org#define VP9_COMMON_VP9_RECONINTER_H_
136fefe538d859300e7febe78271828198c10f1b52fgalligan@chromium.org
14d348b8d765c019ee7250075d663a83db00c65c08tomfinegan@chromium.org#include "vpx/vpx_integer.h"
156fefe538d859300e7febe78271828198c10f1b52fgalligan@chromium.org#include "vp9/common/vp9_onyxc_int.h"
166fefe538d859300e7febe78271828198c10f1b52fgalligan@chromium.org
17dddee1ec7cedf276305b107429f684539b105276johannkoenig@chromium.org#ifdef __cplusplus
18dddee1ec7cedf276305b107429f684539b105276johannkoenig@chromium.orgextern "C" {
19dddee1ec7cedf276305b107429f684539b105276johannkoenig@chromium.org#endif
20dddee1ec7cedf276305b107429f684539b105276johannkoenig@chromium.org
2153a13f1fa964820f7a8f9d3932a6f3c0433f8bf5fgalligan@chromium.orgvoid vp9_build_inter_predictors_sby(MACROBLOCKD *xd, int mi_row, int mi_col,
2253a13f1fa964820f7a8f9d3932a6f3c0433f8bf5fgalligan@chromium.org                                    BLOCK_SIZE bsize);
231958a6b43506c5fdf713554177fdd12c3b255c54johannkoenig@chromium.org
2453a13f1fa964820f7a8f9d3932a6f3c0433f8bf5fgalligan@chromium.orgvoid vp9_build_inter_predictors_sbuv(MACROBLOCKD *xd, int mi_row, int mi_col,
2553a13f1fa964820f7a8f9d3932a6f3c0433f8bf5fgalligan@chromium.org                                     BLOCK_SIZE bsize);
2610a9a0d835561a7f2300c561c514efcf374554d6fgalligan@chromium.org
2753a13f1fa964820f7a8f9d3932a6f3c0433f8bf5fgalligan@chromium.orgvoid vp9_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col,
2853a13f1fa964820f7a8f9d3932a6f3c0433f8bf5fgalligan@chromium.org                                   BLOCK_SIZE bsize);
291958a6b43506c5fdf713554177fdd12c3b255c54johannkoenig@chromium.org
30d851b91d14ef0bd71acdce7b90c9a8f1af1181adjohannkoenig@chromium.orgvoid vp9_dec_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col,
31d851b91d14ef0bd71acdce7b90c9a8f1af1181adjohannkoenig@chromium.org                                       BLOCK_SIZE bsize);
321958a6b43506c5fdf713554177fdd12c3b255c54johannkoenig@chromium.org
331958a6b43506c5fdf713554177fdd12c3b255c54johannkoenig@chromium.orgvoid vp9_build_inter_predictor(const uint8_t *src, int src_stride,
341958a6b43506c5fdf713554177fdd12c3b255c54johannkoenig@chromium.org                               uint8_t *dst, int dst_stride,
3553a13f1fa964820f7a8f9d3932a6f3c0433f8bf5fgalligan@chromium.org                               const MV *mv_q3,
360e29f91ae7876791fc422e9c7cea72b1866439a6johannkoenig@chromium.org                               const struct scale_factors *sf,
371958a6b43506c5fdf713554177fdd12c3b255c54johannkoenig@chromium.org                               int w, int h, int do_avg,
3876e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org                               const InterpKernel *kernel,
390e29f91ae7876791fc422e9c7cea72b1866439a6johannkoenig@chromium.org                               enum mv_precision precision,
400e29f91ae7876791fc422e9c7cea72b1866439a6johannkoenig@chromium.org                               int x, int y);
411958a6b43506c5fdf713554177fdd12c3b255c54johannkoenig@chromium.org
4287997d490ae52aa962a985c95b3cddf7f8832641johannkoenig@chromium.org#if CONFIG_VP9_HIGHBITDEPTH
4387997d490ae52aa962a985c95b3cddf7f8832641johannkoenig@chromium.orgvoid vp9_high_build_inter_predictor(const uint8_t *src, int src_stride,
4487997d490ae52aa962a985c95b3cddf7f8832641johannkoenig@chromium.org                                    uint8_t *dst, int dst_stride,
4587997d490ae52aa962a985c95b3cddf7f8832641johannkoenig@chromium.org                                    const MV *mv_q3,
4687997d490ae52aa962a985c95b3cddf7f8832641johannkoenig@chromium.org                                    const struct scale_factors *sf,
4787997d490ae52aa962a985c95b3cddf7f8832641johannkoenig@chromium.org                                    int w, int h, int do_avg,
4887997d490ae52aa962a985c95b3cddf7f8832641johannkoenig@chromium.org                                    const InterpKernel *kernel,
4987997d490ae52aa962a985c95b3cddf7f8832641johannkoenig@chromium.org                                    enum mv_precision precision,
5087997d490ae52aa962a985c95b3cddf7f8832641johannkoenig@chromium.org                                    int x, int y, int bd);
5187997d490ae52aa962a985c95b3cddf7f8832641johannkoenig@chromium.org#endif
5287997d490ae52aa962a985c95b3cddf7f8832641johannkoenig@chromium.org
5376e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.orgstatic INLINE int scaled_buffer_offset(int x_offset, int y_offset, int stride,
5476e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org                                       const struct scale_factors *sf) {
550e29f91ae7876791fc422e9c7cea72b1866439a6johannkoenig@chromium.org  const int x = sf ? sf->scale_value_x(x_offset, sf) : x_offset;
560e29f91ae7876791fc422e9c7cea72b1866439a6johannkoenig@chromium.org  const int y = sf ? sf->scale_value_y(y_offset, sf) : y_offset;
5710a9a0d835561a7f2300c561c514efcf374554d6fgalligan@chromium.org  return y * stride + x;
581958a6b43506c5fdf713554177fdd12c3b255c54johannkoenig@chromium.org}
591958a6b43506c5fdf713554177fdd12c3b255c54johannkoenig@chromium.org
6076e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.orgstatic INLINE void setup_pred_plane(struct buf_2d *dst,
6176e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org                                    uint8_t *src, int stride,
6276e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org                                    int mi_row, int mi_col,
6376e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org                                    const struct scale_factors *scale,
6476e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org                                    int subsampling_x, int subsampling_y) {
6510a9a0d835561a7f2300c561c514efcf374554d6fgalligan@chromium.org  const int x = (MI_SIZE * mi_col) >> subsampling_x;
6610a9a0d835561a7f2300c561c514efcf374554d6fgalligan@chromium.org  const int y = (MI_SIZE * mi_row) >> subsampling_y;
6710a9a0d835561a7f2300c561c514efcf374554d6fgalligan@chromium.org  dst->buf = src + scaled_buffer_offset(x, y, stride, scale);
6810a9a0d835561a7f2300c561c514efcf374554d6fgalligan@chromium.org  dst->stride = stride;
691958a6b43506c5fdf713554177fdd12c3b255c54johannkoenig@chromium.org}
701958a6b43506c5fdf713554177fdd12c3b255c54johannkoenig@chromium.org
71118f379ec73bf762ee63784bc5f41ffd41107470johannkoenig@chromium.orgvoid vp9_setup_dst_planes(struct macroblockd_plane planes[MAX_MB_PLANE],
72118f379ec73bf762ee63784bc5f41ffd41107470johannkoenig@chromium.org                          const YV12_BUFFER_CONFIG *src,
7393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org                          int mi_row, int mi_col);
7410a9a0d835561a7f2300c561c514efcf374554d6fgalligan@chromium.org
7593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgvoid vp9_setup_pre_planes(MACROBLOCKD *xd, int idx,
7693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org                          const YV12_BUFFER_CONFIG *src, int mi_row, int mi_col,
7793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org                          const struct scale_factors *sf);
781958a6b43506c5fdf713554177fdd12c3b255c54johannkoenig@chromium.org
79dddee1ec7cedf276305b107429f684539b105276johannkoenig@chromium.org#ifdef __cplusplus
80dddee1ec7cedf276305b107429f684539b105276johannkoenig@chromium.org}  // extern "C"
81dddee1ec7cedf276305b107429f684539b105276johannkoenig@chromium.org#endif
8210a9a0d835561a7f2300c561c514efcf374554d6fgalligan@chromium.org
83d348b8d765c019ee7250075d663a83db00c65c08tomfinegan@chromium.org#endif  // VP9_COMMON_VP9_RECONINTER_H_
84