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 19 matching lines...) Expand all Loading... |
30 #include "vp9/decoder/vp9_decodeframe.h" | 30 #include "vp9/decoder/vp9_decodeframe.h" |
31 #include "vp9/decoder/vp9_decoder.h" | 31 #include "vp9/decoder/vp9_decoder.h" |
32 #include "vp9/decoder/vp9_detokenize.h" | 32 #include "vp9/decoder/vp9_detokenize.h" |
33 #include "vp9/decoder/vp9_dthread.h" | 33 #include "vp9/decoder/vp9_dthread.h" |
34 | 34 |
35 static void initialize_dec() { | 35 static void initialize_dec() { |
36 static int init_done = 0; | 36 static int init_done = 0; |
37 | 37 |
38 if (!init_done) { | 38 if (!init_done) { |
39 vp9_init_neighbors(); | 39 vp9_init_neighbors(); |
40 vp9_init_quant_tables(); | |
41 init_done = 1; | 40 init_done = 1; |
42 } | 41 } |
43 } | 42 } |
44 | 43 |
45 VP9Decoder *vp9_decoder_create() { | 44 VP9Decoder *vp9_decoder_create() { |
46 VP9Decoder *const pbi = vpx_memalign(32, sizeof(*pbi)); | 45 VP9Decoder *const pbi = vpx_memalign(32, sizeof(*pbi)); |
47 VP9_COMMON *const cm = pbi ? &pbi->common : NULL; | 46 VP9_COMMON *const cm = pbi ? &pbi->common : NULL; |
48 | 47 |
49 if (!cm) | 48 if (!cm) |
50 return NULL; | 49 return NULL; |
(...skipping 19 matching lines...) Expand all Loading... |
70 | 69 |
71 // vp9_init_dequantizer() is first called here. Add check in | 70 // vp9_init_dequantizer() is first called here. Add check in |
72 // frame_init_dequantizer() to avoid unnecessary calling of | 71 // frame_init_dequantizer() to avoid unnecessary calling of |
73 // vp9_init_dequantizer() for every frame. | 72 // vp9_init_dequantizer() for every frame. |
74 vp9_init_dequantizer(cm); | 73 vp9_init_dequantizer(cm); |
75 | 74 |
76 vp9_loop_filter_init(cm); | 75 vp9_loop_filter_init(cm); |
77 | 76 |
78 cm->error.setjmp = 0; | 77 cm->error.setjmp = 0; |
79 | 78 |
80 vp9_worker_init(&pbi->lf_worker); | 79 vp9_get_worker_interface()->init(&pbi->lf_worker); |
81 | 80 |
82 return pbi; | 81 return pbi; |
83 } | 82 } |
84 | 83 |
85 void vp9_decoder_remove(VP9Decoder *pbi) { | 84 void vp9_decoder_remove(VP9Decoder *pbi) { |
86 VP9_COMMON *const cm = &pbi->common; | 85 VP9_COMMON *const cm = &pbi->common; |
87 int i; | 86 int i; |
88 | 87 |
89 vp9_remove_common(cm); | 88 vp9_remove_common(cm); |
90 vp9_worker_end(&pbi->lf_worker); | 89 vp9_get_worker_interface()->end(&pbi->lf_worker); |
91 vpx_free(pbi->lf_worker.data1); | 90 vpx_free(pbi->lf_worker.data1); |
92 vpx_free(pbi->tile_data); | 91 vpx_free(pbi->tile_data); |
93 for (i = 0; i < pbi->num_tile_workers; ++i) { | 92 for (i = 0; i < pbi->num_tile_workers; ++i) { |
94 VP9Worker *const worker = &pbi->tile_workers[i]; | 93 VP9Worker *const worker = &pbi->tile_workers[i]; |
95 vp9_worker_end(worker); | 94 vp9_get_worker_interface()->end(worker); |
96 vpx_free(worker->data1); | 95 vpx_free(worker->data1); |
97 vpx_free(worker->data2); | 96 vpx_free(worker->data2); |
98 } | 97 } |
99 vpx_free(pbi->tile_workers); | 98 vpx_free(pbi->tile_workers); |
100 | 99 |
101 if (pbi->num_tile_workers) { | 100 if (pbi->num_tile_workers) { |
102 const int sb_rows = | 101 const int sb_rows = |
103 mi_cols_aligned_to_sb(cm->mi_rows) >> MI_BLOCK_SIZE_LOG2; | 102 mi_cols_aligned_to_sb(cm->mi_rows) >> MI_BLOCK_SIZE_LOG2; |
104 vp9_loop_filter_dealloc(&pbi->lf_row_sync, sb_rows); | 103 vp9_loop_filter_dealloc(&pbi->lf_row_sync, sb_rows); |
105 } | 104 } |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 | 307 |
309 #if CONFIG_VP9_POSTPROC | 308 #if CONFIG_VP9_POSTPROC |
310 ret = vp9_post_proc_frame(&pbi->common, sd, flags); | 309 ret = vp9_post_proc_frame(&pbi->common, sd, flags); |
311 #else | 310 #else |
312 *sd = *pbi->common.frame_to_show; | 311 *sd = *pbi->common.frame_to_show; |
313 ret = 0; | 312 ret = 0; |
314 #endif /*!CONFIG_POSTPROC*/ | 313 #endif /*!CONFIG_POSTPROC*/ |
315 vp9_clear_system_state(); | 314 vp9_clear_system_state(); |
316 return ret; | 315 return ret; |
317 } | 316 } |
OLD | NEW |