[libvpx] Update to v1.12.0

This commit is contained in:
Andrey Volk committed 2026-07-10 19:38:46 +03:00
1 parent 287a71dc66
commit b5046d2a76
572 files changed
+52900 -29493

No files matched your search

+26 -13
View File
@@ -27,13 +27,15 @@
* </pre>
*
* An application instantiates a specific decoder instance by using
* vpx_codec_init() and a pointer to the algorithm's interface structure:
* vpx_codec_dec_init() and a pointer to the algorithm's interface structure:
* <pre>
* my_app.c:
* extern vpx_codec_iface_t my_codec;
* {
* vpx_codec_ctx_t algo;
* res = vpx_codec_init(&algo, &my_codec);
* int threads = 4;
* vpx_codec_dec_cfg_t cfg = { threads, 0, 0 };
* res = vpx_codec_dec_init(&algo, &my_codec, &cfg, 0);
* }
* </pre>
*
@@ -66,7 +68,7 @@ typedef struct vpx_codec_priv_enc_mr_cfg vpx_codec_priv_enc_mr_cfg_t;
/*!\brief init function pointer prototype
*
* Performs algorithm-specific initialization of the decoder context. This
* function is called by the generic vpx_codec_init() wrapper function, so
* function is called by vpx_codec_dec_init() and vpx_codec_enc_init(), so
* plugins implementing this interface may trust the input parameters to be
* properly initialized.
*
@@ -175,16 +177,15 @@ typedef const struct vpx_codec_ctrl_fn_map {
/*!\brief decode data function pointer prototype
*
* Processes a buffer of coded data. If the processing results in a new
* decoded frame becoming available, #VPX_CODEC_CB_PUT_SLICE and
* #VPX_CODEC_CB_PUT_FRAME events are generated as appropriate. This
* function is called by the generic vpx_codec_decode() wrapper function,
* so plugins implementing this interface may trust the input parameters
* to be properly initialized.
* decoded frame becoming available, put_slice and put_frame callbacks
* are invoked as appropriate. This function is called by the generic
* vpx_codec_decode() wrapper function, so plugins implementing this
* interface may trust the input parameters to be properly initialized.
*
* \param[in] ctx Pointer to this instance's context
* \param[in] data Pointer to this block of new coded data. If
* NULL, a #VPX_CODEC_CB_PUT_FRAME event is posted
* for the previously decoded frame.
* NULL, the put_frame callback is invoked for
* the previously decoded frame.
* \param[in] data_sz Size of the coded data, in bytes.
*
* \return Returns #VPX_CODEC_OK if the coded data was processed completely
@@ -282,7 +283,7 @@ typedef const struct vpx_codec_enc_cfg_map {
vpx_codec_enc_cfg_t cfg;
} vpx_codec_enc_cfg_map_t;
/*!\brief Decoder algorithm interface interface
/*!\brief Decoder algorithm interface
*
* All decoders \ref MUST expose a variable of this type.
*/
@@ -434,9 +435,21 @@ struct vpx_internal_error_info {
#endif
#endif
// Tells the compiler to perform `printf` format string checking if the
// compiler supports it; see the 'format' attribute in
// <https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html>.
#define LIBVPX_FORMAT_PRINTF(string_index, first_to_check)
#if defined(__has_attribute)
#if __has_attribute(format)
#undef LIBVPX_FORMAT_PRINTF
#define LIBVPX_FORMAT_PRINTF(string_index, first_to_check) \
__attribute__((__format__(__printf__, string_index, first_to_check)))
#endif
#endif
void vpx_internal_error(struct vpx_internal_error_info *info,
vpx_codec_err_t error, const char *fmt,
...) CLANG_ANALYZER_NORETURN;
vpx_codec_err_t error, const char *fmt, ...)
LIBVPX_FORMAT_PRINTF(3, 4) CLANG_ANALYZER_NORETURN;
#ifdef __cplusplus
} // extern "C"
@@ -0,0 +1,62 @@
/*
* Copyright (c) 2021 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef VPX_VPX_INTERNAL_VPX_RATECTRL_RTC_H_
#define VPX_VPX_INTERNAL_VPX_RATECTRL_RTC_H_
#include "vpx/vpx_encoder.h"
namespace libvpx {
struct VpxRateControlRtcConfig {
public:
VpxRateControlRtcConfig() {
width = 1280;
height = 720;
max_quantizer = 63;
min_quantizer = 2;
target_bandwidth = 1000;
buf_initial_sz = 600;
buf_optimal_sz = 600;
buf_sz = 1000;
undershoot_pct = overshoot_pct = 50;
max_intra_bitrate_pct = 50;
max_inter_bitrate_pct = 0;
framerate = 30.0;
ts_number_layers = 1;
rc_mode = VPX_CBR;
aq_mode = 0;
layer_target_bitrate[0] = static_cast<int>(target_bandwidth);
ts_rate_decimator[0] = 1;
}
int width;
int height;
// 0-63
int max_quantizer;
int min_quantizer;
int64_t target_bandwidth;
int64_t buf_initial_sz;
int64_t buf_optimal_sz;
int64_t buf_sz;
int undershoot_pct;
int overshoot_pct;
int max_intra_bitrate_pct;
int max_inter_bitrate_pct;
double framerate;
// Number of temporal layers
int ts_number_layers;
int layer_target_bitrate[VPX_MAX_LAYERS];
int ts_rate_decimator[VPX_TS_MAX_LAYERS];
// vbr, cbr
enum vpx_rc_mode rc_mode;
int aq_mode;
};
} // namespace libvpx
#endif // VPX_VPX_INTERNAL_VPX_RATECTRL_RTC_H_