OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 234 |
235 pbi->ready_for_new_data = 0; | 235 pbi->ready_for_new_data = 0; |
236 | 236 |
237 // Check if the previous frame was a frame without any references to it. | 237 // Check if the previous frame was a frame without any references to it. |
238 if (cm->new_fb_idx >= 0 && cm->frame_bufs[cm->new_fb_idx].ref_count == 0) | 238 if (cm->new_fb_idx >= 0 && cm->frame_bufs[cm->new_fb_idx].ref_count == 0) |
239 cm->release_fb_cb(cm->cb_priv, | 239 cm->release_fb_cb(cm->cb_priv, |
240 &cm->frame_bufs[cm->new_fb_idx].raw_frame_buffer); | 240 &cm->frame_bufs[cm->new_fb_idx].raw_frame_buffer); |
241 cm->new_fb_idx = get_free_fb(cm); | 241 cm->new_fb_idx = get_free_fb(cm); |
242 | 242 |
243 if (setjmp(cm->error.jmp)) { | 243 if (setjmp(cm->error.jmp)) { |
| 244 const VP9WorkerInterface *const winterface = vp9_get_worker_interface(); |
| 245 int i; |
| 246 |
244 pbi->need_resync = 1; | 247 pbi->need_resync = 1; |
245 cm->error.setjmp = 0; | 248 cm->error.setjmp = 0; |
| 249 |
| 250 // Synchronize all threads immediately as a subsequent decode call may |
| 251 // cause a resize invalidating some allocations. |
| 252 winterface->sync(&pbi->lf_worker); |
| 253 for (i = 0; i < pbi->num_tile_workers; ++i) { |
| 254 winterface->sync(&pbi->tile_workers[i]); |
| 255 } |
| 256 |
246 vp9_clear_system_state(); | 257 vp9_clear_system_state(); |
247 | 258 |
248 // We do not know if the missing frame(s) was supposed to update | 259 // We do not know if the missing frame(s) was supposed to update |
249 // any of the reference buffers, but we act conservative and | 260 // any of the reference buffers, but we act conservative and |
250 // mark only the last buffer as corrupted. | 261 // mark only the last buffer as corrupted. |
251 // | 262 // |
252 // TODO(jkoleszar): Error concealment is undefined and non-normative | 263 // TODO(jkoleszar): Error concealment is undefined and non-normative |
253 // at this point, but if it becomes so, [0] may not always be the correct | 264 // at this point, but if it becomes so, [0] may not always be the correct |
254 // thing to do here. | 265 // thing to do here. |
255 if (cm->frame_refs[0].idx != INT_MAX && cm->frame_refs[0].buf != NULL) | 266 if (cm->frame_refs[0].idx != INT_MAX && cm->frame_refs[0].buf != NULL) |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 | 384 |
374 for (j = 0; j < mag; ++j) | 385 for (j = 0; j < mag; ++j) |
375 this_sz |= (*x++) << (j * 8); | 386 this_sz |= (*x++) << (j * 8); |
376 sizes[i] = this_sz; | 387 sizes[i] = this_sz; |
377 } | 388 } |
378 *count = frames; | 389 *count = frames; |
379 } | 390 } |
380 } | 391 } |
381 return VPX_CODEC_OK; | 392 return VPX_CODEC_OK; |
382 } | 393 } |
OLD | NEW |