2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
11 #ifndef VP9_DECODER_VP9_DTHREAD_H_
12 #define VP9_DECODER_VP9_DTHREAD_H_
14 #include "./vpx_config.h"
15 #include "vp9/decoder/vp9_reader.h"
16 #include "vp9/decoder/vp9_thread.h"
21 typedef struct TileWorkerData {
23 vp9_reader bit_reader;
24 DECLARE_ALIGNED(16, struct macroblockd, xd);
26 // Row-based parallel loopfilter data
30 // Loopfilter row synchronization
31 typedef struct VP9LfSyncData {
32 #if CONFIG_MULTITHREAD
33 pthread_mutex_t *mutex_;
34 pthread_cond_t *cond_;
36 // Allocate memory to store the loop-filtered superblock index in each row.
38 // 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.
43 // Allocate memory for loopfilter row synchronization.
44 void vp9_loop_filter_alloc(struct VP9Common *cm, VP9LfSync *lf_sync,
47 // Deallocate loopfilter synchronization related mutex and data.
48 void vp9_loop_filter_dealloc(VP9LfSync *lf_sync, int rows);
50 // Multi-threaded loopfilter that uses the tile threads.
51 void vp9_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame,
52 struct VP9Decoder *pbi,
54 int frame_filter_level,
57 #endif // VP9_DECODER_VP9_DTHREAD_H_