vp9_encode_intra_block_plane(x, VPXMAX(bsize, BLOCK_8X8), plane);
if (output_enabled)
sum_intra_stats(td->counts, mi);
- vp9_tokenize_sb(cpi, td, t, !output_enabled, VPXMAX(bsize, BLOCK_8X8));
+ vp9_tokenize_sb(cpi, td, t, !output_enabled, seg_skip,
+ VPXMAX(bsize, BLOCK_8X8));
} else {
int ref;
const int is_compound = has_second_ref(mi);
VPXMAX(bsize, BLOCK_8X8));
vp9_encode_sb(x, VPXMAX(bsize, BLOCK_8X8));
- vp9_tokenize_sb(cpi, td, t, !output_enabled, VPXMAX(bsize, BLOCK_8X8));
+ vp9_tokenize_sb(cpi, td, t, !output_enabled, seg_skip,
+ VPXMAX(bsize, BLOCK_8X8));
}
if (output_enabled) {
#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_pred_common.h"
#include "vp9/common/vp9_scan.h"
-#include "vp9/common/vp9_seg_common.h"
#include "vp9/encoder/vp9_cost.h"
#include "vp9/encoder/vp9_encoder.h"
++counts[token];
}
-static INLINE int get_tx_eob(const struct segmentation *seg, int segment_id,
- TX_SIZE tx_size) {
- const int eob_max = 16 << (tx_size << 1);
- return segfeature_active(seg, segment_id, SEG_LVL_SKIP) ? 0 : eob_max;
-}
-
static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, void *arg) {
struct tokenize_b_args* const args = arg;
int eob = p->eobs[block];
const PLANE_TYPE type = get_plane_type(plane);
const tran_low_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block);
- const int segment_id = mi->segment_id;
const int16_t *scan, *nb;
const scan_order *so;
const int ref = is_inter_block(mi);
unsigned int (*const eob_branch)[COEFF_CONTEXTS] =
td->counts->eob_branch[tx_size][type][ref];
const uint8_t *const band = get_band_translate(tx_size);
- const int seg_eob = get_tx_eob(&cpi->common.seg, segment_id, tx_size);
+ const int tx_eob = 16 << (tx_size << 1);
int16_t token;
EXTRABIT extra;
int aoff, loff;
++c;
pt = get_coef_context(nb, token_cache, c);
}
- if (c < seg_eob) {
+ if (c < tx_eob) {
++eob_branch[band[c]][pt];
add_token_no_extra(&t, coef_probs[band[c]][pt], EOB_TOKEN,
counts[band[c]][pt]);
}
void vp9_tokenize_sb(VP9_COMP *cpi, ThreadData *td, TOKENEXTRA **t,
- int dry_run, BLOCK_SIZE bsize) {
- VP9_COMMON *const cm = &cpi->common;
+ int dry_run, int seg_skip, BLOCK_SIZE bsize) {
MACROBLOCK *const x = &td->mb;
MACROBLOCKD *const xd = &x->e_mbd;
MODE_INFO *const mi = xd->mi[0];
const int ctx = vp9_get_skip_context(xd);
- const int skip_inc = !segfeature_active(&cm->seg, mi->segment_id,
- SEG_LVL_SKIP);
struct tokenize_b_args arg = {cpi, td, t};
+
+ if (seg_skip) {
+ assert(mi->skip);
+ }
+
if (mi->skip) {
- if (!dry_run)
- td->counts->skip[ctx][1] += skip_inc;
+ if (!dry_run && !seg_skip)
+ ++td->counts->skip[ctx][1];
reset_skip_context(xd, bsize);
return;
}
if (!dry_run) {
- td->counts->skip[ctx][0] += skip_inc;
+ ++td->counts->skip[ctx][0];
vp9_foreach_transformed_block(xd, bsize, tokenize_b, &arg);
} else {
vp9_foreach_transformed_block(xd, bsize, set_entropy_context_b, &arg);