summaryrefslogtreecommitdiff
path: root/vp8/common
diff options
context:
space:
mode:
Diffstat (limited to 'vp8/common')
-rw-r--r--vp8/common/onyxc_int.h10
-rw-r--r--vp8/common/pred_common.c19
2 files changed, 17 insertions, 12 deletions
diff --git a/vp8/common/onyxc_int.h b/vp8/common/onyxc_int.h
index b05bf2596..d6f5b1315 100644
--- a/vp8/common/onyxc_int.h
+++ b/vp8/common/onyxc_int.h
@@ -48,6 +48,14 @@ void vp8_initialize_common(void);
#define MAX_PARTITIONS 9
+#if CONFIG_DUALPRED
+#if CONFIG_COMPRED
+#define DUAL_PRED_CONTEXTS 2
+#else
+#define DUAL_PRED_CONTEXTS 3
+#endif
+#endif /* CONFIG_DUALPRED */
+
typedef struct frame_contexts
{
vp8_prob bmode_prob [VP8_BINTRAMODES-1];
@@ -242,7 +250,7 @@ typedef struct VP8Common
#endif
#if CONFIG_DUALPRED
- vp8_prob prob_dualpred[3];
+ vp8_prob prob_dualpred[DUAL_PRED_CONTEXTS];
#endif /* CONFIG_DUALPRED */
FRAME_CONTEXT lfc_a; /* last alt ref entropy */
diff --git a/vp8/common/pred_common.c b/vp8/common/pred_common.c
index 810c11d2f..6d8256812 100644
--- a/vp8/common/pred_common.c
+++ b/vp8/common/pred_common.c
@@ -41,24 +41,21 @@ unsigned char get_pred_context( VP8_COMMON *const cm,
case PRED_DUAL:
// Context based on use of dual pred flag by neighbours
//pred_context =
- // ((m - 1)->mbmi.second_ref_frame != INTRA_FRAME) +
+ // ((m - 1)->mbmi.second_ref_frame != INTRA_FRAME) +
// ((m - cm->mode_info_stride)->mbmi.second_ref_frame != INTRA_FRAME);
- // Context based on mode
- //if ( m->mbmi.mode == ZEROMV )
- // pred_context = 0;
- //else if ( (m->mbmi.mode == NEARESTMV) || (m->mbmi.mode == NEARMV) )
- // pred_context = 1;
+ // Context based on mode and reference frame
+ //if ( m->mbmi.ref_frame == LAST_FRAME )
+ // pred_context = 0 + (m->mbmi.mode != ZEROMV);
+ //else if ( m->mbmi.ref_frame == GOLDEN_FRAME )
+ // pred_context = 2 + (m->mbmi.mode != ZEROMV);
//else
- // pred_context = 2;
+ // pred_context = 4 + (m->mbmi.mode != ZEROMV);
- // Context based on reference frame
if ( m->mbmi.ref_frame == LAST_FRAME )
pred_context = 0;
- else if ( m->mbmi.ref_frame == GOLDEN_FRAME )
- pred_context = 1;
else
- pred_context = 2;
+ pred_context = 1;
break;
#endif