{ // Read the non-zero coefficient with scan index eob-1 // TODO(angiebird): Put this into a function const int c = *eob - 1; const int pos = scan[c]; const int coeff_ctx = get_lower_levels_ctx_eob(bhl, width, c); const int nsymbs = 3;
aom_cdf_prob *cdf =
ec_ctx->coeff_base_eob_cdf[txs_ctx][plane_type][coeff_ctx];
int level = aom_read_symbol(r, cdf, nsymbs, ACCT_STR) + 1;
if (level > NUM_BASE_LEVELS) { const int br_ctx = get_br_ctx_eob(pos, bhl, tx_class);
cdf = ec_ctx->coeff_br_cdf[AOMMIN(txs_ctx, TX_32X32)][plane_type][br_ctx];
for (int idx = 0; idx < COEFF_BASE_RANGE; idx += BR_CDF_SIZE - 1) { const int k = aom_read_symbol(r, cdf, BR_CDF_SIZE, ACCT_STR);
level += k;
if (k < BR_CDF_SIZE - 1) break;
}
}
levels[get_padded_idx(pos, bhl)] = level;
}
if (*eob > 1) {
base_cdf_arr base_cdf = ec_ctx->coeff_base_cdf[txs_ctx][plane_type];
br_cdf_arr br_cdf =
ec_ctx->coeff_br_cdf[AOMMIN(txs_ctx, TX_32X32)][plane_type];
if (tx_class == TX_CLASS_2D) {
read_coeffs_reverse_2d(r, tx_size, 1, *eob - 1 - 1, scan, bhl, levels,
base_cdf, br_cdf);
read_coeffs_reverse(r, tx_size, tx_class, 0, 0, scan, bhl, levels,
base_cdf, br_cdf);
} else {
read_coeffs_reverse(r, tx_size, tx_class, 0, *eob - 1 - 1, scan, bhl,
levels, base_cdf, br_cdf);
}
}
for (int c = 0; c < *eob; ++c) { const int pos = scan[c];
uint8_t sign;
tran_low_t level = levels[get_padded_idx(pos, bhl)];
if (level) {
*max_scan_line = AOMMAX(*max_scan_line, pos);
if (c == 0) { const int dc_sign_ctx = txb_ctx->dc_sign_ctx;
sign = aom_read_symbol(r, ec_ctx->dc_sign_cdf[plane_type][dc_sign_ctx], 2, ACCT_STR);
} else {
sign = aom_read_bit(r, ACCT_STR);
}
if (level >= MAX_BASE_BR_RANGE) {
level += read_golomb(xd, r);
}
if (c == 0) dc_val = sign ? -level : level;
// Bitmasking to clamp level to valid range: // The valid range for 8/10/12 bit vdieo is at most 14/16/18 bit
level &= 0xfffff;
cul_level += level;
tran_low_t dq_coeff; // Bitmasking to clamp dq_coeff to valid range: // The valid range for 8/10/12 bit video is at most 17/19/21 bit
dq_coeff =
(tran_low_t)((int64_t)level * get_dqv(dequant, scan[c], iqmatrix) & 0xffffff);
dq_coeff = dq_coeff >> shift;
if (sign) {
dq_coeff = -dq_coeff;
}
tcoeffs[pos] = clamp(dq_coeff, min_value, max_value);
}
}
if (is_inter_block(mbmi)) { const PLANE_TYPE plane_type = get_plane_type(plane); // tx_type will be read out in av1_read_coeffs_txb_facade const TX_TYPE tx_type = av1_get_tx_type(xd, plane_type, row, col, tx_size,
cm->features.reduced_tx_set_used);
if (plane == 0) { const int txw = tx_size_wide_unit[tx_size]; const int txh = tx_size_high_unit[tx_size]; // The 16x16 unit is due to the constraint from tx_64x64 which sets the // maximum tx size for chroma as 32x32. Coupled with 4x1 transform block // size, the constraint takes effect in 32x16 / 16x32 size too. To solve // the intricacy, cover all the 16x16 units inside a 64 level transform.
if (txw == tx_size_wide_unit[TX_64X64] ||
txh == tx_size_high_unit[TX_64X64]) { const int tx_unit = tx_size_wide_unit[TX_16X16]; const int stride = xd->tx_type_map_stride;
for (int idy = 0; idy < txh; idy += tx_unit) {
for (int idx = 0; idx < txw; idx += tx_unit) {
xd->tx_type_map[(row + idy) * stride + col + idx] = tx_type;
}
}
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.