Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / libvpx / source / libvpx / vp9 / common / vp9_reconinter.h
1 /*
2  *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10
11 #ifndef VP9_COMMON_VP9_RECONINTER_H_
12 #define VP9_COMMON_VP9_RECONINTER_H_
13
14 #include "vpx/vpx_integer.h"
15 #include "vp9/common/vp9_onyxc_int.h"
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 void vp9_build_inter_predictors_sby(MACROBLOCKD *xd, int mi_row, int mi_col,
22                                     BLOCK_SIZE bsize);
23
24 void vp9_build_inter_predictors_sbuv(MACROBLOCKD *xd, int mi_row, int mi_col,
25                                      BLOCK_SIZE bsize);
26
27 void vp9_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col,
28                                    BLOCK_SIZE bsize);
29
30 void vp9_dec_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col,
31                                        BLOCK_SIZE bsize);
32
33 void vp9_build_inter_predictor(const uint8_t *src, int src_stride,
34                                uint8_t *dst, int dst_stride,
35                                const MV *mv_q3,
36                                const struct scale_factors *sf,
37                                int w, int h, int do_avg,
38                                const InterpKernel *kernel,
39                                enum mv_precision precision,
40                                int x, int y);
41
42 #if CONFIG_VP9_HIGHBITDEPTH
43 void vp9_high_build_inter_predictor(const uint8_t *src, int src_stride,
44                                     uint8_t *dst, int dst_stride,
45                                     const MV *mv_q3,
46                                     const struct scale_factors *sf,
47                                     int w, int h, int do_avg,
48                                     const InterpKernel *kernel,
49                                     enum mv_precision precision,
50                                     int x, int y, int bd);
51 #endif
52
53 static INLINE int scaled_buffer_offset(int x_offset, int y_offset, int stride,
54                                        const struct scale_factors *sf) {
55   const int x = sf ? sf->scale_value_x(x_offset, sf) : x_offset;
56   const int y = sf ? sf->scale_value_y(y_offset, sf) : y_offset;
57   return y * stride + x;
58 }
59
60 static INLINE void setup_pred_plane(struct buf_2d *dst,
61                                     uint8_t *src, int stride,
62                                     int mi_row, int mi_col,
63                                     const struct scale_factors *scale,
64                                     int subsampling_x, int subsampling_y) {
65   const int x = (MI_SIZE * mi_col) >> subsampling_x;
66   const int y = (MI_SIZE * mi_row) >> subsampling_y;
67   dst->buf = src + scaled_buffer_offset(x, y, stride, scale);
68   dst->stride = stride;
69 }
70
71 void vp9_setup_dst_planes(struct macroblockd_plane planes[MAX_MB_PLANE],
72                           const YV12_BUFFER_CONFIG *src,
73                           int mi_row, int mi_col);
74
75 void vp9_setup_pre_planes(MACROBLOCKD *xd, int idx,
76                           const YV12_BUFFER_CONFIG *src, int mi_row, int mi_col,
77                           const struct scale_factors *sf);
78
79 #ifdef __cplusplus
80 }  // extern "C"
81 #endif
82
83 #endif  // VP9_COMMON_VP9_RECONINTER_H_