shithub: libvpx

Download patch

ref: 64c0b3075e232921994dc0b05383a0afb2a63cf7
parent: c0504a9b2412967edb608afca07b717ac031b17f
author: John Koleszar <jkoleszar@google.com>
date: Tue May 7 06:09:57 EDT 2013

Use common setup_dst_planes function

Previous code assumed 4:2:0 subsampling.

Change-Id: Ie0814e45d099e84d0ded880b62e7bc98f85b7f0c

--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -370,15 +370,9 @@
   const int bw = 1 << mi_width_log2(bsize);
   VP9_COMMON *const cm = &pbi->common;
   MACROBLOCKD *const xd = &pbi->mb;
+  const int mi_idx = mi_row * cm->mode_info_stride + mi_col;
   int i;
 
-  const int mi_idx = mi_row * cm->mode_info_stride + mi_col;
-  const YV12_BUFFER_CONFIG *dst_fb = &cm->yv12_fb[cm->new_fb_idx];
-  const int recon_yoffset =
-      (MI_SIZE * mi_row) * dst_fb->y_stride + (MI_SIZE * mi_col);
-  const int recon_uvoffset =
-      (MI_UV_SIZE * mi_row) * dst_fb->uv_stride + (MI_UV_SIZE * mi_col);
-
   xd->mode_info_context = cm->mi + mi_idx;
   xd->mode_info_context->mbmi.sb_type = bsize;
   xd->prev_mode_info_context = cm->prev_mi + mi_idx;
@@ -396,9 +390,7 @@
   // as they are always compared to values that are in 1/8th pel units
   set_mi_row_col(cm, xd, mi_row, bh, mi_col, bw);
 
-  xd->plane[0].dst.buf = dst_fb->y_buffer + recon_yoffset;
-  xd->plane[1].dst.buf = dst_fb->u_buffer + recon_uvoffset;
-  xd->plane[2].dst.buf = dst_fb->v_buffer + recon_uvoffset;
+  setup_dst_planes(xd, &cm->yv12_fb[cm->new_fb_idx], mi_row, mi_col);
 }
 
 static void set_refs(VP9D_COMP *pbi, int mi_row, int mi_col) {