Removing vp9_get_coef_neighbors_handle function.
Change-Id: I6be72c8b048d1ccc7ef43764cf84c32360098970
This commit is contained in:
Родитель
db60c02c9e
Коммит
209c6cbf8f
|
@ -569,31 +569,6 @@ void vp9_init_neighbors() {
|
|||
vp9_default_scan_32x32_neighbors);
|
||||
}
|
||||
|
||||
const int16_t *vp9_get_coef_neighbors_handle(const int16_t *scan) {
|
||||
if (scan == vp9_default_scan_4x4) {
|
||||
return vp9_default_scan_4x4_neighbors;
|
||||
} else if (scan == vp9_row_scan_4x4) {
|
||||
return vp9_row_scan_4x4_neighbors;
|
||||
} else if (scan == vp9_col_scan_4x4) {
|
||||
return vp9_col_scan_4x4_neighbors;
|
||||
} else if (scan == vp9_default_scan_8x8) {
|
||||
return vp9_default_scan_8x8_neighbors;
|
||||
} else if (scan == vp9_row_scan_8x8) {
|
||||
return vp9_row_scan_8x8_neighbors;
|
||||
} else if (scan == vp9_col_scan_8x8) {
|
||||
return vp9_col_scan_8x8_neighbors;
|
||||
} else if (scan == vp9_default_scan_16x16) {
|
||||
return vp9_default_scan_16x16_neighbors;
|
||||
} else if (scan == vp9_row_scan_16x16) {
|
||||
return vp9_row_scan_16x16_neighbors;
|
||||
} else if (scan == vp9_col_scan_16x16) {
|
||||
return vp9_col_scan_16x16_neighbors;
|
||||
} else {
|
||||
assert(scan == vp9_default_scan_32x32);
|
||||
return vp9_default_scan_32x32_neighbors;
|
||||
}
|
||||
}
|
||||
|
||||
void vp9_coef_tree_initialize() {
|
||||
vp9_init_neighbors();
|
||||
init_bit_trees();
|
||||
|
|
|
@ -190,9 +190,6 @@ static INLINE int get_coef_context(const int16_t *neighbors,
|
|||
token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >> 1;
|
||||
}
|
||||
|
||||
const int16_t *vp9_get_coef_neighbors_handle(const int16_t *scan);
|
||||
|
||||
|
||||
// 128 lists of probabilities are stored for the following ONE node probs:
|
||||
// 1, 3, 5, 7, ..., 253, 255
|
||||
// In between probabilities are interpolated linearly
|
||||
|
@ -367,22 +364,24 @@ static int get_entropy_context(TX_SIZE tx_size,
|
|||
static void get_scan_and_band(const MACROBLOCKD *xd, TX_SIZE tx_size,
|
||||
PLANE_TYPE type, int block_idx,
|
||||
const int16_t **scan,
|
||||
const int16_t **scan_nb,
|
||||
const uint8_t **band_translate) {
|
||||
switch (tx_size) {
|
||||
case TX_4X4:
|
||||
*scan = get_scan_4x4(get_tx_type_4x4(type, xd, block_idx));
|
||||
get_scan_nb_4x4(get_tx_type_4x4(type, xd, block_idx), scan, scan_nb);
|
||||
*band_translate = vp9_coefband_trans_4x4;
|
||||
break;
|
||||
case TX_8X8:
|
||||
*scan = get_scan_8x8(get_tx_type_8x8(type, xd));
|
||||
get_scan_nb_8x8(get_tx_type_8x8(type, xd), scan, scan_nb);
|
||||
*band_translate = vp9_coefband_trans_8x8plus;
|
||||
break;
|
||||
case TX_16X16:
|
||||
*scan = get_scan_16x16(get_tx_type_16x16(type, xd));
|
||||
get_scan_nb_16x16(get_tx_type_16x16(type, xd), scan, scan_nb);
|
||||
*band_translate = vp9_coefband_trans_8x8plus;
|
||||
break;
|
||||
case TX_32X32:
|
||||
*scan = vp9_default_scan_32x32;
|
||||
*scan_nb = vp9_default_scan_32x32_neighbors;
|
||||
*band_translate = vp9_coefband_trans_8x8plus;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -106,8 +106,7 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
|
|||
const uint8_t *band_translate;
|
||||
uint8_t token_cache[1024];
|
||||
int pt = get_entropy_context(tx_size, A, L);
|
||||
get_scan_and_band(xd, tx_size, type, block_idx, &scan, &band_translate);
|
||||
nb = vp9_get_coef_neighbors_handle(scan);
|
||||
get_scan_and_band(xd, tx_size, type, block_idx, &scan, &nb, &band_translate);
|
||||
|
||||
while (1) {
|
||||
int val;
|
||||
|
|
|
@ -172,7 +172,7 @@ static void optimize_b(MACROBLOCK *mb,
|
|||
assert((!type && !plane) || (type && plane));
|
||||
dqcoeff_ptr = BLOCK_OFFSET(pd->dqcoeff, block);
|
||||
qcoeff_ptr = BLOCK_OFFSET(pd->qcoeff, block);
|
||||
get_scan_and_band(xd, tx_size, type, ib, &scan, &band_translate);
|
||||
get_scan_and_band(xd, tx_size, type, ib, &scan, &nb, &band_translate);
|
||||
assert(eob <= default_eob);
|
||||
|
||||
/* Now set up a Viterbi trellis to evaluate alternative roundings. */
|
||||
|
@ -191,7 +191,6 @@ static void optimize_b(MACROBLOCK *mb,
|
|||
for (i = 0; i < eob; i++)
|
||||
token_cache[scan[i]] = vp9_pt_energy_class[vp9_dct_value_tokens_ptr[
|
||||
qcoeff_ptr[scan[i]]].token];
|
||||
nb = vp9_get_coef_neighbors_handle(scan);
|
||||
|
||||
for (i = eob; i-- > i0;) {
|
||||
int base_bits, d2, dx;
|
||||
|
|
|
@ -1097,6 +1097,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
|
|||
for (idx = 0; idx < num_4x4_blocks_wide; ++idx) {
|
||||
int64_t ssz;
|
||||
const int16_t *scan;
|
||||
const int16_t *nb;
|
||||
uint8_t *src = src_init + idx * 4 + idy * 4 * src_stride;
|
||||
uint8_t *dst = dst_init + idx * 4 + idy * 4 * dst_stride;
|
||||
|
||||
|
@ -1122,10 +1123,10 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
|
|||
x->quantize_b_4x4(x, block, tx_type, 16);
|
||||
}
|
||||
|
||||
scan = get_scan_4x4(get_tx_type_4x4(PLANE_TYPE_Y_WITH_DC, xd, block));
|
||||
get_scan_nb_4x4(get_tx_type_4x4(PLANE_TYPE_Y_WITH_DC, xd, block),
|
||||
&scan, &nb);
|
||||
ratey += cost_coeffs(x, 0, block,
|
||||
tempa + idx, templ + idy, TX_4X4, scan,
|
||||
vp9_get_coef_neighbors_handle(scan));
|
||||
tempa + idx, templ + idy, TX_4X4, scan, nb);
|
||||
distortion += vp9_block_error(coeff, BLOCK_OFFSET(pd->dqcoeff, block),
|
||||
16, &ssz) >> 2;
|
||||
if (RDCOST(x->rdmult, x->rddiv, ratey, distortion) >= best_rd)
|
||||
|
|
|
@ -137,8 +137,7 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
|
|||
|
||||
pt = get_entropy_context(tx_size, pd->above_context + aoff,
|
||||
pd->left_context + loff);
|
||||
get_scan_and_band(xd, tx_size, type, block, &scan, &band_translate);
|
||||
nb = vp9_get_coef_neighbors_handle(scan);
|
||||
get_scan_and_band(xd, tx_size, type, block, &scan, &nb, &band_translate);
|
||||
c = 0;
|
||||
do {
|
||||
const int band = get_coef_band(band_translate, c);
|
||||
|
|
Загрузка…
Ссылка в новой задаче