diff options
Diffstat (limited to 'vp9/common/vp9_blockd.h')
-rw-r--r-- | vp9/common/vp9_blockd.h | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h index 1b6ed68d8..bc3416ec2 100644 --- a/vp9/common/vp9_blockd.h +++ b/vp9/common/vp9_blockd.h @@ -243,12 +243,9 @@ struct scale_factors { int (*scale_value_x)(int val, const struct scale_factors *scale); int (*scale_value_y)(int val, const struct scale_factors *scale); void (*set_scaled_offsets)(struct scale_factors *scale, int row, int col); - int_mv32 (*scale_motion_vector_q3_to_q4)(const int_mv *src_mv, - const struct scale_factors *scale); - int32_t (*scale_motion_vector_component_q4)(int mv_q4, - int num, - int den, - int offset_q4); + int_mv32 (*scale_mv_q3_to_q4)(const int_mv *src_mv, + const struct scale_factors *scale); + int32_t (*scale_mv_component_q4)(int mv_q4, int num, int den, int offset_q4); convolve_fn_t predict[2][2][2]; // horiz, vert, avg }; @@ -306,10 +303,6 @@ typedef struct macroblockd { /* 0 (do not update) 1 (update) the macroblock segmentation map. */ unsigned char update_mb_segmentation_map; -#if CONFIG_IMPLICIT_SEGMENTATION - unsigned char allow_implicit_segment_update; -#endif - /* 0 (do not update) 1 (update) the macroblock segmentation feature data. */ unsigned char update_mb_segmentation_data; @@ -615,6 +608,16 @@ static INLINE struct plane_block_idx plane_block_idx(int y_blocks, return res; } +static INLINE int plane_block_width(BLOCK_SIZE_TYPE bsize, + const struct macroblockd_plane* plane) { + return 4 << (b_width_log2(bsize) - plane->subsampling_x); +} + +static INLINE int plane_block_height(BLOCK_SIZE_TYPE bsize, + const struct macroblockd_plane* plane) { + return 4 << (b_height_log2(bsize) - plane->subsampling_y); +} + typedef void (*foreach_transformed_block_visitor)(int plane, int block, BLOCK_SIZE_TYPE bsize, int ss_txfrm_size, @@ -685,8 +688,8 @@ static INLINE void foreach_predicted_block_in_plane( // block sizes in number of 4x4 blocks log 2 ("*_b") // 4x4=0, 8x8=2, 16x16=4, 32x32=6, 64x64=8 // subsampled size of the block - const int bw = b_width_log2(bsize) - xd->plane[plane].subsampling_x; - const int bh = b_height_log2(bsize) - xd->plane[plane].subsampling_y; + const int bwl = b_width_log2(bsize) - xd->plane[plane].subsampling_x; + const int bhl = b_height_log2(bsize) - xd->plane[plane].subsampling_y; // size of the predictor to use. int pred_w, pred_h; @@ -696,21 +699,20 @@ static INLINE void foreach_predicted_block_in_plane( pred_w = 0; pred_h = 0; } else { - pred_w = bw; - pred_h = bh; + pred_w = bwl; + pred_h = bhl; } - assert(pred_w <= bw); - assert(pred_h <= bh); + assert(pred_w <= bwl); + assert(pred_h <= bhl); // visit each subblock in raster order i = 0; - for (y = 0; y < 1 << bh; y += 1 << pred_h) { - for (x = 0; x < 1 << bw; x += 1 << pred_w) { + for (y = 0; y < 1 << bhl; y += 1 << pred_h) { + for (x = 0; x < 1 << bwl; x += 1 << pred_w) { visit(plane, i, bsize, pred_w, pred_h, arg); i += 1 << pred_w; } - i -= 1 << bw; - i += 1 << (bw + pred_h); + i += (1 << (bwl + pred_h)) - (1 << bwl); } } static INLINE void foreach_predicted_block( @@ -740,8 +742,7 @@ static int raster_block_offset(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize, static int16_t* raster_block_offset_int16(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize, int plane, int block, int16_t *base) { - const int bw = b_width_log2(bsize) - xd->plane[plane].subsampling_x; - const int stride = 4 << bw; + const int stride = plane_block_width(bsize, &xd->plane[plane]); return base + raster_block_offset(xd, bsize, plane, block, stride); } static uint8_t* raster_block_offset_uint8(MACROBLOCKD *xd, @@ -778,5 +779,4 @@ static void txfrm_block_to_raster_xy(MACROBLOCKD *xd, *x = (raster_mb & (tx_cols - 1)) << (txwl); *y = raster_mb >> tx_cols_lg2 << (txwl); } - #endif // VP9_COMMON_VP9_BLOCKD_H_ |