Commit 45870619 authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Renaming BLOCK_SIZE_TYPE to BLOCK_SIZE in the common/decoder.

Adding temporary "typedef BLOCK_SIZE BLOCK_SIZE_TYPE" which will go away
after encoder's patch.

Change-Id: I06ec6a6f079401439843ec981d1496234fd7775c
parent 5eed6e22
...@@ -39,8 +39,8 @@ TEST_P(VP9SubtractBlockTest, SimpleSubtract) { ...@@ -39,8 +39,8 @@ TEST_P(VP9SubtractBlockTest, SimpleSubtract) {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
// FIXME(rbultje) split in its own file // FIXME(rbultje) split in its own file
for (BLOCK_SIZE_TYPE bsize = BLOCK_4X4; bsize < BLOCK_SIZES; for (BLOCK_SIZE bsize = BLOCK_4X4; bsize < BLOCK_SIZES;
bsize = static_cast<BLOCK_SIZE_TYPE>(static_cast<int>(bsize) + 1)) { bsize = static_cast<BLOCK_SIZE>(static_cast<int>(bsize) + 1)) {
const int block_width = 4 << b_width_log2(bsize); const int block_width = 4 << b_width_log2(bsize);
const int block_height = 4 << b_height_log2(bsize); const int block_height = 4 << b_height_log2(bsize);
int16_t *diff = reinterpret_cast<int16_t *>( int16_t *diff = reinterpret_cast<int16_t *>(
......
...@@ -115,18 +115,18 @@ typedef enum { ...@@ -115,18 +115,18 @@ typedef enum {
MAX_REF_FRAMES = 4 MAX_REF_FRAMES = 4
} MV_REFERENCE_FRAME; } MV_REFERENCE_FRAME;
static INLINE int b_width_log2(BLOCK_SIZE_TYPE sb_type) { static INLINE int b_width_log2(BLOCK_SIZE sb_type) {
return b_width_log2_lookup[sb_type]; return b_width_log2_lookup[sb_type];
} }
static INLINE int b_height_log2(BLOCK_SIZE_TYPE sb_type) { static INLINE int b_height_log2(BLOCK_SIZE sb_type) {
return b_height_log2_lookup[sb_type]; return b_height_log2_lookup[sb_type];
} }
static INLINE int mi_width_log2(BLOCK_SIZE_TYPE sb_type) { static INLINE int mi_width_log2(BLOCK_SIZE sb_type) {
return mi_width_log2_lookup[sb_type]; return mi_width_log2_lookup[sb_type];
} }
static INLINE int mi_height_log2(BLOCK_SIZE_TYPE sb_type) { static INLINE int mi_height_log2(BLOCK_SIZE sb_type) {
return mi_height_log2_lookup[sb_type]; return mi_height_log2_lookup[sb_type];
} }
...@@ -153,7 +153,7 @@ typedef struct { ...@@ -153,7 +153,7 @@ typedef struct {
INTERPOLATIONFILTERTYPE interp_filter; INTERPOLATIONFILTERTYPE interp_filter;
BLOCK_SIZE_TYPE sb_type; BLOCK_SIZE sb_type;
} MB_MODE_INFO; } MB_MODE_INFO;
typedef struct { typedef struct {
...@@ -245,7 +245,7 @@ typedef struct macroblockd { ...@@ -245,7 +245,7 @@ typedef struct macroblockd {
} MACROBLOCKD; } MACROBLOCKD;
static INLINE unsigned char *get_sb_index(MACROBLOCKD *xd, BLOCK_SIZE_TYPE subsize) { static INLINE unsigned char *get_sb_index(MACROBLOCKD *xd, BLOCK_SIZE subsize) {
switch (subsize) { switch (subsize) {
case BLOCK_64X64: case BLOCK_64X64:
case BLOCK_64X32: case BLOCK_64X32:
...@@ -270,9 +270,8 @@ static INLINE unsigned char *get_sb_index(MACROBLOCKD *xd, BLOCK_SIZE_TYPE subsi ...@@ -270,9 +270,8 @@ static INLINE unsigned char *get_sb_index(MACROBLOCKD *xd, BLOCK_SIZE_TYPE subsi
} }
} }
static INLINE void update_partition_context(MACROBLOCKD *xd, static INLINE void update_partition_context(MACROBLOCKD *xd, BLOCK_SIZE sb_type,
BLOCK_SIZE_TYPE sb_type, BLOCK_SIZE sb_size) {
BLOCK_SIZE_TYPE sb_size) {
const int bsl = b_width_log2(sb_size), bs = (1 << bsl) / 2; const int bsl = b_width_log2(sb_size), bs = (1 << bsl) / 2;
const int bwl = b_width_log2(sb_type); const int bwl = b_width_log2(sb_type);
const int bhl = b_height_log2(sb_type); const int bhl = b_height_log2(sb_type);
...@@ -290,8 +289,7 @@ static INLINE void update_partition_context(MACROBLOCKD *xd, ...@@ -290,8 +289,7 @@ static INLINE void update_partition_context(MACROBLOCKD *xd,
vpx_memset(xd->left_seg_context, pcvalue[bhl == bsl], bs); vpx_memset(xd->left_seg_context, pcvalue[bhl == bsl], bs);
} }
static INLINE int partition_plane_context(MACROBLOCKD *xd, static INLINE int partition_plane_context(MACROBLOCKD *xd, BLOCK_SIZE sb_type) {
BLOCK_SIZE_TYPE sb_type) {
int bsl = mi_width_log2(sb_type), bs = 1 << bsl; int bsl = mi_width_log2(sb_type), bs = 1 << bsl;
int above = 0, left = 0, i; int above = 0, left = 0, i;
int boffset = mi_width_log2(BLOCK_64X64) - bsl; int boffset = mi_width_log2(BLOCK_64X64) - bsl;
...@@ -311,9 +309,8 @@ static INLINE int partition_plane_context(MACROBLOCKD *xd, ...@@ -311,9 +309,8 @@ static INLINE int partition_plane_context(MACROBLOCKD *xd,
return (left * 2 + above) + bsl * PARTITION_PLOFFSET; return (left * 2 + above) + bsl * PARTITION_PLOFFSET;
} }
static BLOCK_SIZE_TYPE get_subsize(BLOCK_SIZE_TYPE bsize, static BLOCK_SIZE get_subsize(BLOCK_SIZE bsize, PARTITION_TYPE partition) {
PARTITION_TYPE partition) { const BLOCK_SIZE subsize = subsize_lookup[partition][bsize];
const BLOCK_SIZE_TYPE subsize = subsize_lookup[partition][bsize];
assert(subsize < BLOCK_SIZES); assert(subsize < BLOCK_SIZES);
return subsize; return subsize;
} }
...@@ -366,31 +363,30 @@ static INLINE TX_SIZE get_uv_tx_size(const MB_MODE_INFO *mbmi) { ...@@ -366,31 +363,30 @@ static INLINE TX_SIZE get_uv_tx_size(const MB_MODE_INFO *mbmi) {
return MIN(mbmi->txfm_size, max_uv_txsize_lookup[mbmi->sb_type]); return MIN(mbmi->txfm_size, max_uv_txsize_lookup[mbmi->sb_type]);
} }
static BLOCK_SIZE_TYPE get_plane_block_size(BLOCK_SIZE_TYPE bsize, static BLOCK_SIZE get_plane_block_size(BLOCK_SIZE bsize,
const struct macroblockd_plane *pd) { const struct macroblockd_plane *pd) {
BLOCK_SIZE_TYPE bs = ss_size_lookup[bsize] BLOCK_SIZE bs = ss_size_lookup[bsize][pd->subsampling_x][pd->subsampling_y];
[pd->subsampling_x][pd->subsampling_y];
assert(bs < BLOCK_SIZES); assert(bs < BLOCK_SIZES);
return bs; return bs;
} }
static INLINE int plane_block_width(BLOCK_SIZE_TYPE bsize, static INLINE int plane_block_width(BLOCK_SIZE bsize,
const struct macroblockd_plane* plane) { const struct macroblockd_plane* plane) {
return 4 << (b_width_log2(bsize) - plane->subsampling_x); return 4 << (b_width_log2(bsize) - plane->subsampling_x);
} }
static INLINE int plane_block_height(BLOCK_SIZE_TYPE bsize, static INLINE int plane_block_height(BLOCK_SIZE bsize,
const struct macroblockd_plane* plane) { const struct macroblockd_plane* plane) {
return 4 << (b_height_log2(bsize) - plane->subsampling_y); return 4 << (b_height_log2(bsize) - plane->subsampling_y);
} }
typedef void (*foreach_transformed_block_visitor)(int plane, int block, typedef void (*foreach_transformed_block_visitor)(int plane, int block,
BLOCK_SIZE_TYPE plane_bsize, BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, TX_SIZE tx_size,
void *arg); void *arg);
static INLINE void foreach_transformed_block_in_plane( static INLINE void foreach_transformed_block_in_plane(
const MACROBLOCKD *const xd, BLOCK_SIZE_TYPE bsize, int plane, const MACROBLOCKD *const xd, BLOCK_SIZE bsize, int plane,
foreach_transformed_block_visitor visit, void *arg) { foreach_transformed_block_visitor visit, void *arg) {
const struct macroblockd_plane *const pd = &xd->plane[plane]; const struct macroblockd_plane *const pd = &xd->plane[plane];
const MB_MODE_INFO* mbmi = &xd->mode_info_context->mbmi; const MB_MODE_INFO* mbmi = &xd->mode_info_context->mbmi;
...@@ -399,7 +395,7 @@ static INLINE void foreach_transformed_block_in_plane( ...@@ -399,7 +395,7 @@ static INLINE void foreach_transformed_block_in_plane(
// transform size varies per plane, look it up in a common way. // transform size varies per plane, look it up in a common way.
const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi) const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi)
: mbmi->txfm_size; : mbmi->txfm_size;
const BLOCK_SIZE_TYPE plane_bsize = get_plane_block_size(bsize, pd); const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize]; const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize]; const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
const int step = 1 << (tx_size << 1); const int step = 1 << (tx_size << 1);
...@@ -440,7 +436,7 @@ static INLINE void foreach_transformed_block_in_plane( ...@@ -440,7 +436,7 @@ static INLINE void foreach_transformed_block_in_plane(
} }
static INLINE void foreach_transformed_block( static INLINE void foreach_transformed_block(
const MACROBLOCKD* const xd, BLOCK_SIZE_TYPE bsize, const MACROBLOCKD* const xd, BLOCK_SIZE bsize,
foreach_transformed_block_visitor visit, void *arg) { foreach_transformed_block_visitor visit, void *arg) {
int plane; int plane;
...@@ -449,7 +445,7 @@ static INLINE void foreach_transformed_block( ...@@ -449,7 +445,7 @@ static INLINE void foreach_transformed_block(
} }
static INLINE void foreach_transformed_block_uv( static INLINE void foreach_transformed_block_uv(
const MACROBLOCKD* const xd, BLOCK_SIZE_TYPE bsize, const MACROBLOCKD* const xd, BLOCK_SIZE bsize,
foreach_transformed_block_visitor visit, void *arg) { foreach_transformed_block_visitor visit, void *arg) {
int plane; int plane;
...@@ -457,25 +453,25 @@ static INLINE void foreach_transformed_block_uv( ...@@ -457,25 +453,25 @@ static INLINE void foreach_transformed_block_uv(
foreach_transformed_block_in_plane(xd, bsize, plane, visit, arg); foreach_transformed_block_in_plane(xd, bsize, plane, visit, arg);
} }
static int raster_block_offset(BLOCK_SIZE_TYPE plane_bsize, static int raster_block_offset(BLOCK_SIZE plane_bsize,
int raster_block, int stride) { int raster_block, int stride) {
const int bw = b_width_log2(plane_bsize); const int bw = b_width_log2(plane_bsize);
const int y = 4 * (raster_block >> bw); const int y = 4 * (raster_block >> bw);
const int x = 4 * (raster_block & ((1 << bw) - 1)); const int x = 4 * (raster_block & ((1 << bw) - 1));
return y * stride + x; return y * stride + x;
} }
static int16_t* raster_block_offset_int16(BLOCK_SIZE_TYPE plane_bsize, static int16_t* raster_block_offset_int16(BLOCK_SIZE plane_bsize,
int raster_block, int16_t *base) { int raster_block, int16_t *base) {
const int stride = 4 << b_width_log2(plane_bsize); const int stride = 4 << b_width_log2(plane_bsize);
return base + raster_block_offset(plane_bsize, raster_block, stride); return base + raster_block_offset(plane_bsize, raster_block, stride);
} }
static uint8_t* raster_block_offset_uint8(BLOCK_SIZE_TYPE plane_bsize, static uint8_t* raster_block_offset_uint8(BLOCK_SIZE plane_bsize,
int raster_block, uint8_t *base, int raster_block, uint8_t *base,
int stride) { int stride) {
return base + raster_block_offset(plane_bsize, raster_block, stride); return base + raster_block_offset(plane_bsize, raster_block, stride);
} }
static int txfrm_block_to_raster_block(BLOCK_SIZE_TYPE plane_bsize, static int txfrm_block_to_raster_block(BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, int block) { TX_SIZE tx_size, int block) {
const int bwl = b_width_log2(plane_bsize); const int bwl = b_width_log2(plane_bsize);
const int tx_cols_log2 = bwl - tx_size; const int tx_cols_log2 = bwl - tx_size;
...@@ -486,7 +482,7 @@ static int txfrm_block_to_raster_block(BLOCK_SIZE_TYPE plane_bsize, ...@@ -486,7 +482,7 @@ static int txfrm_block_to_raster_block(BLOCK_SIZE_TYPE plane_bsize,
return x + (y << bwl); return x + (y << bwl);
} }
static void txfrm_block_to_raster_xy(BLOCK_SIZE_TYPE plane_bsize, static void txfrm_block_to_raster_xy(BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, int block, TX_SIZE tx_size, int block,
int *x, int *y) { int *x, int *y) {
const int bwl = b_width_log2(plane_bsize); const int bwl = b_width_log2(plane_bsize);
...@@ -497,7 +493,7 @@ static void txfrm_block_to_raster_xy(BLOCK_SIZE_TYPE plane_bsize, ...@@ -497,7 +493,7 @@ static void txfrm_block_to_raster_xy(BLOCK_SIZE_TYPE plane_bsize,
*y = (raster_mb >> tx_cols_log2) << tx_size; *y = (raster_mb >> tx_cols_log2) << tx_size;
} }
static void extend_for_intra(MACROBLOCKD* const xd, BLOCK_SIZE_TYPE plane_bsize, static void extend_for_intra(MACROBLOCKD* const xd, BLOCK_SIZE plane_bsize,
int plane, int block, TX_SIZE tx_size) { int plane, int block, TX_SIZE tx_size) {
struct macroblockd_plane *const pd = &xd->plane[plane]; struct macroblockd_plane *const pd = &xd->plane[plane];
uint8_t *const buf = pd->dst.buf; uint8_t *const buf = pd->dst.buf;
...@@ -536,7 +532,7 @@ static void extend_for_intra(MACROBLOCKD* const xd, BLOCK_SIZE_TYPE plane_bsize, ...@@ -536,7 +532,7 @@ static void extend_for_intra(MACROBLOCKD* const xd, BLOCK_SIZE_TYPE plane_bsize,
} }
static void set_contexts_on_border(MACROBLOCKD *xd, static void set_contexts_on_border(MACROBLOCKD *xd,
struct macroblockd_plane *pd, struct macroblockd_plane *pd,
BLOCK_SIZE_TYPE plane_bsize, BLOCK_SIZE plane_bsize,
int tx_size_in_blocks, int has_eob, int tx_size_in_blocks, int has_eob,
int aoff, int loff, int aoff, int loff,
ENTROPY_CONTEXT *A, ENTROPY_CONTEXT *L) { ENTROPY_CONTEXT *A, ENTROPY_CONTEXT *L) {
...@@ -573,7 +569,7 @@ static void set_contexts_on_border(MACROBLOCKD *xd, ...@@ -573,7 +569,7 @@ static void set_contexts_on_border(MACROBLOCKD *xd,
} }
static void set_contexts(MACROBLOCKD *xd, struct macroblockd_plane *pd, static void set_contexts(MACROBLOCKD *xd, struct macroblockd_plane *pd,
BLOCK_SIZE_TYPE plane_bsize, TX_SIZE tx_size, BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
int has_eob, int aoff, int loff) { int has_eob, int aoff, int loff) {
ENTROPY_CONTEXT *const A = pd->above_context + aoff; ENTROPY_CONTEXT *const A = pd->above_context + aoff;
ENTROPY_CONTEXT *const L = pd->left_context + loff; ENTROPY_CONTEXT *const L = pd->left_context + loff;
......
...@@ -74,7 +74,7 @@ const PARTITION_TYPE partition_lookup[][BLOCK_SIZES] = { ...@@ -74,7 +74,7 @@ const PARTITION_TYPE partition_lookup[][BLOCK_SIZES] = {
} }
}; };
const BLOCK_SIZE_TYPE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] = { const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] = {
{ // PARTITION_NONE { // PARTITION_NONE
BLOCK_4X4, BLOCK_4X8, BLOCK_8X4, BLOCK_4X4, BLOCK_4X8, BLOCK_8X4,
BLOCK_8X8, BLOCK_8X16, BLOCK_16X8, BLOCK_8X8, BLOCK_8X16, BLOCK_16X8,
...@@ -115,7 +115,7 @@ const TX_SIZE max_uv_txsize_lookup[BLOCK_SIZES] = { ...@@ -115,7 +115,7 @@ const TX_SIZE max_uv_txsize_lookup[BLOCK_SIZES] = {
TX_16X16, TX_16X16, TX_16X16, TX_32X32 TX_16X16, TX_16X16, TX_16X16, TX_32X32
}; };
const BLOCK_SIZE_TYPE ss_size_lookup[BLOCK_SIZES][2][2] = { const BLOCK_SIZE ss_size_lookup[BLOCK_SIZES][2][2] = {
// ss_x == 0 ss_x == 0 ss_x == 1 ss_x == 1 // ss_x == 0 ss_x == 0 ss_x == 1 ss_x == 1
// ss_y == 0 ss_y == 1 ss_y == 0 ss_y == 1 // ss_y == 0 ss_y == 1 ss_y == 0 ss_y == 1
{{BLOCK_4X4, BLOCK_INVALID}, {BLOCK_INVALID, BLOCK_INVALID}}, {{BLOCK_4X4, BLOCK_INVALID}, {BLOCK_INVALID, BLOCK_INVALID}},
......
...@@ -24,9 +24,9 @@ extern const int num_4x4_blocks_wide_lookup[BLOCK_SIZES]; ...@@ -24,9 +24,9 @@ extern const int num_4x4_blocks_wide_lookup[BLOCK_SIZES];
extern const int size_group_lookup[BLOCK_SIZES]; extern const int size_group_lookup[BLOCK_SIZES];
extern const int num_pels_log2_lookup[BLOCK_SIZES]; extern const int num_pels_log2_lookup[BLOCK_SIZES];
extern const PARTITION_TYPE partition_lookup[][BLOCK_SIZES]; extern const PARTITION_TYPE partition_lookup[][BLOCK_SIZES];
extern const BLOCK_SIZE_TYPE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES]; extern const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES];
extern const TX_SIZE max_txsize_lookup[BLOCK_SIZES]; extern const TX_SIZE max_txsize_lookup[BLOCK_SIZES];
extern const TX_SIZE max_uv_txsize_lookup[BLOCK_SIZES]; extern const TX_SIZE max_uv_txsize_lookup[BLOCK_SIZES];
extern const BLOCK_SIZE_TYPE ss_size_lookup[BLOCK_SIZES][2][2]; extern const BLOCK_SIZE ss_size_lookup[BLOCK_SIZES][2][2];
#endif // VP9_COMMON_VP9_COMMON_DATA_H #endif // VP9_COMMON_VP9_COMMON_DATA_H
...@@ -156,11 +156,11 @@ extern DECLARE_ALIGNED(16, int16_t, ...@@ -156,11 +156,11 @@ extern DECLARE_ALIGNED(16, int16_t,
void vp9_coef_tree_initialize(void); void vp9_coef_tree_initialize(void);
void vp9_adapt_coef_probs(struct VP9Common *); void vp9_adapt_coef_probs(struct VP9Common *);
static INLINE void reset_skip_context(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { static INLINE void reset_skip_context(MACROBLOCKD *xd, BLOCK_SIZE bsize) {
int i; int i;
for (i = 0; i < MAX_MB_PLANE; i++) { for (i = 0; i < MAX_MB_PLANE; i++) {
struct macroblockd_plane *const pd = &xd->plane[i]; struct macroblockd_plane *const pd = &xd->plane[i];
const BLOCK_SIZE_TYPE plane_bsize = get_plane_block_size(bsize, pd); const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
vpx_memset(pd->above_context, 0, sizeof(ENTROPY_CONTEXT) * vpx_memset(pd->above_context, 0, sizeof(ENTROPY_CONTEXT) *
num_4x4_blocks_wide_lookup[plane_bsize]); num_4x4_blocks_wide_lookup[plane_bsize]);
vpx_memset(pd->left_context, 0, sizeof(ENTROPY_CONTEXT) * vpx_memset(pd->left_context, 0, sizeof(ENTROPY_CONTEXT) *
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define MI_MASK (MI_BLOCK_SIZE - 1) #define MI_MASK (MI_BLOCK_SIZE - 1)
typedef enum BLOCK_SIZE_TYPE { typedef enum BLOCK_SIZE {
BLOCK_4X4, BLOCK_4X4,
BLOCK_4X8, BLOCK_4X8,
BLOCK_8X4, BLOCK_8X4,
...@@ -38,7 +38,9 @@ typedef enum BLOCK_SIZE_TYPE { ...@@ -38,7 +38,9 @@ typedef enum BLOCK_SIZE_TYPE {
BLOCK_64X64, BLOCK_64X64,
BLOCK_SIZES, BLOCK_SIZES,
BLOCK_INVALID = BLOCK_SIZES BLOCK_INVALID = BLOCK_SIZES
} BLOCK_SIZE_TYPE; } BLOCK_SIZE;
typedef BLOCK_SIZE BLOCK_SIZE_TYPE;
typedef enum PARTITION_TYPE { typedef enum PARTITION_TYPE {
PARTITION_NONE, PARTITION_NONE,
......
...@@ -383,7 +383,7 @@ unsigned char vp9_get_pred_context_tx_size(const MACROBLOCKD *xd) { ...@@ -383,7 +383,7 @@ unsigned char vp9_get_pred_context_tx_size(const MACROBLOCKD *xd) {
return above_context + left_context > max_tx_size; return above_context + left_context > max_tx_size;
} }
void vp9_set_pred_flag_seg_id(VP9_COMMON *cm, BLOCK_SIZE_TYPE bsize, void vp9_set_pred_flag_seg_id(VP9_COMMON *cm, BLOCK_SIZE bsize,
int mi_row, int mi_col, uint8_t pred_flag) { int mi_row, int mi_col, uint8_t pred_flag) {
MODE_INFO *mi = &cm->mi[mi_row * cm->mode_info_stride + mi_col]; MODE_INFO *mi = &cm->mi[mi_row * cm->mode_info_stride + mi_col];
const int bw = 1 << mi_width_log2(bsize); const int bw = 1 << mi_width_log2(bsize);
...@@ -397,7 +397,7 @@ void vp9_set_pred_flag_seg_id(VP9_COMMON *cm, BLOCK_SIZE_TYPE bsize, ...@@ -397,7 +397,7 @@ void vp9_set_pred_flag_seg_id(VP9_COMMON *cm, BLOCK_SIZE_TYPE bsize,
mi[y * cm->mode_info_stride + x].mbmi.seg_id_predicted = pred_flag; mi[y * cm->mode_info_stride + x].mbmi.seg_id_predicted = pred_flag;
} }
void vp9_set_pred_flag_mbskip(VP9_COMMON *cm, BLOCK_SIZE_TYPE bsize, void vp9_set_pred_flag_mbskip(VP9_COMMON *cm, BLOCK_SIZE bsize,
int mi_row, int mi_col, uint8_t pred_flag) { int mi_row, int mi_col, uint8_t pred_flag) {
MODE_INFO *mi = &cm->mi[mi_row * cm->mode_info_stride + mi_col]; MODE_INFO *mi = &cm->mi[mi_row * cm->mode_info_stride + mi_col];
const int bw = 1 << mi_width_log2(bsize); const int bw = 1 << mi_width_log2(bsize);
...@@ -412,7 +412,7 @@ void vp9_set_pred_flag_mbskip(VP9_COMMON *cm, BLOCK_SIZE_TYPE bsize, ...@@ -412,7 +412,7 @@ void vp9_set_pred_flag_mbskip(VP9_COMMON *cm, BLOCK_SIZE_TYPE bsize,
} }
int vp9_get_segment_id(VP9_COMMON *cm, const uint8_t *segment_ids, int vp9_get_segment_id(VP9_COMMON *cm, const uint8_t *segment_ids,
BLOCK_SIZE_TYPE bsize, int mi_row, int mi_col) { BLOCK_SIZE bsize, int mi_row, int mi_col) {
const int mi_offset = mi_row * cm->mi_cols + mi_col; const int mi_offset = mi_row * cm->mi_cols + mi_col;
const int bw = 1 << mi_width_log2(bsize); const int bw = 1 << mi_width_log2(bsize);
const int bh = 1 << mi_height_log2(bsize); const int bh = 1 << mi_height_log2(bsize);
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "vp9/common/vp9_onyxc_int.h" #include "vp9/common/vp9_onyxc_int.h"
int vp9_get_segment_id(VP9_COMMON *cm, const uint8_t *segment_ids, int vp9_get_segment_id(VP9_COMMON *cm, const uint8_t *segment_ids,
BLOCK_SIZE_TYPE bsize, int mi_row, int mi_col); BLOCK_SIZE bsize, int mi_row, int mi_col);
static INLINE int vp9_get_pred_context_seg_id(const MACROBLOCKD *xd) { static INLINE int vp9_get_pred_context_seg_id(const MACROBLOCKD *xd) {
...@@ -32,7 +32,7 @@ static INLINE vp9_prob vp9_get_pred_prob_seg_id(struct segmentation *seg, ...@@ -32,7 +32,7 @@ static INLINE vp9_prob vp9_get_pred_prob_seg_id(struct segmentation *seg,
return seg->pred_probs[vp9_get_pred_context_seg_id(xd)]; return seg->pred_probs[vp9_get_pred_context_seg_id(xd)];
} }
void vp9_set_pred_flag_seg_id(VP9_COMMON *cm, BLOCK_SIZE_TYPE bsize, void vp9_set_pred_flag_seg_id(VP9_COMMON *cm, BLOCK_SIZE bsize,
int mi_row, int mi_col, uint8_t pred_flag); int mi_row, int mi_col, uint8_t pred_flag);
static INLINE int vp9_get_pred_context_mbskip(const MACROBLOCKD *xd) { static INLINE int vp9_get_pred_context_mbskip(const MACROBLOCKD *xd) {
...@@ -53,7 +53,7 @@ static INLINE unsigned char vp9_get_pred_flag_mbskip(const MACROBLOCKD *xd) { ...@@ -53,7 +53,7 @@ static INLINE unsigned char vp9_get_pred_flag_mbskip(const MACROBLOCKD *xd) {
return xd->mode_info_context->mbmi.skip_coeff; return xd->mode_info_context->mbmi.skip_coeff;
} }
void vp9_set_pred_flag_mbskip(VP9_COMMON *cm, BLOCK_SIZE_TYPE bsize, void vp9_set_pred_flag_mbskip(VP9_COMMON *cm, BLOCK_SIZE bsize,
int mi_row, int mi_col, uint8_t pred_flag); int mi_row, int mi_col, uint8_t pred_flag);
unsigned char vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd); unsigned char vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd);
...@@ -103,7 +103,7 @@ static INLINE vp9_prob vp9_get_pred_prob_single_ref_p2(const VP9_COMMON *cm, ...@@ -103,7 +103,7 @@ static INLINE vp9_prob vp9_get_pred_prob_single_ref_p2(const VP9_COMMON *cm,
unsigned char vp9_get_pred_context_tx_size(const MACROBLOCKD *xd); unsigned char vp9_get_pred_context_tx_size(const MACROBLOCKD *xd);
static const vp9_prob *get_tx_probs(BLOCK_SIZE_TYPE bsize, uint8_t context, static const vp9_prob *get_tx_probs(BLOCK_SIZE bsize, uint8_t context,
const struct tx_probs *tx_probs) { const struct tx_probs *tx_probs) {
if (bsize < BLOCK_16X16) if (bsize < BLOCK_16X16)
return tx_probs->p8x8[context]; return tx_probs->p8x8[context];
...@@ -115,12 +115,12 @@ static const vp9_prob *get_tx_probs(BLOCK_SIZE_TYPE bsize, uint8_t context, ...@@ -115,12 +115,12 @@ static const vp9_prob *get_tx_probs(BLOCK_SIZE_TYPE bsize, uint8_t context,
static const vp9_prob *get_tx_probs2(const MACROBLOCKD *xd, static const vp9_prob *get_tx_probs2(const MACROBLOCKD *xd,
const struct tx_probs *tx_probs) { const struct tx_probs *tx_probs) {
const BLOCK_SIZE_TYPE bsize = xd->mode_info_context->mbmi.sb_type; const BLOCK_SIZE bsize = xd->mode_info_context->mbmi.sb_type;
const int context = vp9_get_pred_context_tx_size(xd); const int context = vp9_get_pred_context_tx_size(xd);
return get_tx_probs(bsize, context, tx_probs); return get_tx_probs(bsize, context, tx_probs);
} }
static void update_tx_counts(BLOCK_SIZE_TYPE bsize, uint8_t context, static void update_tx_counts(BLOCK_SIZE bsize, uint8_t context,
TX_SIZE tx_size, struct tx_counts *tx_counts) { TX_SIZE tx_size, struct tx_counts *tx_counts) {
if (bsize >= BLOCK_32X32) if (bsize >= BLOCK_32X32)
tx_counts->p32x32[context][tx_size]++; tx_counts->p32x32[context][tx_size]++;
......
...@@ -117,8 +117,7 @@ struct build_inter_predictors_args { ...@@ -117,8 +117,7 @@ struct build_inter_predictors_args {
int x, y; int x, y;
}; };
static void build_inter_predictors(int plane, int block, static void build_inter_predictors(int plane, int block, BLOCK_SIZE bsize,
BLOCK_SIZE_TYPE bsize,
int pred_w, int pred_h, int pred_w, int pred_h,
void *argv) { void *argv) {
const struct build_inter_predictors_args* const arg = argv; const struct build_inter_predictors_args* const arg = argv;
...@@ -174,14 +173,14 @@ static void build_inter_predictors(int plane, int block, ...@@ -174,14 +173,14 @@ static void build_inter_predictors(int plane, int block,
} }
// TODO(jkoleszar): In principle, pred_w, pred_h are unnecessary, as we could // TODO(jkoleszar): In principle, pred_w, pred_h are unnecessary, as we could
// calculate the subsampled BLOCK_SIZE_TYPE, but that type isn't defined for // calculate the subsampled BLOCK_SIZE, but that type isn't defined for
// sizes smaller than 16x16 yet. // sizes smaller than 16x16 yet.
typedef void (*foreach_predicted_block_visitor)(int plane, int block, typedef void (*foreach_predicted_block_visitor)(int plane, int block,
BLOCK_SIZE_TYPE bsize, BLOCK_SIZE bsize,
int pred_w, int pred_h, int pred_w, int pred_h,
void *arg); void *arg);
static INLINE void foreach_predicted_block_in_plane( static INLINE void foreach_predicted_block_in_plane(
const MACROBLOCKD* const xd, BLOCK_SIZE_TYPE bsize, int plane, const MACROBLOCKD* const xd, BLOCK_SIZE bsize, int plane,
foreach_predicted_block_visitor visit, void *arg) { foreach_predicted_block_visitor visit, void *arg) {
int i, x, y; int i, x, y;
...@@ -216,8 +215,7 @@ static INLINE void foreach_predicted_block_in_plane( ...@@ -216,8 +215,7 @@ static INLINE void foreach_predicted_block_in_plane(
} }
} }
static void build_inter_predictors_for_planes(MACROBLOCKD *xd, static void build_inter_predictors_for_planes(MACROBLOCKD *xd, BLOCK_SIZE bsize,
BLOCK_SIZE_TYPE bsize,
int mi_row, int mi_col, int mi_row, int mi_col,
int plane_from, int plane_to) { int plane_from, int plane_to) {
int plane; int plane;
...@@ -231,16 +229,16 @@ static void build_inter_predictors_for_planes(MACROBLOCKD *xd, ...@@ -231,16 +229,16 @@ static void build_inter_predictors_for_planes(MACROBLOCKD *xd,
} }
void vp9_build_inter_predictors_sby(MACROBLOCKD *xd, int mi_row, int mi_col, void vp9_build_inter_predictors_sby(MACROBLOCKD *xd, int mi_row, int mi_col,
BLOCK_SIZE_TYPE bsize) { BLOCK_SIZE bsize) {
build_inter_predictors_for_planes(xd, bsize, mi_row, mi_col, 0, 0); build_inter_predictors_for_planes(xd, bsize, mi_row, mi_col, 0, 0);
} }