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

Side by Side Diff: source/libvpx/vp8/common/blockd.h

Issue 7671004: Update libvpx snapshot to v0.9.7-p1 (Cayuga). (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libvpx/
Patch Set: '' Created 9 years, 4 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/vp8/common/asm_com_offsets.c ('k') | source/libvpx/vp8/common/coefupdateprobs.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
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 B_MODE_COUNT 130 B_MODE_COUNT
131 } B_PREDICTION_MODE; 131 } B_PREDICTION_MODE;
132 132
133 #define VP8_BINTRAMODES (B_HU_PRED + 1) /* 10 */ 133 #define VP8_BINTRAMODES (B_HU_PRED + 1) /* 10 */
134 #define VP8_SUBMVREFS (1 + NEW4X4 - LEFT4X4) 134 #define VP8_SUBMVREFS (1 + NEW4X4 - LEFT4X4)
135 135
136 /* For keyframes, intra block modes are predicted by the (already decoded) 136 /* For keyframes, intra block modes are predicted by the (already decoded)
137 modes for the Y blocks to the left and above us; for interframes, there 137 modes for the Y blocks to the left and above us; for interframes, there
138 is a single probability table. */ 138 is a single probability table. */
139 139
140 typedef struct 140 union b_mode_info
141 { 141 {
142 B_PREDICTION_MODE mode; 142 B_PREDICTION_MODE as_mode;
143 union 143 int_mv mv;
144 { 144 };
145 int as_int;
146 MV as_mv;
147 } mv;
148 } B_MODE_INFO;
149
150 145
151 typedef enum 146 typedef enum
152 { 147 {
153 INTRA_FRAME = 0, 148 INTRA_FRAME = 0,
154 LAST_FRAME = 1, 149 LAST_FRAME = 1,
155 GOLDEN_FRAME = 2, 150 GOLDEN_FRAME = 2,
156 ALTREF_FRAME = 3, 151 ALTREF_FRAME = 3,
157 MAX_REF_FRAMES = 4 152 MAX_REF_FRAMES = 4
158 } MV_REFERENCE_FRAME; 153 } MV_REFERENCE_FRAME;
159 154
160 typedef struct 155 typedef struct
161 { 156 {
162 MB_PREDICTION_MODE mode, uv_mode; 157 MB_PREDICTION_MODE mode, uv_mode;
163 MV_REFERENCE_FRAME ref_frame; 158 MV_REFERENCE_FRAME ref_frame;
164 union 159 int_mv mv;
165 {
166 int as_int;
167 MV as_mv;
168 } mv;
169 160
170 unsigned char partitioning; 161 unsigned char partitioning;
171 unsigned char mb_skip_coeff; /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */ 162 unsigned char mb_skip_coeff; /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */
172 unsigned char dc_diff;
173 unsigned char need_to_clamp_mvs; 163 unsigned char need_to_clamp_mvs;
174
175 unsigned char segment_id; /* Which set of segmentation para meters should be used for this MB */ 164 unsigned char segment_id; /* Which set of segmentation para meters should be used for this MB */
176
177 unsigned char force_no_skip; /* encoder only */
178 } MB_MODE_INFO; 165 } MB_MODE_INFO;
179 166
180
181 typedef struct 167 typedef struct
182 { 168 {
183 MB_MODE_INFO mbmi; 169 MB_MODE_INFO mbmi;
184 B_MODE_INFO bmi[16]; 170 union b_mode_info bmi[16];
185 } MODE_INFO; 171 } MODE_INFO;
186 172
187
188 typedef struct 173 typedef struct
189 { 174 {
190 short *qcoeff; 175 short *qcoeff;
191 short *dqcoeff; 176 short *dqcoeff;
192 unsigned char *predictor; 177 unsigned char *predictor;
193 short *diff; 178 short *diff;
194 short *reference;
195
196 short *dequant; 179 short *dequant;
197 180
198 /* 16 Y blocks, 4 U blocks, 4 V blocks each with 16 entries */ 181 /* 16 Y blocks, 4 U blocks, 4 V blocks each with 16 entries */
199 unsigned char **base_pre; 182 unsigned char **base_pre;
200 int pre; 183 int pre;
201 int pre_stride; 184 int pre_stride;
202 185
203 unsigned char **base_dst; 186 unsigned char **base_dst;
204 int dst; 187 int dst;
205 int dst_stride; 188 int dst_stride;
206 189
207 int eob; 190 int eob;
208 191
209 B_MODE_INFO bmi; 192 union b_mode_info bmi;
210
211 } BLOCKD; 193 } BLOCKD;
212 194
213 typedef struct 195 typedef struct MacroBlockD
214 { 196 {
215 DECLARE_ALIGNED(16, short, diff[400]); /* from idct diff */ 197 DECLARE_ALIGNED(16, short, diff[400]); /* from idct diff */
216 DECLARE_ALIGNED(16, unsigned char, predictor[384]); 198 DECLARE_ALIGNED(16, unsigned char, predictor[384]);
217 /* not used DECLARE_ALIGNED(16, short, reference[384]); */
218 DECLARE_ALIGNED(16, short, qcoeff[400]); 199 DECLARE_ALIGNED(16, short, qcoeff[400]);
219 DECLARE_ALIGNED(16, short, dqcoeff[400]); 200 DECLARE_ALIGNED(16, short, dqcoeff[400]);
220 DECLARE_ALIGNED(16, char, eobs[25]); 201 DECLARE_ALIGNED(16, char, eobs[25]);
221 202
222 /* 16 Y blocks, 4 U, 4 V, 1 DC 2nd order block, each with 16 entries. */ 203 /* 16 Y blocks, 4 U, 4 V, 1 DC 2nd order block, each with 16 entries. */
223 BLOCKD block[25]; 204 BLOCKD block[25];
224 205
225 YV12_BUFFER_CONFIG pre; /* Filtered copy of previous frame reconstruction */ 206 YV12_BUFFER_CONFIG pre; /* Filtered copy of previous frame reconstruction */
226 YV12_BUFFER_CONFIG dst; 207 YV12_BUFFER_CONFIG dst;
227 208
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 signed char ref_lf_deltas[MAX_REF_LF_DELTAS]; /* 0 = Int ra, Last, GF, ARF */ 245 signed char ref_lf_deltas[MAX_REF_LF_DELTAS]; /* 0 = Int ra, Last, GF, ARF */
265 signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS]; /* 0 = BPRED, ZERO_MV, MV, SPLIT */ 246 signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS]; /* 0 = BPRED, ZERO_MV, MV, SPLIT */
266 signed char mode_lf_deltas[MAX_MODE_LF_DELTAS]; /* 0 = BPRED, ZERO_MV, MV, SPLIT */ 247 signed char mode_lf_deltas[MAX_MODE_LF_DELTAS]; /* 0 = BPRED, ZERO_MV, MV, SPLIT */
267 248
268 /* Distance of MB away from frame edges */ 249 /* Distance of MB away from frame edges */
269 int mb_to_left_edge; 250 int mb_to_left_edge;
270 int mb_to_right_edge; 251 int mb_to_right_edge;
271 int mb_to_top_edge; 252 int mb_to_top_edge;
272 int mb_to_bottom_edge; 253 int mb_to_bottom_edge;
273 254
255 int ref_frame_cost[MAX_REF_FRAMES];
256
257
274 unsigned int frames_since_golden; 258 unsigned int frames_since_golden;
275 unsigned int frames_till_alt_ref_frame; 259 unsigned int frames_till_alt_ref_frame;
276 vp8_subpix_fn_t subpixel_predict; 260 vp8_subpix_fn_t subpixel_predict;
277 vp8_subpix_fn_t subpixel_predict8x4; 261 vp8_subpix_fn_t subpixel_predict8x4;
278 vp8_subpix_fn_t subpixel_predict8x8; 262 vp8_subpix_fn_t subpixel_predict8x8;
279 vp8_subpix_fn_t subpixel_predict16x16; 263 vp8_subpix_fn_t subpixel_predict16x16;
280 264
281 void *current_bc; 265 void *current_bc;
282 266
283 int corrupted; 267 int corrupted;
284 268
269 #if ARCH_X86 || ARCH_X86_64
270 /* This is an intermediate buffer currently used in sub-pixel motion search
271 * to keep a copy of the reference area. This buffer can be used for other
272 * purpose.
273 */
274 DECLARE_ALIGNED(32, unsigned char, y_buf[22*32]);
275 #endif
276
285 #if CONFIG_RUNTIME_CPU_DETECT 277 #if CONFIG_RUNTIME_CPU_DETECT
286 struct VP8_COMMON_RTCD *rtcd; 278 struct VP8_COMMON_RTCD *rtcd;
287 #endif 279 #endif
288 } MACROBLOCKD; 280 } MACROBLOCKD;
289 281
290 282
291 extern void vp8_build_block_doffsets(MACROBLOCKD *x); 283 extern void vp8_build_block_doffsets(MACROBLOCKD *x);
292 extern void vp8_setup_block_dptrs(MACROBLOCKD *x); 284 extern void vp8_setup_block_dptrs(MACROBLOCKD *x);
293 285
286 static void update_blockd_bmi(MACROBLOCKD *xd)
287 {
288 int i;
289 int is_4x4;
290 is_4x4 = (xd->mode_info_context->mbmi.mode == SPLITMV) ||
291 (xd->mode_info_context->mbmi.mode == B_PRED);
292
293 if (is_4x4)
294 {
295 for (i = 0; i < 16; i++)
296 {
297 xd->block[i].bmi = xd->mode_info_context->bmi[i];
298 }
299 }
300 }
301
294 #endif /* __INC_BLOCKD_H */ 302 #endif /* __INC_BLOCKD_H */
OLDNEW
« no previous file with comments | « source/libvpx/vp8/common/asm_com_offsets.c ('k') | source/libvpx/vp8/common/coefupdateprobs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698