Commit 45592a39 authored by Brennan Shacklett's avatar Brennan Shacklett

Remove multiple coefficient buffers from PICK_MODE_CONTEXT

The swap_block_ptr functionality was removed by
0d6980d7 in nextgenv2.

This patch removes all the code removed in nextgenv2 and deletes
some now unnecessary left over struct members as well.

Change-Id: I1e22514c6fe5af556710254278f2f8a5805db999
parent 180acb91
......@@ -67,7 +67,6 @@ struct macroblock {
MACROBLOCKD e_mbd;
MB_MODE_INFO_EXT *mbmi_ext;
int skip_block;
int select_tx_size;
int q_index;
// The equivalent error at the current rdmult of one whole bit (not one
......
......@@ -20,40 +20,32 @@ static void alloc_mode_context(AV1_COMMON *cm, int num_4x4_blk,
PICK_MODE_CONTEXT *ctx) {
const int num_blk = (num_4x4_blk < 4 ? 4 : num_4x4_blk);
const int num_pix = num_blk << 4;
int i, k;
int i;
ctx->num_4x4_blk = num_blk;
for (i = 0; i < MAX_MB_PLANE; ++i) {
for (k = 0; k < 3; ++k) {
CHECK_MEM_ERROR(cm, ctx->coeff[i][k],
aom_memalign(32, num_pix * sizeof(*ctx->coeff[i][k])));
CHECK_MEM_ERROR(cm, ctx->qcoeff[i][k],
aom_memalign(32, num_pix * sizeof(*ctx->qcoeff[i][k])));
CHECK_MEM_ERROR(cm, ctx->dqcoeff[i][k],
aom_memalign(32, num_pix * sizeof(*ctx->dqcoeff[i][k])));
CHECK_MEM_ERROR(cm, ctx->eobs[i][k],
aom_memalign(32, num_blk * sizeof(*ctx->eobs[i][k])));
ctx->coeff_pbuf[i][k] = ctx->coeff[i][k];
ctx->qcoeff_pbuf[i][k] = ctx->qcoeff[i][k];
ctx->dqcoeff_pbuf[i][k] = ctx->dqcoeff[i][k];
ctx->eobs_pbuf[i][k] = ctx->eobs[i][k];
}
CHECK_MEM_ERROR(cm, ctx->coeff[i],
aom_memalign(32, num_pix * sizeof(*ctx->coeff[i])));
CHECK_MEM_ERROR(cm, ctx->qcoeff[i],
aom_memalign(32, num_pix * sizeof(*ctx->qcoeff[i])));
CHECK_MEM_ERROR(cm, ctx->dqcoeff[i],
aom_memalign(32, num_pix * sizeof(*ctx->dqcoeff[i])));
CHECK_MEM_ERROR(cm, ctx->eobs[i],
aom_memalign(32, num_blk * sizeof(*ctx->eobs[i])));
}
}
static void free_mode_context(PICK_MODE_CONTEXT *ctx) {
int i, k;
int i;
for (i = 0; i < MAX_MB_PLANE; ++i) {
for (k = 0; k < 3; ++k) {
aom_free(ctx->coeff[i][k]);
ctx->coeff[i][k] = 0;
aom_free(ctx->qcoeff[i][k]);
ctx->qcoeff[i][k] = 0;
aom_free(ctx->dqcoeff[i][k]);
ctx->dqcoeff[i][k] = 0;
aom_free(ctx->eobs[i][k]);
ctx->eobs[i][k] = 0;
}
aom_free(ctx->coeff[i]);
ctx->coeff[i] = 0;
aom_free(ctx->qcoeff[i]);
ctx->qcoeff[i] = 0;
aom_free(ctx->dqcoeff[i]);
ctx->dqcoeff[i] = 0;
aom_free(ctx->eobs[i]);
ctx->eobs[i] = 0;
}
for (i = 0; i < 2; ++i) {
......
......@@ -28,16 +28,10 @@ typedef struct {
MODE_INFO mic;
MB_MODE_INFO_EXT mbmi_ext;
uint8_t *color_index_map[2];
tran_low_t *coeff[MAX_MB_PLANE][3];
tran_low_t *qcoeff[MAX_MB_PLANE][3];
tran_low_t *dqcoeff[MAX_MB_PLANE][3];
uint16_t *eobs[MAX_MB_PLANE][3];
// dual buffer pointers, 0: in use, 1: best in store
tran_low_t *coeff_pbuf[MAX_MB_PLANE][3];
tran_low_t *qcoeff_pbuf[MAX_MB_PLANE][3];
tran_low_t *dqcoeff_pbuf[MAX_MB_PLANE][3];
uint16_t *eobs_pbuf[MAX_MB_PLANE][3];
tran_low_t *coeff[MAX_MB_PLANE];
tran_low_t *qcoeff[MAX_MB_PLANE];
tran_low_t *dqcoeff[MAX_MB_PLANE];
uint16_t *eobs[MAX_MB_PLANE];
int num_4x4_blk;
int skip;
......
......@@ -901,7 +901,6 @@ static void update_state(const AV1_COMP *const cpi, ThreadData *td,
const int mis = cm->mi_stride;
const int mi_width = num_8x8_blocks_wide_lookup[bsize];
const int mi_height = num_8x8_blocks_high_lookup[bsize];
int max_plane;
#if CONFIG_REF_MV
int8_t rf_type;
#endif
......@@ -945,19 +944,11 @@ static void update_state(const AV1_COMP *const cpi, ThreadData *td,
}
}
max_plane = is_inter_block(mbmi) ? MAX_MB_PLANE : 1;
for (i = 0; i < max_plane; ++i) {
p[i].coeff = ctx->coeff_pbuf[i][1];
p[i].qcoeff = ctx->qcoeff_pbuf[i][1];
pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][1];
p[i].eobs = ctx->eobs_pbuf[i][1];
}
for (i = max_plane; i < MAX_MB_PLANE; ++i) {
p[i].coeff = ctx->coeff_pbuf[i][2];
p[i].qcoeff = ctx->qcoeff_pbuf[i][2];
pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][2];
p[i].eobs = ctx->eobs_pbuf[i][2];
for (i = 0; i < MAX_MB_PLANE; ++i) {
p[i].coeff = ctx->coeff[i];
p[i].qcoeff = ctx->qcoeff[i];
pd[i].dqcoeff = ctx->dqcoeff[i];
p[i].eobs = ctx->eobs[i];
}
for (i = 0; i < 2; ++i) pd[i].color_index_map = ctx->color_index_map[i];
......@@ -1090,10 +1081,10 @@ static void rd_pick_sb_modes(const AV1_COMP *const cpi, TileDataEnc *tile_data,
mbmi->sb_type = bsize;
for (i = 0; i < MAX_MB_PLANE; ++i) {
p[i].coeff = ctx->coeff_pbuf[i][0];
p[i].qcoeff = ctx->qcoeff_pbuf[i][0];
pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][0];
p[i].eobs = ctx->eobs_pbuf[i][0];
p[i].coeff = ctx->coeff[i];
p[i].qcoeff = ctx->qcoeff[i];
pd[i].dqcoeff = ctx->dqcoeff[i];
p[i].eobs = ctx->eobs[i];
}
for (i = 0; i < 2; ++i) pd[i].color_index_map = ctx->color_index_map[i];
......
......@@ -520,10 +520,10 @@ void av1_first_pass(AV1_COMP *cpi, const struct lookahead_entry *source) {
av1_frame_init_quantizer(cpi);
for (i = 0; i < MAX_MB_PLANE; ++i) {
p[i].coeff = ctx->coeff_pbuf[i][1];
p[i].qcoeff = ctx->qcoeff_pbuf[i][1];
pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][1];
p[i].eobs = ctx->eobs_pbuf[i][1];
p[i].coeff = ctx->coeff[i];
p[i].qcoeff = ctx->qcoeff[i];
pd[i].dqcoeff = ctx->dqcoeff[i];
p[i].eobs = ctx->eobs[i];
}
av1_init_mv_probs(cm);
......
......@@ -290,11 +290,6 @@ void av1_initialize_rd_consts(AV1_COMP *cpi) {
set_error_per_bit(x, rd->RDMULT);
x->select_tx_size = (cpi->sf.tx_size_search_method == USE_LARGESTALL &&
cm->frame_type != KEY_FRAME)
? 0
: 1;
set_block_thresholds(cm, rd);
fill_token_costs(x->token_costs, cm->fc->coef_probs);
......
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