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 #ifndef VPX_VPX_ENCODER_H_ | 10 #ifndef VPX_VPX_ENCODER_H_ |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 148 |
149 /*!\brief Encoder output packet variants | 149 /*!\brief Encoder output packet variants |
150 * | 150 * |
151 * This enumeration lists the different kinds of data packets that can be | 151 * This enumeration lists the different kinds of data packets that can be |
152 * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY | 152 * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY |
153 * extend this list to provide additional functionality. | 153 * extend this list to provide additional functionality. |
154 */ | 154 */ |
155 enum vpx_codec_cx_pkt_kind { | 155 enum vpx_codec_cx_pkt_kind { |
156 VPX_CODEC_CX_FRAME_PKT, /**< Compressed video frame */ | 156 VPX_CODEC_CX_FRAME_PKT, /**< Compressed video frame */ |
157 VPX_CODEC_STATS_PKT, /**< Two-pass statistics for this frame */ | 157 VPX_CODEC_STATS_PKT, /**< Two-pass statistics for this frame */ |
| 158 VPX_CODEC_FPMB_STATS_PKT, /**< first pass mb statistics for this frame */ |
158 VPX_CODEC_PSNR_PKT, /**< PSNR statistics for this frame */ | 159 VPX_CODEC_PSNR_PKT, /**< PSNR statistics for this frame */ |
| 160 #ifdef CONFIG_SPATIAL_SVC |
| 161 VPX_CODEC_SPATIAL_SVC_LAYER_SIZES, /**< Sizes for each layer in this frame*/ |
| 162 #endif |
159 VPX_CODEC_CUSTOM_PKT = 256 /**< Algorithm extensions */ | 163 VPX_CODEC_CUSTOM_PKT = 256 /**< Algorithm extensions */ |
160 }; | 164 }; |
161 | 165 |
162 | 166 |
163 /*!\brief Encoder output packet | 167 /*!\brief Encoder output packet |
164 * | 168 * |
165 * This structure contains the different kinds of output data the encoder | 169 * This structure contains the different kinds of output data the encoder |
166 * may produce while compressing a frame. | 170 * may produce while compressing a frame. |
167 */ | 171 */ |
168 typedef struct vpx_codec_cx_pkt { | 172 typedef struct vpx_codec_cx_pkt { |
169 enum vpx_codec_cx_pkt_kind kind; /**< packet variant */ | 173 enum vpx_codec_cx_pkt_kind kind; /**< packet variant */ |
170 union { | 174 union { |
171 struct { | 175 struct { |
172 void *buf; /**< compressed data buffer */ | 176 void *buf; /**< compressed data buffer */ |
173 size_t sz; /**< length of compressed data */ | 177 size_t sz; /**< length of compressed data */ |
174 vpx_codec_pts_t pts; /**< time stamp to show frame | 178 vpx_codec_pts_t pts; /**< time stamp to show frame |
175 (in timebase units) */ | 179 (in timebase units) */ |
176 unsigned long duration; /**< duration to show frame | 180 unsigned long duration; /**< duration to show frame |
177 (in timebase units) */ | 181 (in timebase units) */ |
178 vpx_codec_frame_flags_t flags; /**< flags for this frame */ | 182 vpx_codec_frame_flags_t flags; /**< flags for this frame */ |
179 int partition_id; /**< the partition id | 183 int partition_id; /**< the partition id |
180 defines the decoding order | 184 defines the decoding order |
181 of the partitions. Only | 185 of the partitions. Only |
182 applicable when "output partition" | 186 applicable when "output partition" |
183 mode is enabled. First partition | 187 mode is enabled. First partition |
184 has id 0.*/ | 188 has id 0.*/ |
185 | 189 |
186 } frame; /**< data for compressed frame packet */ | 190 } frame; /**< data for compressed frame packet */ |
187 struct vpx_fixed_buf twopass_stats; /**< data for two-pass packet */ | 191 struct vpx_fixed_buf twopass_stats; /**< data for two-pass packet */ |
| 192 struct vpx_fixed_buf firstpass_mb_stats; /**< first pass mb packet */ |
188 struct vpx_psnr_pkt { | 193 struct vpx_psnr_pkt { |
189 unsigned int samples[4]; /**< Number of samples, total/y/u/v */ | 194 unsigned int samples[4]; /**< Number of samples, total/y/u/v */ |
190 uint64_t sse[4]; /**< sum squared error, total/y/u/v */ | 195 uint64_t sse[4]; /**< sum squared error, total/y/u/v */ |
191 double psnr[4]; /**< PSNR, total/y/u/v */ | 196 double psnr[4]; /**< PSNR, total/y/u/v */ |
192 } psnr; /**< data for PSNR packet */ | 197 } psnr; /**< data for PSNR packet */ |
193 struct vpx_fixed_buf raw; /**< data for arbitrary packets */ | 198 struct vpx_fixed_buf raw; /**< data for arbitrary packets */ |
| 199 #ifdef CONFIG_SPATIAL_SVC |
| 200 size_t layer_sizes[VPX_SS_MAX_LAYERS]; |
| 201 #endif |
194 | 202 |
195 /* This packet size is fixed to allow codecs to extend this | 203 /* This packet size is fixed to allow codecs to extend this |
196 * interface without having to manage storage for raw packets, | 204 * interface without having to manage storage for raw packets, |
197 * i.e., if it's smaller than 128 bytes, you can store in the | 205 * i.e., if it's smaller than 128 bytes, you can store in the |
198 * packet list directly. | 206 * packet list directly. |
199 */ | 207 */ |
200 char pad[128 - sizeof(enum vpx_codec_cx_pkt_kind)]; /**< fixed sz */ | 208 char pad[128 - sizeof(enum vpx_codec_cx_pkt_kind)]; /**< fixed sz */ |
201 } data; /**< packet data */ | 209 } data; /**< packet data */ |
202 } vpx_codec_cx_pkt_t; /**< alias for struct vpx_codec_cx_pkt */ | 210 } vpx_codec_cx_pkt_t; /**< alias for struct vpx_codec_cx_pkt */ |
203 | 211 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 enum vpx_rc_mode rc_end_usage; | 447 enum vpx_rc_mode rc_end_usage; |
440 | 448 |
441 | 449 |
442 /*!\brief Two-pass stats buffer. | 450 /*!\brief Two-pass stats buffer. |
443 * | 451 * |
444 * A buffer containing all of the stats packets produced in the first | 452 * A buffer containing all of the stats packets produced in the first |
445 * pass, concatenated. | 453 * pass, concatenated. |
446 */ | 454 */ |
447 struct vpx_fixed_buf rc_twopass_stats_in; | 455 struct vpx_fixed_buf rc_twopass_stats_in; |
448 | 456 |
| 457 /*!\brief first pass mb stats buffer. |
| 458 * |
| 459 * A buffer containing all of the first pass mb stats packets produced |
| 460 * in the first pass, concatenated. |
| 461 */ |
| 462 struct vpx_fixed_buf rc_firstpass_mb_stats_in; |
449 | 463 |
450 /*!\brief Target data rate | 464 /*!\brief Target data rate |
451 * | 465 * |
452 * Target bandwidth to use for this stream, in kilobits per second. | 466 * Target bandwidth to use for this stream, in kilobits per second. |
453 */ | 467 */ |
454 unsigned int rc_target_bitrate; | 468 unsigned int rc_target_bitrate; |
455 | 469 |
456 | 470 |
457 /* | 471 /* |
458 * quantizer settings | 472 * quantizer settings |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 /* | 630 /* |
617 * Spatial scalability settings (ss) | 631 * Spatial scalability settings (ss) |
618 */ | 632 */ |
619 | 633 |
620 /*!\brief Number of spatial coding layers. | 634 /*!\brief Number of spatial coding layers. |
621 * | 635 * |
622 * This value specifies the number of spatial coding layers to be used. | 636 * This value specifies the number of spatial coding layers to be used. |
623 */ | 637 */ |
624 unsigned int ss_number_layers; | 638 unsigned int ss_number_layers; |
625 | 639 |
| 640 #ifdef CONFIG_SPATIAL_SVC |
| 641 /*!\brief Enable auto alt reference flags for each spatial layer. |
| 642 * |
| 643 * These values specify if auto alt reference frame is enabled for each |
| 644 * spatial layer. |
| 645 */ |
| 646 int ss_enable_auto_alt_ref[VPX_SS_MAX_LAYERS]; |
| 647 #endif |
| 648 |
626 /*!\brief Target bitrate for each spatial layer. | 649 /*!\brief Target bitrate for each spatial layer. |
627 * | 650 * |
628 * These values specify the target coding bitrate to be used for each | 651 * These values specify the target coding bitrate to be used for each |
629 * spatial layer. | 652 * spatial layer. |
630 */ | 653 */ |
631 unsigned int ss_target_bitrate[VPX_SS_MAX_LAYERS]; | 654 unsigned int ss_target_bitrate[VPX_SS_MAX_LAYERS]; |
632 | 655 |
633 /*!\brief Number of temporal coding layers. | 656 /*!\brief Number of temporal coding layers. |
634 * | 657 * |
635 * This value specifies the number of temporal layers to be used. | 658 * This value specifies the number of temporal layers to be used. |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 */ | 971 */ |
949 const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx); | 972 const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx); |
950 | 973 |
951 | 974 |
952 /*!@} - end defgroup encoder*/ | 975 /*!@} - end defgroup encoder*/ |
953 #ifdef __cplusplus | 976 #ifdef __cplusplus |
954 } | 977 } |
955 #endif | 978 #endif |
956 #endif // VPX_VPX_ENCODER_H_ | 979 #endif // VPX_VPX_ENCODER_H_ |
957 | 980 |
OLD | NEW |