diff --git a/deps/vpx/include/vpx/vp8cx.h b/deps/vpx/include/vpx/vp8cx.h index 2875e185..94516d40 100644 --- a/deps/vpx/include/vpx/vp8cx.h +++ b/deps/vpx/include/vpx/vp8cx.h @@ -673,6 +673,14 @@ enum vp8e_enc_control_id { */ VP9E_SET_TPL, + /*!\brief Codec control function to enable key frame temporal filtering. + * + * Vp9 allows the encoder to run key frame temporal filtering and use it to + * improve the compression performance. To enable, set this parameter to be + * 1. The default value is set to be 0. + */ + VP9E_SET_KEY_FRAME_FILTERING, + /*!\brief Codec control function to enable postencode frame drop. * * This will allow encoder to drop frame after it's encoded. @@ -1078,6 +1086,8 @@ VPX_CTRL_USE_TYPE(VP9E_SET_SVC_SPATIAL_LAYER_SYNC, #define VPX_CTRL_VP9E_SET_SVC_SPATIAL_LAYER_SYNC VPX_CTRL_USE_TYPE(VP9E_SET_TPL, int) #define VPX_CTRL_VP9E_SET_TPL +VPX_CTRL_USE_TYPE(VP9E_SET_KEY_FRAME_FILTERING, int) +#define VPX_CTRL_VP9E_SET_KEY_FRAME_FILTERING VPX_CTRL_USE_TYPE(VP9E_SET_POSTENCODE_DROP, unsigned int) #define VPX_CTRL_VP9E_SET_POSTENCODE_DROP VPX_CTRL_USE_TYPE(VP9E_SET_DELTA_Q_UV, int) diff --git a/deps/vpx/include/vpx/vpx_codec.h b/deps/vpx/include/vpx/vpx_codec.h index 0d61b073..60288977 100644 --- a/deps/vpx/include/vpx/vpx_codec.h +++ b/deps/vpx/include/vpx/vpx_codec.h @@ -50,7 +50,7 @@ extern "C" { /*!\brief Decorator indicating a function is deprecated */ #ifndef VPX_DEPRECATED -#if defined(__GNUC__) && __GNUC__ +#if defined(__GNUC__) #define VPX_DEPRECATED __attribute__((deprecated)) #elif defined(_MSC_VER) #define VPX_DEPRECATED @@ -60,7 +60,7 @@ extern "C" { #endif /* VPX_DEPRECATED */ #ifndef VPX_DECLSPEC_DEPRECATED -#if defined(__GNUC__) && __GNUC__ +#if defined(__GNUC__) #define VPX_DECLSPEC_DEPRECATED /**< \copydoc #VPX_DEPRECATED */ #elif defined(_MSC_VER) /*!\brief \copydoc #VPX_DEPRECATED */ diff --git a/deps/vpx/include/vpx/vpx_decoder.h b/deps/vpx/include/vpx/vpx_decoder.h index 99dd8cf6..e2c31ea7 100644 --- a/deps/vpx/include/vpx/vpx_decoder.h +++ b/deps/vpx/include/vpx/vpx_decoder.h @@ -29,7 +29,7 @@ extern "C" { #endif -#include "./vpx_codec.h" +#include "./vpx_codec.h" // IWYU pragma: export #include "./vpx_frame_buffer.h" /*!\brief Current ABI version number @@ -152,7 +152,7 @@ vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx, * \param[in] iface Pointer to the algorithm interface * \param[in] data Pointer to a block of data to parse * \param[in] data_sz Size of the data buffer - * \param[in,out] si Pointer to stream info to update. The size member + * \param[in,out] si Pointer to stream info to update. The sz member * \ref MUST be properly initialized, but \ref MAY be * clobbered by the algorithm. This parameter \ref MAY * be NULL. @@ -170,7 +170,7 @@ vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface, * Returns information about the stream that has been parsed during decoding. * * \param[in] ctx Pointer to this instance's context - * \param[in,out] si Pointer to stream info to update. The size member + * \param[in,out] si Pointer to stream info to update. The sz member * \ref MUST be properly initialized, but \ref MAY be * clobbered by the algorithm. This parameter \ref MAY * be NULL. @@ -205,6 +205,8 @@ vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx, * this frame. * \param[in] deadline Soft deadline the decoder should attempt to meet, * in us. Set to zero for unlimited. + * NOTE: The deadline parameter is ignored. Always + * pass 0. * * \return Returns #VPX_CODEC_OK if the coded data was processed completely * and future pictures can be decoded without error. Otherwise, diff --git a/deps/vpx/include/vpx/vpx_encoder.h b/deps/vpx/include/vpx/vpx_encoder.h index e65d2722..501723b4 100644 --- a/deps/vpx/include/vpx/vpx_encoder.h +++ b/deps/vpx/include/vpx/vpx_encoder.h @@ -29,9 +29,8 @@ extern "C" { #endif -#include "./vpx_codec.h" +#include "./vpx_codec.h" // IWYU pragma: export #include "./vpx_ext_ratectrl.h" -#include "./vpx_tpl.h" /*! Temporal Scalability: Maximum length of the sequence defining frame * layer membership @@ -57,10 +56,15 @@ extern "C" { * must be bumped. Examples include, but are not limited to, changing * types, removing or reassigning enums, adding/removing/rearranging * fields to structures + * + * \note + * VPX_ENCODER_ABI_VERSION has a VPX_EXT_RATECTRL_ABI_VERSION component + * because the VP9E_SET_EXTERNAL_RATE_CONTROL codec control uses + * vpx_rc_funcs_t. */ -#define VPX_ENCODER_ABI_VERSION \ - (16 + VPX_CODEC_ABI_VERSION + VPX_EXT_RATECTRL_ABI_VERSION + \ - VPX_TPL_ABI_VERSION) /**<\hideinitializer*/ +#define VPX_ENCODER_ABI_VERSION \ + (18 + VPX_CODEC_ABI_VERSION + \ + VPX_EXT_RATECTRL_ABI_VERSION) /**<\hideinitializer*/ /*! \brief Encoder capabilities bitfield * @@ -460,6 +464,8 @@ typedef struct vpx_codec_enc_cfg { /*!\brief Target data rate * * Target bitrate to use for this stream, in kilobits per second. + * Internally capped to the smaller of the uncompressed bitrate and + * 1000000 kilobits per second. */ unsigned int rc_target_bitrate; @@ -988,12 +994,18 @@ vpx_codec_err_t vpx_codec_enc_config_set(vpx_codec_ctx_t *ctx, */ vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx); +/*!\brief Encode Deadline + * + * This type indicates a deadline, in microseconds, to be passed to + * vpx_codec_encode(). + */ +typedef unsigned long vpx_enc_deadline_t; /*!\brief deadline parameter analogous to VPx REALTIME mode. */ -#define VPX_DL_REALTIME (1) +#define VPX_DL_REALTIME 1ul /*!\brief deadline parameter analogous to VPx GOOD QUALITY mode. */ -#define VPX_DL_GOOD_QUALITY (1000000) +#define VPX_DL_GOOD_QUALITY 1000000ul /*!\brief deadline parameter analogous to VPx BEST QUALITY mode. */ -#define VPX_DL_BEST_QUALITY (0) +#define VPX_DL_BEST_QUALITY 0ul /*!\brief Encode a frame * * Encodes a video frame at the given "presentation time." The presentation @@ -1018,6 +1030,8 @@ vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx); * * \param[in] ctx Pointer to this instance's context * \param[in] img Image data to encode, NULL to flush. + * Encoding sample values outside the range + * [0..(1<bit_depth)-1] is undefined behavior. * \param[in] pts Presentation time stamp, in timebase units. * \param[in] duration Duration to show frame, in timebase units. * \param[in] flags Flags to use for encoding this frame. @@ -1033,7 +1047,7 @@ vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx); vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx, const vpx_image_t *img, vpx_codec_pts_t pts, unsigned long duration, vpx_enc_frame_flags_t flags, - unsigned long deadline); + vpx_enc_deadline_t deadline); /*!\brief Set compressed data output buffer * @@ -1077,6 +1091,12 @@ vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx, const vpx_image_t *img, * The buffer was set successfully. * \retval #VPX_CODEC_INVALID_PARAM * A parameter was NULL, the image format is unsupported, etc. + * + * \note + * `duration` and `deadline` are of the unsigned long type, which can be 32 + * or 64 bits. `duration` and `deadline` must be less than or equal to + * UINT32_MAX so that their ranges are independent of the size of unsigned + * long. */ vpx_codec_err_t vpx_codec_set_cx_data_buf(vpx_codec_ctx_t *ctx, const vpx_fixed_buf_t *buf, diff --git a/deps/vpx/include/vpx/vpx_ext_ratectrl.h b/deps/vpx/include/vpx/vpx_ext_ratectrl.h index 46d290df..2396f874 100644 --- a/deps/vpx/include/vpx/vpx_ext_ratectrl.h +++ b/deps/vpx/include/vpx/vpx_ext_ratectrl.h @@ -8,6 +8,10 @@ * be found in the AUTHORS file in the root of the source tree. */ +/*!\file + * \brief Defines structs and callbacks needed for external rate control. + * + */ #ifndef VPX_VPX_VPX_EXT_RATECTRL_H_ #define VPX_VPX_VPX_EXT_RATECTRL_H_ @@ -26,25 +30,51 @@ extern "C" { * types, removing or reassigning enums, adding/removing/rearranging * fields to structures. */ -#define VPX_EXT_RATECTRL_ABI_VERSION (7) +#define VPX_EXT_RATECTRL_ABI_VERSION (5 + VPX_TPL_ABI_VERSION) -/*!\brief The control type of the inference API. - * In VPX_RC_QP mode, the external rate control model determines the - * quantization parameter (QP) for each frame. - * In VPX_RC_GOP mode, the external rate control model determines the - * group of picture (GOP) of the video sequence. - * In VPX_RC_RDMULT mode, the external rate control model determines the - * rate-distortion multiplier (rdmult) for the current frame. - * In VPX_RC_GOP_QP mode, the external rate control model determines - * both the QP and the GOP. - * In VPX_RC_GOP_QP_RDMULT mode, the external rate control model determines - * the QP, GOP and the rdmult. +/*!\brief Corresponds to MAX_STATIC_GF_GROUP_LENGTH defined in vp9_ratectrl.h + */ +#define VPX_RC_MAX_STATIC_GF_GROUP_LENGTH 250 + +/*!\brief Max number of ref frames returned by the external RC. + * + * Corresponds to MAX_REF_FRAMES defined in vp9_blockd.h. + */ +#define VPX_RC_MAX_REF_FRAMES 4 + +/*!\brief The type of the external rate control. + * + * This controls what encoder parameters are determined by the external rate + * control. */ typedef enum vpx_rc_type { + /*! + * The external rate control doesn't determine anything. + * This mode is used as baseline. + */ + VPX_RC_NONE = 0, + /*! + * The external rate control model determines the quantization parameter (QP) + * for each frame. + */ VPX_RC_QP = 1 << 0, + /*! + * The external rate control model determines the group of picture (GOP) of + * the video sequence. + */ VPX_RC_GOP = 1 << 1, + /*! + * The external rate control model determines the rate-distortion multiplier + * (rdmult) for the current frame. + */ VPX_RC_RDMULT = 1 << 2, + /*! + * The external rate control model determines both QP and GOP. + */ VPX_RC_GOP_QP = VPX_RC_QP | VPX_RC_GOP, + /*! + * The external rate control model determines the QP, GOP and the rdmult. + */ VPX_RC_GOP_QP_RDMULT = VPX_RC_QP | VPX_RC_GOP | VPX_RC_RDMULT } vpx_rc_type_t; @@ -56,10 +86,35 @@ typedef enum vpx_ext_rc_mode { VPX_RC_CQ = 2, } vpx_ext_rc_mode_t; +/*!\brief Corresponds to FRAME_UPDATE_TYPE defined in vp9_firstpass.h. + */ +typedef enum vpx_rc_frame_update_type { + VPX_RC_INVALID_UPDATE_TYPE = -1, + VPX_RC_KF_UPDATE = 0, + VPX_RC_LF_UPDATE = 1, + VPX_RC_GF_UPDATE = 2, + VPX_RC_ARF_UPDATE = 3, + VPX_RC_OVERLAY_UPDATE = 4, + VPX_RC_MID_OVERLAY_UPDATE = 5, + VPX_RC_USE_BUF_FRAME = 6, +} vpx_rc_frame_update_type_t; + +/*!\brief Name for the ref frames returned by the external RC. + * + * Corresponds to the ref frames defined in vp9_blockd.h. + */ +typedef enum vpx_rc_ref_name { + VPX_RC_INVALID_REF_FRAME = -1, + VPX_RC_INTRA_FRAME = 0, + VPX_RC_LAST_FRAME = 1, + VPX_RC_GOLDEN_FRAME = 2, + VPX_RC_ALTREF_FRAME = 3, +} vpx_rc_ref_name_t; + /*!\brief Abstract rate control model handler * - * The encoder will receive the model handler from create_model() defined in - * vpx_rc_funcs_t. + * The encoder will receive the model handler from + * vpx_rc_funcs_t::create_model(). */ typedef void *vpx_rc_model_t; @@ -80,24 +135,17 @@ typedef void *vpx_rc_model_t; /*!\brief Encode frame decision made by the external rate control model * * The encoder will receive the decision from the external rate control model - * through get_encodeframe_decision() defined in vpx_rc_funcs_t. - * - * If q_index = VPX_DEFAULT_Q, the encoder will use libvpx's default q. - * - * If max_frame_size = 0, the encoding ignores max frame size limit. - * If max_frame_size = -1, the encoding uses VP9's max frame size as the limit. - * If the encoded frame size is larger than max_frame_size, the frame is - * recoded to meet the size limit, following VP9's recoding principles. + * through vpx_rc_funcs_t::get_encodeframe_decision(). */ typedef struct vpx_rc_encodeframe_decision { - int q_index; /**< Quantizer step index [0..255]*/ - int max_frame_size; /**< Maximal frame size allowed to encode a frame*/ + int q_index; /**< Quantizer step index [0..255]*/ + int rdmult; /**< Frame level Lagrangian multiplier*/ } vpx_rc_encodeframe_decision_t; /*!\brief Information for the frame to be encoded. * * The encoder will send the information to external rate control model through - * get_encodeframe_decision() defined in vpx_rc_funcs_t. + * vpx_rc_funcs_t::get_encodeframe_decision(). * */ typedef struct vpx_rc_encodeframe_info { @@ -135,12 +183,10 @@ typedef struct vpx_rc_encodeframe_info { /*!\brief Frame coding result * * The encoder will send the result to the external rate control model through - * update_encodeframe_result() defined in vpx_rc_funcs_t. + * vpx_rc_funcs_t::update_encodeframe_result(). */ typedef struct vpx_rc_encodeframe_result { - int64_t sse; /**< sum of squared error of the reconstructed frame */ - int64_t bit_count; /**< number of bits spent on coding the frame*/ - int64_t pixel_count; /**< number of pixels in YUV planes of the frame*/ + int64_t bit_count; /**< number of bits spent on coding the frame*/ int actual_encoding_qindex; /**< the actual qindex used to encode the frame*/ } vpx_rc_encodeframe_result_t; @@ -322,77 +368,26 @@ typedef struct vpx_rc_config { vpx_ext_rc_mode_t rc_mode; /**< Q mode or VBR mode */ int overshoot_percent; /**< for VBR mode only */ int undershoot_percent; /**< for VBR mode only */ + int min_base_q_index; /**< for VBR mode only */ + int max_base_q_index; /**< for VBR mode only */ + int base_qp; /**< base QP for leaf frames, 0-255 */ } vpx_rc_config_t; -/*!\brief Information passed to the external rate control model to - * help make GOP decisions. +/*!\brief Control what ref frame to use and its index. */ -typedef struct vpx_rc_gop_info { +typedef struct vpx_rc_ref_frame { /*! - * Minimum allowed gf interval, fixed for the whole clip. - * Note that it will be modified to match vp9's level constraints - * in the encoder. - * The level constraint is defined in vp9_encoder.c: - * const Vp9LevelSpec vp9_level_defs[VP9_LEVELS]. + * Ref frame index. Corresponding to |lst_fb_idx|, |gld_fb_idx| or + * |alt_fb_idx| in VP9_COMP depending on the ref frame #name. */ - int min_gf_interval; + int index[VPX_RC_MAX_REF_FRAMES]; /*! - * Maximum allowed gf interval, fixed for the whole clip. + * Ref frame name. This decides whether the #index is used as + * |lst_fb_idx|, |gld_fb_idx| or |alt_fb_idx| in VP9_COMP. + * */ - int max_gf_interval; - /*! - * Minimum allowed gf interval for the current GOP, determined - * by the encoder. - */ - int active_min_gf_interval; - /*! - * Maximum allowed gf interval for the current GOP, determined - * by the encoder. - */ - int active_max_gf_interval; - /*! - * Whether to allow the use of alt ref, determined by the encoder. - * It is fixed for the entire encode. - * See function "is_altref_enabled" in vp9_encoder.h. - */ - int allow_alt_ref; - /*! - * Is the current frame a key frame. - */ - int is_key_frame; - /*! - * Does the previous gop use alt ref or not. - */ - int last_gop_use_alt_ref; - /*! - * Current frame distance to the last keyframe, e.g., if Nth frame is a key, - * then the value of the N+1 th frame is 1. - */ - int frames_since_key; - /*! - * Current frame distance to the next keyframe, e.g. if Nth frame is a key, - * then the value of frame N - 1 is 1. - */ - int frames_to_key; - /*! - * Number of lookahead source frames. - */ - int lag_in_frames; - /*! - * Display index (temporal stamp) of this frame in the whole clip, - * starts from zero. - */ - int show_index; - /*! - * Coding index of this frame in the whole clip, starts from zero. - */ - int coding_index; - /*! - * The index of the current gop, starts from zero, resets to zero - * when a keyframe is set. - */ - int gop_global_index; -} vpx_rc_gop_info_t; + vpx_rc_ref_name_t name[VPX_RC_MAX_REF_FRAMES]; +} vpx_rc_ref_frame_t; /*!\brief The decision made by the external rate control model to set the * group of picture. @@ -400,8 +395,27 @@ typedef struct vpx_rc_gop_info { typedef struct vpx_rc_gop_decision { int gop_coding_frames; /**< The number of frames of this GOP */ int use_alt_ref; /**< Whether to use alt ref for this GOP */ + int use_key_frame; /**< Whether to set key frame for this GOP */ + /*! + * Frame type for each frame in this GOP. + * This will be populated to |update_type| in GF_GROUP defined in + * vp9_firstpass.h + */ + vpx_rc_frame_update_type_t update_type[VPX_RC_MAX_STATIC_GF_GROUP_LENGTH + 2]; + /*! Ref frame buffer index to be updated for each frame in this GOP. */ + int update_ref_index[VPX_RC_MAX_STATIC_GF_GROUP_LENGTH + 2]; + /*! Ref frame list to be used for each frame in this GOP. */ + vpx_rc_ref_frame_t ref_frame_list[VPX_RC_MAX_STATIC_GF_GROUP_LENGTH + 2]; } vpx_rc_gop_decision_t; +/*!\brief The decision made by the external rate control model to set the + * key frame location and the show frame count in the key frame group + */ +typedef struct vpx_rc_key_frame_decision { + int key_frame_show_index; /**< This key frame's show index in the video */ + int key_frame_group_size; /**< Show frame count of this key frame group */ +} vpx_rc_key_frame_decision_t; + /*!\brief Create an external rate control model callback prototype * * This callback is invoked by the encoder to create an external rate control @@ -446,12 +460,11 @@ typedef vpx_rc_status_t (*vpx_rc_send_tpl_gop_stats_cb_fn_t)( * the external rate control model. * * \param[in] rate_ctrl_model rate control model - * \param[in] encode_frame_info information of the coding frame + * \param[in] frame_gop_index index of the frame in current gop * \param[out] frame_decision encode decision of the coding frame */ typedef vpx_rc_status_t (*vpx_rc_get_encodeframe_decision_cb_fn_t)( - vpx_rc_model_t rate_ctrl_model, - const vpx_rc_encodeframe_info_t *encode_frame_info, + vpx_rc_model_t rate_ctrl_model, const int frame_gop_index, vpx_rc_encodeframe_decision_t *frame_decision); /*!\brief Update encode frame result callback prototype @@ -466,18 +479,28 @@ typedef vpx_rc_status_t (*vpx_rc_update_encodeframe_result_cb_fn_t)( vpx_rc_model_t rate_ctrl_model, const vpx_rc_encodeframe_result_t *encode_frame_result); +/*!\brief Get the key frame decision from the external rate control model. + * + * This callback is invoked by the encoder to get key frame decision from + * the external rate control model. + * + * \param[in] rate_ctrl_model rate control model + * \param[out] key_frame_decision key frame decision from the model + */ +typedef vpx_rc_status_t (*vpx_rc_get_key_frame_decision_cb_fn_t)( + vpx_rc_model_t rate_ctrl_model, + vpx_rc_key_frame_decision_t *key_frame_decision); + /*!\brief Get the GOP structure from the external rate control model. * * This callback is invoked by the encoder to get GOP decisions from * the external rate control model. * * \param[in] rate_ctrl_model rate control model - * \param[in] gop_info information collected from the encoder * \param[out] gop_decision GOP decision from the model */ typedef vpx_rc_status_t (*vpx_rc_get_gop_decision_cb_fn_t)( - vpx_rc_model_t rate_ctrl_model, const vpx_rc_gop_info_t *gop_info, - vpx_rc_gop_decision_t *gop_decision); + vpx_rc_model_t rate_ctrl_model, vpx_rc_gop_decision_t *gop_decision); /*!\brief Get the frame rdmult from the external rate control model. * @@ -506,7 +529,7 @@ typedef vpx_rc_status_t (*vpx_rc_delete_model_cb_fn_t)( * * The user can enable external rate control by registering * a set of callback functions with the codec control flag - * VP9E_SET_EXTERNAL_RATE_CONTROL. + * #VP9E_SET_EXTERNAL_RATE_CONTROL. */ typedef struct vpx_rc_funcs { /*! @@ -533,6 +556,10 @@ typedef struct vpx_rc_funcs { * Update encodeframe result to the external rate control model. */ vpx_rc_update_encodeframe_result_cb_fn_t update_encodeframe_result; + /*! + * Get key frame decision from the external rate control model. + */ + vpx_rc_get_key_frame_decision_cb_fn_t get_key_frame_decision; /*! * Get GOP decisions from the external rate control model. */ @@ -545,6 +572,11 @@ typedef struct vpx_rc_funcs { * Delete the external rate control model. */ vpx_rc_delete_model_cb_fn_t delete_model; + + /*! + * Rate control log path. + */ + const char *rate_ctrl_log_path; /*! * Private data for the external rate control model. */ diff --git a/deps/vpx/include/vpx/vpx_image.h b/deps/vpx/include/vpx/vpx_image.h index a0c16c34..314f6447 100644 --- a/deps/vpx/include/vpx/vpx_image.h +++ b/deps/vpx/include/vpx/vpx_image.h @@ -64,8 +64,12 @@ typedef enum vpx_color_space { /*!\brief List of supported color range */ typedef enum vpx_color_range { - VPX_CR_STUDIO_RANGE = 0, /**< Y [16..235], UV [16..240] */ - VPX_CR_FULL_RANGE = 1 /**< YUV/RGB [0..255] */ + VPX_CR_STUDIO_RANGE = 0, /**<- Y [16..235], UV [16..240] (bit depth 8) */ + /**<- Y [64..940], UV [64..960] (bit depth 10) */ + /**<- Y [256..3760], UV [256..3840] (bit depth 12) */ + VPX_CR_FULL_RANGE = 1 /**<- YUV/RGB [0..255] (bit depth 8) */ + /**<- YUV/RGB [0..1023] (bit depth 10) */ + /**<- YUV/RGB [0..4095] (bit depth 12) */ } vpx_color_range_t; /**< alias for enum vpx_color_range */ /**\brief Image Descriptor */ @@ -164,7 +168,9 @@ vpx_image_t *vpx_img_alloc(vpx_image_t *img, vpx_img_fmt_t fmt, * (2^27). * \param[in] stride_align Alignment, in bytes, of each row in the image * (stride). Must not exceed 65536. - * \param[in] img_data Storage to use for the image + * \param[in] img_data Storage to use for the image. The storage must + * outlive the returned image descriptor; it can be + * disposed of after calling vpx_img_free(). * * \return Returns a pointer to the initialized image descriptor. If the img * parameter is non-null, the value of the img parameter will be diff --git a/deps/vpx/include/vpx/vpx_integer.h b/deps/vpx/include/vpx/vpx_integer.h index 4129d156..34e37964 100644 --- a/deps/vpx/include/vpx/vpx_integer.h +++ b/deps/vpx/include/vpx/vpx_integer.h @@ -12,7 +12,7 @@ #define VPX_VPX_VPX_INTEGER_H_ /* get ptrdiff_t, size_t, wchar_t, NULL */ -#include +#include // IWYU pragma: export #if defined(_MSC_VER) #define VPX_FORCE_INLINE __forceinline @@ -34,7 +34,7 @@ #endif #endif // __cplusplus -#include -#include +#include // IWYU pragma: export +#include // IWYU pragma: export #endif // VPX_VPX_VPX_INTEGER_H_ diff --git a/deps/vpx/include/vpx/vpx_tpl.h b/deps/vpx/include/vpx/vpx_tpl.h index a250aada..e14eefcd 100644 --- a/deps/vpx/include/vpx/vpx_tpl.h +++ b/deps/vpx/include/vpx/vpx_tpl.h @@ -15,8 +15,6 @@ #ifndef VPX_VPX_VPX_TPL_H_ #define VPX_VPX_VPX_TPL_H_ -#include - #include "./vpx_integer.h" #include "./vpx_codec.h" @@ -32,19 +30,21 @@ extern "C" { * types, removing or reassigning enums, adding/removing/rearranging * fields to structures */ -#define VPX_TPL_ABI_VERSION (2) /**<\hideinitializer*/ +#define VPX_TPL_ABI_VERSION 4 /**<\hideinitializer*/ /*!\brief Temporal dependency model stats for each block before propagation */ typedef struct VpxTplBlockStats { - int16_t row; /**< Pixel row of the top left corner */ - int16_t col; /**< Pixel col of the top left corner */ - int64_t intra_cost; /**< Intra cost */ - int64_t inter_cost; /**< Inter cost */ - int16_t mv_r; /**< Motion vector row */ - int16_t mv_c; /**< Motion vector col */ - int64_t recrf_rate; /**< Rate from reconstructed ref frame */ - int64_t recrf_dist; /**< Distortion from reconstructed ref frame */ - int ref_frame_index; /**< Ref frame index in the ref frame buffer */ + int16_t row; /**< Pixel row of the top left corner */ + int16_t col; /**< Pixel col of the top left corner */ + int64_t intra_cost; /**< Intra cost */ + int64_t inter_cost; /**< Inter cost */ + int16_t mv_r; /**< Motion vector row */ + int16_t mv_c; /**< Motion vector col */ + int64_t srcrf_rate; /**< Rate from source ref frame */ + int64_t srcrf_dist; /**< Distortion from source ref frame */ + int64_t inter_pred_err; /**< Inter prediction error */ + int64_t intra_pred_err; /**< Intra prediction error */ + int ref_frame_index; /**< Ref frame index in the ref frame buffer */ } VpxTplBlockStats; /*!\brief Temporal dependency model stats for each frame before propagation */ @@ -61,40 +61,6 @@ typedef struct VpxTplGopStats { VpxTplFrameStats *frame_stats_list; /**< List of tpl stats for each frame */ } VpxTplGopStats; -/*!\brief Write VpxTplGopStats to file - * - * Accepts an opened file handle and writes \p tpl_gop_stats. - * - * \param[in] tpl_file A FILE pointer that's already been opened. - * \param[in] tpl_gop_stats VpxTplGopStats that contains TPL stats for the - * whole GOP. - * - * \return VPX_CODEC_OK if TPL stats are successfully written. - */ -vpx_codec_err_t vpx_write_tpl_gop_stats(FILE *tpl_file, - const VpxTplGopStats *tpl_gop_stats); - -/*!\brief Read VpxTplGopStats from file - * - * Accepts an opened file handle and reads TPL stats and stores them into - * \p tpl_gop_stats. Allocates memory for TPL stats. - * - * \param[in] tpl_file A FILE pointer that's already been opened. - * \param[out] tpl_gop_stats VpxTplGopStats that contains TPL stats for the - * whole GOP. - * - * \return VPX_CODEC_OK if TPL stats are successfully read from file. - */ -vpx_codec_err_t vpx_read_tpl_gop_stats(FILE *tpl_file, - VpxTplGopStats *tpl_gop_stats); - -/*!\brief Free the memory allocated for VpxTplGopStats - * - * \param[in] tpl_gop_stats VpxTplGopStats that contains TPL stats for the - * whole GOP. - */ -void vpx_free_tpl_gop_stats(VpxTplGopStats *tpl_gop_stats); - #ifdef __cplusplus } // extern "C" #endif diff --git a/deps/vpx/lib/libvpx.a b/deps/vpx/lib/libvpx.a index 1ecba2ad..34a09c25 100644 Binary files a/deps/vpx/lib/libvpx.a and b/deps/vpx/lib/libvpx.a differ diff --git a/deps/vpx/lib/pkgconfig/vpx.pc b/deps/vpx/lib/pkgconfig/vpx.pc index c1db27d1..84176a45 100644 --- a/deps/vpx/lib/pkgconfig/vpx.pc +++ b/deps/vpx/lib/pkgconfig/vpx.pc @@ -1,4 +1,4 @@ -# pkg-config file from libvpx v1.14.1 +# pkg-config file from libvpx v1.15.0 prefix= exec_prefix=${prefix} libdir=${exec_prefix}/lib @@ -6,7 +6,7 @@ includedir=${prefix}/include Name: vpx Description: WebM Project VPx codec implementation -Version: 1.14.1 +Version: 1.15.0 Requires: Conflicts: Libs: -L${libdir} -lvpx -lm