Exemplo n.º 1
0
void vp10_tokenize_sb(VP10_COMP *cpi, ThreadData *td, TOKENEXTRA **t,
                     int dry_run, BLOCK_SIZE bsize) {
  VP10_COMMON *const cm = &cpi->common;
  MACROBLOCK *const x = &td->mb;
  MACROBLOCKD *const xd = &x->e_mbd;
  MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
  const int ctx = vp10_get_skip_context(xd);
  const int skip_inc = !segfeature_active(&cm->seg, mbmi->segment_id,
                                          SEG_LVL_SKIP);
  struct tokenize_b_args arg = {cpi, td, t};
  if (mbmi->skip) {
    if (!dry_run)
      td->counts->skip[ctx][1] += skip_inc;
    reset_skip_context(xd, bsize);
    return;
  }

  if (!dry_run) {
    int plane;

    td->counts->skip[ctx][0] += skip_inc;

    for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
      vp10_foreach_transformed_block_in_plane(xd, bsize, plane, tokenize_b,
                                              &arg);
      (*t)->token = EOSB_TOKEN;
      (*t)++;
    }
  } else {
    vp10_foreach_transformed_block(xd, bsize, set_entropy_context_b, &arg);
  }
}
Exemplo n.º 2
0
static int read_skip(VP10_COMMON *cm, const MACROBLOCKD *xd,
                     int segment_id, vpx_reader *r) {
  if (segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP)) {
    return 1;
  } else {
    const int ctx = vp10_get_skip_context(xd);
    const int skip = vpx_read(r, cm->fc->skip_probs[ctx]);
    FRAME_COUNTS *counts = xd->counts;
    if (counts)
      ++counts->skip[ctx][skip];
    return skip;
  }
}