Commit e9fd1eac authored by John Koleszar's avatar John Koleszar

Remove bc, bc2 from pbi,cpi,xd

Pass the bool coder to be used explicitly. This avoids cases where two
different bool coders can be addressed from the same function. Also be
more consistent with bool coder variable naming, start to standardize
on 'bc'.

Change-Id: I1c95e2fdbe24ebe8c0f84924daa1728e3b054a31
parent f3208f36
......@@ -364,8 +364,6 @@ typedef struct MacroBlockD {
vp8_subpix_fn_t subpixel_predict_avg16x16;
int allow_high_precision_mv;
void *current_bc;
int corrupted;
#if !CONFIG_SUPERBLOCKS && (ARCH_X86 || ARCH_X86_64)
......
......@@ -24,7 +24,6 @@ DEFINE(detok_A, offsetof(DETOK, A));
DEFINE(detok_L, offsetof(DETOK, L));
DEFINE(detok_qcoeff_start_ptr, offsetof(DETOK, qcoeff_start_ptr));
DEFINE(detok_current_bc, offsetof(DETOK, current_bc));
DEFINE(detok_coef_probs, offsetof(DETOK, coef_probs));
DEFINE(detok_eob, offsetof(DETOK, eob));
......
......@@ -18,7 +18,7 @@
#include "vp8/common/seg_common.h"
#include "vp8/common/pred_common.h"
#include "vp8/common/entropy.h"
#include "vp8/decoder/decodemv.h"
#if CONFIG_DEBUG
#include <assert.h>
#endif
......@@ -73,12 +73,12 @@ static void vp8_read_mb_segid(vp8_reader *r, MB_MODE_INFO *mi,
}
extern const int vp8_i8x8_block[4];
static void vp8_kfread_modes(VP8D_COMP *pbi,
MODE_INFO *m,
int mb_row,
int mb_col) {
static void kfread_modes(VP8D_COMP *pbi,
MODE_INFO *m,
int mb_row,
int mb_col,
BOOL_DECODER* const bc) {
VP8_COMMON *const cm = &pbi->common;
vp8_reader *const bc = pbi->mb.current_bc;
const int mis = pbi->common.mode_info_stride;
int map_index = mb_row * pbi->common.mb_cols + mb_col;
MB_PREDICTION_MODE y_mode;
......@@ -597,9 +597,9 @@ static const unsigned char mbsplit_fill_offset[4][16] = {
};
#if CONFIG_SWITCHABLE_INTERP
static void read_switchable_interp_probs(VP8D_COMP *pbi) {
static void read_switchable_interp_probs(VP8D_COMP* const pbi,
BOOL_DECODER* const bc) {
VP8_COMMON *const cm = &pbi->common;
vp8_reader *const bc = &pbi->bc;
int i, j;
for (j = 0; j <= VP8_SWITCHABLE_FILTERS; ++j) {
//for (j = 0; j <= 0; ++j) {
......@@ -634,7 +634,7 @@ static void mb_mode_mv_init(VP8D_COMP *pbi, vp8_reader *bc) {
#endif
#if CONFIG_SWITCHABLE_INTERP
if (cm->mcomp_filter_type == SWITCHABLE)
read_switchable_interp_probs(pbi);
read_switchable_interp_probs(pbi, bc);
#endif
// Decode the baseline probabilities for decoding reference frame
cm->prob_intra_coded = (vp8_prob)vp8_read_literal(bc, 8);
......@@ -676,10 +676,10 @@ static void mb_mode_mv_init(VP8D_COMP *pbi, vp8_reader *bc) {
// the bitstream or if the value is temporally predicted asserts the predicted
// value
static void read_mb_segment_id(VP8D_COMP *pbi,
int mb_row, int mb_col) {
int mb_row, int mb_col,
BOOL_DECODER* const bc) {
VP8_COMMON *const cm = &pbi->common;
MACROBLOCKD *const xd = &pbi->mb;
vp8_reader *const bc = xd->current_bc;
MODE_INFO *mi = xd->mode_info_context;
MB_MODE_INFO *mbmi = &mi->mbmi;
int index = mb_row * pbi->common.mb_cols + mb_col;
......@@ -748,7 +748,8 @@ static void read_mb_segment_id(VP8D_COMP *pbi,
static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
MODE_INFO *prev_mi,
int mb_row, int mb_col) {
int mb_row, int mb_col,
BOOL_DECODER* const bc) {
VP8_COMMON *const cm = &pbi->common;
#if CONFIG_NEWMVENTROPY
nmv_context *const nmvc = &pbi->common.fc.nmvc;
......@@ -758,7 +759,6 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
#endif
const int mis = pbi->common.mode_info_stride;
MACROBLOCKD *const xd = &pbi->mb;
vp8_reader *const bc = xd->current_bc;
int_mv *const mv = &mbmi->mv;
int mb_to_left_edge;
......@@ -790,7 +790,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
xd->prev_mode_info_context = prev_mi;
// Read the macroblock segment id.
read_mb_segment_id(pbi, mb_row, mb_col);
read_mb_segment_id(pbi, mb_row, mb_col, bc);
if (pbi->common.mb_no_coeff_skip &&
(!segfeature_active(xd,
......@@ -1305,27 +1305,28 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
}
}
void vpx_decode_mode_mvs_init(VP8D_COMP *pbi){
void vpx_decode_mode_mvs_init(VP8D_COMP *pbi, BOOL_DECODER* const bc) {
VP8_COMMON *cm = &pbi->common;
vpx_memset(cm->mbskip_pred_probs, 0, sizeof(cm->mbskip_pred_probs));
if (pbi->common.mb_no_coeff_skip) {
int k;
for (k = 0; k < MBSKIP_CONTEXTS; ++k)
cm->mbskip_pred_probs[k] = (vp8_prob)vp8_read_literal(&pbi->bc, 8);
cm->mbskip_pred_probs[k] = (vp8_prob)vp8_read_literal(bc, 8);
}
mb_mode_mv_init(pbi, &pbi->bc);
mb_mode_mv_init(pbi, bc);
}
void vpx_decode_mb_mode_mv(VP8D_COMP *pbi,
MACROBLOCKD *xd,
int mb_row,
int mb_col){
int mb_col,
BOOL_DECODER* const bc) {
MODE_INFO *mi = xd->mode_info_context;
MODE_INFO *prev_mi = xd->prev_mode_info_context;
if (pbi->common.frame_type == KEY_FRAME)
vp8_kfread_modes(pbi, mi, mb_row, mb_col);
kfread_modes(pbi, mi, mb_row, mb_col, bc);
else
read_mb_modes_mv(pbi, mi, &mi->mbmi, prev_mi, mb_row, mb_col);
read_mb_modes_mv(pbi, mi, &mi->mbmi, prev_mi, mb_row, mb_col, bc);
}
......@@ -11,8 +11,9 @@
#include "onyxd_int.h"
void vpx_decode_mb_mode_mv(VP8D_COMP *pbi,
MACROBLOCKD *xd,
void vpx_decode_mb_mode_mv(VP8D_COMP* const pbi,
MACROBLOCKD* const xd,
int mb_row,
int mb_col);
void vpx_decode_mode_mvs_init(VP8D_COMP *pbi);
int mb_col,
BOOL_DECODER* const bc);
void vpx_decode_mode_mvs_init(VP8D_COMP* const pbi, BOOL_DECODER* const bc);
This diff is collapsed.
......@@ -302,17 +302,17 @@ static int vp8_get_signed(BOOL_DECODER *br, int value_to_sign) {
val += (UINT16)(1 << bits_count);\
} while (0);
static int vp8_decode_coefs(VP8D_COMP *dx, const MACROBLOCKD *xd,
ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l,
PLANE_TYPE type,
static int decode_coefs(VP8D_COMP *dx, const MACROBLOCKD *xd,
BOOL_DECODER* const br,
ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l,
PLANE_TYPE type,
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM16X16
TX_TYPE tx_type,
TX_TYPE tx_type,
#endif
int seg_eob, INT16 *qcoeff_ptr, int i,
const int *const scan, int block_type,
const int *coef_bands) {
int seg_eob, INT16 *qcoeff_ptr, int i,
const int *const scan, int block_type,
const int *coef_bands) {
FRAME_CONTEXT *const fc = &dx->common.fc;
BOOL_DECODER *br = xd->current_bc;
int tmp, c = (type == PLANE_TYPE_Y_NO_DC);
const vp8_prob *prob, *coef_probs;
......@@ -446,7 +446,8 @@ SKIP_START:
return c;
}
int vp8_decode_mb_tokens_16x16(VP8D_COMP *pbi, MACROBLOCKD *xd) {
int vp8_decode_mb_tokens_16x16(VP8D_COMP *pbi, MACROBLOCKD *xd,
BOOL_DECODER* const bc) {
ENTROPY_CONTEXT* const A = (ENTROPY_CONTEXT *)xd->above_context;
ENTROPY_CONTEXT* const L = (ENTROPY_CONTEXT *)xd->left_context;
......@@ -473,12 +474,12 @@ int vp8_decode_mb_tokens_16x16(VP8D_COMP *pbi, MACROBLOCKD *xd) {
// Luma block
{
const int* const scan = vp8_default_zig_zag1d_16x16;
c = vp8_decode_coefs(pbi, xd, A, L, type,
c = decode_coefs(pbi, xd, bc, A, L, type,
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM16X16
tx_type,
tx_type,
#endif
seg_eob, qcoeff_ptr,
0, scan, TX_16X16, coef_bands_x_16x16);
seg_eob, qcoeff_ptr,
0, scan, TX_16X16, coef_bands_x_16x16);
eobs[0] = c;
*A = *L = (c != !type);
for (i = 1; i < 16; i++) {
......@@ -503,12 +504,12 @@ int vp8_decode_mb_tokens_16x16(VP8D_COMP *pbi, MACROBLOCKD *xd) {
ENTROPY_CONTEXT* const l = L + vp8_block2left_8x8[i];
const int* const scan = vp8_default_zig_zag1d_8x8;
c = vp8_decode_coefs(pbi, xd, a, l, type,
c = decode_coefs(pbi, xd, bc, a, l, type,
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM16X16
tx_type,
tx_type,
#endif
seg_eob, qcoeff_ptr,
i, scan, TX_8X8, coef_bands_x_8x8);
seg_eob, qcoeff_ptr,
i, scan, TX_8X8, coef_bands_x_8x8);
a[0] = l[0] = ((eobs[i] = c) != !type);
a[1] = a[0];
l[1] = l[0];
......@@ -521,7 +522,8 @@ int vp8_decode_mb_tokens_16x16(VP8D_COMP *pbi, MACROBLOCKD *xd) {
return eobtotal;
}
int vp8_decode_mb_tokens_8x8(VP8D_COMP *pbi, MACROBLOCKD *xd) {
int vp8_decode_mb_tokens_8x8(VP8D_COMP *pbi, MACROBLOCKD *xd,
BOOL_DECODER* const bc) {
ENTROPY_CONTEXT *const A = (ENTROPY_CONTEXT *)xd->above_context;
ENTROPY_CONTEXT *const L = (ENTROPY_CONTEXT *)xd->left_context;
......@@ -548,12 +550,12 @@ int vp8_decode_mb_tokens_8x8(VP8D_COMP *pbi, MACROBLOCKD *xd) {
seg_eob = get_segdata(xd, segment_id, SEG_LVL_EOB);
else
seg_eob = 4;
c = vp8_decode_coefs(pbi, xd, a, l, type,
c = decode_coefs(pbi, xd, bc, a, l, type,
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM16X16
tx_type,
tx_type,
#endif
seg_eob, qcoeff_ptr + 24 * 16,
24, scan, TX_8X8, coef_bands_x);
seg_eob, qcoeff_ptr + 24 * 16,
24, scan, TX_8X8, coef_bands_x);
a[0] = l[0] = ((eobs[24] = c) != !type);
eobtotal += c - 4;
......@@ -583,12 +585,12 @@ int vp8_decode_mb_tokens_8x8(VP8D_COMP *pbi, MACROBLOCKD *xd) {
}
#endif
c = vp8_decode_coefs(pbi, xd, a, l, type,
c = decode_coefs(pbi, xd, bc, a, l, type,
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM16X16
tx_type,
tx_type,
#endif
seg_eob, qcoeff_ptr,
i, scan, TX_8X8, coef_bands_x_8x8);
seg_eob, qcoeff_ptr,
i, scan, TX_8X8, coef_bands_x_8x8);
a[0] = l[0] = ((eobs[i] = c) != !type);
a[1] = a[0];
l[1] = l[0];
......@@ -610,12 +612,12 @@ int vp8_decode_mb_tokens_8x8(VP8D_COMP *pbi, MACROBLOCKD *xd) {
ENTROPY_CONTEXT *const l = L + vp8_block2left[i];
const int *scan = vp8_default_zig_zag1d;
c = vp8_decode_coefs(pbi, xd, a, l, type,
c = decode_coefs(pbi, xd, bc, a, l, type,
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM16X16
tx_type,
tx_type,
#endif
seg_eob, qcoeff_ptr,
i, scan, TX_4X4, coef_bands_x);
seg_eob, qcoeff_ptr,
i, scan, TX_4X4, coef_bands_x);
a[0] = l[0] = ((eobs[i] = c) != !type);
eobtotal += c;
......@@ -627,7 +629,8 @@ int vp8_decode_mb_tokens_8x8(VP8D_COMP *pbi, MACROBLOCKD *xd) {
}
int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *xd) {
int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *xd,
BOOL_DECODER* const bc) {
ENTROPY_CONTEXT *const A = (ENTROPY_CONTEXT *)xd->above_context;
ENTROPY_CONTEXT *const L = (ENTROPY_CONTEXT *)xd->left_context;
......@@ -648,12 +651,12 @@ int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *xd) {
ENTROPY_CONTEXT *const l = L + vp8_block2left[24];
type = PLANE_TYPE_Y2;
c = vp8_decode_coefs(dx, xd, a, l, type,
c = decode_coefs(dx, xd, bc, a, l, type,
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM16X16
DCT_DCT,
DCT_DCT,
#endif
seg_eob, qcoeff_ptr + 24 * 16, 24,
scan, TX_4X4, coef_bands_x);
seg_eob, qcoeff_ptr + 24 * 16, 24,
scan, TX_4X4, coef_bands_x);
a[0] = l[0] = ((eobs[24] = c) != !type);
eobtotal += c - 16;
......@@ -688,12 +691,12 @@ int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *xd) {
}
#endif
c = vp8_decode_coefs(dx, xd, a, l, type,
c = decode_coefs(dx, xd, bc, a, l, type,
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM16X16
tx_type,
tx_type,
#endif
seg_eob, qcoeff_ptr,
i, scan, TX_4X4, coef_bands_x);
seg_eob, qcoeff_ptr,
i, scan, TX_4X4, coef_bands_x);
a[0] = l[0] = ((eobs[i] = c) != !type);
eobtotal += c;
......
......@@ -14,9 +14,12 @@
#include "onyxd_int.h"
void vp8_reset_mb_tokens_context(MACROBLOCKD *xd);
int vp8_decode_mb_tokens(VP8D_COMP *, MACROBLOCKD *);
int vp8_decode_mb_tokens_8x8(VP8D_COMP *, MACROBLOCKD *);
int vp8_decode_mb_tokens_16x16(VP8D_COMP *, MACROBLOCKD *);
void vp8_reset_mb_tokens_context(MACROBLOCKD* const);
int vp8_decode_mb_tokens(VP8D_COMP* const, MACROBLOCKD* const,
BOOL_DECODER* const);
int vp8_decode_mb_tokens_8x8(VP8D_COMP* const, MACROBLOCKD* const,
BOOL_DECODER* const);
int vp8_decode_mb_tokens_16x16(VP8D_COMP* const, MACROBLOCKD* const,
BOOL_DECODER* const);
#endif /* DETOKENIZE_H */
......@@ -45,7 +45,6 @@ typedef struct {
ENTROPY_CONTEXT_PLANES *L;
INT16 *qcoeff_start_ptr;
BOOL_DECODER *current_bc;
vp8_prob const *coef_probs[BLOCK_TYPES];
vp8_prob const *coef_probs_8x8[BLOCK_TYPES_8X8];
......@@ -60,8 +59,6 @@ typedef struct VP8Decompressor {
DECLARE_ALIGNED(16, VP8_COMMON, common);
vp8_reader bc, bc2;
VP8D_CONFIG oxcf;
......
......@@ -68,7 +68,6 @@ DEFINE(vp8_extra_bit_struct_base_val, offsetof(vp8_extra_bit_struct, b
DEFINE(vp8_comp_tplist, offsetof(VP8_COMP, tplist));
DEFINE(vp8_comp_common, offsetof(VP8_COMP, common));
DEFINE(vp8_comp_bc2, offsetof(VP8_COMP, bc2));
DEFINE(tokenlist_start, offsetof(TOKENLIST, start));
DEFINE(tokenlist_stop, offsetof(TOKENLIST, stop));
......
This diff is collapsed.
This diff is collapsed.
......@@ -15,11 +15,12 @@
#include "onyx_int.h"
#if CONFIG_NEWMVENTROPY
void vp8_write_nmvprobs(VP8_COMP *, int usehp);
void vp8_encode_nmv(vp8_writer *w, const MV *mv, const MV *ref,
const nmv_context *mvctx);
void vp8_encode_nmv_fp(vp8_writer *w, const MV *mv, const MV *ref,
const nmv_context *mvctx, int usehp);
void vp8_write_nmvprobs(VP8_COMP* const, int usehp, vp8_writer* const);
void vp8_encode_nmv(vp8_writer* const w, const MV* const mv,
const MV* const ref, const nmv_context* const mvctx);
void vp8_encode_nmv_fp(vp8_writer* const w, const MV* const mv,
const MV* const ref, const nmv_context *mvctx,
int usehp);
void vp8_build_nmv_cost_table(int *mvjoint,
int *mvcost[2],
const nmv_context *mvctx,
......@@ -27,18 +28,18 @@ void vp8_build_nmv_cost_table(int *mvjoint,
int mvc_flag_v,
int mvc_flag_h);
#else /* CONFIG_NEWMVENTROPY */
void vp8_write_mvprobs(VP8_COMP *);
void vp8_encode_motion_vector(vp8_writer *, const MV *,
const MV_CONTEXT *);
void vp8_write_mvprobs(VP8_COMP* const, vp8_writer* const);
void vp8_encode_motion_vector(vp8_writer* const, const MV* const,
const MV_CONTEXT* const);
void vp8_build_component_cost_table(int *mvcost[2],
const MV_CONTEXT *mvc,
int mvc_flag[2]);
void vp8_write_mvprobs_hp(VP8_COMP *);
void vp8_encode_motion_vector_hp(vp8_writer *, const MV *,
const MV_CONTEXT_HP *);
const MV_CONTEXT*,
const int mvc_flag[2]);
void vp8_write_mvprobs_hp(VP8_COMP* const, vp8_writer* const);
void vp8_encode_motion_vector_hp(vp8_writer* const, const MV* const,
const MV_CONTEXT_HP* const);
void vp8_build_component_cost_table_hp(int *mvcost[2],
const MV_CONTEXT_HP *mvc,
int mvc_flag[2]);
const MV_CONTEXT_HP*,
const int mvc_flag[2]);
#endif /* CONFIG_NEWMVENTROPY */
#endif
......@@ -420,9 +420,6 @@ typedef struct VP8_COMP {
MACROBLOCK mb;
VP8_COMMON common;
vp8_writer bc, bc2;
// bool_writer *bc2;
VP8_CONFIG oxcf;
struct lookahead_ctx *lookahead;
......
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