diff --git a/vpx/src/vpx_decoder.c b/vpx/src/vpx_decoder.c index 42aedee7edbd59b79e9d58eab4f55c3677d81182..6e877b0670ff3a27a505c86fc8b4f7dc1be0ebc9 100644 --- a/vpx/src/vpx_decoder.c +++ b/vpx/src/vpx_decoder.c @@ -39,6 +39,9 @@ vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx, else if ((flags & VPX_CODEC_USE_ERROR_CONCEALMENT) && !(iface->caps & VPX_CODEC_CAP_ERROR_CONCEALMENT)) res = VPX_CODEC_INCAPABLE; + else if ((flags & VPX_CODEC_USE_INPUT_PARTITION) && + !(iface->caps & VPX_CODEC_CAP_INPUT_PARTITION)) + res = VPX_CODEC_INCAPABLE; else if (!(iface->caps & VPX_CODEC_CAP_DECODER)) res = VPX_CODEC_INCAPABLE; else diff --git a/vpx/src/vpx_encoder.c b/vpx/src/vpx_encoder.c index dab7554308137180f651edd30905fad5389df364..5e86835ea05488f7ee5b10aead874384b7488eb9 100644 --- a/vpx/src/vpx_encoder.c +++ b/vpx/src/vpx_encoder.c @@ -41,6 +41,9 @@ vpx_codec_err_t vpx_codec_enc_init_ver(vpx_codec_ctx_t *ctx, else if ((flags & VPX_CODEC_USE_PSNR) && !(iface->caps & VPX_CODEC_CAP_PSNR)) res = VPX_CODEC_INCAPABLE; + else if ((flags & VPX_CODEC_USE_OUTPUT_PARTITION) + && !(iface->caps & VPX_CODEC_CAP_OUTPUT_PARTITION)) + res = VPX_CODEC_INCAPABLE; else { ctx->iface = iface; diff --git a/vpx/vpx_decoder.h b/vpx/vpx_decoder.h index e50fd765f1207ef6484abf024df0b976a06b733d..0fc38c69f720402471ba4ef6af29fd8c00f2729b 100644 --- a/vpx/vpx_decoder.h +++ b/vpx/vpx_decoder.h @@ -55,6 +55,8 @@ extern "C" { #define VPX_CODEC_CAP_POSTPROC 0x40000 /**< Can postprocess decoded frame */ #define VPX_CODEC_CAP_ERROR_CONCEALMENT 0x80000 /**< Can conceal errors due to packet loss */ +#define VPX_CODEC_CAP_INPUT_PARTITION 0x100000 /**< Can receive encoded frames + one partition at a time */ /*! \brief Initialization-time Feature Enabling * @@ -66,6 +68,9 @@ extern "C" { #define VPX_CODEC_USE_POSTPROC 0x10000 /**< Postprocess decoded frame */ #define VPX_CODEC_USE_ERROR_CONCEALMENT 0x20000 /**< Conceal errors in decoded frames */ +#define VPX_CODEC_USE_INPUT_PARTITION 0x40000 /**< The input frame should be + passed to the decoder one + partition at a time */ /*!\brief Stream properties * @@ -184,6 +189,11 @@ extern "C" { * generated, as appropriate. Encoded data \ref MUST be passed in DTS (decode * time stamp) order. Frames produced will always be in PTS (presentation * time stamp) order. + * If the decoder is configured with VPX_CODEC_USE_INPUT_PARTITION enabled, + * data and data_sz must contain at most one encoded partition. When no more + * data is available, this function should be called with NULL as data and 0 + * as data_sz. The memory passed to this function must be available until + * the frame has been decoded. * * \param[in] ctx Pointer to this instance's context * \param[in] data Pointer to this block of new coded data. If diff --git a/vpx/vpx_encoder.h b/vpx/vpx_encoder.h index 33433a707fcabfb28c6362a1a8815ea7a484ad6e..d168d5cfd5ca93cc09ea67175323f8651e776c3e 100644 --- a/vpx/vpx_encoder.h +++ b/vpx/vpx_encoder.h @@ -55,6 +55,13 @@ extern "C" { */ #define VPX_CODEC_CAP_PSNR 0x10000 /**< Can issue PSNR packets */ + /*! Can output one partition at a time. Each partition is returned in its + * own VPX_CODEC_CX_FRAME_PKT, with the FRAME_IS_FRAGMENT flag set for + * every partition but the last. In this mode all frames are always + * returned partition by partition. + */ +#define VPX_CODEC_CAP_OUTPUT_PARTITION 0x20000 + /*! \brief Initialization-time Feature Enabling * @@ -64,6 +71,8 @@ extern "C" { * The available flags are specified by VPX_CODEC_USE_* defines. */ #define VPX_CODEC_USE_PSNR 0x10000 /**< Calculate PSNR on each frame */ +#define VPX_CODEC_USE_OUTPUT_PARTITION 0x20000 /**< Make the encoder output one + partition at a time. */ /*!\brief Generic fixed size buffer structure @@ -99,6 +108,8 @@ extern "C" { this one) */ #define VPX_FRAME_IS_INVISIBLE 0x4 /**< frame should be decoded but will not be shown */ +#define VPX_FRAME_IS_FRAGMENT 0x8 /**< this is a fragment of the encoded + frame */ /*!\brief Error Resilient flags *