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