aboutsummaryrefslogtreecommitdiff
path: root/third_party/libaom/source/libaom/aom
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libaom/source/libaom/aom')
-rw-r--r--third_party/libaom/source/libaom/aom/aom.h50
-rw-r--r--third_party/libaom/source/libaom/aom/aom_codec.h2
-rw-r--r--third_party/libaom/source/libaom/aom/aom_encoder.h22
-rw-r--r--third_party/libaom/source/libaom/aom/aom_external_partition.h331
-rw-r--r--third_party/libaom/source/libaom/aom/aomcx.h79
-rw-r--r--third_party/libaom/source/libaom/aom/aomdx.h3
-rw-r--r--third_party/libaom/source/libaom/aom/internal/aom_codec_internal.h2
-rw-r--r--third_party/libaom/source/libaom/aom/src/aom_image.c4
8 files changed, 434 insertions, 59 deletions
diff --git a/third_party/libaom/source/libaom/aom/aom.h b/third_party/libaom/source/libaom/aom/aom.h
index c591dc9a43..0650a11f6b 100644
--- a/third_party/libaom/source/libaom/aom/aom.h
+++ b/third_party/libaom/source/libaom/aom/aom.h
@@ -41,27 +41,45 @@ extern "C" {
/*!\brief Control functions
*
* The set of macros define the control functions of AOM interface
+ * The range for common control IDs is 230-255(max).
*/
enum aom_com_control_id {
- /* TODO(https://crbug.com/aomedia/2671): The encoder overlaps the range of
- * these values for its control ids, see the NOTEs in aom/aomcx.h. These
- * should be migrated to something like the AOM_DECODER_CTRL_ID_START range
- * next time we're ready to break the ABI.
+ /*!\brief Codec control function to get a pointer to a reference frame
+ *
+ * av1_ref_frame_t* parameter
*/
- AV1_GET_REFERENCE = 128, /**< get a pointer to a reference frame,
- av1_ref_frame_t* parameter */
- AV1_SET_REFERENCE = 129, /**< write a frame into a reference buffer,
- av1_ref_frame_t* parameter */
- AV1_COPY_REFERENCE = 130, /**< get a copy of reference frame from the decoderm
- av1_ref_frame_t* parameter */
- AOM_COMMON_CTRL_ID_MAX,
-
- AV1_GET_NEW_FRAME_IMAGE =
- 192, /**< get a pointer to the new frame, aom_image_t* parameter */
- AV1_COPY_NEW_FRAME_IMAGE = 193, /**< copy the new frame to an external buffer,
- aom_image_t* parameter */
+ AV1_GET_REFERENCE = 230,
+ /*!\brief Codec control function to write a frame into a reference buffer
+ *
+ * av1_ref_frame_t* parameter
+ */
+ AV1_SET_REFERENCE = 231,
+
+ /*!\brief Codec control function to get a copy of reference frame from the
+ * decoder
+ *
+ * av1_ref_frame_t* parameter
+ */
+ AV1_COPY_REFERENCE = 232,
+
+ /*!\brief Codec control function to get a pointer to the new frame
+ *
+ * aom_image_t* parameter
+ */
+ AV1_GET_NEW_FRAME_IMAGE = 233,
+
+ /*!\brief Codec control function to copy the new frame to an external buffer
+ *
+ * aom_image_t* parameter
+ */
+ AV1_COPY_NEW_FRAME_IMAGE = 234,
+
+ /*!\brief Start point of control IDs for aom_dec_control_id.
+ * Any new common control IDs should be added above.
+ */
AOM_DECODER_CTRL_ID_START = 256
+ // No common control IDs should be added after AOM_DECODER_CTRL_ID_START.
};
/*!\brief AV1 specific reference frame data struct
diff --git a/third_party/libaom/source/libaom/aom/aom_codec.h b/third_party/libaom/source/libaom/aom/aom_codec.h
index f58272ee2c..a2a9efaef3 100644
--- a/third_party/libaom/source/libaom/aom/aom_codec.h
+++ b/third_party/libaom/source/libaom/aom/aom_codec.h
@@ -149,7 +149,7 @@ extern "C" {
* types, removing or reassigning enums, adding/removing/rearranging
* fields to structures
*/
-#define AOM_CODEC_ABI_VERSION (6 + AOM_IMAGE_ABI_VERSION) /**<\hideinitializer*/
+#define AOM_CODEC_ABI_VERSION (7 + AOM_IMAGE_ABI_VERSION) /**<\hideinitializer*/
/*!\brief Algorithm return codes */
typedef enum {
diff --git a/third_party/libaom/source/libaom/aom/aom_encoder.h b/third_party/libaom/source/libaom/aom/aom_encoder.h
index 48e705646d..a98c8d8270 100644
--- a/third_party/libaom/source/libaom/aom/aom_encoder.h
+++ b/third_party/libaom/source/libaom/aom/aom_encoder.h
@@ -31,6 +31,7 @@ extern "C" {
#endif
#include "aom/aom_codec.h"
+#include "aom/aom_external_partition.h"
/*!\brief Current ABI version number
*
@@ -41,7 +42,7 @@ extern "C" {
* fields to structures
*/
#define AOM_ENCODER_ABI_VERSION \
- (9 + AOM_CODEC_ABI_VERSION) /**<\hideinitializer*/
+ (9 + AOM_CODEC_ABI_VERSION + AOM_EXT_PART_ABI_VERSION) /**<\hideinitializer*/
/*! \brief Encoder capabilities bitfield
*
@@ -142,15 +143,8 @@ typedef struct aom_codec_cx_pkt {
double psnr_hbd[4];
} psnr; /**< data for PSNR packet */
aom_fixed_buf_t raw; /**< data for arbitrary packets */
-
- /* This packet size is fixed to allow codecs to extend this
- * interface without having to manage storage for raw packets,
- * i.e., if it's smaller than 128 bytes, you can store in the
- * packet list directly.
- */
- char pad[128 - sizeof(enum aom_codec_cx_pkt_kind)]; /**< fixed sz */
- } data; /**< packet data */
-} aom_codec_cx_pkt_t; /**< alias for struct aom_codec_cx_pkt */
+ } data; /**< packet data */
+} aom_codec_cx_pkt_t; /**< alias for struct aom_codec_cx_pkt */
/*!\brief Rational Number
*
@@ -300,10 +294,6 @@ typedef struct cfg_options {
*
*/
unsigned int disable_smooth_intra;
- /*!\brief disable D45 to D203 intra modes
- *
- */
- unsigned int disable_diagonal_intra;
/*!\brief disable filter intra
*
*/
@@ -880,11 +870,11 @@ typedef struct aom_codec_enc_cfg {
*/
unsigned int use_fixed_qp_offsets;
-/*!\brief Number of fixed QP offsets
+/*!\brief Max number of fixed QP offsets
*
* This defines the number of elements in the fixed_qp_offsets array.
*/
-#define FIXED_QP_OFFSET_COUNT 5
+#define FIXED_QP_OFFSET_COUNT 6
/*!\brief Array of fixed QP offsets
*
diff --git a/third_party/libaom/source/libaom/aom/aom_external_partition.h b/third_party/libaom/source/libaom/aom/aom_external_partition.h
new file mode 100644
index 0000000000..3710466316
--- /dev/null
+++ b/third_party/libaom/source/libaom/aom/aom_external_partition.h
@@ -0,0 +1,331 @@
+/*
+ * Copyright (c) 2021, Alliance for Open Media. All rights reserved
+ *
+ * This source code is subject to the terms of the BSD 2 Clause License and
+ * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
+ * was not distributed with this source code in the LICENSE file, you can
+ * obtain it at www.aomedia.org/license/software. If the Alliance for Open
+ * Media Patent License 1.0 was not distributed with this source code in the
+ * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
+ */
+#ifndef AOM_AOM_AOM_EXTERNAL_PARTITION_H_
+#define AOM_AOM_AOM_EXTERNAL_PARTITION_H_
+
+/*!\defgroup aom_encoder AOMedia AOM/AV1 Encoder
+ * \ingroup aom
+ *
+ * @{
+ */
+#include "./aom_integer.h"
+
+/*!\file
+ * \brief Provides function pointer definitions for the external partition.
+ */
+
+/*!\brief Current ABI version number
+ *
+ * \internal
+ * If this file is altered in any way that changes the ABI, this value
+ * must be bumped. Examples include, but are not limited to, changing
+ * types, removing or reassigning enums, adding/removing/rearranging
+ * fields to structures.
+ */
+#define AOM_EXT_PART_ABI_VERSION (1)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*!\brief Abstract external partition model handler
+ */
+typedef void *aom_ext_part_model_t;
+
+/*!\brief Number of features to determine whether to skip partition none and
+ * do partition split directly. The same as "FEATURE_SIZE_SMS_SPLIT".
+ */
+#define SIZE_DIRECT_SPLIT 17
+
+/*!\brief Number of features to use simple motion search to prune out
+ * rectangular partition in some direction. The same as
+ * "FEATURE_SIZE_SMS_PRUNE_PART".
+ */
+#define SIZE_PRUNE_PART 25
+
+/*!\brief Number of features to prune split and rectangular partition
+ * after PARTITION_NONE.
+ */
+#define SIZE_PRUNE_NONE 4
+
+/*!\brief Number of features to terminates partition after partition none using
+ * simple_motion_search features and the rate, distortion, and rdcost of
+ * PARTITION_NONE. The same as "FEATURE_SIZE_SMS_TERM_NONE".
+ */
+#define SIZE_TERM_NONE 28
+
+/*!\brief Number of features to terminates partition after partition split.
+ */
+#define SIZE_TERM_SPLIT 31
+
+/*!\brief Number of features to prune rectangular partition using stats
+ * collected after partition split.
+ */
+#define SIZE_PRUNE_RECT 9
+
+/*!\brief Number of features to prune AB partition using stats
+ * collected after rectangular partition..
+ */
+#define SIZE_PRUNE_AB 10
+
+/*!\brief Number of features to prune 4-way partition using stats
+ * collected after AB partition.
+ */
+#define SIZE_PRUNE_4_WAY 18
+
+/*!\brief Config information sent to the external partition model.
+ *
+ * For example, the maximum superblock size determined by the sequence header.
+ */
+typedef struct aom_ext_part_config {
+ int superblock_size; /**< super block size (either 64x64 or 128x128) */
+} aom_ext_part_config_t;
+
+/*!\brief Features pass to the external model to make partition decisions.
+ * Specifically, features collected before NONE partition.
+ * Features "f" are used to determine:
+ * partition_none_allowed, partition_horz_allowed, partition_vert_allowed,
+ * do_rectangular_split, do_square_split
+ * Features "f_part2" are used to determine:
+ * prune_horz, prune_vert.
+ */
+typedef struct aom_partition_features_before_none {
+ float f[SIZE_DIRECT_SPLIT]; /**< features to determine whether skip partition
+ none and do split directly */
+ float f_part2[SIZE_PRUNE_PART]; /**< features to determine whether to prune
+ rectangular partition */
+} aom_partition_features_before_none_t;
+
+/*!\brief Features pass to the external model to make partition decisions.
+ * Specifically, features collected after NONE partition.
+ */
+typedef struct aom_partition_features_none {
+ float f[SIZE_PRUNE_NONE]; /**< features to prune split and rectangular
+ partition*/
+ float f_terminate[SIZE_TERM_NONE]; /**< features to determine termination of
+ partition */
+} aom_partition_features_none_t;
+
+/*!\brief Features pass to the external model to make partition decisions.
+ * Specifically, features collected after SPLIT partition.
+ */
+typedef struct aom_partition_features_split {
+ float f_terminate[SIZE_TERM_SPLIT]; /**< features to determine termination of
+ partition */
+ float f_prune_rect[SIZE_PRUNE_RECT]; /**< features to determine pruning rect
+ partition */
+} aom_partition_features_split_t;
+
+/*!\brief Features pass to the external model to make partition decisions.
+ * Specifically, features collected after RECTANGULAR partition.
+ */
+typedef struct aom_partition_features_rect {
+ float f[SIZE_PRUNE_AB]; /**< features to determine pruning AB partition */
+} aom_partition_features_rect_t;
+
+/*!\brief Features pass to the external model to make partition decisions.
+ * Specifically, features collected after AB partition: HORZ_A, HORZ_B, VERT_A,
+ * VERT_B.
+ */
+typedef struct aom_partition_features_ab {
+ float
+ f[SIZE_PRUNE_4_WAY]; /**< features to determine pruning 4-way partition */
+} aom_partition_features_ab_t;
+
+/*!\brief Feature id to tell the external model the current stage in partition
+ * pruning and what features to use to make decisions accordingly.
+ */
+typedef enum {
+ FEATURE_BEFORE_PART_NONE,
+ FEATURE_BEFORE_PART_NONE_PART2,
+ FEATURE_AFTER_PART_NONE,
+ FEATURE_AFTER_PART_NONE_PART2,
+ FEATURE_AFTER_PART_SPLIT,
+ FEATURE_AFTER_PART_SPLIT_PART2,
+ FEATURE_AFTER_PART_RECT,
+ FEATURE_AFTER_PART_AB
+} PART_FEATURE_ID;
+
+/*!\brief Features pass to the external model to make partition decisions.
+ *
+ * The encoder sends these features to the external model through
+ * "func()" defined in .....
+ *
+ * NOTE: new member variables may be added to this structure in the future.
+ * Once new features are finalized, bump the major version of libaom.
+ */
+typedef struct aom_partition_features {
+ PART_FEATURE_ID id; /**< Feature ID to indicate active features */
+ aom_partition_features_before_none_t
+ before_part_none; /**< Features collected before NONE partition */
+ aom_partition_features_none_t
+ after_part_none; /**< Features collected after NONE partition */
+ aom_partition_features_split_t
+ after_part_split; /**< Features collected after SPLIT partition */
+ aom_partition_features_rect_t
+ after_part_rect; /**< Features collected after RECTANGULAR partition */
+ aom_partition_features_ab_t
+ after_part_ab; /**< Features collected after AB partition */
+} aom_partition_features_t;
+
+/*!\brief Partition decisions received from the external model.
+ *
+ * The encoder receives partition decisions and encodes the superblock
+ * with the given partition type.
+ * The encoder receives it from "func()" define in ....
+ *
+ * NOTE: new member variables may be added to this structure in the future.
+ * Once new features are finalized, bump the major version of libaom.
+ */
+typedef struct aom_partition_decision {
+ // Decisions for directly set partition types
+ int is_final_decision; /**< The flag whether it is the final decision */
+ int partition_decision[256]; /**< Partition decisions */
+
+ // Decisions for partition type pruning
+ int terminate_partition_search; /**< Terminate further partition search */
+ int partition_none_allowed; /**< Allow partition none type */
+ int partition_rect_allowed[2]; /**< Allow rectangular partitions */
+ int do_rectangular_split; /**< Try rectangular split partition */
+ int do_square_split; /**< Try square split partition */
+ int prune_rect_part[2]; /**< Prune rectangular partition */
+ int horza_partition_allowed; /**< Allow HORZ_A partitioin */
+ int horzb_partition_allowed; /**< Allow HORZ_B partitioin */
+ int verta_partition_allowed; /**< Allow VERT_A partitioin */
+ int vertb_partition_allowed; /**< Allow VERT_B partitioin */
+ int partition_horz4_allowed; /**< Allow HORZ4 partition */
+ int partition_vert4_allowed; /**< Allow VERT4 partition */
+} aom_partition_decision_t;
+
+/*!\brief Encoding stats for the given partition decision.
+ *
+ * The encoding stats collected by encoding the superblock with the
+ * given partition types.
+ * The encoder sends the stats to the external model for training
+ * or inference though "func()" defined in ....
+ */
+typedef struct aom_partition_stats {
+ int rate; /**< Rate cost of the block */
+ int64_t dist; /**< Distortion of the block */
+ int64_t rdcost; /**< Rate-distortion cost of the block */
+} aom_partition_stats_t;
+
+/*!\brief Enum for return status.
+ */
+typedef enum aom_ext_part_status {
+ AOM_EXT_PART_OK = 0, /**< Status of success */
+ AOM_EXT_PART_ERROR = 1, /**< Status of failure */
+ AOM_EXT_PART_TEST = 2, /**< Status used for tests */
+} aom_ext_part_status_t;
+
+/*!\brief Callback of creating an external partition model.
+ *
+ * The callback is invoked by the encoder to create an external partition
+ * model.
+ *
+ * \param[in] priv Callback's private data
+ * \param[in] part_config Config information pointer for model creation
+ * \param[out] ext_part_model Pointer to the model
+ */
+typedef aom_ext_part_status_t (*aom_ext_part_create_model_fn_t)(
+ void *priv, const aom_ext_part_config_t *part_config,
+ aom_ext_part_model_t *ext_part_model);
+
+/*!\brief Callback of sending features to the external partition model.
+ *
+ * The callback is invoked by the encoder to send features to the external
+ * partition model.
+ *
+ * \param[in] ext_part_model The external model
+ * \param[in] part_features Pointer to the features
+ */
+typedef aom_ext_part_status_t (*aom_ext_part_send_features_fn_t)(
+ aom_ext_part_model_t ext_part_model,
+ const aom_partition_features_t *part_features);
+
+/*!\brief Callback of receiving partition decisions from the external
+ * partition model.
+ *
+ * The callback is invoked by the encoder to receive partition decisions from
+ * the external partition model.
+ *
+ * \param[in] ext_part_model The external model
+ * \param[in] ext_part_decision Pointer to the partition decisions
+ */
+typedef aom_ext_part_status_t (*aom_ext_part_get_decision_fn_t)(
+ aom_ext_part_model_t ext_part_model,
+ aom_partition_decision_t *ext_part_decision);
+
+/*!\brief Callback of sending stats to the external partition model.
+ *
+ * The callback is invoked by the encoder to send encoding stats to
+ * the external partition model.
+ *
+ * \param[in] ext_part_model The external model
+ * \param[in] ext_part_stats Pointer to the encoding stats
+ */
+typedef aom_ext_part_status_t (*aom_ext_part_send_partition_stats_fn_t)(
+ aom_ext_part_model_t ext_part_model,
+ const aom_partition_stats_t *ext_part_stats);
+
+/*!\brief Callback of deleting the external partition model.
+ *
+ * The callback is invoked by the encoder to delete the external partition
+ * model.
+ *
+ * \param[in] ext_part_model The external model
+ */
+typedef aom_ext_part_status_t (*aom_ext_part_delete_model_fn_t)(
+ aom_ext_part_model_t ext_part_model);
+
+/*!\brief Callback function set for external partition model.
+ *
+ * Uses can enable external partition model by registering a set of
+ * callback functions with the flag: AV1E_SET_EXTERNAL_PARTITION_MODEL
+ */
+typedef struct aom_ext_part_funcs {
+ /*!
+ * Create an external partition model.
+ */
+ aom_ext_part_create_model_fn_t create_model;
+
+ /*!
+ * Send features to the external partition model to make partition decisions.
+ */
+ aom_ext_part_send_features_fn_t send_features;
+
+ /*!
+ * Get partition decisions from the external partition model.
+ */
+ aom_ext_part_get_decision_fn_t get_partition_decision;
+
+ /*!
+ * Send stats of the current partition to the external model.
+ */
+ aom_ext_part_send_partition_stats_fn_t send_partition_stats;
+
+ /*!
+ * Delete the external partition model.
+ */
+ aom_ext_part_delete_model_fn_t delete_model;
+
+ /*!
+ * Private data for the external partition model.
+ */
+ void *priv;
+} aom_ext_part_funcs_t;
+
+/*!@} - end defgroup aom_encoder*/
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // AOM_AOM_AOM_EXTERNAL_PARTITION_H_
diff --git a/third_party/libaom/source/libaom/aom/aomcx.h b/third_party/libaom/source/libaom/aom/aomcx.h
index 87f0b5db9b..8345911abd 100644
--- a/third_party/libaom/source/libaom/aom/aomcx.h
+++ b/third_party/libaom/source/libaom/aom/aomcx.h
@@ -18,6 +18,7 @@
*/
#include "aom/aom.h"
#include "aom/aom_encoder.h"
+#include "aom/aom_external_partition.h"
/*!\file
* \brief Provides definitions for using AOM or AV1 encoder algorithm within the
@@ -167,6 +168,7 @@ extern aom_codec_iface_t *aom_codec_av1_cx(void);
*
* This set of macros define the control functions available for AVx
* encoder interface.
+ * The range of encode control ID is 7-229(max).
*
* \sa #aom_codec_control(aom_codec_ctx_t *ctx, int ctrl_id, ...)
*/
@@ -221,10 +223,14 @@ enum aome_enc_control_id {
/* NOTE: enum 15 unused */
- /*!\brief Codec control function to set loop filter sharpness,
+ /*!\brief Codec control function to set the sharpness parameter,
* unsigned int parameter.
*
- * Valid range: 0..7. The default is 0.
+ * This parameter controls the level at which rate-distortion optimization of
+ * transform coefficients favours sharpness in the block.
+ *
+ * Valid range: 0..7. The default is 0. Values 1-7 will avoid eob and skip
+ * block optimization and will change rdmult in favour of block sharpness.
*/
AOME_SET_SHARPNESS = AOME_SET_ENABLEAUTOALTREF + 2, // 16
@@ -1204,9 +1210,6 @@ enum aome_enc_control_id {
parameter */
AV1E_SET_REDUCED_REFERENCE_SET = 125,
- /* NOTE: enums 126-139 unused */
- /* NOTE: Need a gap in enum values to avoud conflict with 128, 129, 130 */
-
/*!\brief Control to set frequency of the cost updates for coefficients,
* unsigned int parameter
*
@@ -1215,7 +1218,7 @@ enum aome_enc_control_id {
* - 2 = update at tile level
* - 3 = turn off
*/
- AV1E_SET_COEFF_COST_UPD_FREQ = 140,
+ AV1E_SET_COEFF_COST_UPD_FREQ = 126,
/*!\brief Control to set frequency of the cost updates for mode, unsigned int
* parameter
@@ -1225,7 +1228,7 @@ enum aome_enc_control_id {
* - 2 = update at tile level
* - 3 = turn off
*/
- AV1E_SET_MODE_COST_UPD_FREQ = 141,
+ AV1E_SET_MODE_COST_UPD_FREQ = 127,
/*!\brief Control to set frequency of the cost updates for motion vectors,
* unsigned int parameter
@@ -1235,7 +1238,7 @@ enum aome_enc_control_id {
* - 2 = update at tile level
* - 3 = turn off
*/
- AV1E_SET_MV_COST_UPD_FREQ = 142,
+ AV1E_SET_MV_COST_UPD_FREQ = 128,
/*!\brief Control to set bit mask that specifies which tier each of the 32
* possible operating points conforms to, unsigned int parameter
@@ -1243,37 +1246,37 @@ enum aome_enc_control_id {
* - 0 = main tier (default)
* - 1 = high tier
*/
- AV1E_SET_TIER_MASK = 143,
+ AV1E_SET_TIER_MASK = 129,
/*!\brief Control to set minimum compression ratio, unsigned int parameter
* Take integer values. If non-zero, encoder will try to keep the compression
* ratio of each frame to be higher than the given value divided by 100.
* E.g. 850 means minimum compression ratio of 8.5.
*/
- AV1E_SET_MIN_CR = 144,
+ AV1E_SET_MIN_CR = 130,
/* NOTE: enums 145-149 unused */
/*!\brief Codec control function to set the layer id, aom_svc_layer_id_t*
* parameter
*/
- AV1E_SET_SVC_LAYER_ID = 150,
+ AV1E_SET_SVC_LAYER_ID = 131,
/*!\brief Codec control function to set SVC paramaeters, aom_svc_params_t*
* parameter
*/
- AV1E_SET_SVC_PARAMS = 151,
+ AV1E_SET_SVC_PARAMS = 132,
/*!\brief Codec control function to set reference frame config:
* the ref_idx and the refresh flags for each buffer slot.
* aom_svc_ref_frame_config_t* parameter
*/
- AV1E_SET_SVC_REF_FRAME_CONFIG = 152,
+ AV1E_SET_SVC_REF_FRAME_CONFIG = 133,
/*!\brief Codec control function to set the path to the VMAF model used when
* tuning the encoder for VMAF, const char* parameter
*/
- AV1E_SET_VMAF_MODEL_PATH = 153,
+ AV1E_SET_VMAF_MODEL_PATH = 134,
/*!\brief Codec control function to enable EXT_TILE_DEBUG in AV1 encoder,
* unsigned int parameter
@@ -1283,7 +1286,7 @@ enum aome_enc_control_id {
*
* \note This is only used in lightfield example test.
*/
- AV1E_ENABLE_EXT_TILE_DEBUG = 154,
+ AV1E_ENABLE_EXT_TILE_DEBUG = 135,
/*!\brief Codec control function to enable the superblock multipass unit test
* in AV1 to ensure that the encoder does not leak state between different
@@ -1294,30 +1297,30 @@ enum aome_enc_control_id {
*
* \note This is only used in sb_multipass unit test.
*/
- AV1E_ENABLE_SB_MULTIPASS_UNIT_TEST = 155,
+ AV1E_ENABLE_SB_MULTIPASS_UNIT_TEST = 136,
/*!\brief Control to select minimum height for the GF group pyramid structure,
* unsigned int parameter
*
* Valid values: 0..5
*/
- AV1E_SET_GF_MIN_PYRAMID_HEIGHT = 156,
+ AV1E_SET_GF_MIN_PYRAMID_HEIGHT = 137,
/*!\brief Control to set average complexity of the corpus in the case of
* single pass vbr based on LAP, unsigned int parameter
*/
- AV1E_SET_VBR_CORPUS_COMPLEXITY_LAP = 157,
+ AV1E_SET_VBR_CORPUS_COMPLEXITY_LAP = 138,
/*!\brief Control to get baseline gf interval
*/
- AV1E_GET_BASELINE_GF_INTERVAL = 158,
+ AV1E_GET_BASELINE_GF_INTERVAL = 139,
/*\brief Control to set encoding the denoised frame from denoise-noise-level
*
* - 0 = disabled/encode the original frame
* - 1 = enabled/encode the denoised frame (default)
*/
- AV1E_SET_ENABLE_DNL_DENOISING = 159,
+ AV1E_SET_ENABLE_DNL_DENOISING = 140,
/*!\brief Codec control function to turn on / off D45 to D203 intra mode
* usage, int parameter
@@ -1327,7 +1330,32 @@ enum aome_enc_control_id {
* - 0 = disable
* - 1 = enable (default)
*/
- AV1E_SET_ENABLE_DIAGONAL_INTRA = 160,
+ AV1E_SET_ENABLE_DIAGONAL_INTRA = 141,
+
+ /*!\brief Control to set frequency of the cost updates for intrabc motion
+ * vectors, unsigned int parameter
+ *
+ * - 0 = update at SB level (default)
+ * - 1 = update at SB row level in tile
+ * - 2 = update at tile level
+ * - 3 = turn off
+ */
+ AV1E_SET_DV_COST_UPD_FREQ = 142,
+
+ /*!\brief Codec control to set the path for partition stats read and write.
+ * const char * parameter.
+ */
+ AV1E_SET_PARTITION_INFO_PATH = 143,
+
+ /*!\brief Codec control to use an external partition model
+ * A set of callback functions is passed through this control
+ * to let the encoder encode with given partitions.
+ */
+ AV1E_SET_EXTERNAL_PARTITION = 144,
+
+ // Any new encoder control IDs should be added above.
+ // Maximum allowed encoder control ID is 229.
+ // No encoder control ID should be added below.
};
/*!\brief aom 1-D scaling mode
@@ -1858,6 +1886,15 @@ AOM_CTRL_USE_TYPE(AV1E_SET_VBR_CORPUS_COMPLEXITY_LAP, unsigned int)
AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_DNL_DENOISING, int)
#define AOM_CTRL_AV1E_SET_ENABLE_DNL_DENOISING
+AOM_CTRL_USE_TYPE(AV1E_SET_DV_COST_UPD_FREQ, unsigned int)
+#define AOM_CTRL_AV1E_SET_DV_COST_UPD_FREQ
+
+AOM_CTRL_USE_TYPE(AV1E_SET_PARTITION_INFO_PATH, const char *)
+#define AOM_CTRL_AV1E_SET_PARTITION_INFO_PATH
+
+AOM_CTRL_USE_TYPE(AV1E_SET_EXTERNAL_PARTITION, aom_ext_part_funcs_t *)
+#define AOM_CTRL_AV1E_SET_ENABLE_DNL_DENOISING
+
/*!\endcond */
/*! @} - end defgroup aom_encoder */
#ifdef __cplusplus
diff --git a/third_party/libaom/source/libaom/aom/aomdx.h b/third_party/libaom/source/libaom/aom/aomdx.h
index aa4f435ec4..b3fd90e460 100644
--- a/third_party/libaom/source/libaom/aom/aomdx.h
+++ b/third_party/libaom/source/libaom/aom/aomdx.h
@@ -188,6 +188,7 @@ typedef struct av1_ext_ref_frame {
*
* This set of macros define the control functions available for the AOM
* decoder interface.
+ * The range for decoder control ID is >= 256.
*
* \sa #aom_codec_control(aom_codec_ctx_t *ctx, int ctrl_id, ...)
*/
@@ -381,8 +382,6 @@ enum aom_dec_control_id {
*/
AV1D_SET_SKIP_FILM_GRAIN,
- AOM_DECODER_CTRL_ID_MAX,
-
/*!\brief Codec control function to check the presence of forward key frames
*/
AOMD_GET_FWD_KF_PRESENT,
diff --git a/third_party/libaom/source/libaom/aom/internal/aom_codec_internal.h b/third_party/libaom/source/libaom/aom/internal/aom_codec_internal.h
index 0ad33bdf2e..457da9244a 100644
--- a/third_party/libaom/source/libaom/aom/internal/aom_codec_internal.h
+++ b/third_party/libaom/source/libaom/aom/internal/aom_codec_internal.h
@@ -278,7 +278,7 @@ typedef aom_fixed_buf_t *(*aom_codec_get_global_headers_fn_t)(
typedef aom_image_t *(*aom_codec_get_preview_frame_fn_t)(
aom_codec_alg_priv_t *ctx);
-/*!\brief Decoder algorithm interface interface
+/*!\brief Decoder algorithm interface
*
* All decoders \ref MUST expose a variable of this type.
*/
diff --git a/third_party/libaom/source/libaom/aom/src/aom_image.c b/third_party/libaom/source/libaom/aom/src/aom_image.c
index dfdee87d26..13f71b2bf5 100644
--- a/third_party/libaom/source/libaom/aom/src/aom_image.c
+++ b/third_party/libaom/source/libaom/aom/src/aom_image.c
@@ -38,6 +38,8 @@ static aom_image_t *img_alloc_helper(
unsigned int h, w, s, xcs, ycs, bps, bit_depth;
unsigned int stride_in_bytes;
+ if (img != NULL) memset(img, 0, sizeof(aom_image_t));
+
/* Treat align==0 like align==1 */
if (!buf_align) buf_align = 1;
@@ -111,8 +113,6 @@ static aom_image_t *img_alloc_helper(
if (!img) goto fail;
img->self_allocd = 1;
- } else {
- memset(img, 0, sizeof(aom_image_t));
}
img->img_data = img_data;