From 875a6675a76182baafb3c04a40bd245737a7374c Mon Sep 17 00:00:00 2001 From: Urvang Joshi Date: Mon, 5 Jun 2017 11:59:35 -0700 Subject: [PATCH] is_directional_mode: Check for directional modes directly. Earlier, the condition was negating all non-directional modes to check if a mode is directional. This was error-prone, e.g. when a new non-directional mode is added. By checking for directional modes directly, we avoid such errors. Change-Id: Ia4a62e278cd73078c53ed5096db646eff77f054e --- av1/common/enums.h | 2 ++ av1/common/reconintra.h | 9 +-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/av1/common/enums.h b/av1/common/enums.h index 0cce8f0ee..3f905deaa 100644 --- a/av1/common/enums.h +++ b/av1/common/enums.h @@ -318,6 +318,8 @@ typedef enum { } PALETTE_COLOR; #endif // CONFIG_PALETTE +// Note: All directional predictors must be between V_PRED and D63_PRED (both +// inclusive). typedef enum ATTRIBUTE_PACKED { DC_PRED, // Average of above and left pixels V_PRED, // Vertical diff --git a/av1/common/reconintra.h b/av1/common/reconintra.h index fbcb7f9b4..8ad3bae8d 100644 --- a/av1/common/reconintra.h +++ b/av1/common/reconintra.h @@ -76,14 +76,7 @@ static const INTERINTRA_MODE intra_to_interintra_mode[INTRA_MODES] = { #if CONFIG_EXT_INTRA static INLINE int av1_is_directional_mode(PREDICTION_MODE mode, BLOCK_SIZE bsize) { - return mode != DC_PRED && mode != TM_PRED && -#if CONFIG_ALT_INTRA - mode != SMOOTH_PRED && -#if CONFIG_SMOOTH_HV - mode != SMOOTH_V_PRED && mode != SMOOTH_H_PRED && -#endif // CONFIG_SMOOTH_HV -#endif // CONFIG_ALT_INTRA - bsize >= BLOCK_8X8; + return mode >= V_PRED && mode <= D63_PRED && bsize >= BLOCK_8X8; } #endif // CONFIG_EXT_INTRA -- GitLab