OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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_ENCODER_VP9_LOOKAHEAD_H_ | 11 #ifndef VP9_ENCODER_VP9_LOOKAHEAD_H_ |
12 #define VP9_ENCODER_VP9_LOOKAHEAD_H_ | 12 #define VP9_ENCODER_VP9_LOOKAHEAD_H_ |
13 | 13 |
14 #include "vpx_scale/yv12config.h" | 14 #include "vpx_scale/yv12config.h" |
15 #include "vpx/vpx_integer.h" | 15 #include "vpx/vpx_integer.h" |
16 | 16 |
| 17 #ifdef CONFIG_SPATIAL_SVC |
| 18 #include "vpx/vp8cx.h" |
| 19 #include "vpx/vpx_encoder.h" |
| 20 #endif |
| 21 |
17 #ifdef __cplusplus | 22 #ifdef __cplusplus |
18 extern "C" { | 23 extern "C" { |
19 #endif | 24 #endif |
20 | 25 |
21 #define MAX_LAG_BUFFERS 25 | 26 #define MAX_LAG_BUFFERS 25 |
22 | 27 |
23 struct lookahead_entry { | 28 struct lookahead_entry { |
24 YV12_BUFFER_CONFIG img; | 29 YV12_BUFFER_CONFIG img; |
25 int64_t ts_start; | 30 int64_t ts_start; |
26 int64_t ts_end; | 31 int64_t ts_end; |
27 unsigned int flags; | 32 unsigned int flags; |
| 33 |
| 34 #ifdef CONFIG_SPATIAL_SVC |
| 35 vpx_svc_parameters_t svc_params[VPX_SS_MAX_LAYERS]; |
| 36 #endif |
28 }; | 37 }; |
29 | 38 |
| 39 // The max of past frames we want to keep in the queue. |
| 40 #define MAX_PRE_FRAMES 1 |
30 | 41 |
31 struct lookahead_ctx; | 42 struct lookahead_ctx { |
| 43 unsigned int max_sz; /* Absolute size of the queue */ |
| 44 unsigned int sz; /* Number of buffers currently in the queue */ |
| 45 unsigned int read_idx; /* Read index */ |
| 46 unsigned int write_idx; /* Write index */ |
| 47 struct lookahead_entry *buf; /* Buffer list */ |
| 48 }; |
32 | 49 |
33 /**\brief Initializes the lookahead stage | 50 /**\brief Initializes the lookahead stage |
34 * | 51 * |
35 * The lookahead stage is a queue of frame buffers on which some analysis | 52 * The lookahead stage is a queue of frame buffers on which some analysis |
36 * may be done when buffers are enqueued. | 53 * may be done when buffers are enqueued. |
37 */ | 54 */ |
38 struct lookahead_ctx *vp9_lookahead_init(unsigned int width, | 55 struct lookahead_ctx *vp9_lookahead_init(unsigned int width, |
39 unsigned int height, | 56 unsigned int height, |
40 unsigned int subsampling_x, | 57 unsigned int subsampling_x, |
41 unsigned int subsampling_y, | 58 unsigned int subsampling_y, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 * | 112 * |
96 * \param[in] ctx Pointer to the lookahead context | 113 * \param[in] ctx Pointer to the lookahead context |
97 */ | 114 */ |
98 unsigned int vp9_lookahead_depth(struct lookahead_ctx *ctx); | 115 unsigned int vp9_lookahead_depth(struct lookahead_ctx *ctx); |
99 | 116 |
100 #ifdef __cplusplus | 117 #ifdef __cplusplus |
101 } // extern "C" | 118 } // extern "C" |
102 #endif | 119 #endif |
103 | 120 |
104 #endif // VP9_ENCODER_VP9_LOOKAHEAD_H_ | 121 #endif // VP9_ENCODER_VP9_LOOKAHEAD_H_ |
OLD | NEW |