diff options
author | Deb Mukherjee <debargha@google.com> | 2012-07-26 13:42:07 -0700 |
---|---|---|
committer | Deb Mukherjee <debargha@google.com> | 2012-09-06 08:28:21 -0700 |
commit | 00f9eb659034cb5cef0bf063c1b72c72c6333f36 (patch) | |
tree | 760c659d32debf97ec1c0a6ecb5c9e834be4a915 /vp8/encoder/ratectrl.c | |
parent | de6dfa6bb0cd680ca446a15b52b2a026859eb1e6 (diff) | |
download | libvpx-00f9eb659034cb5cef0bf063c1b72c72c6333f36.tar libvpx-00f9eb659034cb5cef0bf063c1b72c72c6333f36.tar.gz libvpx-00f9eb659034cb5cef0bf063c1b72c72c6333f36.tar.bz2 libvpx-00f9eb659034cb5cef0bf063c1b72c72c6333f36.zip |
New motion vector entropy coding
Adds a new experiment with redesigned/refactored motion vector entropy
coding. The patch also takes a first step towards separating the
integer and fractional pel components of a MV. However the fractional
pel encoding still depends on the integer pel part and so they are
not fully independent. Further experiments are in progress to see
how much they can be decoupled without affecting performance.
All components including entropy coding/decoding, costing for MV
search, forward updates and backward updates to probability tables,
have been implemented.
Results so far:
derf: +0.19%
std-hd: +0.28%
yt: +0.80%
hd: +1.15%
Patch: Simplifies the fractional pel models:
derf: +0.284%
std-hd: +0.289%
yt: +0.849%
hd: +1.254%
Patch: Some changes in the models, rebased.
derf: +0.330%
std-hd: +0.306%
yt: +0.816%
hd: +1.225%
Change-Id: I646b3c48f3587f4cc909639b78c3798da6402678
Diffstat (limited to 'vp8/encoder/ratectrl.c')
-rw-r--r-- | vp8/encoder/ratectrl.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/vp8/encoder/ratectrl.c b/vp8/encoder/ratectrl.c index 809279e7d..e985748da 100644 --- a/vp8/encoder/ratectrl.c +++ b/vp8/encoder/ratectrl.c @@ -132,10 +132,17 @@ void vp8_save_coding_context(VP8_COMP *cpi) { // intended for use in a re-code loop in vp8_compress_frame where the // quantizer value is adjusted between loop iterations. +#if CONFIG_NEWMVENTROPY + cc->nmvc = cm->fc.nmvc; + vp8_copy(cc->nmvjointcost, cpi->mb.nmvjointcost); + vp8_copy(cc->nmvcosts, cpi->mb.nmvcosts); + vp8_copy(cc->nmvcosts_hp, cpi->mb.nmvcosts_hp); +#else vp8_copy(cc->mvc, cm->fc.mvc); vp8_copy(cc->mvcosts, cpi->mb.mvcosts); vp8_copy(cc->mvc_hp, cm->fc.mvc_hp); vp8_copy(cc->mvcosts_hp, cpi->mb.mvcosts_hp); +#endif vp8_copy(cc->mv_ref_ct, cm->fc.mv_ref_ct); vp8_copy(cc->mode_context, cm->fc.mode_context); @@ -188,10 +195,17 @@ void vp8_restore_coding_context(VP8_COMP *cpi) { // Restore key state variables to the snapshot state stored in the // previous call to vp8_save_coding_context. +#if CONFIG_NEWMVENTROPY + cm->fc.nmvc = cc->nmvc; + vp8_copy(cpi->mb.nmvjointcost, cc->nmvjointcost); + vp8_copy(cpi->mb.nmvcosts, cc->nmvcosts); + vp8_copy(cpi->mb.nmvcosts_hp, cc->nmvcosts_hp); +#else vp8_copy(cm->fc.mvc, cc->mvc); vp8_copy(cpi->mb.mvcosts, cc->mvcosts); vp8_copy(cm->fc.mvc_hp, cc->mvc_hp); vp8_copy(cpi->mb.mvcosts_hp, cc->mvcosts_hp); +#endif vp8_copy(cm->fc.mv_ref_ct, cc->mv_ref_ct); vp8_copy(cm->fc.mode_context, cc->mode_context); @@ -244,17 +258,17 @@ void vp8_setup_key_frame(VP8_COMP *cpi) { vp8_kf_default_bmode_probs(cpi->common.kf_bmode_prob); vp8_init_mbmode_probs(& cpi->common); - vpx_memcpy(cpi->common.fc.mvc, vp8_default_mv_context, sizeof(vp8_default_mv_context)); - { - int flag[2] = {1, 1}; - vp8_build_component_cost_table(cpi->mb.mvcost, (const MV_CONTEXT *) cpi->common.fc.mvc, flag); - } - vpx_memcpy(cpi->common.fc.mvc_hp, vp8_default_mv_context_hp, sizeof(vp8_default_mv_context_hp)); + vp8_init_mv_probs(& cpi->common); +#if CONFIG_NEWMVENTROPY == 0 + /* this is not really required */ { int flag[2] = {1, 1}; - vp8_build_component_cost_table_hp(cpi->mb.mvcost_hp, (const MV_CONTEXT_HP *) cpi->common.fc.mvc_hp, flag); + vp8_build_component_cost_table( + cpi->mb.mvcost, (const MV_CONTEXT *) cpi->common.fc.mvc, flag); + vp8_build_component_cost_table_hp( + cpi->mb.mvcost_hp, (const MV_CONTEXT_HP *) cpi->common.fc.mvc_hp, flag); } - +#endif cpi->common.txfm_mode = ALLOW_8X8; @@ -285,6 +299,7 @@ void vp8_setup_key_frame(VP8_COMP *cpi) { sizeof(default_vp8_mode_contexts)); } + void vp8_setup_inter_frame(VP8_COMP *cpi) { cpi->common.txfm_mode = ALLOW_8X8; |