Commit 980a248e authored by Sarah Parker's avatar Sarah Parker
Browse files

Use mrc mask when eob==1

Change-Id: I60d5134405bd8b8810b82752d3cacfe466a56241
parent 4f9ead8c
......@@ -1180,6 +1180,26 @@ void aom_idct32_c(const tran_low_t *input, tran_low_t *output) {
}
#if CONFIG_MRC_TX
void aom_imrc32x32_1_add_c(const tran_low_t *input, uint8_t *dest, int stride,
uint8_t *mask) {
int i, j;
tran_high_t a1;
tran_low_t out = WRAPLOW(dct_const_round_shift(input[0] * cospi_16_64));
out = WRAPLOW(dct_const_round_shift(out * cospi_16_64));
a1 = ROUND_POWER_OF_TWO(out, 6);
if (a1 == 0) return;
for (j = 0; j < 32; ++j) {
for (i = 0; i < 32; ++i) {
int mask_val = mask[i];
dest[i] = mask_val ? clip_pixel_add(dest[i], a1) : dest[i];
}
mask += 32;
dest += stride;
}
}
void aom_imrc32x32_1024_add_c(const tran_low_t *input, uint8_t *dest,
int stride, uint8_t *mask) {
tran_low_t out[32 * 32];
......
......@@ -44,6 +44,9 @@ static INLINE tran_high_t check_range(tran_high_t input, int bd) {
#if CONFIG_MRC_TX
// These each perform dct but add coefficients based on a mask
void aom_imrc32x32_1_add_c(const tran_low_t *input, uint8_t *dest, int stride,
uint8_t *mask);
void aom_imrc32x32_1024_add_c(const tran_low_t *input, uint8_t *dest,
int stride, uint8_t *mask);
......
......@@ -1776,21 +1776,20 @@ static void imrc32x32_add_c(const tran_low_t *input, uint8_t *dest, int stride,
int n_masked_vals = 0;
uint8_t *mask;
uint8_t mask_tmp[32 * 32];
if (eob == 1) {
aom_idct32x32_1_add_c(input, dest, stride);
} else {
if ((txfm_param->is_inter && SIGNAL_MRC_MASK_INTER) ||
(!txfm_param->is_inter && SIGNAL_MRC_MASK_INTRA)) {
mask = txfm_param->mask;
} else {
n_masked_vals =
get_mrc_pred_mask(txfm_param->dst, txfm_param->stride, mask_tmp, 32,
32, 32, txfm_param->is_inter);
get_mrc_pred_mask(txfm_param->dst, txfm_param->stride, mask_tmp, 32, 32,
32, txfm_param->is_inter);
if (!is_valid_mrc_mask(n_masked_vals, 32, 32))
assert(0 && "Invalid MRC mask");
mask = mask_tmp;
}
if (eob <= quarter)
if (eob == 1)
aom_imrc32x32_1_add_c(input, dest, stride, mask);
else if (eob <= quarter)
// non-zero coeff only in upper-left 8x8
aom_imrc32x32_34_add_c(input, dest, stride, mask);
else if (eob <= half)
......@@ -1798,7 +1797,6 @@ static void imrc32x32_add_c(const tran_low_t *input, uint8_t *dest, int stride,
aom_imrc32x32_135_add_c(input, dest, stride, mask);
else
aom_imrc32x32_1024_add_c(input, dest, stride, mask);
}
}
#endif // CONFIG_MRC_TX
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment