diff --git a/src/intra.c b/src/intra.c index 516e9d69..90ea5e0f 100644 --- a/src/intra.c +++ b/src/intra.c @@ -316,8 +316,8 @@ void kvz_intra_predict( } else { // Angular modes use smoothed reference pixels, unless the mode is close // to being either vertical or horizontal. - static const int kvz_intra_hor_ver_dist_thres[5] = { 0, 7, 1, 0, 0 }; - int filter_threshold = kvz_intra_hor_ver_dist_thres[kvz_math_floor_log2(width) - 2]; + static const int kvz_intra_hor_ver_dist_thres[2][8] = { { 20, 20, 20, 14, 2, 0, 20, 0 }, {40, 40, 40, 28, 4, 0, 40, 0} }; + int filter_threshold = kvz_intra_hor_ver_dist_thres[color == COLOR_Y ? 0 : 1][kvz_math_floor_log2(width)]; int dist_from_vert_or_hor = MIN(abs(mode - 50), abs(mode - 18)); if (dist_from_vert_or_hor > filter_threshold) { used_ref = &refs->filtered_ref; diff --git a/src/strategies/generic/intra-generic.c b/src/strategies/generic/intra-generic.c index a7c3bafa..934e553d 100644 --- a/src/strategies/generic/intra-generic.c +++ b/src/strategies/generic/intra-generic.c @@ -153,7 +153,7 @@ static void kvz_angular_pred_generic( int delta_int_0 = delta_pos_0 >> 6; int delta_y = y + delta_int_0; // TODO: convert to JVET_K0500_WAIP - if (delta_y > width + width) break; + if (delta_y > width + width - 2) break; int wL = 32 >> MIN(31, ((x << 1) >> scale)); if (wL == 0) break;