diff options
author | Dmitry Kovalev <dkovalev@google.com> | 2013-08-07 15:33:17 -0700 |
---|---|---|
committer | Dmitry Kovalev <dkovalev@google.com> | 2013-08-07 15:33:17 -0700 |
commit | 8db2675b97f2a9c5600f533093a5df3dcc409d86 (patch) | |
tree | e9ce95631e629ae6fde5ee5ff425c0b96baa671b /vp9/common/vp9_blockd.h | |
parent | 78182538d64d2e919c2729fd7f10dd77ded27bec (diff) | |
download | libvpx-8db2675b97f2a9c5600f533093a5df3dcc409d86.tar libvpx-8db2675b97f2a9c5600f533093a5df3dcc409d86.tar.gz libvpx-8db2675b97f2a9c5600f533093a5df3dcc409d86.tar.bz2 libvpx-8db2675b97f2a9c5600f533093a5df3dcc409d86.zip |
Adding ss_size_lookup table.
Removing the old one bsize_from_dim_lookup. Now we have a way to determine
block size for plane using its subsampling values (ss_size_lookup). And
then we can find the number of pixels in the block (num_pels_log2_lookup).
Change-Id: I6fc981da2ae093de81741d3d78eaefed11015db9
Diffstat (limited to 'vp9/common/vp9_blockd.h')
-rw-r--r-- | vp9/common/vp9_blockd.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h index aab47e472..a4295544f 100644 --- a/vp9/common/vp9_blockd.h +++ b/vp9/common/vp9_blockd.h @@ -433,6 +433,14 @@ static INLINE struct plane_block_idx plane_block_idx(int y_blocks, return res; } +static BLOCK_SIZE_TYPE get_plane_block_size(BLOCK_SIZE_TYPE bsize, + struct macroblockd_plane *pd) { + BLOCK_SIZE_TYPE bs = ss_size_lookup[bsize] + [pd->subsampling_x][pd->subsampling_y]; + assert(bs < BLOCK_SIZE_TYPES); + return bs; +} + static INLINE int plane_block_width(BLOCK_SIZE_TYPE bsize, const struct macroblockd_plane* plane) { return 4 << (b_width_log2(bsize) - plane->subsampling_x); @@ -695,10 +703,11 @@ static void set_contexts_on_border(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize, int eob, int aoff, int loff, ENTROPY_CONTEXT *A, ENTROPY_CONTEXT *L) { struct macroblockd_plane *pd = &xd->plane[plane]; + const BLOCK_SIZE_TYPE bs = get_plane_block_size(bsize, pd); + int mi_blocks_wide = num_4x4_blocks_wide_lookup[bs]; + int mi_blocks_high = num_4x4_blocks_high_lookup[bs]; int above_contexts = tx_size_in_blocks; int left_contexts = tx_size_in_blocks; - int mi_blocks_wide = 1 << plane_block_width_log2by4(bsize, pd); - int mi_blocks_high = 1 << plane_block_height_log2by4(bsize, pd); int pt; // xd->mb_to_right_edge is in units of pixels * 8. This converts |