Correct guard macros in header files
[aom.git] / vp10 / decoder / dthread.h
blobf08389655b3e6cc3fcf17000324c9e3a73b67571
1 /*
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.
9 */
11 #ifndef VP10_DECODER_DTHREAD_H_
12 #define VP10_DECODER_DTHREAD_H_
14 #include "./vpx_config.h"
15 #include "vpx_util/vpx_thread.h"
16 #include "vpx/internal/vpx_codec_internal.h"
18 struct VP9Common;
19 struct VP9Decoder;
21 // WorkerData for the FrameWorker thread. It contains all the information of
22 // the worker and decode structures for decoding a frame.
23 typedef struct FrameWorkerData {
24 struct VP9Decoder *pbi;
25 const uint8_t *data;
26 const uint8_t *data_end;
27 size_t data_size;
28 void *user_priv;
29 int result;
30 int worker_id;
31 int received_frame;
33 // scratch_buffer is used in frame parallel mode only.
34 // It is used to make a copy of the compressed data.
35 uint8_t *scratch_buffer;
36 size_t scratch_buffer_size;
38 #if CONFIG_MULTITHREAD
39 pthread_mutex_t stats_mutex;
40 pthread_cond_t stats_cond;
41 #endif
43 int frame_context_ready; // Current frame's context is ready to read.
44 int frame_decoded; // Finished decoding current frame.
45 } FrameWorkerData;
47 void vp10_frameworker_lock_stats(VPxWorker *const worker);
48 void vp10_frameworker_unlock_stats(VPxWorker *const worker);
49 void vp10_frameworker_signal_stats(VPxWorker *const worker);
51 // Wait until ref_buf has been decoded to row in real pixel unit.
52 // Note: worker may already finish decoding ref_buf and release it in order to
53 // start decoding next frame. So need to check whether worker is still decoding
54 // ref_buf.
55 void vp10_frameworker_wait(VPxWorker *const worker, RefCntBuffer *const ref_buf,
56 int row);
58 // FrameWorker broadcasts its decoding progress so other workers that are
59 // waiting on it can resume decoding.
60 void vp10_frameworker_broadcast(RefCntBuffer *const buf, int row);
62 // Copy necessary decoding context from src worker to dst worker.
63 void vp10_frameworker_copy_context(VPxWorker *const dst_worker,
64 VPxWorker *const src_worker);
66 #endif // VP10_DECODER_DTHREAD_H_