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

Side by Side Diff: source/libvpx/vp9/decoder/vp9_decodemv.c

Issue 168343002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: libvpx: Pull from upstream Created 6 years, 10 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/decoder/vp9_decodeframe.c ('k') | source/libvpx/vp9/decoder/vp9_detokenize.c » ('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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 mbmi->seg_id_predicted = vp9_read(r, pred_prob); 139 mbmi->seg_id_predicted = vp9_read(r, pred_prob);
140 segment_id = mbmi->seg_id_predicted ? predicted_segment_id 140 segment_id = mbmi->seg_id_predicted ? predicted_segment_id
141 : read_segment_id(r, seg); 141 : read_segment_id(r, seg);
142 } else { 142 } else {
143 segment_id = read_segment_id(r, seg); 143 segment_id = read_segment_id(r, seg);
144 } 144 }
145 set_segment_id(cm, bsize, mi_row, mi_col, segment_id); 145 set_segment_id(cm, bsize, mi_row, mi_col, segment_id);
146 return segment_id; 146 return segment_id;
147 } 147 }
148 148
149 static int read_skip_coeff(VP9_COMMON *cm, const MACROBLOCKD *xd, 149 static int read_skip(VP9_COMMON *cm, const MACROBLOCKD *xd,
150 int segment_id, vp9_reader *r) { 150 int segment_id, vp9_reader *r) {
151 if (vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP)) { 151 if (vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP)) {
152 return 1; 152 return 1;
153 } else { 153 } else {
154 const int ctx = vp9_get_skip_context(xd); 154 const int ctx = vp9_get_skip_context(xd);
155 const int skip = vp9_read(r, cm->fc.mbskip_probs[ctx]); 155 const int skip = vp9_read(r, cm->fc.skip_probs[ctx]);
156 if (!cm->frame_parallel_decoding_mode) 156 if (!cm->frame_parallel_decoding_mode)
157 ++cm->counts.mbskip[ctx][skip]; 157 ++cm->counts.skip[ctx][skip];
158 return skip; 158 return skip;
159 } 159 }
160 } 160 }
161 161
162 static void read_intra_frame_mode_info(VP9_COMMON *const cm, 162 static void read_intra_frame_mode_info(VP9_COMMON *const cm,
163 MACROBLOCKD *const xd, 163 MACROBLOCKD *const xd,
164 int mi_row, int mi_col, vp9_reader *r) { 164 int mi_row, int mi_col, vp9_reader *r) {
165 MODE_INFO *const mi = xd->mi_8x8[0]; 165 MODE_INFO *const mi = xd->mi_8x8[0];
166 MB_MODE_INFO *const mbmi = &mi->mbmi; 166 MB_MODE_INFO *const mbmi = &mi->mbmi;
167 const MODE_INFO *above_mi = xd->mi_8x8[-cm->mode_info_stride]; 167 const MODE_INFO *above_mi = xd->mi_8x8[-cm->mode_info_stride];
168 const MODE_INFO *left_mi = xd->left_available ? xd->mi_8x8[-1] : NULL; 168 const MODE_INFO *left_mi = xd->left_available ? xd->mi_8x8[-1] : NULL;
169 const BLOCK_SIZE bsize = mbmi->sb_type; 169 const BLOCK_SIZE bsize = mbmi->sb_type;
170 170
171 mbmi->segment_id = read_intra_segment_id(cm, xd, mi_row, mi_col, r); 171 mbmi->segment_id = read_intra_segment_id(cm, xd, mi_row, mi_col, r);
172 mbmi->skip_coeff = read_skip_coeff(cm, xd, mbmi->segment_id, r); 172 mbmi->skip = read_skip(cm, xd, mbmi->segment_id, r);
173 mbmi->tx_size = read_tx_size(cm, xd, cm->tx_mode, bsize, 1, r); 173 mbmi->tx_size = read_tx_size(cm, xd, cm->tx_mode, bsize, 1, r);
174 mbmi->ref_frame[0] = INTRA_FRAME; 174 mbmi->ref_frame[0] = INTRA_FRAME;
175 mbmi->ref_frame[1] = NONE; 175 mbmi->ref_frame[1] = NONE;
176 176
177 if (bsize >= BLOCK_8X8) { 177 if (bsize >= BLOCK_8X8) {
178 const MB_PREDICTION_MODE A = above_block_mode(mi, above_mi, 0); 178 const MB_PREDICTION_MODE A = vp9_above_block_mode(mi, above_mi, 0);
179 const MB_PREDICTION_MODE L = left_block_mode(mi, left_mi, 0); 179 const MB_PREDICTION_MODE L = vp9_left_block_mode(mi, left_mi, 0);
180 mbmi->mode = read_intra_mode(r, vp9_kf_y_mode_prob[A][L]); 180 mbmi->mode = read_intra_mode(r, vp9_kf_y_mode_prob[A][L]);
181 } else { 181 } else {
182 // Only 4x4, 4x8, 8x4 blocks 182 // Only 4x4, 4x8, 8x4 blocks
183 const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize]; // 1 or 2 183 const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize]; // 1 or 2
184 const int num_4x4_h = num_4x4_blocks_high_lookup[bsize]; // 1 or 2 184 const int num_4x4_h = num_4x4_blocks_high_lookup[bsize]; // 1 or 2
185 int idx, idy; 185 int idx, idy;
186 186
187 for (idy = 0; idy < 2; idy += num_4x4_h) { 187 for (idy = 0; idy < 2; idy += num_4x4_h) {
188 for (idx = 0; idx < 2; idx += num_4x4_w) { 188 for (idx = 0; idx < 2; idx += num_4x4_w) {
189 const int ib = idy * 2 + idx; 189 const int ib = idy * 2 + idx;
190 const MB_PREDICTION_MODE A = above_block_mode(mi, above_mi, ib); 190 const MB_PREDICTION_MODE A = vp9_above_block_mode(mi, above_mi, ib);
191 const MB_PREDICTION_MODE L = left_block_mode(mi, left_mi, ib); 191 const MB_PREDICTION_MODE L = vp9_left_block_mode(mi, left_mi, ib);
192 const MB_PREDICTION_MODE b_mode = read_intra_mode(r, 192 const MB_PREDICTION_MODE b_mode = read_intra_mode(r,
193 vp9_kf_y_mode_prob[A][L]); 193 vp9_kf_y_mode_prob[A][L]);
194 mi->bmi[ib].as_mode = b_mode; 194 mi->bmi[ib].as_mode = b_mode;
195 if (num_4x4_h == 2) 195 if (num_4x4_h == 2)
196 mi->bmi[ib + 2].as_mode = b_mode; 196 mi->bmi[ib + 2].as_mode = b_mode;
197 if (num_4x4_w == 2) 197 if (num_4x4_w == 2)
198 mi->bmi[ib + 1].as_mode = b_mode; 198 mi->bmi[ib + 1].as_mode = b_mode;
199 } 199 }
200 } 200 }
201 201
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 MACROBLOCKD *const xd, 513 MACROBLOCKD *const xd,
514 const TileInfo *const tile, 514 const TileInfo *const tile,
515 int mi_row, int mi_col, vp9_reader *r) { 515 int mi_row, int mi_col, vp9_reader *r) {
516 MODE_INFO *const mi = xd->mi_8x8[0]; 516 MODE_INFO *const mi = xd->mi_8x8[0];
517 MB_MODE_INFO *const mbmi = &mi->mbmi; 517 MB_MODE_INFO *const mbmi = &mi->mbmi;
518 int inter_block; 518 int inter_block;
519 519
520 mbmi->mv[0].as_int = 0; 520 mbmi->mv[0].as_int = 0;
521 mbmi->mv[1].as_int = 0; 521 mbmi->mv[1].as_int = 0;
522 mbmi->segment_id = read_inter_segment_id(cm, xd, mi_row, mi_col, r); 522 mbmi->segment_id = read_inter_segment_id(cm, xd, mi_row, mi_col, r);
523 mbmi->skip_coeff = read_skip_coeff(cm, xd, mbmi->segment_id, r); 523 mbmi->skip = read_skip(cm, xd, mbmi->segment_id, r);
524 inter_block = read_is_inter_block(cm, xd, mbmi->segment_id, r); 524 inter_block = read_is_inter_block(cm, xd, mbmi->segment_id, r);
525 mbmi->tx_size = read_tx_size(cm, xd, cm->tx_mode, mbmi->sb_type, 525 mbmi->tx_size = read_tx_size(cm, xd, cm->tx_mode, mbmi->sb_type,
526 !mbmi->skip_coeff || !inter_block, r); 526 !mbmi->skip || !inter_block, r);
527 527
528 if (inter_block) 528 if (inter_block)
529 read_inter_block_mode_info(cm, xd, tile, mi, mi_row, mi_col, r); 529 read_inter_block_mode_info(cm, xd, tile, mi, mi_row, mi_col, r);
530 else 530 else
531 read_intra_block_mode_info(cm, mi, r); 531 read_intra_block_mode_info(cm, mi, r);
532 } 532 }
533 533
534 void vp9_read_mode_info(VP9_COMMON *cm, MACROBLOCKD *xd, 534 void vp9_read_mode_info(VP9_COMMON *cm, MACROBLOCKD *xd,
535 const TileInfo *const tile, 535 const TileInfo *const tile,
536 int mi_row, int mi_col, vp9_reader *r) { 536 int mi_row, int mi_col, vp9_reader *r) {
537 if (frame_is_intra_only(cm)) 537 if (frame_is_intra_only(cm))
538 read_intra_frame_mode_info(cm, xd, mi_row, mi_col, r); 538 read_intra_frame_mode_info(cm, xd, mi_row, mi_col, r);
539 else 539 else
540 read_inter_frame_mode_info(cm, xd, tile, mi_row, mi_col, r); 540 read_inter_frame_mode_info(cm, xd, tile, mi_row, mi_col, r);
541 } 541 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/decoder/vp9_decodeframe.c ('k') | source/libvpx/vp9/decoder/vp9_detokenize.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698