From 5d4cffb35f4bc23462eedc95a4802c65e32d7d5a Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Mon, 20 Aug 2012 14:43:34 -0700 Subject: Superblock coding. This commit adds a pick_sb_mode() function which selects the best 32x32 superblock coding mode. Then it selects the best per-MB modes, compares the two and encodes that in the bitstream. The bitstream coding is rather simplistic right now. At the SB level, we code a bit to indicate whether this block uses SB-coding (32x32 prediction) or MB-coding (anything else), and then we follow with the actual modes. This could and should be modified in the future, but is omitted from this commit because it will likely involve reorganizing much more code rather than just adding SB coding, so it's better to let that be judged on its own merits. Gains on derf: about even, YT/HD: +0.75%, STD/HD: +1.5%. Change-Id: Iae313a7cbd8f75b3c66d04a68b991cb096eaaba6 --- vp8/encoder/encodemb.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'vp8/encoder/encodemb.c') diff --git a/vp8/encoder/encodemb.c b/vp8/encoder/encodemb.c index e03b47e2c..473f8ba3d 100644 --- a/vp8/encoder/encodemb.c +++ b/vp8/encoder/encodemb.c @@ -67,11 +67,10 @@ void vp8_subtract_4b_c(BLOCK *be, BLOCKD *bd, int pitch) { } } -void vp8_subtract_mbuv_c(short *diff, unsigned char *usrc, unsigned char *vsrc, unsigned char *pred, int stride) { +void vp8_subtract_mbuv_s_c(short *diff, unsigned char *usrc, unsigned char *vsrc, int src_stride, + unsigned char *upred, unsigned char *vpred, int dst_stride) { short *udiff = diff + 256; short *vdiff = diff + 320; - unsigned char *upred = pred + 256; - unsigned char *vpred = pred + 320; int r, c; @@ -81,8 +80,8 @@ void vp8_subtract_mbuv_c(short *diff, unsigned char *usrc, unsigned char *vsrc, } udiff += 8; - upred += 8; - usrc += stride; + upred += dst_stride; + usrc += src_stride; } for (r = 0; r < 8; r++) { @@ -91,12 +90,19 @@ void vp8_subtract_mbuv_c(short *diff, unsigned char *usrc, unsigned char *vsrc, } vdiff += 8; - vpred += 8; - vsrc += stride; + vpred += dst_stride; + vsrc += src_stride; } } -void vp8_subtract_mby_c(short *diff, unsigned char *src, unsigned char *pred, int stride) { +void vp8_subtract_mbuv_c(short *diff, unsigned char *usrc, unsigned char *vsrc, unsigned char *pred, int stride) { + unsigned char *upred = pred + 256; + unsigned char *vpred = pred + 320; + + vp8_subtract_mbuv_s_c(diff, usrc, vsrc, stride, upred, vpred, 8); +} + +void vp8_subtract_mby_s_c(short *diff, unsigned char *src, int src_stride, unsigned char *pred, int dst_stride) { int r, c; for (r = 0; r < 16; r++) { @@ -105,11 +111,16 @@ void vp8_subtract_mby_c(short *diff, unsigned char *src, unsigned char *pred, in } diff += 16; - pred += 16; - src += stride; + pred += dst_stride; + src += src_stride; } } +void vp8_subtract_mby_c(short *diff, unsigned char *src, unsigned char *pred, int stride) +{ + vp8_subtract_mby_s_c(diff, src, stride, pred, 16); +} + static void vp8_subtract_mb(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) { BLOCK *b = &x->block[0]; -- cgit v1.2.3