Fix a bug in inverse halfright 32x32 transform
Fix a bug in the C implementation of the ihalfright32 transform, in the case that its input and output buffers are the same. This occurs when it is called by av1_iht32x16_512_add_c. Change-Id: I61c652e2662178520c0639a2879ae128a9c7ec3f
This commit is contained in:
@@ -33,6 +33,9 @@ int get_tx_scale(const MACROBLOCKD *const xd, const TX_TYPE tx_type,
|
|||||||
return txsize_sqr_up_map[tx_size] == TX_32X32;
|
return txsize_sqr_up_map[tx_size] == TX_32X32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOTE: The implementation of all inverses need to be aware of the fact
|
||||||
|
// that input and output could be the same buffer.
|
||||||
|
|
||||||
#if CONFIG_EXT_TX
|
#if CONFIG_EXT_TX
|
||||||
static void iidtx4_c(const tran_low_t *input, tran_low_t *output) {
|
static void iidtx4_c(const tran_low_t *input, tran_low_t *output) {
|
||||||
int i;
|
int i;
|
||||||
@@ -56,17 +59,17 @@ static void iidtx32_c(const tran_low_t *input, tran_low_t *output) {
|
|||||||
for (i = 0; i < 32; ++i) output[i] = input[i] * 4;
|
for (i = 0; i < 32; ++i) output[i] = input[i] * 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
// For use in lieu of DST
|
// For use in lieu of ADST
|
||||||
static void ihalfright32_c(const tran_low_t *input, tran_low_t *output) {
|
static void ihalfright32_c(const tran_low_t *input, tran_low_t *output) {
|
||||||
int i;
|
int i;
|
||||||
tran_low_t inputhalf[16];
|
tran_low_t inputhalf[16];
|
||||||
for (i = 0; i < 16; ++i) {
|
|
||||||
output[i] = input[16 + i] * 4;
|
|
||||||
}
|
|
||||||
// Multiply input by sqrt(2)
|
// Multiply input by sqrt(2)
|
||||||
for (i = 0; i < 16; ++i) {
|
for (i = 0; i < 16; ++i) {
|
||||||
inputhalf[i] = (tran_low_t)dct_const_round_shift(input[i] * Sqrt2);
|
inputhalf[i] = (tran_low_t)dct_const_round_shift(input[i] * Sqrt2);
|
||||||
}
|
}
|
||||||
|
for (i = 0; i < 16; ++i) {
|
||||||
|
output[i] = input[16 + i] * 4;
|
||||||
|
}
|
||||||
idct16_c(inputhalf, output + 16);
|
idct16_c(inputhalf, output + 16);
|
||||||
// Note overall scaling factor is 4 times orthogonal
|
// Note overall scaling factor is 4 times orthogonal
|
||||||
}
|
}
|
||||||
@@ -106,14 +109,14 @@ static void highbd_ihalfright32_c(const tran_low_t *input, tran_low_t *output,
|
|||||||
int bd) {
|
int bd) {
|
||||||
int i;
|
int i;
|
||||||
tran_low_t inputhalf[16];
|
tran_low_t inputhalf[16];
|
||||||
for (i = 0; i < 16; ++i) {
|
|
||||||
output[i] = input[16 + i] * 4;
|
|
||||||
}
|
|
||||||
// Multiply input by sqrt(2)
|
// Multiply input by sqrt(2)
|
||||||
for (i = 0; i < 16; ++i) {
|
for (i = 0; i < 16; ++i) {
|
||||||
inputhalf[i] =
|
inputhalf[i] =
|
||||||
HIGHBD_WRAPLOW(highbd_dct_const_round_shift(input[i] * Sqrt2), bd);
|
HIGHBD_WRAPLOW(highbd_dct_const_round_shift(input[i] * Sqrt2), bd);
|
||||||
}
|
}
|
||||||
|
for (i = 0; i < 16; ++i) {
|
||||||
|
output[i] = input[16 + i] * 4;
|
||||||
|
}
|
||||||
aom_highbd_idct16_c(inputhalf, output + 16, bd);
|
aom_highbd_idct16_c(inputhalf, output + 16, bd);
|
||||||
// Note overall scaling factor is 4 times orthogonal
|
// Note overall scaling factor is 4 times orthogonal
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user