Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(569)

Side by Side Diff: source/libvpx/vp9/common/vp9_thread_common.c

Issue 1302353004: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 struct macroblockd_plane planes[MAX_MB_PLANE], 158 struct macroblockd_plane planes[MAX_MB_PLANE],
159 int start, int stop, int y_only, 159 int start, int stop, int y_only,
160 VPxWorker *workers, int nworkers, 160 VPxWorker *workers, int nworkers,
161 VP9LfSync *lf_sync) { 161 VP9LfSync *lf_sync) {
162 const VPxWorkerInterface *const winterface = vpx_get_worker_interface(); 162 const VPxWorkerInterface *const winterface = vpx_get_worker_interface();
163 // Number of superblock rows and cols 163 // Number of superblock rows and cols
164 const int sb_rows = mi_cols_aligned_to_sb(cm->mi_rows) >> MI_BLOCK_SIZE_LOG2; 164 const int sb_rows = mi_cols_aligned_to_sb(cm->mi_rows) >> MI_BLOCK_SIZE_LOG2;
165 // Decoder may allocate more threads than number of tiles based on user's 165 // Decoder may allocate more threads than number of tiles based on user's
166 // input. 166 // input.
167 const int tile_cols = 1 << cm->log2_tile_cols; 167 const int tile_cols = 1 << cm->log2_tile_cols;
168 const int num_workers = MIN(nworkers, tile_cols); 168 const int num_workers = VPXMIN(nworkers, tile_cols);
169 int i; 169 int i;
170 170
171 if (!lf_sync->sync_range || sb_rows != lf_sync->rows || 171 if (!lf_sync->sync_range || sb_rows != lf_sync->rows ||
172 num_workers > lf_sync->num_workers) { 172 num_workers > lf_sync->num_workers) {
173 vp9_loop_filter_dealloc(lf_sync); 173 vp9_loop_filter_dealloc(lf_sync);
174 vp9_loop_filter_alloc(lf_sync, cm, sb_rows, cm->width, num_workers); 174 vp9_loop_filter_alloc(lf_sync, cm, sb_rows, cm->width, num_workers);
175 } 175 }
176 176
177 // Initialize cur_sb_col to -1 for all SB rows. 177 // Initialize cur_sb_col to -1 for all SB rows.
178 memset(lf_sync->cur_sb_col, -1, sizeof(*lf_sync->cur_sb_col) * sb_rows); 178 memset(lf_sync->cur_sb_col, -1, sizeof(*lf_sync->cur_sb_col) * sb_rows);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 VP9LfSync *lf_sync) { 222 VP9LfSync *lf_sync) {
223 int start_mi_row, end_mi_row, mi_rows_to_filter; 223 int start_mi_row, end_mi_row, mi_rows_to_filter;
224 224
225 if (!frame_filter_level) return; 225 if (!frame_filter_level) return;
226 226
227 start_mi_row = 0; 227 start_mi_row = 0;
228 mi_rows_to_filter = cm->mi_rows; 228 mi_rows_to_filter = cm->mi_rows;
229 if (partial_frame && cm->mi_rows > 8) { 229 if (partial_frame && cm->mi_rows > 8) {
230 start_mi_row = cm->mi_rows >> 1; 230 start_mi_row = cm->mi_rows >> 1;
231 start_mi_row &= 0xfffffff8; 231 start_mi_row &= 0xfffffff8;
232 mi_rows_to_filter = MAX(cm->mi_rows / 8, 8); 232 mi_rows_to_filter = VPXMAX(cm->mi_rows / 8, 8);
233 } 233 }
234 end_mi_row = start_mi_row + mi_rows_to_filter; 234 end_mi_row = start_mi_row + mi_rows_to_filter;
235 vp9_loop_filter_frame_init(cm, frame_filter_level); 235 vp9_loop_filter_frame_init(cm, frame_filter_level);
236 236
237 loop_filter_rows_mt(frame, cm, planes, start_mi_row, end_mi_row, 237 loop_filter_rows_mt(frame, cm, planes, start_mi_row, end_mi_row,
238 y_only, workers, num_workers, lf_sync); 238 y_only, workers, num_workers, lf_sync);
239 } 239 }
240 240
241 // Set up nsync by width. 241 // Set up nsync by width.
242 static INLINE int get_sync_range(int width) { 242 static INLINE int get_sync_range(int width) {
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 } 427 }
428 428
429 for (i = 0; i < MV_OFFSET_BITS; i++) 429 for (i = 0; i < MV_OFFSET_BITS; i++)
430 for (j = 0; j < 2; j++) 430 for (j = 0; j < 2; j++)
431 comps->bits[i][j] += comps_t->bits[i][j]; 431 comps->bits[i][j] += comps_t->bits[i][j];
432 432
433 for (i = 0; i < MV_FP_SIZE; i++) 433 for (i = 0; i < MV_FP_SIZE; i++)
434 comps->fp[i] += comps_t->fp[i]; 434 comps->fp[i] += comps_t->fp[i];
435 } 435 }
436 } 436 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/common/vp9_systemdependent.h ('k') | source/libvpx/vp9/common/vp9_tile_common.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698