OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 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_DECODER_H_ | 11 #ifndef VP9_DECODER_VP9_DECODER_H_ |
12 #define VP9_DECODER_VP9_DECODER_H_ | 12 #define VP9_DECODER_VP9_DECODER_H_ |
13 | 13 |
14 #include "./vpx_config.h" | 14 #include "./vpx_config.h" |
15 | 15 |
16 #include "vpx/vpx_codec.h" | 16 #include "vpx/vpx_codec.h" |
17 #include "vpx_scale/yv12config.h" | 17 #include "vpx_scale/yv12config.h" |
18 | 18 |
19 #include "vp9/common/vp9_onyxc_int.h" | 19 #include "vp9/common/vp9_onyxc_int.h" |
20 #include "vp9/common/vp9_ppflags.h" | 20 #include "vp9/common/vp9_ppflags.h" |
21 | 21 |
22 #include "vp9/decoder/vp9_decoder.h" | 22 #include "vp9/decoder/vp9_decoder.h" |
23 #include "vp9/decoder/vp9_dthread.h" | 23 #include "vp9/decoder/vp9_dthread.h" |
24 #include "vp9/decoder/vp9_thread.h" | 24 #include "vp9/decoder/vp9_thread.h" |
25 | 25 |
26 #ifdef __cplusplus | 26 #ifdef __cplusplus |
27 extern "C" { | 27 extern "C" { |
28 #endif | 28 #endif |
29 | 29 |
| 30 // TODO(hkuang): combine this with TileWorkerData. |
| 31 typedef struct TileData { |
| 32 VP9_COMMON *cm; |
| 33 vp9_reader bit_reader; |
| 34 DECLARE_ALIGNED(16, MACROBLOCKD, xd); |
| 35 } TileData; |
| 36 |
30 typedef struct VP9Decoder { | 37 typedef struct VP9Decoder { |
31 DECLARE_ALIGNED(16, MACROBLOCKD, mb); | 38 DECLARE_ALIGNED(16, MACROBLOCKD, mb); |
32 | 39 |
33 DECLARE_ALIGNED(16, VP9_COMMON, common); | 40 DECLARE_ALIGNED(16, VP9_COMMON, common); |
34 | 41 |
35 int64_t last_time_stamp; | |
36 int ready_for_new_data; | 42 int ready_for_new_data; |
37 | 43 |
38 int refresh_frame_flags; | 44 int refresh_frame_flags; |
39 | 45 |
40 int decoded_key_frame; | 46 int frame_parallel_decode; // frame-based threading. |
41 | 47 |
42 VP9Worker lf_worker; | 48 VP9Worker lf_worker; |
43 | |
44 VP9Worker *tile_workers; | 49 VP9Worker *tile_workers; |
45 int num_tile_workers; | 50 int num_tile_workers; |
46 | 51 |
| 52 TileData *tile_data; |
| 53 int total_tiles; |
| 54 |
47 VP9LfSync lf_row_sync; | 55 VP9LfSync lf_row_sync; |
48 | 56 |
49 vpx_decrypt_cb decrypt_cb; | 57 vpx_decrypt_cb decrypt_cb; |
50 void *decrypt_state; | 58 void *decrypt_state; |
51 | 59 |
52 int max_threads; | 60 int max_threads; |
53 int inv_tile_order; | 61 int inv_tile_order; |
54 } VP9Decoder; | 62 } VP9Decoder; |
55 | 63 |
56 void vp9_initialize_dec(); | 64 int vp9_receive_compressed_data(struct VP9Decoder *pbi, |
| 65 size_t size, const uint8_t **dest); |
57 | 66 |
58 int vp9_receive_compressed_data(struct VP9Decoder *pbi, | 67 int vp9_get_raw_frame(struct VP9Decoder *pbi, YV12_BUFFER_CONFIG *sd, |
59 size_t size, const uint8_t **dest, | |
60 int64_t time_stamp); | |
61 | |
62 int vp9_get_raw_frame(struct VP9Decoder *pbi, | |
63 YV12_BUFFER_CONFIG *sd, | |
64 int64_t *time_stamp, int64_t *time_end_stamp, | |
65 vp9_ppflags_t *flags); | 68 vp9_ppflags_t *flags); |
66 | 69 |
67 vpx_codec_err_t vp9_copy_reference_dec(struct VP9Decoder *pbi, | 70 vpx_codec_err_t vp9_copy_reference_dec(struct VP9Decoder *pbi, |
68 VP9_REFFRAME ref_frame_flag, | 71 VP9_REFFRAME ref_frame_flag, |
69 YV12_BUFFER_CONFIG *sd); | 72 YV12_BUFFER_CONFIG *sd); |
70 | 73 |
71 vpx_codec_err_t vp9_set_reference_dec(VP9_COMMON *cm, | 74 vpx_codec_err_t vp9_set_reference_dec(VP9_COMMON *cm, |
72 VP9_REFFRAME ref_frame_flag, | 75 VP9_REFFRAME ref_frame_flag, |
73 YV12_BUFFER_CONFIG *sd); | 76 YV12_BUFFER_CONFIG *sd); |
74 | 77 |
75 int vp9_get_reference_dec(struct VP9Decoder *pbi, | 78 int vp9_get_reference_dec(struct VP9Decoder *pbi, |
76 int index, YV12_BUFFER_CONFIG **fb); | 79 int index, YV12_BUFFER_CONFIG **fb); |
77 | 80 |
78 struct VP9Decoder *vp9_decoder_create(); | 81 struct VP9Decoder *vp9_decoder_create(); |
79 | 82 |
80 void vp9_decoder_remove(struct VP9Decoder *pbi); | 83 void vp9_decoder_remove(struct VP9Decoder *pbi); |
81 | 84 |
82 #ifdef __cplusplus | 85 #ifdef __cplusplus |
83 } // extern "C" | 86 } // extern "C" |
84 #endif | 87 #endif |
85 | 88 |
86 #endif // VP9_DECODER_VP9_DECODER_H_ | 89 #endif // VP9_DECODER_VP9_DECODER_H_ |
OLD | NEW |