Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: source/libvpx/vp9/common/vp9_onyxc_int.h

Issue 11974002: libvpx: Pull from upstream (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « source/libvpx/vp9/common/vp9_onyx.h ('k') | source/libvpx/vp9/common/vp9_onyxd.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11
12 #ifndef VP9_COMMON_VP9_ONYXC_INT_H_ 11 #ifndef VP9_COMMON_VP9_ONYXC_INT_H_
13 #define VP9_COMMON_VP9_ONYXC_INT_H_ 12 #define VP9_COMMON_VP9_ONYXC_INT_H_
14 13
15 #include "vpx_config.h" 14 #include "vpx_config.h"
16 #include "vpx/internal/vpx_codec_internal.h" 15 #include "vpx/internal/vpx_codec_internal.h"
17 #include "vp9_rtcd.h" 16 #include "vp9_rtcd.h"
18 #include "vp9/common/vp9_loopfilter.h" 17 #include "vp9/common/vp9_loopfilter.h"
19 #include "vp9/common/vp9_entropymv.h" 18 #include "vp9/common/vp9_entropymv.h"
20 #include "vp9/common/vp9_entropy.h" 19 #include "vp9/common/vp9_entropy.h"
21 #include "vp9/common/vp9_entropymode.h" 20 #include "vp9/common/vp9_entropymode.h"
(...skipping 16 matching lines...) Expand all
38 37
39 #define QINDEX_RANGE (MAXQ + 1) 38 #define QINDEX_RANGE (MAXQ + 1)
40 39
41 #define NUM_YV12_BUFFERS 4 40 #define NUM_YV12_BUFFERS 4
42 41
43 #define COMP_PRED_CONTEXTS 2 42 #define COMP_PRED_CONTEXTS 2
44 43
45 typedef struct frame_contexts { 44 typedef struct frame_contexts {
46 vp9_prob bmode_prob[VP9_NKF_BINTRAMODES - 1]; 45 vp9_prob bmode_prob[VP9_NKF_BINTRAMODES - 1];
47 vp9_prob ymode_prob[VP9_YMODES - 1]; /* interframe intra mode probs */ 46 vp9_prob ymode_prob[VP9_YMODES - 1]; /* interframe intra mode probs */
48 #if CONFIG_SUPERBLOCKS
49 vp9_prob sb_ymode_prob[VP9_I32X32_MODES - 1]; 47 vp9_prob sb_ymode_prob[VP9_I32X32_MODES - 1];
50 #endif
51 vp9_prob uv_mode_prob[VP9_YMODES][VP9_UV_MODES - 1]; 48 vp9_prob uv_mode_prob[VP9_YMODES][VP9_UV_MODES - 1];
52 vp9_prob i8x8_mode_prob[VP9_I8X8_MODES - 1]; 49 vp9_prob i8x8_mode_prob[VP9_I8X8_MODES - 1];
53 vp9_prob sub_mv_ref_prob[SUBMVREF_COUNT][VP9_SUBMVREFS - 1]; 50 vp9_prob sub_mv_ref_prob[SUBMVREF_COUNT][VP9_SUBMVREFS - 1];
54 vp9_prob mbsplit_prob[VP9_NUMMBSPLITS - 1]; 51 vp9_prob mbsplit_prob[VP9_NUMMBSPLITS - 1];
55 vp9_prob coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_N ODES]; 52 vp9_coeff_probs coef_probs_4x4[BLOCK_TYPES_4X4];
56 vp9_prob hybrid_coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [EN TROPY_NODES]; 53 vp9_coeff_probs hybrid_coef_probs_4x4[BLOCK_TYPES_4X4];
57 vp9_prob coef_probs_8x8 [BLOCK_TYPES_8X8] [COEF_BANDS] [PREV_COEF_CONTEXTS] [E NTROPY_NODES]; 54 vp9_coeff_probs coef_probs_8x8[BLOCK_TYPES_8X8];
58 vp9_prob hybrid_coef_probs_8x8 [BLOCK_TYPES_8X8] [COEF_BANDS] [PREV_COEF_CONTE XTS] [ENTROPY_NODES]; 55 vp9_coeff_probs hybrid_coef_probs_8x8[BLOCK_TYPES_8X8];
59 vp9_prob coef_probs_16x16 [BLOCK_TYPES_16X16] [COEF_BANDS] [PREV_COEF_CONTEXTS ] [ENTROPY_NODES]; 56 vp9_coeff_probs coef_probs_16x16[BLOCK_TYPES_16X16];
60 vp9_prob hybrid_coef_probs_16x16 [BLOCK_TYPES_16X16] [COEF_BANDS] [PREV_COEF_C ONTEXTS] [ENTROPY_NODES]; 57 vp9_coeff_probs hybrid_coef_probs_16x16[BLOCK_TYPES_16X16];
58 vp9_coeff_probs coef_probs_32x32[BLOCK_TYPES_32X32];
61 59
62 nmv_context nmvc; 60 nmv_context nmvc;
63 nmv_context pre_nmvc; 61 nmv_context pre_nmvc;
64 vp9_prob pre_bmode_prob[VP9_NKF_BINTRAMODES - 1]; 62 vp9_prob pre_bmode_prob[VP9_NKF_BINTRAMODES - 1];
65 vp9_prob pre_ymode_prob[VP9_YMODES - 1]; /* interframe intra mode probs */ 63 vp9_prob pre_ymode_prob[VP9_YMODES - 1]; /* interframe intra mode probs */
66 #if CONFIG_SUPERBLOCKS
67 vp9_prob pre_sb_ymode_prob[VP9_I32X32_MODES - 1]; 64 vp9_prob pre_sb_ymode_prob[VP9_I32X32_MODES - 1];
68 #endif
69 vp9_prob pre_uv_mode_prob[VP9_YMODES][VP9_UV_MODES - 1]; 65 vp9_prob pre_uv_mode_prob[VP9_YMODES][VP9_UV_MODES - 1];
70 vp9_prob pre_i8x8_mode_prob[VP9_I8X8_MODES - 1]; 66 vp9_prob pre_i8x8_mode_prob[VP9_I8X8_MODES - 1];
71 vp9_prob pre_sub_mv_ref_prob[SUBMVREF_COUNT][VP9_SUBMVREFS - 1]; 67 vp9_prob pre_sub_mv_ref_prob[SUBMVREF_COUNT][VP9_SUBMVREFS - 1];
72 vp9_prob pre_mbsplit_prob[VP9_NUMMBSPLITS - 1]; 68 vp9_prob pre_mbsplit_prob[VP9_NUMMBSPLITS - 1];
73 unsigned int bmode_counts[VP9_NKF_BINTRAMODES]; 69 unsigned int bmode_counts[VP9_NKF_BINTRAMODES];
74 unsigned int ymode_counts[VP9_YMODES]; /* interframe intra mode probs */ 70 unsigned int ymode_counts[VP9_YMODES]; /* interframe intra mode probs */
75 #if CONFIG_SUPERBLOCKS
76 unsigned int sb_ymode_counts[VP9_I32X32_MODES]; 71 unsigned int sb_ymode_counts[VP9_I32X32_MODES];
77 #endif
78 unsigned int uv_mode_counts[VP9_YMODES][VP9_UV_MODES]; 72 unsigned int uv_mode_counts[VP9_YMODES][VP9_UV_MODES];
79 unsigned int i8x8_mode_counts[VP9_I8X8_MODES]; /* interframe intra probs */ 73 unsigned int i8x8_mode_counts[VP9_I8X8_MODES]; /* interframe intra probs */
80 unsigned int sub_mv_ref_counts[SUBMVREF_COUNT][VP9_SUBMVREFS]; 74 unsigned int sub_mv_ref_counts[SUBMVREF_COUNT][VP9_SUBMVREFS];
81 unsigned int mbsplit_counts[VP9_NUMMBSPLITS]; 75 unsigned int mbsplit_counts[VP9_NUMMBSPLITS];
82 76
83 vp9_prob pre_coef_probs [BLOCK_TYPES] [COEF_BANDS] 77 vp9_coeff_probs pre_coef_probs_4x4[BLOCK_TYPES_4X4];
84 [PREV_COEF_CONTEXTS] [ENTROPY_NODES]; 78 vp9_coeff_probs pre_hybrid_coef_probs_4x4[BLOCK_TYPES_4X4];
85 vp9_prob pre_hybrid_coef_probs [BLOCK_TYPES] [COEF_BANDS] 79 vp9_coeff_probs pre_coef_probs_8x8[BLOCK_TYPES_8X8];
86 [PREV_COEF_CONTEXTS] [ENTROPY_NODES]; 80 vp9_coeff_probs pre_hybrid_coef_probs_8x8[BLOCK_TYPES_8X8];
81 vp9_coeff_probs pre_coef_probs_16x16[BLOCK_TYPES_16X16];
82 vp9_coeff_probs pre_hybrid_coef_probs_16x16[BLOCK_TYPES_16X16];
83 vp9_coeff_probs pre_coef_probs_32x32[BLOCK_TYPES_32X32];
87 84
88 vp9_prob pre_coef_probs_8x8 [BLOCK_TYPES_8X8] [COEF_BANDS] 85 vp9_coeff_count coef_counts_4x4[BLOCK_TYPES_4X4];
89 [PREV_COEF_CONTEXTS] [ENTROPY_NODES]; 86 vp9_coeff_count hybrid_coef_counts_4x4[BLOCK_TYPES_4X4];
90 vp9_prob pre_hybrid_coef_probs_8x8 [BLOCK_TYPES_8X8] [COEF_BANDS] 87 vp9_coeff_count coef_counts_8x8[BLOCK_TYPES_8X8];
91 [PREV_COEF_CONTEXTS] [ENTROPY_NODES]; 88 vp9_coeff_count hybrid_coef_counts_8x8[BLOCK_TYPES_8X8];
92 89 vp9_coeff_count coef_counts_16x16[BLOCK_TYPES_16X16];
93 vp9_prob pre_coef_probs_16x16 [BLOCK_TYPES_16X16] [COEF_BANDS] 90 vp9_coeff_count hybrid_coef_counts_16x16[BLOCK_TYPES_16X16];
94 [PREV_COEF_CONTEXTS] [ENTROPY_NODES]; 91 vp9_coeff_count coef_counts_32x32[BLOCK_TYPES_32X32];
95 vp9_prob pre_hybrid_coef_probs_16x16 [BLOCK_TYPES_16X16] [COEF_BANDS]
96 [PREV_COEF_CONTEXTS] [ENTROPY_NODES];
97
98 unsigned int coef_counts [BLOCK_TYPES] [COEF_BANDS]
99 [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS];
100 unsigned int hybrid_coef_counts [BLOCK_TYPES] [COEF_BANDS]
101 [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS];
102
103 unsigned int coef_counts_8x8 [BLOCK_TYPES_8X8] [COEF_BANDS]
104 [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS];
105 unsigned int hybrid_coef_counts_8x8 [BLOCK_TYPES_8X8] [COEF_BANDS]
106 [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS];
107
108 unsigned int coef_counts_16x16 [BLOCK_TYPES_16X16] [COEF_BANDS]
109 [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS];
110 unsigned int hybrid_coef_counts_16x16 [BLOCK_TYPES_16X16] [COEF_BANDS]
111 [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS];
112 92
113 nmv_context_counts NMVcount; 93 nmv_context_counts NMVcount;
114 vp9_prob switchable_interp_prob[VP9_SWITCHABLE_FILTERS + 1] 94 vp9_prob switchable_interp_prob[VP9_SWITCHABLE_FILTERS + 1]
115 [VP9_SWITCHABLE_FILTERS - 1]; 95 [VP9_SWITCHABLE_FILTERS - 1];
116 #if CONFIG_COMP_INTERINTRA_PRED 96 #if CONFIG_COMP_INTERINTRA_PRED
117 unsigned int interintra_counts[2]; 97 unsigned int interintra_counts[2];
118 vp9_prob interintra_prob; 98 vp9_prob interintra_prob;
119 vp9_prob pre_interintra_prob; 99 vp9_prob pre_interintra_prob;
120 #endif 100 #endif
121 101
(...skipping 10 matching lines...) Expand all
132 SINGLE_PREDICTION_ONLY = 0, 112 SINGLE_PREDICTION_ONLY = 0,
133 COMP_PREDICTION_ONLY = 1, 113 COMP_PREDICTION_ONLY = 1,
134 HYBRID_PREDICTION = 2, 114 HYBRID_PREDICTION = 2,
135 NB_PREDICTION_TYPES = 3, 115 NB_PREDICTION_TYPES = 3,
136 } COMPPREDMODE_TYPE; 116 } COMPPREDMODE_TYPE;
137 117
138 typedef enum { 118 typedef enum {
139 ONLY_4X4 = 0, 119 ONLY_4X4 = 0,
140 ALLOW_8X8 = 1, 120 ALLOW_8X8 = 1,
141 ALLOW_16X16 = 2, 121 ALLOW_16X16 = 2,
142 TX_MODE_SELECT = 3, 122 ALLOW_32X32 = 3,
143 NB_TXFM_MODES = 4, 123 TX_MODE_SELECT = 4,
124 NB_TXFM_MODES = 5,
144 } TXFM_MODE; 125 } TXFM_MODE;
145 126
146 typedef struct VP9Common { 127 typedef struct VP9Common {
147 struct vpx_internal_error_info error; 128 struct vpx_internal_error_info error;
148 129
149 DECLARE_ALIGNED(16, short, Y1dequant[QINDEX_RANGE][16]); 130 DECLARE_ALIGNED(16, int16_t, Y1dequant[QINDEX_RANGE][16]);
150 DECLARE_ALIGNED(16, short, Y2dequant[QINDEX_RANGE][16]); 131 DECLARE_ALIGNED(16, int16_t, Y2dequant[QINDEX_RANGE][16]);
151 DECLARE_ALIGNED(16, short, UVdequant[QINDEX_RANGE][16]); 132 DECLARE_ALIGNED(16, int16_t, UVdequant[QINDEX_RANGE][16]);
152 133
153 int Width; 134 int Width;
154 int Height; 135 int Height;
155 int horiz_scale; 136 int horiz_scale;
156 int vert_scale; 137 int vert_scale;
157 138
158 YUV_TYPE clr_type; 139 YUV_TYPE clr_type;
159 CLAMP_TYPE clamp_type; 140 CLAMP_TYPE clamp_type;
160 141
161 YV12_BUFFER_CONFIG *frame_to_show; 142 YV12_BUFFER_CONFIG *frame_to_show;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 208
228 int copy_buffer_to_gf; /* 0 none, 1 Last to GF, 2 ARF to GF */ 209 int copy_buffer_to_gf; /* 0 none, 1 Last to GF, 2 ARF to GF */
229 int copy_buffer_to_arf; /* 0 none, 1 Last to ARF, 2 GF to ARF */ 210 int copy_buffer_to_arf; /* 0 none, 1 Last to ARF, 2 GF to ARF */
230 211
231 int refresh_entropy_probs; /* Two state 0 = NO, 1 = YES */ 212 int refresh_entropy_probs; /* Two state 0 = NO, 1 = YES */
232 213
233 int ref_frame_sign_bias[MAX_REF_FRAMES]; /* Two state 0, 1 */ 214 int ref_frame_sign_bias[MAX_REF_FRAMES]; /* Two state 0, 1 */
234 215
235 /* Y,U,V,Y2 */ 216 /* Y,U,V,Y2 */
236 ENTROPY_CONTEXT_PLANES *above_context; /* row of context for each plane */ 217 ENTROPY_CONTEXT_PLANES *above_context; /* row of context for each plane */
237 ENTROPY_CONTEXT_PLANES left_context[2]; /* (up to) 4 contexts "" */ 218 ENTROPY_CONTEXT_PLANES left_context[4]; /* (up to) 4 contexts "" */
238 219
239 /* keyframe block modes are predicted by their above, left neighbors */ 220 /* keyframe block modes are predicted by their above, left neighbors */
240 221
241 vp9_prob kf_bmode_prob[VP9_KF_BINTRAMODES] 222 vp9_prob kf_bmode_prob[VP9_KF_BINTRAMODES]
242 [VP9_KF_BINTRAMODES] 223 [VP9_KF_BINTRAMODES]
243 [VP9_KF_BINTRAMODES - 1]; 224 [VP9_KF_BINTRAMODES - 1];
244 vp9_prob kf_ymode_prob[8][VP9_YMODES - 1]; /* keyframe "" */ 225 vp9_prob kf_ymode_prob[8][VP9_YMODES - 1]; /* keyframe "" */
245 #if CONFIG_SUPERBLOCKS
246 vp9_prob sb_kf_ymode_prob[8][VP9_I32X32_MODES - 1]; 226 vp9_prob sb_kf_ymode_prob[8][VP9_I32X32_MODES - 1];
247 #endif
248 int kf_ymode_probs_index; 227 int kf_ymode_probs_index;
249 int kf_ymode_probs_update; 228 int kf_ymode_probs_update;
250 vp9_prob kf_uv_mode_prob[VP9_YMODES] [VP9_UV_MODES - 1]; 229 vp9_prob kf_uv_mode_prob[VP9_YMODES] [VP9_UV_MODES - 1];
251 230
252 vp9_prob prob_intra_coded; 231 vp9_prob prob_intra_coded;
253 vp9_prob prob_last_coded; 232 vp9_prob prob_last_coded;
254 vp9_prob prob_gf_coded; 233 vp9_prob prob_gf_coded;
255 #if CONFIG_SUPERBLOCKS 234 vp9_prob sb32_coded;
256 vp9_prob sb_coded; 235 vp9_prob sb64_coded;
257 #endif
258 236
259 // Context probabilities when using predictive coding of segment id 237 // Context probabilities when using predictive coding of segment id
260 vp9_prob segment_pred_probs[PREDICTION_PROBS]; 238 vp9_prob segment_pred_probs[PREDICTION_PROBS];
261 unsigned char temporal_update; 239 unsigned char temporal_update;
262 240
263 // Context probabilities for reference frame prediction 241 // Context probabilities for reference frame prediction
264 unsigned char ref_scores[MAX_REF_FRAMES]; 242 unsigned char ref_scores[MAX_REF_FRAMES];
265 vp9_prob ref_pred_probs[PREDICTION_PROBS]; 243 vp9_prob ref_pred_probs[PREDICTION_PROBS];
266 vp9_prob mod_refprobs[MAX_REF_FRAMES][PREDICTION_PROBS]; 244 vp9_prob mod_refprobs[MAX_REF_FRAMES][PREDICTION_PROBS];
267 245
268 vp9_prob prob_comppred[COMP_PRED_CONTEXTS]; 246 vp9_prob prob_comppred[COMP_PRED_CONTEXTS];
269 247
270 // FIXME contextualize 248 // FIXME contextualize
271 vp9_prob prob_tx[TX_SIZE_MAX - 1]; 249 vp9_prob prob_tx[TX_SIZE_MAX_SB - 1];
272 250
273 vp9_prob mbskip_pred_probs[MBSKIP_CONTEXTS]; 251 vp9_prob mbskip_pred_probs[MBSKIP_CONTEXTS];
274 252
275 FRAME_CONTEXT lfc_a; /* last alt ref entropy */ 253 FRAME_CONTEXT lfc_a; /* last alt ref entropy */
276 FRAME_CONTEXT lfc; /* last frame entropy */ 254 FRAME_CONTEXT lfc; /* last frame entropy */
277 FRAME_CONTEXT fc; /* this frame entropy */ 255 FRAME_CONTEXT fc; /* this frame entropy */
278 256
279 unsigned int current_video_frame; 257 unsigned int current_video_frame;
280 int near_boffset[3]; 258 int near_boffset[3];
281 int version; 259 int version;
282 260
283 #ifdef PACKET_TESTING 261 #ifdef PACKET_TESTING
284 VP9_HEADER oh; 262 VP9_HEADER oh;
285 #endif 263 #endif
286 double bitrate; 264 double bitrate;
287 double framerate; 265 double framerate;
288 266
289 #if CONFIG_POSTPROC 267 #if CONFIG_POSTPROC
290 struct postproc_state postproc_state; 268 struct postproc_state postproc_state;
291 #endif 269 #endif
292 270
293 #if CONFIG_PRED_FILTER
294 /* Prediction filter variables */
295 int pred_filter_mode; // 0=disabled at the frame level (no MB filtered)
296 // 1=enabled at the frame level (all MB filtered)
297 // 2=specified per MB (1=filtered, 0=non-filtered)
298 vp9_prob prob_pred_filter_off;
299 #endif
300 #if CONFIG_COMP_INTERINTRA_PRED 271 #if CONFIG_COMP_INTERINTRA_PRED
301 int use_interintra; 272 int use_interintra;
302 #endif 273 #endif
303 274
304 } VP9_COMMON; 275 } VP9_COMMON;
305 276
306 #endif // __INC_ONYX_INT_H 277 #endif // VP9_COMMON_VP9_ONYXC_INT_H_
OLDNEW
« no previous file with comments | « source/libvpx/vp9/common/vp9_onyx.h ('k') | source/libvpx/vp9/common/vp9_onyxd.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698