summaryrefslogtreecommitdiff
path: root/vp8/encoder/ratectrl.c
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2011-11-30 16:36:46 -0800
committerYaowu Xu <yaowu@google.com>2011-12-02 14:43:33 -0800
commitacf5d20ce5811ff8b6eb561f09c5751b25539fb8 (patch)
tree4020b7c7722e58eec1f43f05d8dd1fc4dfb7c165 /vp8/encoder/ratectrl.c
parenta8fbab8697c77dc82013862e0a9c7f82b6402db8 (diff)
downloadlibvpx-acf5d20ce5811ff8b6eb561f09c5751b25539fb8.tar
libvpx-acf5d20ce5811ff8b6eb561f09c5751b25539fb8.tar.gz
libvpx-acf5d20ce5811ff8b6eb561f09c5751b25539fb8.tar.bz2
libvpx-acf5d20ce5811ff8b6eb561f09c5751b25539fb8.zip
added separate entropy context for alt_ref
This commit added code to keep track of separate entropy contexts for normal frames and alt ref frames. The underly assumption was that the two type of frames have different entropy characteristics given they typically have quite different quantization levels. By keeping entropy contexts separate, it helps the entropy context distribution to be more closely adapted to each frame type. Tests on derf set showed a good and very consistent gain on all clips on all metrics, avg psnr: 0.89%, overall psnr: 0.84% and ssim 0.93%. http://www.corp.google.com/~yaowu/no_crawl/mulcontext.html Change-Id: I15bc9697f6ff7829042911fe0c62930585d7e65d
Diffstat (limited to 'vp8/encoder/ratectrl.c')
-rw-r--r--vp8/encoder/ratectrl.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/vp8/encoder/ratectrl.c b/vp8/encoder/ratectrl.c
index 9a7907e65..de6ccaf0f 100644
--- a/vp8/encoder/ratectrl.c
+++ b/vp8/encoder/ratectrl.c
@@ -247,7 +247,22 @@ void vp8_setup_key_frame(VP8_COMP *cpi)
cpi->common.refresh_golden_frame = TRUE;
cpi->common.refresh_alt_ref_frame = TRUE;
+
+#if CONFIG_MULCONTEXT
+ 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));
+#endif
+
}
+#if CONFIG_MULCONTEXT
+void vp8_setup_inter_frame(VP8_COMP *cpi)
+{
+ if(cpi->common.refresh_alt_ref_frame)
+ vpx_memcpy(&cpi->common.fc, &cpi->common.lfc_a, sizeof(cpi->common.fc));
+ else
+ vpx_memcpy(&cpi->common.fc, &cpi->common.lfc, sizeof(cpi->common.fc));
+}
+#endif
static int estimate_bits_at_q(int frame_kind, int Q, int MBs,