diff options
author | Scott LaVarnway <slavarnway@google.com> | 2013-09-11 13:45:44 -0400 |
---|---|---|
committer | Scott LaVarnway <slavarnway@google.com> | 2013-09-11 13:45:44 -0400 |
commit | ac6093d179d8488f90bf10c6d0abcc48be327d28 (patch) | |
tree | b5be18157350f2fe68238ab4c093aec74e6107f9 /vp9/common/vp9_findnearmv.h | |
parent | 0607abc3dd26e6782ad9577765f9aeef311b0de9 (diff) | |
download | libvpx-ac6093d179d8488f90bf10c6d0abcc48be327d28.tar libvpx-ac6093d179d8488f90bf10c6d0abcc48be327d28.tar.gz libvpx-ac6093d179d8488f90bf10c6d0abcc48be327d28.tar.bz2 libvpx-ac6093d179d8488f90bf10c6d0abcc48be327d28.zip |
New mode_info_context storage -- undo revert
mode_info_context was stored as a grid of MODE_INFO structs.
The grid now constists of pointers to MODE_INFO structs. The
MODE_INFO structs are now stored as a stream (decoder only),
eliminating unnecessary copies and is a little more cache
friendly.
Change-Id: I031d376284c6eb98a38ad5595b797f048a6cfc0d
Diffstat (limited to 'vp9/common/vp9_findnearmv.h')
-rw-r--r-- | vp9/common/vp9_findnearmv.h | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/vp9/common/vp9_findnearmv.h b/vp9/common/vp9_findnearmv.h index 72572dfb1..ad0d882b9 100644 --- a/vp9/common/vp9_findnearmv.h +++ b/vp9/common/vp9_findnearmv.h @@ -43,41 +43,50 @@ void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, int block_idx, int ref_idx, int mi_row, int mi_col); -static MB_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, int b) { +static MB_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, + const MODE_INFO *left_mb, int b) { // FIXME(rbultje, jingning): temporary hack because jenkins doesn't // understand this condition. This will go away soon. + const MODE_INFO *mi = cur_mb; + if (b == 0 || b == 2) { /* On L edge, get from MB to left of us */ - --cur_mb; + mi = left_mb; + if (!mi) + return DC_PRED; - if (is_inter_block(&cur_mb->mbmi)) { + if (mi->mbmi.ref_frame[0] != INTRA_FRAME) { return DC_PRED; - } else if (cur_mb->mbmi.sb_type < BLOCK_8X8) { - return (cur_mb->bmi + 1 + b)->as_mode; + } else if (mi->mbmi.sb_type < BLOCK_8X8) { + return ((mi->bmi + 1 + b)->as_mode); } else { - return cur_mb->mbmi.mode; + return mi->mbmi.mode; } } assert(b == 1 || b == 3); - return (cur_mb->bmi + b - 1)->as_mode; + return (mi->bmi + b - 1)->as_mode; } static MB_PREDICTION_MODE above_block_mode(const MODE_INFO *cur_mb, - int b, int mi_stride) { + const MODE_INFO *above_mb, int b) { + const MODE_INFO *mi = cur_mb; + if (!(b >> 1)) { /* On top edge, get from MB above us */ - cur_mb -= mi_stride; + mi = above_mb; + if (!mi) + return DC_PRED; - if (is_inter_block(&cur_mb->mbmi)) { + if (mi->mbmi.ref_frame[0] != INTRA_FRAME) { return DC_PRED; - } else if (cur_mb->mbmi.sb_type < BLOCK_8X8) { - return (cur_mb->bmi + 2 + b)->as_mode; + } else if (mi->mbmi.sb_type < BLOCK_8X8) { + return ((mi->bmi + 2 + b)->as_mode); } else { - return cur_mb->mbmi.mode; + return mi->mbmi.mode; } } - return (cur_mb->bmi + b - 2)->as_mode; + return (mi->bmi + b - 2)->as_mode; } #endif // VP9_COMMON_VP9_FINDNEARMV_H_ |