diff options
author | James Zern <jzern@google.com> | 2015-07-02 01:52:19 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-07-02 01:52:21 +0000 |
commit | 0ea304620cb4a506060c2b9b2164e4a45261145c (patch) | |
tree | 9853031eba8e6e5f3e2cbe5b977819fb2a2ba5c0 /vp9/common | |
parent | 95dc082168f8e81b036e8cbe6c3eae369afd5f5e (diff) | |
parent | e6add6499fccb1bfc3ea027e656f3fe111fe17bd (diff) | |
download | libvpx-0ea304620cb4a506060c2b9b2164e4a45261145c.tar libvpx-0ea304620cb4a506060c2b9b2164e4a45261145c.tar.gz libvpx-0ea304620cb4a506060c2b9b2164e4a45261145c.tar.bz2 libvpx-0ea304620cb4a506060c2b9b2164e4a45261145c.zip |
Merge "vp9_pred_common: inline vp9_get_segment_id"
Diffstat (limited to 'vp9/common')
-rw-r--r-- | vp9/common/vp9_pred_common.c | 19 | ||||
-rw-r--r-- | vp9/common/vp9_pred_common.h | 20 |
2 files changed, 18 insertions, 21 deletions
diff --git a/vp9/common/vp9_pred_common.c b/vp9/common/vp9_pred_common.c index 0aac4a9e6..a24e95003 100644 --- a/vp9/common/vp9_pred_common.c +++ b/vp9/common/vp9_pred_common.c @@ -9,8 +9,6 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include <limits.h> - #include "vp9/common/vp9_common.h" #include "vp9/common/vp9_pred_common.h" #include "vp9/common/vp9_seg_common.h" @@ -362,20 +360,3 @@ int vp9_get_tx_size_context(const MACROBLOCKD *xd) { return (above_ctx + left_ctx) > max_tx_size; } -int vp9_get_segment_id(const VP9_COMMON *cm, const uint8_t *segment_ids, - BLOCK_SIZE bsize, int mi_row, int mi_col) { - const int mi_offset = mi_row * cm->mi_cols + mi_col; - const int bw = num_8x8_blocks_wide_lookup[bsize]; - const int bh = num_8x8_blocks_high_lookup[bsize]; - const int xmis = MIN(cm->mi_cols - mi_col, bw); - const int ymis = MIN(cm->mi_rows - mi_row, bh); - int x, y, segment_id = INT_MAX; - - for (y = 0; y < ymis; y++) - for (x = 0; x < xmis; x++) - segment_id = MIN(segment_id, - segment_ids[mi_offset + y * cm->mi_cols + x]); - - assert(segment_id >= 0 && segment_id < MAX_SEGMENTS); - return segment_id; -} diff --git a/vp9/common/vp9_pred_common.h b/vp9/common/vp9_pred_common.h index bc19d28b9..7ea8c9da3 100644 --- a/vp9/common/vp9_pred_common.h +++ b/vp9/common/vp9_pred_common.h @@ -18,8 +18,24 @@ extern "C" { #endif -int vp9_get_segment_id(const VP9_COMMON *cm, const uint8_t *segment_ids, - BLOCK_SIZE bsize, int mi_row, int mi_col); +static INLINE int get_segment_id(const VP9_COMMON *cm, + const uint8_t *segment_ids, + BLOCK_SIZE bsize, int mi_row, int mi_col) { + const int mi_offset = mi_row * cm->mi_cols + mi_col; + const int bw = num_8x8_blocks_wide_lookup[bsize]; + const int bh = num_8x8_blocks_high_lookup[bsize]; + const int xmis = MIN(cm->mi_cols - mi_col, bw); + const int ymis = MIN(cm->mi_rows - mi_row, bh); + int x, y, segment_id = MAX_SEGMENTS; + + for (y = 0; y < ymis; ++y) + for (x = 0; x < xmis; ++x) + segment_id = MIN(segment_id, + segment_ids[mi_offset + y * cm->mi_cols + x]); + + assert(segment_id >= 0 && segment_id < MAX_SEGMENTS); + return segment_id; +} static INLINE int vp9_get_pred_context_seg_id(const MACROBLOCKD *xd) { const MODE_INFO *const above_mi = xd->above_mi; |