From: Yunqing Wang Date: Fri, 16 Jan 2015 23:47:25 +0000 (-0800) Subject: Add non420 code in multi-threaded loopfilter X-Git-Tag: v1.4.0~238^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d7b7abf5215ab94c835180d1c90a2365fdbcaf9;p=platform%2Fupstream%2Flibvpx.git Add non420 code in multi-threaded loopfilter Added non420 part back to make it consistent with single thread code in vp9_loopfilter.c. Change-Id: I8ca255d73bffebae294d2627d6655eafe535cb90 --- diff --git a/vp9/common/vp9_loopfilter_thread.c b/vp9/common/vp9_loopfilter_thread.c index bd29ee0..2d47dae 100644 --- a/vp9/common/vp9_loopfilter_thread.c +++ b/vp9/common/vp9_loopfilter_thread.c @@ -91,6 +91,8 @@ void thread_loop_filter_rows(const YV12_BUFFER_CONFIG *const frame_buffer, int start, int stop, int y_only, VP9LfSync *const lf_sync) { const int num_planes = y_only ? 1 : MAX_MB_PLANE; + const int use_420 = y_only || (planes[1].subsampling_y == 1 && + planes[1].subsampling_x == 1); const int sb_cols = mi_cols_aligned_to_sb(cm->mi_cols) >> MI_BLOCK_SIZE_LOG2; int mi_row, mi_col; @@ -107,10 +109,18 @@ void thread_loop_filter_rows(const YV12_BUFFER_CONFIG *const frame_buffer, sync_read(lf_sync, r, c); vp9_setup_dst_planes(planes, frame_buffer, mi_row, mi_col); - vp9_setup_mask(cm, mi_row, mi_col, mi + mi_col, cm->mi_stride, &lfm); + + // TODO(JBB): Make setup_mask work for non 420. + if (use_420) + vp9_setup_mask(cm, mi_row, mi_col, mi + mi_col, cm->mi_stride, + &lfm); for (plane = 0; plane < num_planes; ++plane) { - vp9_filter_block_plane(cm, &planes[plane], mi_row, &lfm); + if (use_420) + vp9_filter_block_plane(cm, &planes[plane], mi_row, &lfm); + else + vp9_filter_block_plane_non420(cm, &planes[plane], mi + mi_col, + mi_row, mi_col); } sync_write(lf_sync, r, c, sb_cols);