OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 /** | 11 /** |
12 * SvcContext - input parameters and state to encode a multi-layered | 12 * SvcContext - input parameters and state to encode a multi-layered |
13 * spatial SVC frame | 13 * spatial SVC frame |
14 */ | 14 */ |
15 | 15 |
16 #ifndef VPX_SVC_CONTEXT_H_ | 16 #ifndef VPX_SVC_CONTEXT_H_ |
17 #define VPX_SVC_CONTEXT_H_ | 17 #define VPX_SVC_CONTEXT_H_ |
18 | 18 |
19 #include "./vp8cx.h" | 19 #include "./vp8cx.h" |
20 #include "./vpx_encoder.h" | 20 #include "./vpx_encoder.h" |
21 | 21 |
22 #ifdef __cplusplus | 22 #ifdef __cplusplus |
23 extern "C" { | 23 extern "C" { |
24 #endif | 24 #endif |
25 | 25 |
26 typedef enum SVC_ENCODING_MODE { | |
27 INTER_LAYER_PREDICTION_I, | |
28 ALT_INTER_LAYER_PREDICTION_IP, | |
29 INTER_LAYER_PREDICTION_IP, | |
30 USE_GOLDEN_FRAME | |
31 } SVC_ENCODING_MODE; | |
32 | |
33 typedef enum SVC_LOG_LEVEL { | 26 typedef enum SVC_LOG_LEVEL { |
34 SVC_LOG_ERROR, | 27 SVC_LOG_ERROR, |
35 SVC_LOG_INFO, | 28 SVC_LOG_INFO, |
36 SVC_LOG_DEBUG | 29 SVC_LOG_DEBUG |
37 } SVC_LOG_LEVEL; | 30 } SVC_LOG_LEVEL; |
38 | 31 |
39 typedef struct { | 32 typedef struct { |
40 // public interface to svc_command options | 33 // public interface to svc_command options |
41 int spatial_layers; // number of layers | 34 int spatial_layers; // number of layers |
42 SVC_ENCODING_MODE encoding_mode; // svc encoding strategy | |
43 SVC_LOG_LEVEL log_level; // amount of information to display | 35 SVC_LOG_LEVEL log_level; // amount of information to display |
44 int log_print; // when set, printf log messages instead of returning the | 36 int log_print; // when set, printf log messages instead of returning the |
45 // message with svc_get_message | 37 // message with svc_get_message |
46 | 38 |
47 // private storage for vpx_svc_encode | 39 // private storage for vpx_svc_encode |
48 void *internal; | 40 void *internal; |
49 } SvcContext; | 41 } SvcContext; |
50 | 42 |
51 /** | 43 /** |
52 * Set SVC options | 44 * Set SVC options |
53 * options are supplied as a single string separated by spaces | 45 * options are supplied as a single string separated by spaces |
54 * Format: encoding-mode=<i|ip|alt-ip|gf> | 46 * Format: encoding-mode=<i|ip|alt-ip|gf> |
55 * layers=<layer_count> | 47 * layers=<layer_count> |
56 * scaling-factors=<n1>/<d1>,<n2>/<d2>,... | 48 * scaling-factors=<n1>/<d1>,<n2>/<d2>,... |
57 * quantizers=<q1>,<q2>,... | 49 * quantizers=<q1>,<q2>,... |
58 */ | 50 */ |
59 vpx_codec_err_t vpx_svc_set_options(SvcContext *svc_ctx, const char *options); | 51 vpx_codec_err_t vpx_svc_set_options(SvcContext *svc_ctx, const char *options); |
60 | 52 |
61 /** | 53 /** |
62 * Set SVC quantizer values | 54 * Set SVC quantizer values |
63 * values comma separated, ordered from lowest resolution to highest | 55 * values comma separated, ordered from lowest resolution to highest |
64 * e.g., "60,53,39,33,27" | 56 * e.g., "60,53,39,33,27" |
65 */ | 57 */ |
66 vpx_codec_err_t vpx_svc_set_quantizers(SvcContext *svc_ctx, | 58 vpx_codec_err_t vpx_svc_set_quantizers(SvcContext *svc_ctx, |
67 const char *quantizer_values, | 59 const char *quantizer_values); |
68 const int is_for_keyframe); | |
69 | 60 |
70 /** | 61 /** |
71 * Set SVC scale factors | 62 * Set SVC scale factors |
72 * values comma separated, ordered from lowest resolution to highest | 63 * values comma separated, ordered from lowest resolution to highest |
73 * e.g., "4/16,5/16,7/16,11/16,16/16" | 64 * e.g., "4/16,5/16,7/16,11/16,16/16" |
74 */ | 65 */ |
75 vpx_codec_err_t vpx_svc_set_scale_factors(SvcContext *svc_ctx, | 66 vpx_codec_err_t vpx_svc_set_scale_factors(SvcContext *svc_ctx, |
76 const char *scale_factors); | 67 const char *scale_factors); |
77 | 68 |
78 /** | 69 /** |
(...skipping 18 matching lines...) Expand all Loading... |
97 * dump accumulated statistics and reset accumulated values | 88 * dump accumulated statistics and reset accumulated values |
98 */ | 89 */ |
99 const char *vpx_svc_dump_statistics(SvcContext *svc_ctx); | 90 const char *vpx_svc_dump_statistics(SvcContext *svc_ctx); |
100 | 91 |
101 /** | 92 /** |
102 * get status message from previous encode | 93 * get status message from previous encode |
103 */ | 94 */ |
104 const char *vpx_svc_get_message(const SvcContext *svc_ctx); | 95 const char *vpx_svc_get_message(const SvcContext *svc_ctx); |
105 | 96 |
106 /** | 97 /** |
107 * return size of encoded data to be returned by vpx_svc_get_buffer | 98 * return size of encoded data to be returned by vpx_svc_get_buffer. |
| 99 * it needs to be called before vpx_svc_get_buffer. |
108 */ | 100 */ |
109 size_t vpx_svc_get_frame_size(const SvcContext *svc_ctx); | 101 size_t vpx_svc_get_frame_size(const SvcContext *svc_ctx); |
110 | 102 |
111 /** | 103 /** |
112 * return buffer with encoded data | 104 * return buffer with encoded data. encoder will maintain a list of frame |
| 105 * buffers. each call of vpx_svc_get_buffer() will return one frame. |
113 */ | 106 */ |
114 void *vpx_svc_get_buffer(const SvcContext *svc_ctx); | 107 void *vpx_svc_get_buffer(SvcContext *svc_ctx); |
115 | 108 |
116 /** | 109 /** |
117 * return size of two pass rate control stats data to be returned by | 110 * return size of two pass rate control stats data to be returned by |
118 * vpx_svc_get_rc_stats_buffer | 111 * vpx_svc_get_rc_stats_buffer |
119 */ | 112 */ |
120 size_t vpx_svc_get_rc_stats_buffer_size(const SvcContext *svc_ctx); | 113 size_t vpx_svc_get_rc_stats_buffer_size(const SvcContext *svc_ctx); |
121 | 114 |
122 /** | 115 /** |
123 * return buffer two pass of rate control stats data | 116 * return buffer two pass of rate control stats data |
124 */ | 117 */ |
(...skipping 19 matching lines...) Expand all Loading... |
144 /** | 137 /** |
145 * force the next frame to be a keyframe | 138 * force the next frame to be a keyframe |
146 */ | 139 */ |
147 void vpx_svc_set_keyframe(SvcContext *svc_ctx); | 140 void vpx_svc_set_keyframe(SvcContext *svc_ctx); |
148 | 141 |
149 #ifdef __cplusplus | 142 #ifdef __cplusplus |
150 } // extern "C" | 143 } // extern "C" |
151 #endif | 144 #endif |
152 | 145 |
153 #endif // VPX_SVC_CONTEXT_H_ | 146 #endif // VPX_SVC_CONTEXT_H_ |
OLD | NEW |