ref: 50b20b90aabcae5a158fe4a622401c8d005cf24f
parent: a83e8ec00854c791930f5fbde8c9ac0ac4a45006
author: James Zern <[email protected]>
date: Wed Oct 7 13:45:45 EDT 2015
vp9/decode_tiles_mt: remove unnecessary local reuse the common loop index Change-Id: I9db45a93c219c2123917514cb8e9d4ea86454711
--- a/vp9/decoder/vp9_decodeframe.c
+++ b/vp9/decoder/vp9_decodeframe.c
@@ -1643,7 +1643,6 @@
if (pbi->num_tile_workers == 0) {
const int num_threads = pbi->max_threads;
- int i;
CHECK_MEM_ERROR(cm, pbi->tile_workers,
vpx_malloc(num_threads * sizeof(*pbi->tile_workers)));
// Ensure tile data offsets will be properly aligned. This may fail on
@@ -1652,12 +1651,12 @@
CHECK_MEM_ERROR(cm, pbi->tile_worker_data,
vpx_memalign(32, num_threads *
sizeof(*pbi->tile_worker_data)));
- for (i = 0; i < num_threads; ++i) {
- VPxWorker *const worker = &pbi->tile_workers[i];
+ for (n = 0; n < num_threads; ++n) {
+ VPxWorker *const worker = &pbi->tile_workers[n];
++pbi->num_tile_workers;
winterface->init(worker);
- if (i < num_threads - 1 && !winterface->reset(worker)) {
+ if (n < num_threads - 1 && !winterface->reset(worker)) {
vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
"Tile decoder thread creation failed");
}
@@ -1720,11 +1719,9 @@
// Initialize thread frame counts.
if (!cm->frame_parallel_decoding_mode) {
- int i;
-
- for (i = 0; i < num_workers; ++i) {
+ for (n = 0; n < num_workers; ++n) {
TileWorkerData *const tile_data =
- (TileWorkerData*)pbi->tile_workers[i].data1;
+ (TileWorkerData*)pbi->tile_workers[n].data1;
vp9_zero(tile_data->counts);
}
}
@@ -1767,10 +1764,9 @@
// Accumulate thread frame counts.
if (!cm->frame_parallel_decoding_mode) {
- int i;
- for (i = 0; i < num_workers; ++i) {
+ for (n = 0; n < num_workers; ++n) {
TileWorkerData *const tile_data =
- (TileWorkerData*)pbi->tile_workers[i].data1;
+ (TileWorkerData*)pbi->tile_workers[n].data1;
vp9_accumulate_frame_counts(&cm->counts, &tile_data->counts, 1);
}
}