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 VP10_COMMON_LOOPFILTER_THREAD_H_
12 #define VP10_COMMON_LOOPFILTER_THREAD_H_
13 #include "./vpx_config.h"
14 #include "vp10/common/loopfilter.h"
15 #include "vpx_util/vpx_thread.h"
24 // Loopfilter row synchronization
25 typedef struct VP9LfSyncData {
26 #if CONFIG_MULTITHREAD
27 pthread_mutex_t *mutex_;
28 pthread_cond_t *cond_;
30 // Allocate memory to store the loop-filtered superblock index in each row.
32 // The optimal sync_range for different resolution and platform should be
33 // determined by testing. Currently, it is chosen to be a power-of-2 number.
37 // Row-based parallel loopfilter data
42 // Allocate memory for loopfilter row synchronization.
43 void vp10_loop_filter_alloc(VP9LfSync *lf_sync, struct VP10Common *cm, int rows,
44 int width, int num_workers);
46 // Deallocate loopfilter synchronization related mutex and data.
47 void vp10_loop_filter_dealloc(VP9LfSync *lf_sync);
49 // Multi-threaded loopfilter that uses the tile threads.
50 void vp10_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame,
51 struct VP10Common *cm,
52 struct macroblockd_plane planes[MAX_MB_PLANE],
53 int frame_filter_level,
54 int y_only, int partial_frame,
55 VPxWorker *workers, int num_workers,
58 void vp10_accumulate_frame_counts(struct VP10Common *cm,
59 struct FRAME_COUNTS *counts, int is_dec);
65 #endif // VP10_COMMON_LOOPFILTER_THREAD_H_