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