summaryrefslogtreecommitdiff
path: root/vp8/encoder/ratectrl.c
diff options
context:
space:
mode:
Diffstat (limited to 'vp8/encoder/ratectrl.c')
-rw-r--r--vp8/encoder/ratectrl.c31
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;