Fixing 8x8/4x4 ADST for intra modes with tx select
This patch allows use of 8x8 and 4x4 ADST correctly for Intra 16x16 modes and Intra 8x8 modes when the block size selected is smaller than the prediction mode. Also includes some cleanups and refactoring. Rebase. Change-Id: Ie3257bdf07bdb9c6e9476915e3a80183c8fa005a
This commit is contained in:
@@ -136,13 +136,26 @@ void vp9_regular_quantize_b_4x4(BLOCK *b, BLOCKD *d) {
|
||||
|
||||
void vp9_quantize_mby_4x4_c(MACROBLOCK *x) {
|
||||
int i;
|
||||
int has_2nd_order = x->e_mbd.mode_info_context->mbmi.mode != SPLITMV;
|
||||
int has_2nd_order = get_2nd_order_usage(&x->e_mbd);
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
x->quantize_b_4x4(&x->block[i], &x->e_mbd.block[i]);
|
||||
|
||||
if (has_2nd_order)
|
||||
for (i = 0; i < 16; i++) {
|
||||
TX_TYPE tx_type = get_tx_type_4x4(&x->e_mbd, &x->e_mbd.block[i]);
|
||||
if (tx_type != DCT_DCT) {
|
||||
assert(has_2nd_order == 0);
|
||||
vp9_ht_quantize_b_4x4(&x->block[i], &x->e_mbd.block[i], tx_type);
|
||||
} else {
|
||||
x->quantize_b_4x4(&x->block[i], &x->e_mbd.block[i]);
|
||||
}
|
||||
}
|
||||
if (has_2nd_order) {
|
||||
x->quantize_b_4x4(&x->block[24], &x->e_mbd.block[24]);
|
||||
} else {
|
||||
vpx_memset(x->e_mbd.block[24].qcoeff, 0,
|
||||
16 * sizeof(x->e_mbd.block[24].qcoeff[0]));
|
||||
vpx_memset(x->e_mbd.block[24].dqcoeff, 0,
|
||||
16 * sizeof(x->e_mbd.block[24].dqcoeff[0]));
|
||||
x->e_mbd.block[24].eob = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void vp9_quantize_mbuv_4x4_c(MACROBLOCK *x) {
|
||||
@@ -257,17 +270,29 @@ void vp9_regular_quantize_b_8x8(BLOCK *b, BLOCKD *d) {
|
||||
|
||||
void vp9_quantize_mby_8x8(MACROBLOCK *x) {
|
||||
int i;
|
||||
int has_2nd_order = x->e_mbd.mode_info_context->mbmi.mode != SPLITMV;
|
||||
int has_2nd_order = get_2nd_order_usage(&x->e_mbd);
|
||||
|
||||
for (i = 0; i < 16; i ++) {
|
||||
x->e_mbd.block[i].eob = 0;
|
||||
}
|
||||
x->e_mbd.block[24].eob = 0;
|
||||
for (i = 0; i < 16; i += 4)
|
||||
for (i = 0; i < 16; i += 4) {
|
||||
int ib = (i & 8) + ((i & 4) >> 1);
|
||||
TX_TYPE tx_type = get_tx_type_8x8(&x->e_mbd, &x->e_mbd.block[ib]);
|
||||
if (tx_type != DCT_DCT)
|
||||
assert(has_2nd_order == 0);
|
||||
x->quantize_b_8x8(&x->block[i], &x->e_mbd.block[i]);
|
||||
}
|
||||
|
||||
if (has_2nd_order)
|
||||
if (has_2nd_order) {
|
||||
x->quantize_b_2x2(&x->block[24], &x->e_mbd.block[24]);
|
||||
} else {
|
||||
vpx_memset(x->e_mbd.block[24].qcoeff, 0,
|
||||
16 * sizeof(x->e_mbd.block[24].qcoeff[0]));
|
||||
vpx_memset(x->e_mbd.block[24].dqcoeff, 0,
|
||||
16 * sizeof(x->e_mbd.block[24].dqcoeff[0]));
|
||||
x->e_mbd.block[24].eob = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void vp9_quantize_mbuv_8x8(MACROBLOCK *x) {
|
||||
|
Reference in New Issue
Block a user