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

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

Issue 592203002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 3 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_decoder.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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 for (y = 0; y < ymis; y++) 97 for (y = 0; y < ymis; y++)
98 for (x = 0; x < xmis; x++) 98 for (x = 0; x < xmis; x++)
99 cm->last_frame_seg_map[mi_offset + y * cm->mi_cols + x] = segment_id; 99 cm->last_frame_seg_map[mi_offset + y * cm->mi_cols + x] = segment_id;
100 } 100 }
101 101
102 static int read_intra_segment_id(VP9_COMMON *const cm, MACROBLOCKD *const xd, 102 static int read_intra_segment_id(VP9_COMMON *const cm, MACROBLOCKD *const xd,
103 int mi_row, int mi_col, 103 int mi_row, int mi_col,
104 vp9_reader *r) { 104 vp9_reader *r) {
105 struct segmentation *const seg = &cm->seg; 105 struct segmentation *const seg = &cm->seg;
106 const BLOCK_SIZE bsize = xd->mi[0]->mbmi.sb_type; 106 const BLOCK_SIZE bsize = xd->mi[0].src_mi->mbmi.sb_type;
107 int segment_id; 107 int segment_id;
108 108
109 if (!seg->enabled) 109 if (!seg->enabled)
110 return 0; // Default for disabled segmentation 110 return 0; // Default for disabled segmentation
111 111
112 if (!seg->update_map) 112 if (!seg->update_map)
113 return 0; 113 return 0;
114 114
115 segment_id = read_segment_id(r, seg); 115 segment_id = read_segment_id(r, seg);
116 set_segment_id(cm, bsize, mi_row, mi_col, segment_id); 116 set_segment_id(cm, bsize, mi_row, mi_col, segment_id);
117 return segment_id; 117 return segment_id;
118 } 118 }
119 119
120 static int read_inter_segment_id(VP9_COMMON *const cm, MACROBLOCKD *const xd, 120 static int read_inter_segment_id(VP9_COMMON *const cm, MACROBLOCKD *const xd,
121 int mi_row, int mi_col, vp9_reader *r) { 121 int mi_row, int mi_col, vp9_reader *r) {
122 struct segmentation *const seg = &cm->seg; 122 struct segmentation *const seg = &cm->seg;
123 MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi; 123 MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi;
124 const BLOCK_SIZE bsize = mbmi->sb_type; 124 const BLOCK_SIZE bsize = mbmi->sb_type;
125 int predicted_segment_id, segment_id; 125 int predicted_segment_id, segment_id;
126 126
127 if (!seg->enabled) 127 if (!seg->enabled)
128 return 0; // Default for disabled segmentation 128 return 0; // Default for disabled segmentation
129 129
130 predicted_segment_id = vp9_get_segment_id(cm, cm->last_frame_seg_map, 130 predicted_segment_id = vp9_get_segment_id(cm, cm->last_frame_seg_map,
131 bsize, mi_row, mi_col); 131 bsize, mi_row, mi_col);
132 if (!seg->update_map) 132 if (!seg->update_map)
133 return predicted_segment_id; 133 return predicted_segment_id;
(...skipping 19 matching lines...) Expand all
153 const int skip = vp9_read(r, cm->fc.skip_probs[ctx]); 153 const int skip = vp9_read(r, cm->fc.skip_probs[ctx]);
154 if (!cm->frame_parallel_decoding_mode) 154 if (!cm->frame_parallel_decoding_mode)
155 ++cm->counts.skip[ctx][skip]; 155 ++cm->counts.skip[ctx][skip];
156 return skip; 156 return skip;
157 } 157 }
158 } 158 }
159 159
160 static void read_intra_frame_mode_info(VP9_COMMON *const cm, 160 static void read_intra_frame_mode_info(VP9_COMMON *const cm,
161 MACROBLOCKD *const xd, 161 MACROBLOCKD *const xd,
162 int mi_row, int mi_col, vp9_reader *r) { 162 int mi_row, int mi_col, vp9_reader *r) {
163 MODE_INFO *const mi = xd->mi[0]; 163 MODE_INFO *const mi = xd->mi[0].src_mi;
164 MB_MODE_INFO *const mbmi = &mi->mbmi; 164 MB_MODE_INFO *const mbmi = &mi->mbmi;
165 const MODE_INFO *above_mi = xd->mi[-cm->mi_stride]; 165 const MODE_INFO *above_mi = xd->mi[-cm->mi_stride].src_mi;
166 const MODE_INFO *left_mi = xd->left_available ? xd->mi[-1] : NULL; 166 const MODE_INFO *left_mi = xd->left_available ? xd->mi[-1].src_mi : NULL;
167 const BLOCK_SIZE bsize = mbmi->sb_type; 167 const BLOCK_SIZE bsize = mbmi->sb_type;
168 int i; 168 int i;
169 169
170 mbmi->segment_id = read_intra_segment_id(cm, xd, mi_row, mi_col, r); 170 mbmi->segment_id = read_intra_segment_id(cm, xd, mi_row, mi_col, r);
171 mbmi->skip = read_skip(cm, xd, mbmi->segment_id, r); 171 mbmi->skip = read_skip(cm, xd, mbmi->segment_id, r);
172 mbmi->tx_size = read_tx_size(cm, xd, cm->tx_mode, bsize, 1, r); 172 mbmi->tx_size = read_tx_size(cm, xd, cm->tx_mode, bsize, 1, r);
173 mbmi->ref_frame[0] = INTRA_FRAME; 173 mbmi->ref_frame[0] = INTRA_FRAME;
174 mbmi->ref_frame[1] = NONE; 174 mbmi->ref_frame[1] = NONE;
175 175
176 switch (bsize) { 176 switch (bsize) {
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 } else { 512 } else {
513 xd->corrupted |= !assign_mv(cm, mbmi->mode, mbmi->mv, nearestmv, 513 xd->corrupted |= !assign_mv(cm, mbmi->mode, mbmi->mv, nearestmv,
514 nearestmv, nearmv, is_compound, allow_hp, r); 514 nearestmv, nearmv, is_compound, allow_hp, r);
515 } 515 }
516 } 516 }
517 517
518 static void read_inter_frame_mode_info(VP9_COMMON *const cm, 518 static void read_inter_frame_mode_info(VP9_COMMON *const cm,
519 MACROBLOCKD *const xd, 519 MACROBLOCKD *const xd,
520 const TileInfo *const tile, 520 const TileInfo *const tile,
521 int mi_row, int mi_col, vp9_reader *r) { 521 int mi_row, int mi_col, vp9_reader *r) {
522 MODE_INFO *const mi = xd->mi[0]; 522 MODE_INFO *const mi = xd->mi[0].src_mi;
523 MB_MODE_INFO *const mbmi = &mi->mbmi; 523 MB_MODE_INFO *const mbmi = &mi->mbmi;
524 int inter_block; 524 int inter_block;
525 525
526 mbmi->mv[0].as_int = 0; 526 mbmi->mv[0].as_int = 0;
527 mbmi->mv[1].as_int = 0; 527 mbmi->mv[1].as_int = 0;
528 mbmi->segment_id = read_inter_segment_id(cm, xd, mi_row, mi_col, r); 528 mbmi->segment_id = read_inter_segment_id(cm, xd, mi_row, mi_col, r);
529 mbmi->skip = read_skip(cm, xd, mbmi->segment_id, r); 529 mbmi->skip = read_skip(cm, xd, mbmi->segment_id, r);
530 inter_block = read_is_inter_block(cm, xd, mbmi->segment_id, r); 530 inter_block = read_is_inter_block(cm, xd, mbmi->segment_id, r);
531 mbmi->tx_size = read_tx_size(cm, xd, cm->tx_mode, mbmi->sb_type, 531 mbmi->tx_size = read_tx_size(cm, xd, cm->tx_mode, mbmi->sb_type,
532 !mbmi->skip || !inter_block, r); 532 !mbmi->skip || !inter_block, r);
533 533
534 if (inter_block) 534 if (inter_block)
535 read_inter_block_mode_info(cm, xd, tile, mi, mi_row, mi_col, r); 535 read_inter_block_mode_info(cm, xd, tile, mi, mi_row, mi_col, r);
536 else 536 else
537 read_intra_block_mode_info(cm, mi, r); 537 read_intra_block_mode_info(cm, mi, r);
538 } 538 }
539 539
540 void vp9_read_mode_info(VP9_COMMON *cm, MACROBLOCKD *xd, 540 void vp9_read_mode_info(VP9_COMMON *cm, MACROBLOCKD *xd,
541 const TileInfo *const tile, 541 const TileInfo *const tile,
542 int mi_row, int mi_col, vp9_reader *r) { 542 int mi_row, int mi_col, vp9_reader *r) {
543 if (frame_is_intra_only(cm)) 543 if (frame_is_intra_only(cm))
544 read_intra_frame_mode_info(cm, xd, mi_row, mi_col, r); 544 read_intra_frame_mode_info(cm, xd, mi_row, mi_col, r);
545 else 545 else
546 read_inter_frame_mode_info(cm, xd, tile, mi_row, mi_col, r); 546 read_inter_frame_mode_info(cm, xd, tile, mi_row, mi_col, r);
547 } 547 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/decoder/vp9_decodeframe.c ('k') | source/libvpx/vp9/decoder/vp9_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698