summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_rdopt.c
diff options
context:
space:
mode:
authorJingning Han <jingning@google.com>2014-10-06 15:53:27 -0700
committerJingning Han <jingning@google.com>2014-10-06 15:57:13 -0700
commita75551585b0fb1ea8705e7e5c53433cfffabbab6 (patch)
treeab5464fd442cab51a4ea04b6f3361099b75496ca /vp9/encoder/vp9_rdopt.c
parent12344f26975c7ecd9ce2e1c75aa98dd068711ed7 (diff)
downloadlibvpx-a75551585b0fb1ea8705e7e5c53433cfffabbab6.tar
libvpx-a75551585b0fb1ea8705e7e5c53433cfffabbab6.tar.gz
libvpx-a75551585b0fb1ea8705e7e5c53433cfffabbab6.tar.bz2
libvpx-a75551585b0fb1ea8705e7e5c53433cfffabbab6.zip
Fix eobs buffer pointer mis-use
This commit fixes a buffer pointer mis-use in store_coding_context. The compression performance for stdhd set of speed 3 is improved by 0.097%. It fixes issue 869. Change-Id: Idc59e22035eaf39f7133ca04174894374d647ff7
Diffstat (limited to 'vp9/encoder/vp9_rdopt.c')
-rw-r--r--vp9/encoder/vp9_rdopt.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 20a4b7082..f793269ee 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -1953,9 +1953,19 @@ static void store_coding_context(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx,
int plane, has_high_freq_coeff = 0;
BLOCK_SIZE bsize = xd->mi[0].src_mi->mbmi.sb_type;
- if (bsize >= BLOCK_8X8)
- for (plane = 0; plane < MAX_MB_PLANE; ++plane)
+ if (bsize >= BLOCK_8X8) {
+ int max_plane = is_inter_block(&xd->mi[0].src_mi->mbmi)
+ ? MAX_MB_PLANE : 1;
+ for (plane = 0; plane < max_plane; ++plane) {
+ x->plane[plane].eobs = ctx->eobs_pbuf[plane][1];
+ has_high_freq_coeff |= vp9_has_high_freq_in_plane(x, bsize, plane);
+ }
+
+ for (plane = max_plane; plane < MAX_MB_PLANE; ++plane) {
+ x->plane[plane].eobs = ctx->eobs_pbuf[plane][2];
has_high_freq_coeff |= vp9_has_high_freq_in_plane(x, bsize, plane);
+ }
+ }
// Take a snapshot of the coding context so it can be
// restored if we decide to encode this way