| 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 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 * | 48 * |
| 49 * Each encoder advertises the capabilities it supports as part of its | 49 * Each encoder advertises the capabilities it supports as part of its |
| 50 * ::vpx_codec_iface_t interface structure. Capabilities are extra | 50 * ::vpx_codec_iface_t interface structure. Capabilities are extra |
| 51 * interfaces or functionality, and are not required to be supported | 51 * interfaces or functionality, and are not required to be supported |
| 52 * by an encoder. | 52 * by an encoder. |
| 53 * | 53 * |
| 54 * The available flags are specified by VPX_CODEC_CAP_* defines. | 54 * The available flags are specified by VPX_CODEC_CAP_* defines. |
| 55 */ | 55 */ |
| 56 #define VPX_CODEC_CAP_PSNR 0x10000 /**< Can issue PSNR packets */ | 56 #define VPX_CODEC_CAP_PSNR 0x10000 /**< Can issue PSNR packets */ |
| 57 | 57 |
| 58 /*! Can output one partition at a time. Each partition is returned in its |
| 59 * own VPX_CODEC_CX_FRAME_PKT, with the FRAME_IS_FRAGMENT flag set for |
| 60 * every partition but the last. In this mode all frames are always |
| 61 * returned partition by partition. |
| 62 */ |
| 63 #define VPX_CODEC_CAP_OUTPUT_PARTITION 0x20000 |
| 64 |
| 58 | 65 |
| 59 /*! \brief Initialization-time Feature Enabling | 66 /*! \brief Initialization-time Feature Enabling |
| 60 * | 67 * |
| 61 * Certain codec features must be known at initialization time, to allow | 68 * Certain codec features must be known at initialization time, to allow |
| 62 * for proper memory allocation. | 69 * for proper memory allocation. |
| 63 * | 70 * |
| 64 * The available flags are specified by VPX_CODEC_USE_* defines. | 71 * The available flags are specified by VPX_CODEC_USE_* defines. |
| 65 */ | 72 */ |
| 66 #define VPX_CODEC_USE_PSNR 0x10000 /**< Calculate PSNR on each frame */ | 73 #define VPX_CODEC_USE_PSNR 0x10000 /**< Calculate PSNR on each frame */ |
| 74 #define VPX_CODEC_USE_OUTPUT_PARTITION 0x20000 /**< Make the encoder output one |
| 75 partition at a time. */ |
| 67 | 76 |
| 68 | 77 |
| 69 /*!\brief Generic fixed size buffer structure | 78 /*!\brief Generic fixed size buffer structure |
| 70 * | 79 * |
| 71 * This structure is able to hold a reference to any fixed size buffer. | 80 * This structure is able to hold a reference to any fixed size buffer. |
| 72 */ | 81 */ |
| 73 typedef struct vpx_fixed_buf | 82 typedef struct vpx_fixed_buf |
| 74 { | 83 { |
| 75 void *buf; /**< Pointer to the data */ | 84 void *buf; /**< Pointer to the data */ |
| 76 size_t sz; /**< Length of the buffer, in chars */ | 85 size_t sz; /**< Length of the buffer, in chars */ |
| (...skipping 15 matching lines...) Expand all Loading... |
| 92 * can be used by an algorithm to provide additional detail, for example to | 101 * can be used by an algorithm to provide additional detail, for example to |
| 93 * support frame types that are codec specific (MPEG-1 D-frames for example) | 102 * support frame types that are codec specific (MPEG-1 D-frames for example) |
| 94 */ | 103 */ |
| 95 typedef uint32_t vpx_codec_frame_flags_t; | 104 typedef uint32_t vpx_codec_frame_flags_t; |
| 96 #define VPX_FRAME_IS_KEY 0x1 /**< frame is the start of a GOP */ | 105 #define VPX_FRAME_IS_KEY 0x1 /**< frame is the start of a GOP */ |
| 97 #define VPX_FRAME_IS_DROPPABLE 0x2 /**< frame can be dropped without affecting | 106 #define VPX_FRAME_IS_DROPPABLE 0x2 /**< frame can be dropped without affecting |
| 98 the stream (no future frame depends on | 107 the stream (no future frame depends on |
| 99 this one) */ | 108 this one) */ |
| 100 #define VPX_FRAME_IS_INVISIBLE 0x4 /**< frame should be decoded but will not | 109 #define VPX_FRAME_IS_INVISIBLE 0x4 /**< frame should be decoded but will not |
| 101 be shown */ | 110 be shown */ |
| 111 #define VPX_FRAME_IS_FRAGMENT 0x8 /**< this is a fragment of the encoded |
| 112 frame */ |
| 102 | 113 |
| 114 /*!\brief Error Resilient flags |
| 115 * |
| 116 * These flags define which error resilient features to enable in the |
| 117 * encoder. The flags are specified through the |
| 118 * vpx_codec_enc_cfg::g_error_resilient variable. |
| 119 */ |
| 120 typedef uint32_t vpx_codec_er_flags_t; |
| 121 #define VPX_ERROR_RESILIENT_DEFAULT 0x1 /**< Improve resiliency against |
| 122 losses of whole frames */ |
| 123 #define VPX_ERROR_RESILIENT_PARTITIONS 0x2 /**< The frame partitions are |
| 124 independently decodable by the |
| 125 bool decoder, meaning that |
| 126 partitions can be decoded even |
| 127 though earlier partitions have |
| 128 been lost. Note that intra |
| 129 predicition is still done over |
| 130 the partition boundary. */ |
| 103 | 131 |
| 104 /*!\brief Encoder output packet variants | 132 /*!\brief Encoder output packet variants |
| 105 * | 133 * |
| 106 * This enumeration lists the different kinds of data packets that can be | 134 * This enumeration lists the different kinds of data packets that can be |
| 107 * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY | 135 * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY |
| 108 * extend this list to provide additional functionality. | 136 * extend this list to provide additional functionality. |
| 109 */ | 137 */ |
| 110 enum vpx_codec_cx_pkt_kind | 138 enum vpx_codec_cx_pkt_kind |
| 111 { | 139 { |
| 112 VPX_CODEC_CX_FRAME_PKT, /**< Compressed video frame */ | 140 VPX_CODEC_CX_FRAME_PKT, /**< Compressed video frame */ |
| (...skipping 15 matching lines...) Expand all Loading... |
| 128 { | 156 { |
| 129 struct | 157 struct |
| 130 { | 158 { |
| 131 void *buf; /**< compressed data buffer *
/ | 159 void *buf; /**< compressed data buffer *
/ |
| 132 size_t sz; /**< length of compressed dat
a */ | 160 size_t sz; /**< length of compressed dat
a */ |
| 133 vpx_codec_pts_t pts; /**< time stamp to show frame | 161 vpx_codec_pts_t pts; /**< time stamp to show frame |
| 134 (in timebase units) */ | 162 (in timebase units) */ |
| 135 unsigned long duration; /**< duration to show frame | 163 unsigned long duration; /**< duration to show frame |
| 136 (in timebase units) */ | 164 (in timebase units) */ |
| 137 vpx_codec_frame_flags_t flags; /**< flags for this frame */ | 165 vpx_codec_frame_flags_t flags; /**< flags for this frame */ |
| 166 int partition_id; /**< the partition id |
| 167 defines the decoding order |
| 168 of the partitions. Only |
| 169 applicable when "output partition" |
| 170 mode is enabled. First partition |
| 171 has id 0.*/ |
| 172 |
| 138 } frame; /**< data for compressed frame packet */ | 173 } frame; /**< data for compressed frame packet */ |
| 139 struct vpx_fixed_buf twopass_stats; /**< data for two-pass packet *
/ | 174 struct vpx_fixed_buf twopass_stats; /**< data for two-pass packet *
/ |
| 140 struct vpx_psnr_pkt | 175 struct vpx_psnr_pkt |
| 141 { | 176 { |
| 142 unsigned int samples[4]; /**< Number of samples, total/y/u/v */ | 177 unsigned int samples[4]; /**< Number of samples, total/y/u/v */ |
| 143 uint64_t sse[4]; /**< sum squared error, total/y/u/v */ | 178 uint64_t sse[4]; /**< sum squared error, total/y/u/v */ |
| 144 double psnr[4]; /**< PSNR, total/y/u/v */ | 179 double psnr[4]; /**< PSNR, total/y/u/v */ |
| 145 } psnr; /**< data for PSNR packet */ | 180 } psnr; /**< data for PSNR packet */ |
| 146 struct vpx_fixed_buf raw; /**< data for arbitrary packets */ | 181 struct vpx_fixed_buf raw; /**< data for arbitrary packets */ |
| 147 | 182 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 * the \ref RECOMMENDED method is to set the timebase to the reciprocal | 317 * the \ref RECOMMENDED method is to set the timebase to the reciprocal |
| 283 * of the frame rate (ex: 1001/30000 for 29.970 Hz NTSC). This allows th
e | 318 * of the frame rate (ex: 1001/30000 for 29.970 Hz NTSC). This allows th
e |
| 284 * pts to correspond to the frame number, which can be handy. For | 319 * pts to correspond to the frame number, which can be handy. For |
| 285 * re-encoding video from containers with absolute time timestamps, the | 320 * re-encoding video from containers with absolute time timestamps, the |
| 286 * \ref RECOMMENDED method is to set the timebase to that of the parent | 321 * \ref RECOMMENDED method is to set the timebase to that of the parent |
| 287 * container or multimedia framework (ex: 1/1000 for ms, as in FLV). | 322 * container or multimedia framework (ex: 1/1000 for ms, as in FLV). |
| 288 */ | 323 */ |
| 289 struct vpx_rational g_timebase; | 324 struct vpx_rational g_timebase; |
| 290 | 325 |
| 291 | 326 |
| 292 /*!\brief Enable error resilient mode. | 327 /*!\brief Enable error resilient modes. |
| 293 * | 328 * |
| 294 * Error resilient mode indicates to the encoder that it should take | 329 * The error resilient bitfield indicates to the encoder which features |
| 295 * measures appropriate for streaming over lossy or noisy links, if | 330 * it should enable to take measures for streaming over lossy or noisy |
| 296 * possible. Set to 1 to enable this feature, 0 to disable it. | 331 * links. |
| 297 */ | 332 */ |
| 298 unsigned int g_error_resilient; | 333 vpx_codec_er_flags_t g_error_resilient; |
| 299 | 334 |
| 300 | 335 |
| 301 /*!\brief Multi-pass Encoding Mode | 336 /*!\brief Multi-pass Encoding Mode |
| 302 * | 337 * |
| 303 * This value should be set to the current phase for multi-pass encoding
. | 338 * This value should be set to the current phase for multi-pass encoding
. |
| 304 * For single pass, set to #VPX_RC_ONE_PASS. | 339 * For single pass, set to #VPX_RC_ONE_PASS. |
| 305 */ | 340 */ |
| 306 enum vpx_enc_pass g_pass; | 341 enum vpx_enc_pass g_pass; |
| 307 | 342 |
| 308 | 343 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 * vpx_codec_enc_config_default() with a usage value of 0. | 458 * vpx_codec_enc_config_default() with a usage value of 0. |
| 424 */ | 459 */ |
| 425 unsigned int rc_max_quantizer; | 460 unsigned int rc_max_quantizer; |
| 426 | 461 |
| 427 | 462 |
| 428 /* | 463 /* |
| 429 * bitrate tolerance | 464 * bitrate tolerance |
| 430 */ | 465 */ |
| 431 | 466 |
| 432 | 467 |
| 433 /*!\brief Rate control undershoot tolerance | 468 /*!\brief Rate control adaptation undershoot control |
| 434 * | 469 * |
| 435 * This value, expressed as a percentage of the target bitrate, describe
s | 470 * This value, expressed as a percentage of the target bitrate, |
| 436 * the target bitrate for easier frames, allowing bits to be saved for | 471 * controls the maximum allowed adaptation speed of the codec. |
| 437 * harder frames. Set to zero to use the codec default. | 472 * This factor controls the maximum amount of bits that can |
| 473 * be subtracted from the target bitrate in order to compensate |
| 474 * for prior overshoot. |
| 475 * |
| 476 * Valid values in the range 0-1000. |
| 438 */ | 477 */ |
| 439 unsigned int rc_undershoot_pct; | 478 unsigned int rc_undershoot_pct; |
| 440 | 479 |
| 441 | 480 |
| 442 /*!\brief Rate control overshoot tolerance | 481 /*!\brief Rate control adaptation overshoot control |
| 443 * | 482 * |
| 444 * This value, expressed as a percentage of the target bitrate, describe
s | 483 * This value, expressed as a percentage of the target bitrate, |
| 445 * the maximum allowed bitrate for a given frame. Set to zero to use th
e | 484 * controls the maximum allowed adaptation speed of the codec. |
| 446 * codec default. | 485 * This factor controls the maximum amount of bits that can |
| 486 * be added to the target bitrate in order to compensate for |
| 487 * prior undershoot. |
| 488 * |
| 489 * Valid values in the range 0-1000. |
| 447 */ | 490 */ |
| 448 unsigned int rc_overshoot_pct; | 491 unsigned int rc_overshoot_pct; |
| 449 | 492 |
| 450 | 493 |
| 451 /* | 494 /* |
| 452 * decoder buffer model parameters | 495 * decoder buffer model parameters |
| 453 */ | 496 */ |
| 454 | 497 |
| 455 | 498 |
| 456 /*!\brief Decoder Buffer Size | 499 /*!\brief Decoder Buffer Size |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 */ | 828 */ |
| 786 const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx); | 829 const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx); |
| 787 | 830 |
| 788 | 831 |
| 789 /*!@} - end defgroup encoder*/ | 832 /*!@} - end defgroup encoder*/ |
| 790 | 833 |
| 791 #endif | 834 #endif |
| 792 #ifdef __cplusplus | 835 #ifdef __cplusplus |
| 793 } | 836 } |
| 794 #endif | 837 #endif |
| OLD | NEW |