OLD | NEW |
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 |
11 #ifndef VP9_DECODER_VP9_DTHREAD_H_ | 11 #ifndef VP9_COMMON_VP9_LOOPFILTER_THREAD_H_ |
12 #define VP9_DECODER_VP9_DTHREAD_H_ | 12 #define VP9_COMMON_VP9_LOOPFILTER_THREAD_H_ |
13 | |
14 #include "./vpx_config.h" | 13 #include "./vpx_config.h" |
| 14 #include "vp9/common/vp9_loopfilter.h" |
15 #include "vp9/common/vp9_thread.h" | 15 #include "vp9/common/vp9_thread.h" |
16 #include "vp9/decoder/vp9_reader.h" | |
17 #include "vpx/internal/vpx_codec_internal.h" | |
18 | 16 |
19 struct VP9Common; | 17 struct VP9Common; |
20 struct VP9Decoder; | |
21 | |
22 typedef struct TileWorkerData { | |
23 struct VP9Common *cm; | |
24 vp9_reader bit_reader; | |
25 DECLARE_ALIGNED(16, struct macroblockd, xd); | |
26 struct vpx_internal_error_info error_info; | |
27 } TileWorkerData; | |
28 | 18 |
29 // Loopfilter row synchronization | 19 // Loopfilter row synchronization |
30 typedef struct VP9LfSyncData { | 20 typedef struct VP9LfSyncData { |
31 #if CONFIG_MULTITHREAD | 21 #if CONFIG_MULTITHREAD |
32 pthread_mutex_t *mutex_; | 22 pthread_mutex_t *mutex_; |
33 pthread_cond_t *cond_; | 23 pthread_cond_t *cond_; |
34 #endif | 24 #endif |
35 // Allocate memory to store the loop-filtered superblock index in each row. | 25 // Allocate memory to store the loop-filtered superblock index in each row. |
36 int *cur_sb_col; | 26 int *cur_sb_col; |
37 // The optimal sync_range for different resolution and platform should be | 27 // The optimal sync_range for different resolution and platform should be |
38 // determined by testing. Currently, it is chosen to be a power-of-2 number. | 28 // determined by testing. Currently, it is chosen to be a power-of-2 number. |
39 int sync_range; | 29 int sync_range; |
40 int rows; | 30 int rows; |
41 | 31 |
42 // Row-based parallel loopfilter data | 32 // Row-based parallel loopfilter data |
43 LFWorkerData *lfdata; | 33 LFWorkerData *lfdata; |
44 int num_workers; | 34 int num_workers; |
45 } VP9LfSync; | 35 } VP9LfSync; |
46 | 36 |
47 // Allocate memory for loopfilter row synchronization. | 37 // Allocate memory for loopfilter row synchronization. |
48 void vp9_loop_filter_alloc(VP9LfSync *lf_sync, VP9_COMMON *cm, int rows, | 38 void vp9_loop_filter_alloc(VP9LfSync *lf_sync, struct VP9Common *cm, int rows, |
49 int width, int num_workers); | 39 int width, int num_workers); |
50 | 40 |
51 // Deallocate loopfilter synchronization related mutex and data. | 41 // Deallocate loopfilter synchronization related mutex and data. |
52 void vp9_loop_filter_dealloc(VP9LfSync *lf_sync); | 42 void vp9_loop_filter_dealloc(VP9LfSync *lf_sync); |
53 | 43 |
54 // Multi-threaded loopfilter that uses the tile threads. | 44 // Multi-threaded loopfilter that uses the tile threads. |
55 void vp9_loop_filter_frame_mt(VP9LfSync *lf_sync, | 45 void vp9_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame, |
56 YV12_BUFFER_CONFIG *frame, | 46 struct VP9Common *cm, |
57 struct macroblockd_plane planes[MAX_MB_PLANE], | 47 struct macroblockd_plane planes[MAX_MB_PLANE], |
58 struct VP9Common *cm, | 48 int frame_filter_level, |
| 49 int y_only, int partial_frame, |
59 VP9Worker *workers, int num_workers, | 50 VP9Worker *workers, int num_workers, |
60 int frame_filter_level, | 51 VP9LfSync *lf_sync); |
61 int y_only); | |
62 | 52 |
63 #endif // VP9_DECODER_VP9_DTHREAD_H_ | 53 #endif // VP9_COMMON_VP9_LOOPFILTER_THREAD_H_ |
OLD | NEW |