Add aom_paeth_predictor_16x64 ssse3,avx2
[aom.git] / av1 / decoder / dthread.h
blobc17053d9c2f929b8aeef6a1f4f20b920101a28a4
1 /*
2 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
4 * This source code is subject to the terms of the BSD 2 Clause License and
5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6 * was not distributed with this source code in the LICENSE file, you can
7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8 * Media Patent License 1.0 was not distributed with this source code in the
9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
12 #ifndef AV1_DECODER_DTHREAD_H_
13 #define AV1_DECODER_DTHREAD_H_
15 #include "./aom_config.h"
16 #include "aom_util/aom_thread.h"
17 #include "aom/internal/aom_codec_internal.h"
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
23 struct AV1Common;
24 struct AV1Decoder;
26 // WorkerData for the FrameWorker thread. It contains all the information of
27 // the worker and decode structures for decoding a frame.
28 typedef struct FrameWorkerData {
29 struct AV1Decoder *pbi;
30 const uint8_t *data;
31 const uint8_t *data_end;
32 size_t data_size;
33 void *user_priv;
34 int result;
35 int worker_id;
36 int received_frame;
38 // scratch_buffer is used in frame parallel mode only.
39 // It is used to make a copy of the compressed data.
40 uint8_t *scratch_buffer;
41 size_t scratch_buffer_size;
43 #if CONFIG_MULTITHREAD
44 pthread_mutex_t stats_mutex;
45 pthread_cond_t stats_cond;
46 #endif
48 int frame_context_ready; // Current frame's context is ready to read.
49 int frame_decoded; // Finished decoding current frame.
50 } FrameWorkerData;
52 void av1_frameworker_lock_stats(AVxWorker *const worker);
53 void av1_frameworker_unlock_stats(AVxWorker *const worker);
54 void av1_frameworker_signal_stats(AVxWorker *const worker);
56 // Wait until ref_buf has been decoded to row in real pixel unit.
57 // Note: worker may already finish decoding ref_buf and release it in order to
58 // start decoding next frame. So need to check whether worker is still decoding
59 // ref_buf.
60 void av1_frameworker_wait(AVxWorker *const worker, RefCntBuffer *const ref_buf,
61 int row);
63 // FrameWorker broadcasts its decoding progress so other workers that are
64 // waiting on it can resume decoding.
65 void av1_frameworker_broadcast(RefCntBuffer *const buf, int row);
67 // Copy necessary decoding context from src worker to dst worker.
68 void av1_frameworker_copy_context(AVxWorker *const dst_worker,
69 AVxWorker *const src_worker);
71 #ifdef __cplusplus
72 } // extern "C"
73 #endif
75 #endif // AV1_DECODER_DTHREAD_H_