Commit 5a9ea000 authored by Urvang Joshi's avatar Urvang Joshi

Handle SMOOTH_HV config in some missing places.

Also, add some asserts so that such mistakes don't happen later on.

Change-Id: I61c5f1bcb4db5903f961c94086f1103deead3d85
parent b44bc0dc
......@@ -129,7 +129,7 @@ static INLINE int is_inter_compound_mode(PREDICTION_MODE mode) {
}
static INLINE PREDICTION_MODE compound_ref0_mode(PREDICTION_MODE mode) {
static PREDICTION_MODE lut[MB_MODE_COUNT] = {
static PREDICTION_MODE lut[] = {
MB_MODE_COUNT, // DC_PRED
MB_MODE_COUNT, // V_PRED
MB_MODE_COUNT, // H_PRED
......@@ -141,6 +141,10 @@ static INLINE PREDICTION_MODE compound_ref0_mode(PREDICTION_MODE mode) {
MB_MODE_COUNT, // D63_PRED
#if CONFIG_ALT_INTRA
MB_MODE_COUNT, // SMOOTH_PRED
#if CONFIG_SMOOTH_HV
MB_MODE_COUNT, // SMOOTH_V_PRED
MB_MODE_COUNT, // SMOOTH_H_PRED
#endif // CONFIG_SMOOTH_HV
#endif // CONFIG_ALT_INTRA
MB_MODE_COUNT, // TM_PRED
MB_MODE_COUNT, // NEARESTMV
......@@ -163,12 +167,13 @@ static INLINE PREDICTION_MODE compound_ref0_mode(PREDICTION_MODE mode) {
ZEROMV, // ZERO_ZEROMV
NEWMV, // NEW_NEWMV
};
assert(NELEMENTS(lut) == MB_MODE_COUNT);
assert(is_inter_compound_mode(mode));
return lut[mode];
}
static INLINE PREDICTION_MODE compound_ref1_mode(PREDICTION_MODE mode) {
static PREDICTION_MODE lut[MB_MODE_COUNT] = {
static PREDICTION_MODE lut[] = {
MB_MODE_COUNT, // DC_PRED
MB_MODE_COUNT, // V_PRED
MB_MODE_COUNT, // H_PRED
......@@ -180,6 +185,10 @@ static INLINE PREDICTION_MODE compound_ref1_mode(PREDICTION_MODE mode) {
MB_MODE_COUNT, // D63_PRED
#if CONFIG_ALT_INTRA
MB_MODE_COUNT, // SMOOTH_PRED
#if CONFIG_SMOOTH_HV
MB_MODE_COUNT, // SMOOTH_V_PRED
MB_MODE_COUNT, // SMOOTH_H_PRED
#endif // CONFIG_SMOOTH_HV
#endif // CONFIG_ALT_INTRA
MB_MODE_COUNT, // TM_PRED
MB_MODE_COUNT, // NEARESTMV
......@@ -202,6 +211,7 @@ static INLINE PREDICTION_MODE compound_ref1_mode(PREDICTION_MODE mode) {
ZEROMV, // ZERO_ZEROMV
NEWMV, // NEW_NEWMV
};
assert(NELEMENTS(lut) == MB_MODE_COUNT);
assert(is_inter_compound_mode(mode));
return lut[mode];
}
......
......@@ -41,7 +41,7 @@ typedef enum {
// adding 9 for each intra block, 3 for each zero mv and 1 for each new
// motion vector. This single number is then converted into a context
// with a single lookup ( counter_to_context ).
static const int mode_2_counter[MB_MODE_COUNT] = {
static const int mode_2_counter[] = {
9, // DC_PRED
9, // V_PRED
9, // H_PRED
......@@ -52,7 +52,11 @@ static const int mode_2_counter[MB_MODE_COUNT] = {
9, // D207_PRED
9, // D63_PRED
#if CONFIG_ALT_INTRA
9, // SMOOTH_PRED
9, // SMOOTH_PRED
#if CONFIG_SMOOTH_HV
9, // SMOOTH_V_PRED
9, // SMOOTH_H_PRED
#endif // CONFIG_SMOOTH_HV
#endif // CONFIG_ALT_INTRA
9, // TM_PRED
0, // NEARESTMV
......
......@@ -1827,6 +1827,8 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
FRAME_CONTEXT *ec_ctx = cm->fc;
#endif
assert(NELEMENTS(mode_2_counter) == MB_MODE_COUNT);
#if CONFIG_PALETTE
mbmi->palette_mode_info.palette_size[0] = 0;
mbmi->palette_mode_info.palette_size[1] = 0;
......
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