| 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_VP8CX_H_ | 10 #ifndef VPX_VP8CX_H_ |
| 11 #define VPX_VP8CX_H_ | 11 #define VPX_VP8CX_H_ |
| 12 | 12 |
| 13 /*!\defgroup vp8_encoder WebM VP8/VP9 Encoder | 13 /*!\defgroup vp8_encoder WebM VP8/VP9 Encoder |
| 14 * \ingroup vp8 | 14 * \ingroup vp8 |
| 15 * | 15 * |
| 16 * @{ | 16 * @{ |
| 17 */ | 17 */ |
| 18 #include "./vp8.h" | 18 #include "./vp8.h" |
| 19 #include "vpx/vpx_encoder.h" |
| 19 | 20 |
| 20 /*!\file | 21 /*!\file |
| 21 * \brief Provides definitions for using VP8 or VP9 encoder algorithm within the | 22 * \brief Provides definitions for using VP8 or VP9 encoder algorithm within the |
| 22 * vpx Codec Interface. | 23 * vpx Codec Interface. |
| 23 */ | 24 */ |
| 24 | 25 |
| 25 #ifdef __cplusplus | 26 #ifdef __cplusplus |
| 26 extern "C" { | 27 extern "C" { |
| 27 #endif | 28 #endif |
| 28 | 29 |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 | 441 |
| 441 /*!\brief Codec control function to turn on/off SVC in encoder. | 442 /*!\brief Codec control function to turn on/off SVC in encoder. |
| 442 * \note Return value is VPX_CODEC_INVALID_PARAM if the encoder does not | 443 * \note Return value is VPX_CODEC_INVALID_PARAM if the encoder does not |
| 443 * support SVC in its current encoding mode | 444 * support SVC in its current encoding mode |
| 444 * 0: off, 1: on | 445 * 0: off, 1: on |
| 445 * | 446 * |
| 446 * Supported in codecs: VP9 | 447 * Supported in codecs: VP9 |
| 447 */ | 448 */ |
| 448 VP9E_SET_SVC, | 449 VP9E_SET_SVC, |
| 449 | 450 |
| 451 #if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) |
| 450 /*!\brief Codec control function to set parameters for SVC. | 452 /*!\brief Codec control function to set parameters for SVC. |
| 451 * \note Parameters contain min_q, max_q, scaling factor for each of the | 453 * \note Parameters contain min_q, max_q, scaling factor for each of the |
| 452 * SVC layers. | 454 * SVC layers. |
| 453 * | 455 * |
| 454 * Supported in codecs: VP9 | 456 * Supported in codecs: VP9 |
| 455 */ | 457 */ |
| 456 VP9E_SET_SVC_PARAMETERS, | 458 VP9E_SET_SVC_PARAMETERS, |
| 459 #endif |
| 457 | 460 |
| 458 /*!\brief Codec control function to set svc layer for spatial and temporal. | 461 /*!\brief Codec control function to set svc layer for spatial and temporal. |
| 459 * \note Valid ranges: 0..#vpx_codec_enc_cfg::ss_number_layers for spatial | 462 * \note Valid ranges: 0..#vpx_codec_enc_cfg::ss_number_layers for spatial |
| 460 * layer and 0..#vpx_codec_enc_cfg::ts_number_layers for | 463 * layer and 0..#vpx_codec_enc_cfg::ts_number_layers for |
| 461 * temporal layer. | 464 * temporal layer. |
| 462 * | 465 * |
| 463 * Supported in codecs: VP9 | 466 * Supported in codecs: VP9 |
| 464 */ | 467 */ |
| 465 VP9E_SET_SVC_LAYER_ID, | 468 VP9E_SET_SVC_LAYER_ID, |
| 466 | 469 |
| 467 /*!\brief Codec control function to set content type. | 470 /*!\brief Codec control function to set content type. |
| 468 * \note Valid parameter range: | 471 * \note Valid parameter range: |
| 469 * VP9E_CONTENT_DEFAULT = Regular video content (Default) | 472 * VP9E_CONTENT_DEFAULT = Regular video content (Default) |
| 470 * VP9E_CONTENT_SCREEN = Screen capture content | 473 * VP9E_CONTENT_SCREEN = Screen capture content |
| 471 * | 474 * |
| 472 * Supported in codecs: VP9 | 475 * Supported in codecs: VP9 |
| 473 */ | 476 */ |
| 474 VP9E_SET_TUNE_CONTENT, | 477 VP9E_SET_TUNE_CONTENT, |
| 475 | 478 |
| 479 #if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) |
| 476 /*!\brief Codec control function to get svc layer ID. | 480 /*!\brief Codec control function to get svc layer ID. |
| 477 * \note The layer ID returned is for the data packet from the registered | 481 * \note The layer ID returned is for the data packet from the registered |
| 478 * callback function. | 482 * callback function. |
| 479 * | 483 * |
| 480 * Supported in codecs: VP9 | 484 * Supported in codecs: VP9 |
| 481 */ | 485 */ |
| 482 VP9E_GET_SVC_LAYER_ID, | 486 VP9E_GET_SVC_LAYER_ID, |
| 483 | 487 |
| 484 /*!\brief Codec control function to register callback to get per layer packet. | 488 /*!\brief Codec control function to register callback to get per layer packet. |
| 485 * \note Parameter for this control function is a structure with a callback | 489 * \note Parameter for this control function is a structure with a callback |
| 486 * function and a pointer to private data used by the callback. | 490 * function and a pointer to private data used by the callback. |
| 487 * | 491 * |
| 488 * Supported in codecs: VP9 | 492 * Supported in codecs: VP9 |
| 489 */ | 493 */ |
| 490 VP9E_REGISTER_CX_CALLBACK, | 494 VP9E_REGISTER_CX_CALLBACK, |
| 495 #endif |
| 491 | 496 |
| 492 /*!\brief Codec control function to set color space info. | 497 /*!\brief Codec control function to set color space info. |
| 493 * \note Valid ranges: 0..7, default is "UNKNOWN". | 498 * \note Valid ranges: 0..7, default is "UNKNOWN". |
| 494 * 0 = UNKNOWN, | 499 * 0 = UNKNOWN, |
| 495 * 1 = BT_601 | 500 * 1 = BT_601 |
| 496 * 2 = BT_709 | 501 * 2 = BT_709 |
| 497 * 3 = SMPTE_170 | 502 * 3 = SMPTE_170 |
| 498 * 4 = SMPTE_240 | 503 * 4 = SMPTE_240 |
| 499 * 5 = BT_2020 | 504 * 5 = BT_2020 |
| 500 * 6 = RESERVED | 505 * 6 = RESERVED |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 /*!\brief VP8 model tuning parameters | 589 /*!\brief VP8 model tuning parameters |
| 585 * | 590 * |
| 586 * Changes the encoder to tune for certain types of input material. | 591 * Changes the encoder to tune for certain types of input material. |
| 587 * | 592 * |
| 588 */ | 593 */ |
| 589 typedef enum { | 594 typedef enum { |
| 590 VP8_TUNE_PSNR, | 595 VP8_TUNE_PSNR, |
| 591 VP8_TUNE_SSIM | 596 VP8_TUNE_SSIM |
| 592 } vp8e_tuning; | 597 } vp8e_tuning; |
| 593 | 598 |
| 599 #if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) |
| 594 /*!\brief vp9 svc layer parameters | 600 /*!\brief vp9 svc layer parameters |
| 595 * | 601 * |
| 596 * This defines the spatial and temporal layer id numbers for svc encoding. | 602 * This defines the spatial and temporal layer id numbers for svc encoding. |
| 597 * This is used with the #VP9E_SET_SVC_LAYER_ID control to set the spatial and | 603 * This is used with the #VP9E_SET_SVC_LAYER_ID control to set the spatial and |
| 598 * temporal layer id for the current frame. | 604 * temporal layer id for the current frame. |
| 599 * | 605 * |
| 600 */ | 606 */ |
| 601 typedef struct vpx_svc_layer_id { | 607 typedef struct vpx_svc_layer_id { |
| 602 int spatial_layer_id; /**< Spatial layer id number. */ | 608 int spatial_layer_id; /**< Spatial layer id number. */ |
| 603 int temporal_layer_id; /**< Temporal layer id number. */ | 609 int temporal_layer_id; /**< Temporal layer id number. */ |
| 604 } vpx_svc_layer_id_t; | 610 } vpx_svc_layer_id_t; |
| 611 #else |
| 612 /*!\brief vp9 svc layer parameters |
| 613 * |
| 614 * This defines the temporal layer id numbers for svc encoding. |
| 615 * This is used with the #VP9E_SET_SVC_LAYER_ID control to set the |
| 616 * temporal layer id for the current frame. |
| 617 * |
| 618 */ |
| 619 typedef struct vpx_svc_layer_id { |
| 620 int temporal_layer_id; /**< Temporal layer id number. */ |
| 621 } vpx_svc_layer_id_t; |
| 622 #endif |
| 605 | 623 |
| 606 /*!\brief VP8 encoder control function parameter type | 624 /*!\brief VP8 encoder control function parameter type |
| 607 * | 625 * |
| 608 * Defines the data types that VP8E control functions take. Note that | 626 * Defines the data types that VP8E control functions take. Note that |
| 609 * additional common controls are defined in vp8.h | 627 * additional common controls are defined in vp8.h |
| 610 * | 628 * |
| 611 */ | 629 */ |
| 612 | 630 |
| 613 | 631 |
| 614 /* These controls have been deprecated in favor of the flags parameter to | 632 /* These controls have been deprecated in favor of the flags parameter to |
| 615 * vpx_codec_encode(). See the definition of VP8_EFLAG_* above. | 633 * vpx_codec_encode(). See the definition of VP8_EFLAG_* above. |
| 616 */ | 634 */ |
| 617 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_ENTROPY, int) | 635 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_ENTROPY, int) |
| 618 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_REFERENCE, int) | 636 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_REFERENCE, int) |
| 619 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_USE_REFERENCE, int) | 637 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_USE_REFERENCE, int) |
| 620 | 638 |
| 621 VPX_CTRL_USE_TYPE(VP8E_SET_FRAME_FLAGS, int) | 639 VPX_CTRL_USE_TYPE(VP8E_SET_FRAME_FLAGS, int) |
| 622 VPX_CTRL_USE_TYPE(VP8E_SET_TEMPORAL_LAYER_ID, int) | 640 VPX_CTRL_USE_TYPE(VP8E_SET_TEMPORAL_LAYER_ID, int) |
| 623 VPX_CTRL_USE_TYPE(VP8E_SET_ROI_MAP, vpx_roi_map_t *) | 641 VPX_CTRL_USE_TYPE(VP8E_SET_ROI_MAP, vpx_roi_map_t *) |
| 624 VPX_CTRL_USE_TYPE(VP8E_SET_ACTIVEMAP, vpx_active_map_t *) | 642 VPX_CTRL_USE_TYPE(VP8E_SET_ACTIVEMAP, vpx_active_map_t *) |
| 625 VPX_CTRL_USE_TYPE(VP8E_SET_SCALEMODE, vpx_scaling_mode_t *) | 643 VPX_CTRL_USE_TYPE(VP8E_SET_SCALEMODE, vpx_scaling_mode_t *) |
| 626 | 644 |
| 627 VPX_CTRL_USE_TYPE(VP9E_SET_SVC, int) | 645 VPX_CTRL_USE_TYPE(VP9E_SET_SVC, int) |
| 646 #if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) |
| 628 VPX_CTRL_USE_TYPE(VP9E_SET_SVC_PARAMETERS, void *) | 647 VPX_CTRL_USE_TYPE(VP9E_SET_SVC_PARAMETERS, void *) |
| 629 VPX_CTRL_USE_TYPE(VP9E_REGISTER_CX_CALLBACK, void *) | 648 VPX_CTRL_USE_TYPE(VP9E_REGISTER_CX_CALLBACK, void *) |
| 649 #endif |
| 630 VPX_CTRL_USE_TYPE(VP9E_SET_SVC_LAYER_ID, vpx_svc_layer_id_t *) | 650 VPX_CTRL_USE_TYPE(VP9E_SET_SVC_LAYER_ID, vpx_svc_layer_id_t *) |
| 631 | 651 |
| 632 VPX_CTRL_USE_TYPE(VP8E_SET_CPUUSED, int) | 652 VPX_CTRL_USE_TYPE(VP8E_SET_CPUUSED, int) |
| 633 VPX_CTRL_USE_TYPE(VP8E_SET_ENABLEAUTOALTREF, unsigned int) | 653 VPX_CTRL_USE_TYPE(VP8E_SET_ENABLEAUTOALTREF, unsigned int) |
| 634 VPX_CTRL_USE_TYPE(VP8E_SET_NOISE_SENSITIVITY, unsigned int) | 654 VPX_CTRL_USE_TYPE(VP8E_SET_NOISE_SENSITIVITY, unsigned int) |
| 635 VPX_CTRL_USE_TYPE(VP8E_SET_SHARPNESS, unsigned int) | 655 VPX_CTRL_USE_TYPE(VP8E_SET_SHARPNESS, unsigned int) |
| 636 VPX_CTRL_USE_TYPE(VP8E_SET_STATIC_THRESHOLD, unsigned int) | 656 VPX_CTRL_USE_TYPE(VP8E_SET_STATIC_THRESHOLD, unsigned int) |
| 637 VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS, int) /* vp8e_token_partitions */ | 657 VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS, int) /* vp8e_token_partitions */ |
| 638 | 658 |
| 639 VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_MAXFRAMES, unsigned int) | 659 VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_MAXFRAMES, unsigned int) |
| 640 VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_STRENGTH, unsigned int) | 660 VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_STRENGTH, unsigned int) |
| 641 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_SET_ARNR_TYPE, unsigned int) | 661 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_SET_ARNR_TYPE, unsigned int) |
| 642 VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */ | 662 VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */ |
| 643 VPX_CTRL_USE_TYPE(VP8E_SET_CQ_LEVEL, unsigned int) | 663 VPX_CTRL_USE_TYPE(VP8E_SET_CQ_LEVEL, unsigned int) |
| 644 | 664 |
| 645 VPX_CTRL_USE_TYPE(VP9E_SET_TILE_COLUMNS, int) | 665 VPX_CTRL_USE_TYPE(VP9E_SET_TILE_COLUMNS, int) |
| 646 VPX_CTRL_USE_TYPE(VP9E_SET_TILE_ROWS, int) | 666 VPX_CTRL_USE_TYPE(VP9E_SET_TILE_ROWS, int) |
| 647 | 667 |
| 648 VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER, int *) | 668 VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER, int *) |
| 649 VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER_64, int *) | 669 VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER_64, int *) |
| 670 #if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) |
| 650 VPX_CTRL_USE_TYPE(VP9E_GET_SVC_LAYER_ID, vpx_svc_layer_id_t *) | 671 VPX_CTRL_USE_TYPE(VP9E_GET_SVC_LAYER_ID, vpx_svc_layer_id_t *) |
| 672 #endif |
| 651 | 673 |
| 652 VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTRA_BITRATE_PCT, unsigned int) | 674 VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTRA_BITRATE_PCT, unsigned int) |
| 653 VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTER_BITRATE_PCT, unsigned int) | 675 VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTER_BITRATE_PCT, unsigned int) |
| 654 | 676 |
| 655 VPX_CTRL_USE_TYPE(VP8E_SET_SCREEN_CONTENT_MODE, unsigned int) | 677 VPX_CTRL_USE_TYPE(VP8E_SET_SCREEN_CONTENT_MODE, unsigned int) |
| 656 | 678 |
| 657 VPX_CTRL_USE_TYPE(VP9E_SET_GF_CBR_BOOST_PCT, unsigned int) | 679 VPX_CTRL_USE_TYPE(VP9E_SET_GF_CBR_BOOST_PCT, unsigned int) |
| 658 | 680 |
| 659 VPX_CTRL_USE_TYPE(VP9E_SET_LOSSLESS, unsigned int) | 681 VPX_CTRL_USE_TYPE(VP9E_SET_LOSSLESS, unsigned int) |
| 660 | 682 |
| 661 VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PARALLEL_DECODING, unsigned int) | 683 VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PARALLEL_DECODING, unsigned int) |
| 662 | 684 |
| 663 VPX_CTRL_USE_TYPE(VP9E_SET_AQ_MODE, unsigned int) | 685 VPX_CTRL_USE_TYPE(VP9E_SET_AQ_MODE, unsigned int) |
| 664 | 686 |
| 665 VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PERIODIC_BOOST, unsigned int) | 687 VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PERIODIC_BOOST, unsigned int) |
| 666 | 688 |
| 667 VPX_CTRL_USE_TYPE(VP9E_SET_NOISE_SENSITIVITY, unsigned int) | 689 VPX_CTRL_USE_TYPE(VP9E_SET_NOISE_SENSITIVITY, unsigned int) |
| 668 | 690 |
| 669 VPX_CTRL_USE_TYPE(VP9E_SET_TUNE_CONTENT, int) /* vp9e_tune_content */ | 691 VPX_CTRL_USE_TYPE(VP9E_SET_TUNE_CONTENT, int) /* vp9e_tune_content */ |
| 670 | 692 |
| 671 VPX_CTRL_USE_TYPE(VP9E_SET_COLOR_SPACE, int) | 693 VPX_CTRL_USE_TYPE(VP9E_SET_COLOR_SPACE, int) |
| 672 /*! @} - end defgroup vp8_encoder */ | 694 /*! @} - end defgroup vp8_encoder */ |
| 673 #ifdef __cplusplus | 695 #ifdef __cplusplus |
| 674 } // extern "C" | 696 } // extern "C" |
| 675 #endif | 697 #endif |
| 676 | 698 |
| 677 #endif // VPX_VP8CX_H_ | 699 #endif // VPX_VP8CX_H_ |
| OLD | NEW |