Commit e6deea4e authored by John Koleszar's avatar John Koleszar

detokenize: use consistent structure for all block sizes

Restructure the code to avoid the majority of per-block-size
switches, code duplication, etc. All block types (mb/sb32/sb64)
can be handled by the same code.

Change-Id: I4022718d66e31a15a7074e43f3b98cd0a5124ea7
parent 05a79f2f
......@@ -215,6 +215,14 @@ typedef enum {
BLOCK_SIZE_SB64X64 = 2,
} BLOCK_SIZE_TYPE;
typedef enum {
BLOCK_4X4_LG2 = 0,
BLOCK_8X8_LG2 = 2,
BLOCK_16X16_LG2 = 4,
BLOCK_32X32_LG2 = 6,
BLOCK_64X64_LG2 = 8
} BLOCK_SIZE_LG2;
typedef struct {
MB_PREDICTION_MODE mode, uv_mode;
#if CONFIG_COMP_INTERINTRA_PRED
......@@ -299,6 +307,9 @@ struct mb_plane {
DECLARE_ALIGNED(16, int16_t, qcoeff[64 * 64]);
DECLARE_ALIGNED(16, int16_t, dqcoeff[64 * 64]);
DECLARE_ALIGNED(16, uint16_t, eobs[256]);
PLANE_TYPE plane_type;
int subsampling_x;
int subsampling_y;
};
#define BLOCK_OFFSET(x, i, n) ((x) + (i) * (n))
......
......@@ -70,7 +70,7 @@ static void setup_macroblock(MACROBLOCKD *mb, BLOCKSET bs) {
}
void vp9_setup_block_dptrs(MACROBLOCKD *mb) {
int r, c;
int r, c, i;
BLOCKD *blockd = mb->block;
for (r = 0; r < 4; r++) {
......@@ -99,6 +99,12 @@ void vp9_setup_block_dptrs(MACROBLOCKD *mb) {
blockd[to].predictor = &mb->predictor[from];
}
}
for (i = 0; i < MAX_MB_PLANE; i++) {
mb->plane[i].plane_type = i ? PLANE_TYPE_UV : PLANE_TYPE_Y_WITH_DC;
mb->plane[i].subsampling_x = !!i;
mb->plane[i].subsampling_y = !!i;
}
}
void vp9_build_block_doffsets(MACROBLOCKD *mb) {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment