OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The VP8 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 |
11 | 11 |
12 #include "onyxc_int.h" | 12 #include "onyxc_int.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 135 } |
136 | 136 |
137 | 137 |
138 void vp8dx_remove_decompressor(VP8D_PTR ptr) | 138 void vp8dx_remove_decompressor(VP8D_PTR ptr) |
139 { | 139 { |
140 VP8D_COMP *pbi = (VP8D_COMP *) ptr; | 140 VP8D_COMP *pbi = (VP8D_COMP *) ptr; |
141 | 141 |
142 if (!pbi) | 142 if (!pbi) |
143 return; | 143 return; |
144 | 144 |
| 145 #if CONFIG_MULTITHREAD |
| 146 if (pbi->b_multithreaded_rd) |
| 147 vp8mt_de_alloc_temp_buffers(pbi, pbi->common.mb_rows); |
| 148 #endif |
145 vp8_decoder_remove_threads(pbi); | 149 vp8_decoder_remove_threads(pbi); |
146 vp8_remove_common(&pbi->common); | 150 vp8_remove_common(&pbi->common); |
147 vpx_free(pbi); | 151 vpx_free(pbi); |
148 } | 152 } |
149 | 153 |
150 | 154 |
151 void vp8dx_set_setting(VP8D_PTR comp, VP8D_SETTING oxst, int x) | 155 void vp8dx_set_setting(VP8D_PTR comp, VP8D_SETTING oxst, int x) |
152 { | 156 { |
153 VP8D_COMP *pbi = (VP8D_COMP *) comp; | 157 VP8D_COMP *pbi = (VP8D_COMP *) comp; |
154 | 158 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 if (retcode < 0) | 352 if (retcode < 0) |
349 { | 353 { |
350 #if HAVE_ARMV7 | 354 #if HAVE_ARMV7 |
351 vp8_pop_neon(dx_store_reg); | 355 vp8_pop_neon(dx_store_reg); |
352 #endif | 356 #endif |
353 pbi->common.error.error_code = VPX_CODEC_ERROR; | 357 pbi->common.error.error_code = VPX_CODEC_ERROR; |
354 pbi->common.error.setjmp = 0; | 358 pbi->common.error.setjmp = 0; |
355 return retcode; | 359 return retcode; |
356 } | 360 } |
357 | 361 |
358 if (pbi->b_multithreaded_lf && pbi->common.filter_level != 0) | 362 if (pbi->b_multithreaded_rd && cm->multi_token_partition != ONE_PARTITION) |
359 vp8_stop_lfthread(pbi); | 363 { |
| 364 if (swap_frame_buffers (cm)) |
| 365 { |
| 366 pbi->common.error.error_code = VPX_CODEC_ERROR; |
| 367 pbi->common.error.setjmp = 0; |
| 368 return -1; |
| 369 } |
| 370 } else |
| 371 { |
| 372 if (swap_frame_buffers (cm)) |
| 373 { |
| 374 pbi->common.error.error_code = VPX_CODEC_ERROR; |
| 375 pbi->common.error.setjmp = 0; |
| 376 return -1; |
| 377 } |
360 | 378 |
361 if (swap_frame_buffers (cm)) | 379 if(pbi->common.filter_level) |
362 { | 380 { |
363 pbi->common.error.error_code = VPX_CODEC_ERROR; | 381 struct vpx_usec_timer lpftimer; |
364 pbi->common.error.setjmp = 0; | 382 vpx_usec_timer_start(&lpftimer); |
365 return -1; | 383 // Apply the loop filter if appropriate. |
366 } | |
367 | 384 |
368 /* | |
369 if (!pbi->b_multithreaded_lf) | |
370 { | |
371 struct vpx_usec_timer lpftimer; | |
372 vpx_usec_timer_start(&lpftimer); | |
373 // Apply the loop filter if appropriate. | |
374 | |
375 if (cm->filter_level > 0) | |
376 vp8_loop_filter_frame(cm, &pbi->mb, cm->filter_level); | 385 vp8_loop_filter_frame(cm, &pbi->mb, cm->filter_level); |
377 | 386 |
378 vpx_usec_timer_mark(&lpftimer); | 387 vpx_usec_timer_mark(&lpftimer); |
379 pbi->time_loop_filtering += vpx_usec_timer_elapsed(&lpftimer); | 388 pbi->time_loop_filtering += vpx_usec_timer_elapsed(&lpftimer); |
380 }else{ | |
381 struct vpx_usec_timer lpftimer; | |
382 vpx_usec_timer_start(&lpftimer); | |
383 // Apply the loop filter if appropriate. | |
384 | 389 |
385 if (cm->filter_level > 0) | 390 cm->last_frame_type = cm->frame_type; |
386 vp8_mt_loop_filter_frame(cm, &pbi->mb, cm->filter_level); | 391 cm->last_filter_type = cm->filter_type; |
387 | 392 cm->last_sharpness_level = cm->sharpness_level; |
388 vpx_usec_timer_mark(&lpftimer); | 393 } |
389 pbi->time_loop_filtering += vpx_usec_timer_elapsed(&lpftimer); | 394 vp8_yv12_extend_frame_borders_ptr(cm->frame_to_show); |
390 } | 395 } |
391 if (cm->filter_level > 0) { | |
392 cm->last_frame_type = cm->frame_type; | |
393 cm->last_filter_type = cm->filter_type; | |
394 cm->last_sharpness_level = cm->sharpness_level; | |
395 } | |
396 */ | |
397 | |
398 if(pbi->common.filter_level) | |
399 { | |
400 struct vpx_usec_timer lpftimer; | |
401 vpx_usec_timer_start(&lpftimer); | |
402 // Apply the loop filter if appropriate. | |
403 | |
404 if (pbi->b_multithreaded_lf && cm->multi_token_partition != ONE_PARTITIO
N) | |
405 vp8_mt_loop_filter_frame(pbi); //cm, &pbi->mb, cm->filter_level); | |
406 else | |
407 vp8_loop_filter_frame(cm, &pbi->mb, cm->filter_level); | |
408 | |
409 vpx_usec_timer_mark(&lpftimer); | |
410 pbi->time_loop_filtering += vpx_usec_timer_elapsed(&lpftimer); | |
411 | |
412 cm->last_frame_type = cm->frame_type; | |
413 cm->last_filter_type = cm->filter_type; | |
414 cm->last_sharpness_level = cm->sharpness_level; | |
415 } | |
416 | |
417 vp8_yv12_extend_frame_borders_ptr(cm->frame_to_show); | |
418 | 396 |
419 #if 0 | 397 #if 0 |
420 // DEBUG code | 398 // DEBUG code |
421 //vp8_recon_write_yuv_frame("recon.yuv", cm->frame_to_show); | 399 //vp8_recon_write_yuv_frame("recon.yuv", cm->frame_to_show); |
422 if (cm->current_video_frame <= 5) | 400 if (cm->current_video_frame <= 5) |
423 write_dx_frame_to_file(cm->frame_to_show, cm->current_video_frame); | 401 write_dx_frame_to_file(cm->frame_to_show, cm->current_video_frame); |
424 #endif | 402 #endif |
425 | 403 |
426 vp8_clear_system_state(); | 404 vp8_clear_system_state(); |
427 | 405 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 } | 487 } |
510 else | 488 else |
511 { | 489 { |
512 ret = -1; | 490 ret = -1; |
513 } | 491 } |
514 | 492 |
515 #endif //!CONFIG_POSTPROC | 493 #endif //!CONFIG_POSTPROC |
516 vp8_clear_system_state(); | 494 vp8_clear_system_state(); |
517 return ret; | 495 return ret; |
518 } | 496 } |
OLD | NEW |