recon.h 8.25 KB
Newer Older
John Koleszar's avatar
John Koleszar committed
1
/*
2
 *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
John Koleszar's avatar
John Koleszar committed
3
 *
4
 *  Use of this source code is governed by a BSD-style license
5
6
 *  that can be found in the LICENSE file in the root of the source
 *  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.
John Koleszar's avatar
John Koleszar committed
9
10
11
12
13
14
 */


#ifndef __INC_RECON_H
#define __INC_RECON_H

15
16
#include "blockd.h"

John Koleszar's avatar
John Koleszar committed
17
#define prototype_copy_block(sym) \
John Koleszar's avatar
John Koleszar committed
18
  void sym(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch)
John Koleszar's avatar
John Koleszar committed
19
20

#define prototype_recon_block(sym) \
John Koleszar's avatar
John Koleszar committed
21
  void sym(unsigned char *pred, short *diff, unsigned char *dst, int pitch)
John Koleszar's avatar
John Koleszar committed
22

23
#define prototype_recon_macroblock(sym) \
Paul Wilkins's avatar
Paul Wilkins committed
24
  void sym(const struct vp8_recon_rtcd_vtable *rtcd, MACROBLOCKD *xd)
25

26
#define prototype_build_intra_predictors(sym) \
Paul Wilkins's avatar
Paul Wilkins committed
27
  void sym(MACROBLOCKD *xd)
28

29
#define prototype_intra4x4_predict(sym) \
John Koleszar's avatar
John Koleszar committed
30
  void sym(BLOCKD *x, int b_mode, unsigned char *predictor)
31

32
33
#if CONFIG_COMP_INTRA_PRED
#define prototype_comp_intra4x4_predict(sym) \
John Koleszar's avatar
John Koleszar committed
34
  void sym(BLOCKD *x, int b_mode, int mode2, unsigned char *predictor)
35
36
#endif

37
38
struct vp8_recon_rtcd_vtable;

John Koleszar's avatar
John Koleszar committed
39
40
41
42
43
44
45
46
47
48
49
50
51
#if ARCH_X86 || ARCH_X86_64
#include "x86/recon_x86.h"
#endif

#if ARCH_ARM
#include "arm/recon_arm.h"
#endif

#ifndef vp8_recon_copy8x8
#define vp8_recon_copy8x8 vp8_copy_mem8x8_c
#endif
extern prototype_copy_block(vp8_recon_copy8x8);

52
53
54
55
56
57
58
59
60
61
#ifndef vp8_recon_avg16x16
#define vp8_recon_avg16x16 vp8_avg_mem16x16_c
#endif
extern prototype_copy_block(vp8_recon_avg16x16);

#ifndef vp8_recon_avg8x8
#define vp8_recon_avg8x8 vp8_avg_mem8x8_c
#endif
extern prototype_copy_block(vp8_recon_avg8x8);

John Koleszar's avatar
John Koleszar committed
62
63
64
65
66
67
68
69
70
71
#ifndef vp8_recon_copy8x4
#define vp8_recon_copy8x4 vp8_copy_mem8x4_c
#endif
extern prototype_copy_block(vp8_recon_copy8x4);

#ifndef vp8_recon_recon
#define vp8_recon_recon vp8_recon_b_c
#endif
extern prototype_recon_block(vp8_recon_recon);

72
73
74
75
76
77
#ifndef vp8_recon_recon_uv
#define vp8_recon_recon_uv vp8_recon_uv_b_c
#endif
extern prototype_recon_block(vp8_recon_recon_uv);

extern prototype_recon_block(vp8_recon_recon);
John Koleszar's avatar
John Koleszar committed
78
79
80
81
82
83
84
85
86
87
#ifndef vp8_recon_recon2
#define vp8_recon_recon2 vp8_recon2b_c
#endif
extern prototype_recon_block(vp8_recon_recon2);

#ifndef vp8_recon_recon4
#define vp8_recon_recon4 vp8_recon4b_c
#endif
extern prototype_recon_block(vp8_recon_recon4);

88
89
90
91
92
93
94
95
96
97
#ifndef vp8_recon_recon_mb
#define vp8_recon_recon_mb vp8_recon_mb_c
#endif
extern prototype_recon_macroblock(vp8_recon_recon_mb);

#ifndef vp8_recon_recon_mby
#define vp8_recon_recon_mby vp8_recon_mby_c
#endif
extern prototype_recon_macroblock(vp8_recon_recon_mby);

Ronald S. Bultje's avatar
Ronald S. Bultje committed
98
99
100
101
102
#ifndef vp8_recon_build_intra_predictors_sby_s
#define vp8_recon_build_intra_predictors_sby_s vp8_build_intra_predictors_sby_s
#endif
extern prototype_build_intra_predictors(vp8_recon_build_intra_predictors_sby_s);

103
104
105
106
#ifndef vp8_recon_build_intra_predictors_mby
#define vp8_recon_build_intra_predictors_mby vp8_build_intra_predictors_mby
#endif
extern prototype_build_intra_predictors\
John Koleszar's avatar
John Koleszar committed
107
(vp8_recon_build_intra_predictors_mby);
108

109
110
111
112
113
#if CONFIG_COMP_INTRA_PRED
#ifndef vp8_recon_build_comp_intra_predictors_mby
#define vp8_recon_build_comp_intra_predictors_mby vp8_build_comp_intra_predictors_mby
#endif
extern prototype_build_intra_predictors\
John Koleszar's avatar
John Koleszar committed
114
(vp8_recon_build_comp_intra_predictors_mby);
115
116
117
118
119
120
#endif

#ifndef vp8_recon_build_intra8x8_predictors_mby
#define vp8_recon_build_intra8x8_predictors_mby vp8_build_intra8x8_predictors_mby
#endif
extern prototype_build_intra_predictors\
John Koleszar's avatar
John Koleszar committed
121
(vp8_recon_build_intra8x8_predictors_mby);
122

123
124
125
126
#ifndef vp8_recon_build_intra_predictors_mby_s
#define vp8_recon_build_intra_predictors_mby_s vp8_build_intra_predictors_mby_s
#endif
extern prototype_build_intra_predictors\
John Koleszar's avatar
John Koleszar committed
127
(vp8_recon_build_intra_predictors_mby_s);
128

Ronald S. Bultje's avatar
Ronald S. Bultje committed
129
130
131
132
133
#ifndef vp8_recon_build_intra_predictors_sbuv_s
#define vp8_recon_build_intra_predictors_sbuv_s vp8_build_intra_predictors_sbuv_s
#endif
extern prototype_build_intra_predictors(vp8_recon_build_intra_predictors_sbuv_s);

134
135
136
137
#ifndef vp8_recon_build_intra_predictors_mbuv
#define vp8_recon_build_intra_predictors_mbuv vp8_build_intra_predictors_mbuv
#endif
extern prototype_build_intra_predictors\
John Koleszar's avatar
John Koleszar committed
138
(vp8_recon_build_intra_predictors_mbuv);
139

140
141
142
143
#ifndef vp8_recon_build_intra8x8_predictors_mbuv
#define vp8_recon_build_intra8x8_predictors_mbuv vp8_build_intra8x8_predictors_mbuv
#endif
extern prototype_build_intra_predictors\
John Koleszar's avatar
John Koleszar committed
144
(vp8_recon_build_intra8x8_predictors_mbuv);
145

146
147
148
149
#ifndef vp8_recon_build_intra_predictors_mbuv_s
#define vp8_recon_build_intra_predictors_mbuv_s vp8_build_intra_predictors_mbuv_s
#endif
extern prototype_build_intra_predictors\
John Koleszar's avatar
John Koleszar committed
150
(vp8_recon_build_intra_predictors_mbuv_s);
151

152
153
154
155
156
#if CONFIG_COMP_INTRA_PRED
#ifndef vp8_recon_build_comp_intra_predictors_mbuv
#define vp8_recon_build_comp_intra_predictors_mbuv vp8_build_comp_intra_predictors_mbuv
#endif
extern prototype_build_intra_predictors\
John Koleszar's avatar
John Koleszar committed
157
(vp8_recon_build_comp_intra_predictors_mbuv);
158
159
#endif

160
161
162
163
#ifndef vp8_recon_intra4x4_predict
#define vp8_recon_intra4x4_predict vp8_intra4x4_predict
#endif
extern prototype_intra4x4_predict\
John Koleszar's avatar
John Koleszar committed
164
(vp8_recon_intra4x4_predict);
165

166
167
168
169
170
#if CONFIG_COMP_INTRA_PRED
#ifndef vp8_recon_comp_intra4x4_predict
#define vp8_recon_comp_intra4x4_predict vp8_comp_intra4x4_predict
#endif
extern prototype_comp_intra4x4_predict\
John Koleszar's avatar
John Koleszar committed
171
(vp8_recon_comp_intra4x4_predict);
172
173
174
175
176
177
#endif

#ifndef vp8_recon_intra8x8_predict
#define vp8_recon_intra8x8_predict vp8_intra8x8_predict
#endif
extern prototype_intra4x4_predict\
John Koleszar's avatar
John Koleszar committed
178
(vp8_recon_intra8x8_predict);
179
180
181
182
183
184

#if CONFIG_COMP_INTRA_PRED
#ifndef vp8_recon_comp_intra8x8_predict
#define vp8_recon_comp_intra8x8_predict vp8_comp_intra8x8_predict
#endif
extern prototype_comp_intra4x4_predict\
John Koleszar's avatar
John Koleszar committed
185
(vp8_recon_comp_intra8x8_predict);
186
187
188
189
190
191
#endif

#ifndef vp8_recon_intra_uv4x4_predict
#define vp8_recon_intra_uv4x4_predict vp8_intra_uv4x4_predict
#endif
extern prototype_intra4x4_predict\
John Koleszar's avatar
John Koleszar committed
192
(vp8_recon_intra_uv4x4_predict);
193
194
195
196
197
198

#if CONFIG_COMP_INTRA_PRED
#ifndef vp8_recon_comp_intra_uv4x4_predict
#define vp8_recon_comp_intra_uv4x4_predict vp8_comp_intra_uv4x4_predict
#endif
extern prototype_comp_intra4x4_predict\
John Koleszar's avatar
John Koleszar committed
199
(vp8_recon_comp_intra_uv4x4_predict);
200
#endif
201

John Koleszar's avatar
John Koleszar committed
202
203
typedef prototype_copy_block((*vp8_copy_block_fn_t));
typedef prototype_recon_block((*vp8_recon_fn_t));
204
typedef prototype_recon_macroblock((*vp8_recon_mb_fn_t));
205
typedef prototype_build_intra_predictors((*vp8_build_intra_pred_fn_t));
206
typedef prototype_intra4x4_predict((*vp8_intra4x4_pred_fn_t));
207
208
209
#if CONFIG_COMP_INTRA_PRED
typedef prototype_comp_intra4x4_predict((*vp8_comp_intra4x4_pred_fn_t));
#endif
John Koleszar's avatar
John Koleszar committed
210
211
212
213
214
215
216
217
218
219
220
221
typedef struct vp8_recon_rtcd_vtable {
  vp8_copy_block_fn_t  copy16x16;
  vp8_copy_block_fn_t  copy8x8;
  vp8_copy_block_fn_t  avg16x16;
  vp8_copy_block_fn_t  avg8x8;
  vp8_copy_block_fn_t  copy8x4;
  vp8_recon_fn_t       recon;
  vp8_recon_fn_t       recon_uv;
  vp8_recon_fn_t       recon2;
  vp8_recon_fn_t       recon4;
  vp8_recon_mb_fn_t    recon_mb;
  vp8_recon_mb_fn_t    recon_mby;
Ronald S. Bultje's avatar
Ronald S. Bultje committed
222
223
224
#if CONFIG_SUPERBLOCKS
  vp8_build_intra_pred_fn_t  build_intra_predictors_sby_s;
#endif
John Koleszar's avatar
John Koleszar committed
225
226
  vp8_build_intra_pred_fn_t  build_intra_predictors_mby_s;
  vp8_build_intra_pred_fn_t  build_intra_predictors_mby;
227
#if CONFIG_COMP_INTRA_PRED
John Koleszar's avatar
John Koleszar committed
228
  vp8_build_intra_pred_fn_t  build_comp_intra_predictors_mby;
Ronald S. Bultje's avatar
Ronald S. Bultje committed
229
230
231
#endif
#if CONFIG_SUPERBLOCKS
  vp8_build_intra_pred_fn_t  build_intra_predictors_sbuv_s;
232
#endif
John Koleszar's avatar
John Koleszar committed
233
234
  vp8_build_intra_pred_fn_t  build_intra_predictors_mbuv_s;
  vp8_build_intra_pred_fn_t  build_intra_predictors_mbuv;
235
#if CONFIG_COMP_INTRA_PRED
John Koleszar's avatar
John Koleszar committed
236
  vp8_build_intra_pred_fn_t  build_comp_intra_predictors_mbuv;
237
#endif
John Koleszar's avatar
John Koleszar committed
238
  vp8_intra4x4_pred_fn_t intra4x4_predict;
239
#if CONFIG_COMP_INTRA_PRED
John Koleszar's avatar
John Koleszar committed
240
  vp8_comp_intra4x4_pred_fn_t comp_intra4x4_predict;
241
#endif
John Koleszar's avatar
John Koleszar committed
242
  vp8_intra4x4_pred_fn_t intra8x8_predict;
243
#if CONFIG_COMP_INTRA_PRED
John Koleszar's avatar
John Koleszar committed
244
  vp8_comp_intra4x4_pred_fn_t comp_intra8x8_predict;
245
#endif
John Koleszar's avatar
John Koleszar committed
246
  vp8_intra4x4_pred_fn_t intra_uv4x4_predict;
247
#if CONFIG_COMP_INTRA_PRED
John Koleszar's avatar
John Koleszar committed
248
  vp8_comp_intra4x4_pred_fn_t comp_intra_uv4x4_predict;
249
#endif
John Koleszar's avatar
John Koleszar committed
250
251
252
253
254
255
256
257
} vp8_recon_rtcd_vtable_t;

#if CONFIG_RUNTIME_CPU_DETECT
#define RECON_INVOKE(ctx,fn) (ctx)->fn
#else
#define RECON_INVOKE(ctx,fn) vp8_recon_##fn
#endif

Paul Wilkins's avatar
Paul Wilkins committed
258
259
void vp8_recon_intra_mbuv(const vp8_recon_rtcd_vtable_t *rtcd,
                          MACROBLOCKD *xd);
Ronald S. Bultje's avatar
Ronald S. Bultje committed
260
261
262
263
264
265
266
267

#if CONFIG_SUPERBLOCKS
extern void vp8_recon_mby_s_c(const vp8_recon_rtcd_vtable_t *rtcd,
                              MACROBLOCKD *xd, uint8_t *dst);
extern void vp8_recon_mbuv_s_c(const vp8_recon_rtcd_vtable_t *rtcd,
                               MACROBLOCKD *xd, uint8_t *udst, uint8_t *vdst);
#endif

John Koleszar's avatar
John Koleszar committed
268
#endif