summaryrefslogtreecommitdiff
path: root/vp8/common
diff options
context:
space:
mode:
authorPaul Wilkins <paulwilkins@google.com>2012-02-09 15:44:18 +0000
committerPaul Wilkins <paulwilkins@google.com>2012-02-09 15:44:18 +0000
commit8266abfe96cb1b46f537aec66b3dfcf22da2bb1c (patch)
treea8d374f99b871026419380b1b76fade8122d0943 /vp8/common
parent59a200f1ea73d2327746fff3d35a05aec10e436f (diff)
downloadlibvpx-8266abfe96cb1b46f537aec66b3dfcf22da2bb1c.tar
libvpx-8266abfe96cb1b46f537aec66b3dfcf22da2bb1c.tar.gz
libvpx-8266abfe96cb1b46f537aec66b3dfcf22da2bb1c.tar.bz2
libvpx-8266abfe96cb1b46f537aec66b3dfcf22da2bb1c.zip
Dual pred flag
Further changes to make experiments with the context used for coding the dual pred flag easier. Current best performing method tested on derf is a two element context based on reference frame. I also tried various combinations of mode and reference frame as shown in commented out case using up to 6 contexts. Derf +0.26 overall psnr +0.15% ssim vs original method. Change-Id: I64c21ddec0abbb27feaaeaa1da2e9f164ebaca03
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