summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_ratectrl.c
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2012-11-27 12:41:59 -0800
committerYaowu Xu <yaowu@google.com>2012-11-28 09:24:30 -0800
commit12da793d001b0be5855c7a5741909f08fe387fa0 (patch)
tree3c796899155a34fb70767883789d8f1cf88b2189 /vp9/encoder/vp9_ratectrl.c
parentfcccbcbb395ce4cf31b54ce1245cc28e5e3ef4c1 (diff)
downloadlibvpx-12da793d001b0be5855c7a5741909f08fe387fa0.tar
libvpx-12da793d001b0be5855c7a5741909f08fe387fa0.tar.gz
libvpx-12da793d001b0be5855c7a5741909f08fe387fa0.tar.bz2
libvpx-12da793d001b0be5855c7a5741909f08fe387fa0.zip
removed redundant mode_context data structures
This commit removed a couple of redundant data structures in frame coding contextsm, mode_context and mode_context_a, and changed to use vp9_mode_contexts only. The switch of the context for different frame type now relies on the switch of frame coding context between lfc and lfc_a. This commit also removed a number of memcpy among these redundant data structure. Change-Id: I42e8174bd60f466b0860afc44c1263896471b0f3
Diffstat (limited to 'vp9/encoder/vp9_ratectrl.c')
-rw-r--r--vp9/encoder/vp9_ratectrl.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c
index ab9dc71c8..0ceb4f653 100644
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -17,6 +17,7 @@
#include "math.h"
#include "vp9/common/vp9_alloccommon.h"
+#include "vp9/common/vp9_modecont.h"
#include "vp9/common/vp9_common.h"
#include "vp9_ratectrl.h"
#include "vp9/common/vp9_entropymode.h"
@@ -135,8 +136,7 @@ void vp9_save_coding_context(VP9_COMP *cpi) {
vp9_copy(cc->nmvcosts, cpi->mb.nmvcosts);
vp9_copy(cc->nmvcosts_hp, cpi->mb.nmvcosts_hp);
- vp9_copy(cc->mode_context, cm->fc.mode_context);
- vp9_copy(cc->mode_context_a, cm->fc.mode_context_a);
+ vp9_copy(cc->vp9_mode_contexts, cm->fc.vp9_mode_contexts);
vp9_copy(cc->ymode_prob, cm->fc.ymode_prob);
#if CONFIG_SUPERBLOCKS
@@ -194,8 +194,7 @@ void vp9_restore_coding_context(VP9_COMP *cpi) {
vp9_copy(cpi->mb.nmvcosts, cc->nmvcosts);
vp9_copy(cpi->mb.nmvcosts_hp, cc->nmvcosts_hp);
- vp9_copy(cm->fc.mode_context, cc->mode_context);
- vp9_copy(cm->fc.mode_context_a, cc->mode_context_a);
+ vp9_copy(cm->fc.vp9_mode_contexts, cc->vp9_mode_contexts);
vp9_copy(cm->fc.ymode_prob, cc->ymode_prob);
#if CONFIG_SUPERBLOCKS
@@ -262,9 +261,16 @@ void vp9_setup_key_frame(VP9_COMP *cpi) {
cpi->common.refresh_alt_ref_frame = TRUE;
vp9_init_mode_contexts(&cpi->common);
+ vpx_memcpy(cpi->common.fc.vp9_mode_contexts,
+ vp9_default_mode_contexts,
+ sizeof(vp9_default_mode_contexts));
vpx_memcpy(&cpi->common.lfc, &cpi->common.fc, sizeof(cpi->common.fc));
vpx_memcpy(&cpi->common.lfc_a, &cpi->common.fc, sizeof(cpi->common.fc));
+ vpx_memcpy(cpi->common.lfc.vp9_mode_contexts,
+ vp9_default_mode_contexts_a,
+ sizeof(vp9_default_mode_contexts_a));
+
vpx_memset(cm->prev_mip, 0,
(cm->mb_cols + 1) * (cm->mb_rows + 1)* sizeof(MODE_INFO));
vpx_memset(cm->mip, 0,
@@ -279,16 +285,10 @@ void vp9_setup_inter_frame(VP9_COMP *cpi) {
vpx_memcpy(&cpi->common.fc,
&cpi->common.lfc_a,
sizeof(cpi->common.fc));
- vpx_memcpy(cpi->common.fc.vp9_mode_contexts,
- cpi->common.fc.mode_context_a,
- sizeof(cpi->common.fc.vp9_mode_contexts));
} else {
vpx_memcpy(&cpi->common.fc,
&cpi->common.lfc,
sizeof(cpi->common.fc));
- vpx_memcpy(cpi->common.fc.vp9_mode_contexts,
- cpi->common.fc.mode_context,
- sizeof(cpi->common.fc.vp9_mode_contexts));
}
}