Commit 57b8ff68 authored by Yue Chen's avatar Yue Chen
Browse files

Optimizations for filter_intra

Reduce number of modes from 10 to 6, and disable fi modes in UV.
To reduce complexity, apply filter directly without subtracting
the estimated means.

Change-Id: Iaf78d92d31e4a7cc30ea7863b57a9611c5f503e6
parent 54671902
......@@ -185,24 +185,16 @@ if (aom_config("CONFIG_FILTER_INTRA") eq "yes") {
add_proto qw/void av1_dc_filter_predictor/, "uint8_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint8_t *above, const uint8_t *left";
add_proto qw/void av1_v_filter_predictor/, "uint8_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint8_t *above, const uint8_t *left";
add_proto qw/void av1_h_filter_predictor/, "uint8_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint8_t *above, const uint8_t *left";
add_proto qw/void av1_d45_filter_predictor/, "uint8_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint8_t *above, const uint8_t *left";
add_proto qw/void av1_d135_filter_predictor/, "uint8_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint8_t *above, const uint8_t *left";
add_proto qw/void av1_d117_filter_predictor/, "uint8_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint8_t *above, const uint8_t *left";
add_proto qw/void av1_d153_filter_predictor/, "uint8_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint8_t *above, const uint8_t *left";
add_proto qw/void av1_d207_filter_predictor/, "uint8_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint8_t *above, const uint8_t *left";
add_proto qw/void av1_d63_filter_predictor/, "uint8_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint8_t *above, const uint8_t *left";
add_proto qw/void av1_paeth_filter_predictor/, "uint8_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint8_t *above, const uint8_t *left";
# High bitdepth functions
if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
add_proto qw/void av1_highbd_dc_filter_predictor/, "uint16_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint16_t *above, const uint16_t *left, int bd";
add_proto qw/void av1_highbd_v_filter_predictor/, "uint16_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint16_t *above, const uint16_t *left, int bd";
add_proto qw/void av1_highbd_h_filter_predictor/, "uint16_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint16_t *above, const uint16_t *left, int bd";
add_proto qw/void av1_highbd_d45_filter_predictor/, "uint16_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint16_t *above, const uint16_t *left, int bd";
add_proto qw/void av1_highbd_d135_filter_predictor/, "uint16_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint16_t *above, const uint16_t *left, int bd";
add_proto qw/void av1_highbd_d117_filter_predictor/, "uint16_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint16_t *above, const uint16_t *left, int bd";
add_proto qw/void av1_highbd_d153_filter_predictor/, "uint16_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint16_t *above, const uint16_t *left, int bd";
add_proto qw/void av1_highbd_d207_filter_predictor/, "uint16_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint16_t *above, const uint16_t *left, int bd";
add_proto qw/void av1_highbd_d63_filter_predictor/, "uint16_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint16_t *above, const uint16_t *left, int bd";
add_proto qw/void av1_highbd_paeth_filter_predictor/, "uint16_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint16_t *above, const uint16_t *left, int bd";
}
}
......
......@@ -261,6 +261,10 @@ typedef struct {
uint8_t use_filter_intra_mode[PLANE_TYPES];
FILTER_INTRA_MODE filter_intra_mode[PLANE_TYPES];
} FILTER_INTRA_MODE_INFO;
static const PREDICTION_MODE fimode_to_intradir[FILTER_INTRA_MODES] = {
DC_PRED, V_PRED, H_PRED, D117_PRED, D153_PRED, DC_PRED
};
#endif // CONFIG_FILTER_INTRA
#if CONFIG_RD_DEBUG
......
This diff is collapsed.
......@@ -616,12 +616,8 @@ typedef enum ATTRIBUTE_PACKED {
FILTER_DC_PRED,
FILTER_V_PRED,
FILTER_H_PRED,
FILTER_D45_PRED,
FILTER_D135_PRED,
FILTER_D117_PRED,
FILTER_D153_PRED,
FILTER_D207_PRED,
FILTER_D63_PRED,
FILTER_PAETH_PRED,
FILTER_INTRA_MODES,
} FILTER_INTRA_MODE;
......
......@@ -1072,61 +1072,41 @@ static int filter_intra_taps_3[TX_SIZES_ALL][FILTER_INTRA_MODES][3] = {
{ 697, 836, -509 },
{ 993, 513, -482 },
{ 381, 984, -341 },
{ 642, 1169, -787 },
{ 590, 553, -119 },
{ 762, 385, -123 },
{ 358, 687, -21 },
{ 411, 1083, -470 },
{ 912, 814, -702 },
{ 883, 902, -761 },
},
{
{ 659, 816, -451 },
{ 980, 625, -581 },
{ 558, 962, -496 },
{ 681, 888, -545 },
{ 591, 613, 180 },
{ 778, 399, -153 },
{ 495, 641, -112 },
{ 671, 937, -584 },
{ 745, 940, -661 },
{ 839, 911, -726 },
},
{
{ 539, 927, -442 },
{ 1003, 714, -693 },
{ 349, 1271, -596 },
{ 820, 764, -560 },
{ 524, 816, -316 },
{ 780, 681, -437 },
{ 586, 795, -357 },
{ 551, 1135, -663 },
{ 593, 1061, -630 },
{ 974, 970, -920 },
},
{
{ 595, 919, -490 },
{ 945, 668, -579 },
{ 945, 668, -589 },
{ 495, 962, -433 },
{ 385, 1551, -912 },
{ 455, 554, 15 },
{ 852, 478, -306 },
{ 177, 760, -87 },
{ -65, 1611, -522 },
{ 815, 894, -685 },
{ 177, 760, 87 },
{ 846, 1010, -832 },
},
#if CONFIG_TX64X64
{
{ 595, 919, -490 },
{ 945, 668, -579 },
{ 945, 668, -589 },
{ 495, 962, -433 },
{ 385, 1551, -912 },
{ 455, 554, 15 },
{ 852, 478, -306 },
{ 177, 760, -87 },
{ -65, 1611, -522 },
{ 815, 894, -685 },
{ 177, 760, 87 },
{ 846, 1010, -832 },
},
#endif // CONFIG_TX64X64
......@@ -1134,120 +1114,80 @@ static int filter_intra_taps_3[TX_SIZES_ALL][FILTER_INTRA_MODES][3] = {
{ 697, 836, -509 },
{ 993, 513, -482 },
{ 381, 984, -341 },
{ 642, 1169, -787 },
{ 590, 553, -119 },
{ 762, 385, -123 },
{ 358, 687, -21 },
{ 411, 1083, -470 },
{ 912, 814, -702 },
{ 883, 902, -761 },
},
{
{ 697, 836, -509 },
{ 993, 513, -482 },
{ 381, 984, -341 },
{ 642, 1169, -787 },
{ 590, 553, -119 },
{ 762, 385, -123 },
{ 358, 687, -21 },
{ 411, 1083, -470 },
{ 912, 814, -702 },
{ 883, 902, -761 },
},
{
{ 659, 816, -451 },
{ 980, 625, -581 },
{ 558, 962, -496 },
{ 681, 888, -545 },
{ 591, 613, 180 },
{ 778, 399, -153 },
{ 495, 641, -112 },
{ 671, 937, -584 },
{ 745, 940, -661 },
{ 839, 911, -726 },
},
{
{ 659, 816, -451 },
{ 980, 625, -581 },
{ 558, 962, -496 },
{ 681, 888, -545 },
{ 591, 613, 180 },
{ 778, 399, -153 },
{ 495, 641, -112 },
{ 671, 937, -584 },
{ 745, 940, -661 },
{ 839, 911, -726 },
},
{
{ 539, 927, -442 },
{ 1003, 714, -693 },
{ 349, 1271, -596 },
{ 820, 764, -560 },
{ 524, 816, -316 },
{ 780, 681, -437 },
{ 586, 795, -357 },
{ 551, 1135, -663 },
{ 593, 1061, -630 },
{ 974, 970, -920 },
},
{
{ 539, 927, -442 },
{ 1003, 714, -693 },
{ 349, 1271, -596 },
{ 820, 764, -560 },
{ 524, 816, -316 },
{ 780, 681, -437 },
{ 586, 795, -357 },
{ 551, 1135, -663 },
{ 593, 1061, -630 },
{ 974, 970, -920 },
},
{
{ 697, 836, -509 },
{ 993, 513, -482 },
{ 381, 984, -341 },
{ 642, 1169, -787 },
{ 590, 553, -119 },
{ 762, 385, -123 },
{ 358, 687, -21 },
{ 411, 1083, -470 },
{ 912, 814, -702 },
{ 883, 902, -761 },
},
{
{ 697, 836, -509 },
{ 993, 513, -482 },
{ 381, 984, -341 },
{ 642, 1169, -787 },
{ 590, 553, -119 },
{ 762, 385, -123 },
{ 358, 687, -21 },
{ 411, 1083, -470 },
{ 912, 814, -702 },
{ 883, 902, -761 },
},
{
{ 659, 816, -451 },
{ 980, 625, -581 },
{ 558, 962, -496 },
{ 681, 888, -545 },
{ 591, 613, 180 },
{ 778, 399, -153 },
{ 495, 641, -112 },
{ 671, 937, -584 },
{ 745, 940, -661 },
{ 839, 911, -726 },
},
{
{ 659, 816, -451 },
{ 980, 625, -581 },
{ 558, 962, -496 },
{ 681, 888, -545 },
{ 591, 613, 180 },
{ 778, 399, -153 },
{ 495, 641, -112 },
{ 671, 937, -584 },
{ 745, 940, -661 },
{ 839, 911, -726 },
}
};
......@@ -1443,7 +1383,7 @@ static void filter_intra_predictors_3tap(uint8_t *dst, ptrdiff_t stride,
TX_SIZE tx_size, const uint8_t *above,
const uint8_t *left, int mode) {
int r, c;
int mean, ipred;
int ipred;
#if CONFIG_TX64X64
int buffer[65][65];
#else
......@@ -1455,30 +1395,21 @@ static void filter_intra_predictors_3tap(uint8_t *dst, ptrdiff_t stride,
const int bw = tx_size_wide[tx_size];
const int bh = tx_size_high[tx_size];
mean = 0;
for (r = 0; r < bh; ++r) {
mean += (int)left[r];
}
for (c = 0; c < bw; ++c) {
mean += (int)above[c];
}
mean = (mean + ((bw + bh) >> 1)) / (bw + bh);
for (r = 0; r < bh; ++r) buffer[r + 1][0] = (int)left[r] - mean;
for (r = 0; r < bh; ++r) buffer[r + 1][0] = (int)left[r];
for (c = 0; c < bw + 1; ++c) buffer[0][c] = (int)above[c - 1] - mean;
for (c = 0; c < bw + 1; ++c) buffer[0][c] = (int)above[c - 1];
for (r = 1; r < bh + 1; ++r)
for (c = 1; c < bw + 1; ++c) {
ipred = c0 * buffer[r - 1][c] + c1 * buffer[r][c - 1] +
c2 * buffer[r - 1][c - 1];
buffer[r][c] = ROUND_POWER_OF_TWO_SIGNED(ipred, FILTER_INTRA_PREC_BITS);
buffer[r][c] = clip_pixel(buffer[r][c] + mean) - mean;
buffer[r][c] = clip_pixel(buffer[r][c]);
}
for (r = 0; r < bh; ++r) {
for (c = 0; c < bw; ++c) {
dst[c] = clip_pixel(buffer[r + 1][c + 1] + mean);
dst[c] = clip_pixel(buffer[r + 1][c + 1]);
}
dst += stride;
}
......@@ -1564,29 +1495,6 @@ void av1_h_filter_predictor_c(uint8_t *dst, ptrdiff_t stride, TX_SIZE tx_size,
#endif
}
void av1_d45_filter_predictor_c(uint8_t *dst, ptrdiff_t stride, TX_SIZE tx_size,
const uint8_t *above, const uint8_t *left) {
#if USE_3TAP_INTRA_FILTER
filter_intra_predictors_3tap(dst, stride, tx_size, above, left,
FILTER_D45_PRED);
#else
filter_intra_predictors_4tap(dst, stride, tx_size, above, left,
FILTER_D45_PRED);
#endif
}
void av1_d135_filter_predictor_c(uint8_t *dst, ptrdiff_t stride,
TX_SIZE tx_size, const uint8_t *above,
const uint8_t *left) {
#if USE_3TAP_INTRA_FILTER
filter_intra_predictors_3tap(dst, stride, tx_size, above, left,
FILTER_D135_PRED);
#else
filter_intra_predictors_4tap(dst, stride, tx_size, above, left,
FILTER_D135_PRED);
#endif
}
void av1_d117_filter_predictor_c(uint8_t *dst, ptrdiff_t stride,
TX_SIZE tx_size, const uint8_t *above,
const uint8_t *left) {
......@@ -1611,29 +1519,6 @@ void av1_d153_filter_predictor_c(uint8_t *dst, ptrdiff_t stride,
#endif
}
void av1_d207_filter_predictor_c(uint8_t *dst, ptrdiff_t stride,
TX_SIZE tx_size, const uint8_t *above,
const uint8_t *left) {
#if USE_3TAP_INTRA_FILTER
filter_intra_predictors_3tap(dst, stride, tx_size, above, left,
FILTER_D207_PRED);
#else
filter_intra_predictors_4tap(dst, stride, tx_size, above, left,
FILTER_D207_PRED);
#endif
}
void av1_d63_filter_predictor_c(uint8_t *dst, ptrdiff_t stride, TX_SIZE tx_size,
const uint8_t *above, const uint8_t *left) {
#if USE_3TAP_INTRA_FILTER
filter_intra_predictors_3tap(dst, stride, tx_size, above, left,
FILTER_D63_PRED);
#else
filter_intra_predictors_4tap(dst, stride, tx_size, above, left,
FILTER_D63_PRED);
#endif
}
void av1_paeth_filter_predictor_c(uint8_t *dst, ptrdiff_t stride,
TX_SIZE tx_size, const uint8_t *above,
const uint8_t *left) {
......@@ -1659,24 +1544,12 @@ static void filter_intra_predictors(FILTER_INTRA_MODE mode, uint8_t *dst,
case FILTER_H_PRED:
av1_h_filter_predictor(dst, stride, tx_size, above, left);
break;
case FILTER_D45_PRED:
av1_d45_filter_predictor(dst, stride, tx_size, above, left);
break;
case FILTER_D135_PRED:
av1_d135_filter_predictor(dst, stride, tx_size, above, left);
break;
case FILTER_D117_PRED:
av1_d117_filter_predictor(dst, stride, tx_size, above, left);
break;
case FILTER_D153_PRED:
av1_d153_filter_predictor(dst, stride, tx_size, above, left);
break;
case FILTER_D207_PRED:
av1_d207_filter_predictor(dst, stride, tx_size, above, left);
break;
case FILTER_D63_PRED:
av1_d63_filter_predictor(dst, stride, tx_size, above, left);
break;
case FILTER_PAETH_PRED:
av1_paeth_filter_predictor(dst, stride, tx_size, above, left);
break;
......@@ -1691,7 +1564,7 @@ static void highbd_filter_intra_predictors_3tap(uint16_t *dst, ptrdiff_t stride,
const uint16_t *left, int mode,
int bd) {
int r, c;
int mean, ipred;
int ipred;
#if CONFIG_TX64X64
int preds[65][65];
#else
......@@ -1703,30 +1576,21 @@ static void highbd_filter_intra_predictors_3tap(uint16_t *dst, ptrdiff_t stride,
const int bw = tx_size_wide[tx_size];
const int bh = tx_size_high[tx_size];
mean = 0;
for (r = 0; r < bh; ++r) {
mean += (int)left[r];
}
for (c = 0; c < bw; ++c) {
mean += (int)above[c];
}
mean = (mean + ((bw + bh) >> 1)) / (bw + bh);
for (r = 0; r < bh; ++r) preds[r + 1][0] = (int)left[r] - mean;
for (r = 0; r < bh; ++r) preds[r + 1][0] = (int)left[r];
for (c = 0; c < bw + 1; ++c) preds[0][c] = (int)above[c - 1] - mean;
for (c = 0; c < bw + 1; ++c) preds[0][c] = (int)above[c - 1];
for (r = 1; r < bh + 1; ++r)
for (c = 1; c < bw + 1; ++c) {
ipred = c0 * preds[r - 1][c] + c1 * preds[r][c - 1] +
c2 * preds[r - 1][c - 1];
preds[r][c] = ROUND_POWER_OF_TWO_SIGNED(ipred, FILTER_INTRA_PREC_BITS);
preds[r][c] = clip_pixel_highbd(preds[r][c] + mean, bd) - mean;
preds[r][c] = clip_pixel_highbd(preds[r][c], bd);
}
for (r = 0; r < bh; ++r) {
for (c = 0; c < bw; ++c) {
dst[c] = clip_pixel_highbd(preds[r + 1][c + 1] + mean, bd);
dst[c] = clip_pixel_highbd(preds[r + 1][c + 1], bd);
}
dst += stride;
}
......@@ -1817,30 +1681,6 @@ void av1_highbd_h_filter_predictor_c(uint16_t *dst, ptrdiff_t stride,
#endif
}
void av1_highbd_d45_filter_predictor_c(uint16_t *dst, ptrdiff_t stride,
TX_SIZE tx_size, const uint16_t *above,
const uint16_t *left, int bd) {
#if USE_3TAP_INTRA_FILTER
highbd_filter_intra_predictors_3tap(dst, stride, tx_size, above, left,
FILTER_D45_PRED, bd);
#else
highbd_filter_intra_predictors_4tap(dst, stride, tx_size, above, left,
FILTER_D45_PRED, bd);
#endif
}
void av1_highbd_d135_filter_predictor_c(uint16_t *dst, ptrdiff_t stride,
TX_SIZE tx_size, const uint16_t *above,
const uint16_t *left, int bd) {
#if USE_3TAP_INTRA_FILTER
highbd_filter_intra_predictors_3tap(dst, stride, tx_size, above, left,
FILTER_D135_PRED, bd);
#else
highbd_filter_intra_predictors_4tap(dst, stride, tx_size, above, left,
FILTER_D135_PRED, bd);
#endif
}
void av1_highbd_d117_filter_predictor_c(uint16_t *dst, ptrdiff_t stride,
TX_SIZE tx_size, const uint16_t *above,
const uint16_t *left, int bd) {
......@@ -1865,30 +1705,6 @@ void av1_highbd_d153_filter_predictor_c(uint16_t *dst, ptrdiff_t stride,
#endif
}
void av1_highbd_d207_filter_predictor_c(uint16_t *dst, ptrdiff_t stride,
TX_SIZE tx_size, const uint16_t *above,
const uint16_t *left, int bd) {
#if USE_3TAP_INTRA_FILTER
highbd_filter_intra_predictors_3tap(dst, stride, tx_size, above, left,
FILTER_D207_PRED, bd);
#else
highbd_filter_intra_predictors_4tap(dst, stride, tx_size, above, left,
FILTER_D207_PRED, bd);
#endif
}
void av1_highbd_d63_filter_predictor_c(uint16_t *dst, ptrdiff_t stride,
TX_SIZE tx_size, const uint16_t *above,
const uint16_t *left, int bd) {
#if USE_3TAP_INTRA_FILTER
highbd_filter_intra_predictors_3tap(dst, stride, tx_size, above, left,
FILTER_D63_PRED, bd);
#else
highbd_filter_intra_predictors_4tap(dst, stride, tx_size, above, left,
FILTER_D63_PRED, bd);
#endif
}
void av1_highbd_paeth_filter_predictor_c(uint16_t *dst, ptrdiff_t stride,
TX_SIZE tx_size, const uint16_t *above,
const uint16_t *left, int bd) {
......@@ -1916,24 +1732,12 @@ static void highbd_filter_intra_predictors(FILTER_INTRA_MODE mode,
case FILTER_H_PRED:
av1_highbd_h_filter_predictor(dst, stride, tx_size, above, left, bd);
break;
case FILTER_D45_PRED:
av1_highbd_d45_filter_predictor(dst, stride, tx_size, above, left, bd);
break;
case FILTER_D135_PRED:
av1_highbd_d135_filter_predictor(dst, stride, tx_size, above, left, bd);
break;
case FILTER_D117_PRED:
av1_highbd_d117_filter_predictor(dst, stride, tx_size, above, left, bd);
break;
case FILTER_D153_PRED:
av1_highbd_d153_filter_predictor(dst, stride, tx_size, above, left, bd);
break;
case FILTER_D207_PRED:
av1_highbd_d207_filter_predictor(dst, stride, tx_size, above, left, bd);
break;
case FILTER_D63_PRED:
av1_highbd_d63_filter_predictor(dst, stride, tx_size, above, left, bd);
break;
case FILTER_PAETH_PRED:
av1_highbd_paeth_filter_predictor(dst, stride, tx_size, above, left, bd);
break;
......
......@@ -859,8 +859,7 @@ static void read_palette_mode_info(AV1_COMMON *const cm, MACROBLOCKD *const xd,
#if CONFIG_FILTER_INTRA
static void read_filter_intra_mode_info(AV1_COMMON *const cm,
MACROBLOCKD *const xd, int mi_row,
int mi_col, aom_reader *r) {
MACROBLOCKD *const xd, aom_reader *r) {
MODE_INFO *const mi = xd->mi[0];
MB_MODE_INFO *const mbmi = &mi->mbmi;
FRAME_COUNTS *counts = xd->counts;
......@@ -880,26 +879,6 @@ static void read_filter_intra_mode_info(AV1_COMMON *const cm,
->filter_intra[0][filter_intra_mode_info->use_filter_intra_mode[0]];
}
}
if (!is_chroma_reference(mi_row, mi_col, mbmi->sb_type,
xd->plane[1].subsampling_x,
xd->plane[1].subsampling_y))
return;
if (mbmi->uv_mode == UV_DC_PRED &&
mbmi->palette_mode_info.palette_size[1] == 0) {
filter_intra_mode_info->use_filter_intra_mode[1] =
aom_read(r, cm->fc->filter_intra_probs[1], ACCT_STR);
if (filter_intra_mode_info->use_filter_intra_mode[1]) {
filter_intra_mode_info->filter_intra_mode[1] =
aom_read_symbol(r, xd->tile_ctx->filter_intra_mode_cdf[1],
FILTER_INTRA_MODES, ACCT_STR);
}
if (counts) {
++counts
->filter_intra[1][filter_intra_mode_info->use_filter_intra_mode[1]];
}
}
}
#endif // CONFIG_FILTER_INTRA
......@@ -971,9 +950,21 @@ void av1_read_tx_type(const AV1_COMMON *const cm, MACROBLOCKD *xd,
r, ec_ctx->inter_ext_tx_cdf[eset][square_tx_size],
av1_num_ext_tx_set[tx_set_type], ACCT_STR)];
} else if (ALLOW_INTRA_EXT_TX) {
#if CONFIG_FILTER_INTRA
PREDICTION_MODE intra_dir;
if (mbmi->filter_intra_mode_info.use_filter_intra_mode[0])
intra_dir = fimode_to_intradir[mbmi->filter_intra_mode_info
.filter_intra_mode[0]];
else
intra_dir = mbmi->mode;
*tx_type = av1_ext_tx_inv[tx_set_type][aom_read_symbol(
r, ec_ctx->intra_ext_tx_cdf[eset][square_tx_size][intra_dir],
av1_num_ext_tx_set[tx_set_type], ACCT_STR)];
#else
*tx_type = av1_ext_tx_inv[tx_set_type][aom_read_symbol(
r, ec_ctx->intra_ext_tx_cdf[eset][square_tx_size][mbmi->mode],
av1_num_ext_tx_set[tx_set_type], ACCT_STR)];
#endif
}
#else
// only signal tx_type when lgt is not allowed or not selected
......@@ -1276,7 +1267,7 @@ static void read_intra_frame_mode_info(AV1_COMMON *const cm,
#if CONFIG_FILTER_INTRA
mbmi->filter_intra_mode_info.use_filter_intra_mode[0] = 0;
mbmi->filter_intra_mode_info.use_filter_intra_mode[1] = 0;
read_filter_intra_mode_info(cm, xd, mi_row, mi_col, r);
read_filter_intra_mode_info(cm, xd, r);
#endif // CONFIG_FILTER_INTRA
#if !CONFIG_TXK_SEL
......@@ -1812,7 +1803,7 @@ static void read_intra_block_mode_info(AV1_COMMON *const cm, const int mi_row,
#if CONFIG_FILTER_INTRA
mbmi->filter_intra_mode_info.use_filter_intra_mode[0] = 0;
mbmi->filter_intra_mode_info.use_filter_intra_mode[1] = 0;
read_filter_intra_mode_info(cm, xd, mi_row, mi_col, r);
read_filter_intra_mode_info(cm, xd, r);
#endif // CONFIG_FILTER_INTRA
}
......
......@@ -1048,7 +1048,6 @@ static void write_ref_frames(const AV1_COMMON *cm, const MACROBLOCKD *xd,
static void write_filter_intra_mode_info(const AV1_COMMON *const cm,
const MACROBLOCKD *xd,
const MB_MODE_INFO *const mbmi,
int mi_row, int mi_col,
aom_writer *w) {
if (mbmi->mode == DC_PRED && mbmi->palette_mode_info.palette_size[0] == 0) {
aom_write(w, mbmi->filter_intra_mode_info.use_filter_intra_mode[0],
......@@ -1060,23 +1059,6 @@ static void write_filter_intra_mode_info(const AV1_COMMON *const cm,
FILTER_INTRA_MODES);
}
}
if (!is_chroma_reference(mi_row, mi_col, mbmi->sb_type,
xd->plane[1].subsampling_x,
xd->plane[1].subsampling_y))
return;
if (mbmi->uv_mode == UV_DC_PRED &&
mbmi->palette_mode_info.palette_size[1] == 0) {
aom_write(w, mbmi->filter_intra_mode_info.use_filter_intra_mode[1],
cm->fc->filter_intra_probs[1]);
if (mbmi->filter_intra_mode_info.use_filter_intra_mode[1]) {
const FILTER_INTRA_MODE mode =
mbmi->filter_intra_mode_info.filter_intra_mode[1];