summaryrefslogtreecommitdiffstats
path: root/third_party/aom/aom
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-10-18 21:53:44 -0500
committertrav90 <travawine@palemoon.org>2018-10-18 21:53:44 -0500
commitec910d81405c736a4490383a250299a7837c2e64 (patch)
tree4f27cc226f93a863121aef6c56313e4153a69b3e /third_party/aom/aom
parent01eb57073ba97b2d6cbf20f745dfcc508197adc3 (diff)
downloadUXP-ec910d81405c736a4490383a250299a7837c2e64.tar
UXP-ec910d81405c736a4490383a250299a7837c2e64.tar.gz
UXP-ec910d81405c736a4490383a250299a7837c2e64.tar.lz
UXP-ec910d81405c736a4490383a250299a7837c2e64.tar.xz
UXP-ec910d81405c736a4490383a250299a7837c2e64.zip
Update aom to commit id e87fb2378f01103d5d6e477a4ef6892dc714e614
Diffstat (limited to 'third_party/aom/aom')
-rw-r--r--third_party/aom/aom/aom.h34
-rw-r--r--third_party/aom/aom/aom_decoder.h4
-rw-r--r--third_party/aom/aom/aom_encoder.h102
-rw-r--r--third_party/aom/aom/aom_image.h52
-rw-r--r--third_party/aom/aom/aomcx.h60
-rw-r--r--third_party/aom/aom/exports_com2
-rw-r--r--third_party/aom/aom/src/aom_decoder.c3
-rw-r--r--third_party/aom/aom/src/aom_image.c14
8 files changed, 178 insertions, 93 deletions
diff --git a/third_party/aom/aom/aom.h b/third_party/aom/aom/aom.h
index 98366b870..fecbeaf56 100644
--- a/third_party/aom/aom/aom.h
+++ b/third_party/aom/aom/aom.h
@@ -45,9 +45,7 @@ extern "C" {
enum aom_com_control_id {
/*!\brief pass in an external frame into decoder to be used as reference frame
*/
- AOM_SET_REFERENCE = 1,
- AOM_COPY_REFERENCE = 2, /**< get a copy of reference frame from the decoder */
- AOM_SET_POSTPROC = 3, /**< set the decoder's post processing settings */
+ AOM_SET_POSTPROC = 3, /**< set the decoder's post processing settings */
AOM_SET_DBG_COLOR_REF_FRAME =
4, /**< set the reference frames to color for each macroblock */
AOM_SET_DBG_COLOR_MB_MODES = 5, /**< set which macro block modes to color */
@@ -59,6 +57,9 @@ enum aom_com_control_id {
* AOM_DECODER_CTRL_ID_START range next time we're ready to break the ABI.
*/
AV1_GET_REFERENCE = 128, /**< get a pointer to a reference frame */
+ AV1_SET_REFERENCE = 129, /**< write a frame into a reference buffer */
+ AV1_COPY_REFERENCE =
+ 130, /**< get a copy of reference frame from the decoder */
AOM_COMMON_CTRL_ID_MAX,
AV1_GET_NEW_FRAME_IMAGE = 192, /**< get a pointer to the new frame */
@@ -98,25 +99,6 @@ typedef struct aom_postproc_cfg {
int noise_level; /**< the strength of additive noise, valid range [0, 16] */
} aom_postproc_cfg_t;
-/*!\brief reference frame type
- *
- * The set of macros define the type of AOM reference frames
- */
-typedef enum aom_ref_frame_type {
- AOM_LAST_FRAME = 1,
- AOM_GOLD_FRAME = 2,
- AOM_ALTR_FRAME = 4
-} aom_ref_frame_type_t;
-
-/*!\brief reference frame data struct
- *
- * Define the data struct to access aom reference frames.
- */
-typedef struct aom_ref_frame {
- aom_ref_frame_type_t frame_type; /**< which reference frame */
- aom_image_t img; /**< reference frame data in image format */
-} aom_ref_frame_t;
-
/*!\brief AV1 specific reference frame data struct
*
* Define the data struct to access av1 reference frames.
@@ -131,10 +113,6 @@ typedef struct av1_ref_frame {
*
* defines the data type for each of AOM decoder control function requires
*/
-AOM_CTRL_USE_TYPE(AOM_SET_REFERENCE, aom_ref_frame_t *)
-#define AOM_CTRL_AOM_SET_REFERENCE
-AOM_CTRL_USE_TYPE(AOM_COPY_REFERENCE, aom_ref_frame_t *)
-#define AOM_CTRL_AOM_COPY_REFERENCE
AOM_CTRL_USE_TYPE(AOM_SET_POSTPROC, aom_postproc_cfg_t *)
#define AOM_CTRL_AOM_SET_POSTPROC
AOM_CTRL_USE_TYPE(AOM_SET_DBG_COLOR_REF_FRAME, int)
@@ -147,6 +125,10 @@ AOM_CTRL_USE_TYPE(AOM_SET_DBG_DISPLAY_MV, int)
#define AOM_CTRL_AOM_SET_DBG_DISPLAY_MV
AOM_CTRL_USE_TYPE(AV1_GET_REFERENCE, av1_ref_frame_t *)
#define AOM_CTRL_AV1_GET_REFERENCE
+AOM_CTRL_USE_TYPE(AV1_SET_REFERENCE, av1_ref_frame_t *)
+#define AOM_CTRL_AV1_SET_REFERENCE
+AOM_CTRL_USE_TYPE(AV1_COPY_REFERENCE, av1_ref_frame_t *)
+#define AOM_CTRL_AV1_COPY_REFERENCE
AOM_CTRL_USE_TYPE(AV1_GET_NEW_FRAME_IMAGE, aom_image_t *)
#define AOM_CTRL_AV1_GET_NEW_FRAME_IMAGE
diff --git a/third_party/aom/aom/aom_decoder.h b/third_party/aom/aom/aom_decoder.h
index 509b875d3..ceab93453 100644
--- a/third_party/aom/aom/aom_decoder.h
+++ b/third_party/aom/aom/aom_decoder.h
@@ -55,8 +55,6 @@ extern "C" {
#define AOM_CODEC_CAP_PUT_SLICE 0x10000 /**< Will issue put_slice callbacks */
#define AOM_CODEC_CAP_PUT_FRAME 0x20000 /**< Will issue put_frame callbacks */
#define AOM_CODEC_CAP_POSTPROC 0x40000 /**< Can postprocess decoded frame */
-/*!\brief Can conceal errors due to packet loss */
-#define AOM_CODEC_CAP_ERROR_CONCEALMENT 0x80000
/*!\brief Can receive encoded frames one fragment at a time */
#define AOM_CODEC_CAP_INPUT_FRAGMENTS 0x100000
@@ -73,8 +71,6 @@ extern "C" {
#define AOM_CODEC_CAP_EXTERNAL_FRAME_BUFFER 0x400000
#define AOM_CODEC_USE_POSTPROC 0x10000 /**< Postprocess decoded frame */
-/*!\brief Conceal errors in decoded frames */
-#define AOM_CODEC_USE_ERROR_CONCEALMENT 0x20000
/*!\brief The input frame should be passed to the decoder one fragment at a
* time */
#define AOM_CODEC_USE_INPUT_FRAGMENTS 0x40000
diff --git a/third_party/aom/aom/aom_encoder.h b/third_party/aom/aom/aom_encoder.h
index 39f1ae3e5..208ba011f 100644
--- a/third_party/aom/aom/aom_encoder.h
+++ b/third_party/aom/aom/aom_encoder.h
@@ -372,21 +372,21 @@ typedef struct aom_codec_enc_cfg {
*/
unsigned int rc_resize_mode;
- /*!\brief Frame resize numerator.
+ /*!\brief Frame resize denominator.
*
- * The numerator for resize to use, assuming 16 as the denominator.
+ * The denominator for resize to use, assuming 8 as the numerator.
*
- * Valid numerators are 8 - 16 for now.
+ * Valid denominators are 8 - 16 for now.
*/
- unsigned int rc_resize_numerator;
+ unsigned int rc_resize_denominator;
- /*!\brief Keyframe resize numerator.
+ /*!\brief Keyframe resize denominator.
*
- * The numerator for resize to use, assuming 16 as the denominator.
+ * The denominator for resize to use, assuming 8 as the numerator.
*
- * Valid numerators are 8 - 16 for now.
+ * Valid denominators are 8 - 16 for now.
*/
- unsigned int rc_resize_kf_numerator;
+ unsigned int rc_resize_kf_denominator;
/*!\brief Frame super-resolution scaling mode.
*
@@ -394,32 +394,50 @@ typedef struct aom_codec_enc_cfg {
* upscaling after the encode/decode process. Taking control of upscaling and
* using restoration filters should allow it to outperform normal resizing.
*
- * Mode 0 is SUPERRES_NONE, mode 1 is SUPERRES_FIXED, and mode 2 is
- * SUPERRES_DYNAMIC.
+ * Mode 0 is SUPERRES_NONE, mode 1 is SUPERRES_FIXED, mode 2 is
+ * SUPERRES_RANDOM and mode 3 is SUPERRES_QTHRESH.
*/
unsigned int rc_superres_mode;
- /*!\brief Frame super-resolution numerator.
+ /*!\brief Frame super-resolution denominator.
*
- * The numerator for superres to use. If fixed it will only change if the
+ * The denominator for superres to use. If fixed it will only change if the
* cumulative scale change over resizing and superres is greater than 1/2;
* this forces superres to reduce scaling.
*
- * Valid numerators are 8 to 16.
+ * Valid denominators are 8 to 16.
*
- * Ignored by SUPERRES_DYNAMIC.
+ * Used only by SUPERRES_FIXED.
*/
- unsigned int rc_superres_numerator;
+ unsigned int rc_superres_denominator;
- /*!\brief Keyframe super-resolution numerator.
+ /*!\brief Keyframe super-resolution denominator.
*
- * The numerator for superres to use. If fixed it will only change if the
+ * The denominator for superres to use. If fixed it will only change if the
* cumulative scale change over resizing and superres is greater than 1/2;
* this forces superres to reduce scaling.
*
- * Valid numerators are 8 - 16 for now.
+ * Valid denominators are 8 - 16 for now.
*/
- unsigned int rc_superres_kf_numerator;
+ unsigned int rc_superres_kf_denominator;
+
+ /*!\brief Frame super-resolution q threshold.
+ *
+ * The q level threshold after which superres is used.
+ * Valid values are 1 to 63.
+ *
+ * Used only by SUPERRES_QTHRESH
+ */
+ unsigned int rc_superres_qthresh;
+
+ /*!\brief Keyframe super-resolution q threshold.
+ *
+ * The q level threshold after which superres is used for key frames.
+ * Valid values are 1 to 63.
+ *
+ * Used only by SUPERRES_QTHRESH
+ */
+ unsigned int rc_superres_kf_qthresh;
/*!\brief Rate control algorithm to use.
*
@@ -601,6 +619,48 @@ typedef struct aom_codec_enc_cfg {
* implies a large-scale tile coding.
*/
unsigned int large_scale_tile;
+
+ /*!\brief Number of explicit tile widths specified
+ *
+ * This value indicates the number of tile widths specified
+ * A value of 0 implies no tile widths are specified.
+ * Tile widths are given in the array tile_widths[]
+ */
+ int tile_width_count;
+
+ /*!\brief Number of explicit tile heights specified
+ *
+ * This value indicates the number of tile heights specified
+ * A value of 0 implies no tile heights are specified.
+ * Tile heights are given in the array tile_heights[]
+ */
+ int tile_height_count;
+
+/*!\brief Maximum number of tile widths in tile widths array
+ *
+ * This define gives the maximum number of elements in the tile_widths array.
+ */
+#define MAX_TILE_WIDTHS 64 // maximum tile width array length
+
+ /*!\brief Array of specified tile widths
+ *
+ * This array specifies tile widths (and may be empty)
+ * The number of widths specified is given by tile_width_count
+ */
+ int tile_widths[MAX_TILE_WIDTHS];
+
+/*!\brief Maximum number of tile heights in tile heights array.
+ *
+ * This define gives the maximum number of elements in the tile_heights array.
+ */
+#define MAX_TILE_HEIGHTS 64 // maximum tile height array length
+
+ /*!\brief Array of specified tile heights
+ *
+ * This array specifies tile heights (and may be empty)
+ * The number of heights specified is given by tile_height_count
+ */
+ int tile_heights[MAX_TILE_HEIGHTS];
} aom_codec_enc_cfg_t; /**< alias for struct aom_codec_enc_cfg */
/*!\brief Initialize an encoder instance
@@ -616,7 +676,7 @@ typedef struct aom_codec_enc_cfg {
*
* \param[in] ctx Pointer to this instance's context.
* \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] cfg Configuration to use, if known. May be NULL.
+ * \param[in] cfg Configuration to use, if known.
* \param[in] flags Bitfield of AOM_CODEC_USE_* flags
* \param[in] ver ABI version number. Must be set to
* AOM_ENCODER_ABI_VERSION
@@ -646,7 +706,7 @@ aom_codec_err_t aom_codec_enc_init_ver(aom_codec_ctx_t *ctx,
*
* \param[in] ctx Pointer to this instance's context.
* \param[in] iface Pointer to the algorithm interface to use.
- * \param[in] cfg Configuration to use, if known. May be NULL.
+ * \param[in] cfg Configuration to use, if known.
* \param[in] num_enc Total number of encoders.
* \param[in] flags Bitfield of AOM_CODEC_USE_* flags
* \param[in] dsf Pointer to down-sampling factors.
diff --git a/third_party/aom/aom/aom_image.h b/third_party/aom/aom/aom_image.h
index 34cf71552..776794960 100644
--- a/third_party/aom/aom/aom_image.h
+++ b/third_party/aom/aom/aom_image.h
@@ -35,8 +35,6 @@ extern "C" {
#define AOM_IMG_FMT_HAS_ALPHA 0x400 /**< Image has an alpha channel. */
#define AOM_IMG_FMT_HIGHBITDEPTH 0x800 /**< Image uses 16bit framebuffer. */
-#include "./aom_config.h"
-
/*!\brief List of supported image formats */
typedef enum aom_img_fmt {
AOM_IMG_FMT_NONE,
@@ -71,25 +69,19 @@ typedef enum aom_img_fmt {
/*!\brief List of supported color spaces */
typedef enum aom_color_space {
- AOM_CS_UNKNOWN = 0, /**< Unknown */
- AOM_CS_BT_601 = 1, /**< BT.601 */
- AOM_CS_BT_709 = 2, /**< BT.709 */
- AOM_CS_SMPTE_170 = 3, /**< SMPTE.170 */
- AOM_CS_SMPTE_240 = 4, /**< SMPTE.240 */
-#if CONFIG_COLORSPACE_HEADERS
+ AOM_CS_UNKNOWN = 0, /**< Unknown */
+ AOM_CS_BT_601 = 1, /**< BT.601 */
+ AOM_CS_BT_709 = 2, /**< BT.709 */
+ AOM_CS_SMPTE_170 = 3, /**< SMPTE.170 */
+ AOM_CS_SMPTE_240 = 4, /**< SMPTE.240 */
AOM_CS_BT_2020_NCL = 5, /**< BT.2020 non-constant luminance (BT.2100) */
AOM_CS_BT_2020_CL = 6, /**< BT.2020 constant luminance */
AOM_CS_SRGB = 7, /**< sRGB */
AOM_CS_ICTCP = 8, /**< ICtCp, ITU-R BT.2100 */
AOM_CS_RESERVED = 9 /**< Values 9..31 are reserved */
-#else
- AOM_CS_BT_2020 = 5, /**< BT.2020 */
- AOM_CS_RESERVED = 6, /**< Reserved */
- AOM_CS_SRGB = 7 /**< sRGB */
-#endif
-} aom_color_space_t; /**< alias for enum aom_color_space */
+} aom_color_space_t; /**< alias for enum aom_color_space */
-#if CONFIG_COLORSPACE_HEADERS
+/*!\brief List of supported transfer functions */
typedef enum aom_transfer_function {
AOM_TF_UNKNOWN = 0, /**< Unknown */
AOM_TF_BT_709 = 1, /**< BT.709 */
@@ -97,7 +89,6 @@ typedef enum aom_transfer_function {
AOM_TF_HLG = 3, /**< Hybrid Log-Gamma */
AOM_TF_RESERVED = 4 /**< Values 4..31 are reserved */
} aom_transfer_function_t; /**< alias for enum aom_transfer_function */
-#endif
/*!\brief List of supported color range */
typedef enum aom_color_range {
@@ -105,7 +96,7 @@ typedef enum aom_color_range {
AOM_CR_FULL_RANGE = 1 /**< YUV/RGB [0..255] */
} aom_color_range_t; /**< alias for enum aom_color_range */
-#if CONFIG_COLORSPACE_HEADERS
+/*!\brief List of chroma sample positions */
typedef enum aom_chroma_sample_position {
AOM_CSP_UNKNOWN = 0, /**< Unknown */
AOM_CSP_VERTICAL = 1, /**< Horizontally co-located with luma(0, 0)*/
@@ -113,17 +104,14 @@ typedef enum aom_chroma_sample_position {
AOM_CSP_COLOCATED = 2, /**< Co-located with luma(0, 0) sample */
AOM_CSP_RESERVED = 3 /**< Reserved value */
} aom_chroma_sample_position_t; /**< alias for enum aom_transfer_function */
-#endif
/**\brief Image Descriptor */
typedef struct aom_image {
- aom_img_fmt_t fmt; /**< Image Format */
- aom_color_space_t cs; /**< Color Space */
-#if CONFIG_COLORSPACE_HEADERS
+ aom_img_fmt_t fmt; /**< Image Format */
+ aom_color_space_t cs; /**< Color Space */
aom_transfer_function_t tf; /**< transfer function */
aom_chroma_sample_position_t csp; /**< chroma sample position */
-#endif
- aom_color_range_t range; /**< Color Range */
+ aom_color_range_t range; /**< Color Range */
/* Image storage dimensions */
unsigned int w; /**< Stored image width */
@@ -252,6 +240,24 @@ void aom_img_flip(aom_image_t *img);
*/
void aom_img_free(aom_image_t *img);
+/*!\brief Get the width of a plane
+ *
+ * Get the width of a plane of an image
+ *
+ * \param[in] img Image descriptor
+ * \param[in] plane Plane index
+ */
+int aom_img_plane_width(const aom_image_t *img, int plane);
+
+/*!\brief Get the height of a plane
+ *
+ * Get the height of a plane of an image
+ *
+ * \param[in] img Image descriptor
+ * \param[in] plane Plane index
+ */
+int aom_img_plane_height(const aom_image_t *img, int plane);
+
#ifdef __cplusplus
} // extern "C"
#endif
diff --git a/third_party/aom/aom/aomcx.h b/third_party/aom/aom/aomcx.h
index 2b87a71d8..e573f986d 100644
--- a/third_party/aom/aom/aomcx.h
+++ b/third_party/aom/aom/aomcx.h
@@ -341,7 +341,6 @@ enum aome_enc_control_id {
*/
AV1E_SET_COLOR_SPACE,
-#if CONFIG_COLORSPACE_HEADERS
/*!\brief Codec control function to set transfer function info.
* \note Valid ranges: 0..4, default is "UNKNOWN".
* 0 = UNKNOWN,
@@ -360,7 +359,6 @@ enum aome_enc_control_id {
* 3 = RESERVED
*/
AV1E_SET_CHROMA_SAMPLE_POSITION,
-#endif
/*!\brief Codec control function to set minimum interval between GF/ARF frames
*
@@ -458,6 +456,21 @@ enum aome_enc_control_id {
*/
AV1E_SET_QM_MAX,
+ /*!\brief Codec control function to encode with dist_8x8.
+ *
+ * The dist_8x8 is enabled automatically for model tuning parameters that
+ * require measuring distortion at the 8x8 level. This control also allows
+ * measuring distortion at the 8x8 level for other tuning options
+ * (e.g., PSNR), for testing purposes.
+ * 0 = do not use dist_8x8
+ * 1 = use dist_8x8
+ *
+ * By default, the encoder does not use dist_8x8
+ *
+ * Experiment: DIST_8X8
+ */
+ AV1E_SET_ENABLE_DIST_8X8,
+
/*!\brief Codec control function to set a maximum number of tile groups.
*
* This will set the maximum number of tile groups. This will be
@@ -567,24 +580,31 @@ typedef enum aom_scaling_mode_1d {
AOME_ONETWO = 3
} AOM_SCALING_MODE;
+/*!\brief Max number of segments
+ *
+ * This is the limit of number of segments allowed within a frame.
+ *
+ * Currently same as "MAX_SEGMENTS" in AV1, the maximum that AV1 supports.
+ *
+ */
+#define AOM_MAX_SEGMENTS 8
+
/*!\brief aom region of interest map
*
* These defines the data structures for the region of interest map
*
+ * TODO(yaowu): create a unit test for ROI map related APIs
+ *
*/
-
typedef struct aom_roi_map {
- /*! An id between 0 and 3 for each 16x16 region within a frame. */
+ /*! An id between 0 and 7 for each 8x8 region within a frame. */
unsigned char *roi_map;
- unsigned int rows; /**< Number of rows. */
- unsigned int cols; /**< Number of columns. */
- // TODO(paulwilkins): broken for AV1 which has 8 segments
- // q and loop filter deltas for each segment
- // (see MAX_MB_SEGMENTS)
- int delta_q[4]; /**< Quantizer deltas. */
- int delta_lf[4]; /**< Loop filter deltas. */
+ unsigned int rows; /**< Number of rows. */
+ unsigned int cols; /**< Number of columns. */
+ int delta_q[AOM_MAX_SEGMENTS]; /**< Quantizer deltas. */
+ int delta_lf[AOM_MAX_SEGMENTS]; /**< Loop filter deltas. */
/*! Static breakout threshold for each segment. */
- unsigned int static_threshold[4];
+ unsigned int static_threshold[AOM_MAX_SEGMENTS];
} aom_roi_map_t;
/*!\brief aom active region map
@@ -622,7 +642,14 @@ typedef enum {
* Changes the encoder to tune for certain types of input material.
*
*/
-typedef enum { AOM_TUNE_PSNR, AOM_TUNE_SSIM } aom_tune_metric;
+typedef enum {
+ AOM_TUNE_PSNR,
+ AOM_TUNE_SSIM,
+#ifdef CONFIG_DIST_8X8
+ AOM_TUNE_CDEF_DIST,
+ AOM_TUNE_DAALA_DIST
+#endif
+} aom_tune_metric;
/*!\cond */
/*!\brief Encoder control function parameter type
@@ -632,7 +659,7 @@ typedef enum { AOM_TUNE_PSNR, AOM_TUNE_SSIM } aom_tune_metric;
*
*/
-AOM_CTRL_USE_TYPE_DEPRECATED(AOME_USE_REFERENCE, int)
+AOM_CTRL_USE_TYPE(AOME_USE_REFERENCE, int)
#define AOM_CTRL_AOME_USE_REFERENCE
AOM_CTRL_USE_TYPE(AOME_SET_ROI_MAP, aom_roi_map_t *)
#define AOM_CTRL_AOME_SET_ROI_MAP
@@ -693,6 +720,9 @@ AOM_CTRL_USE_TYPE(AV1E_SET_LOSSLESS, unsigned int)
AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_QM, unsigned int)
#define AOM_CTRL_AV1E_SET_ENABLE_QM
+AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_DIST_8X8, unsigned int)
+#define AOM_CTRL_AV1E_SET_ENABLE_DIST_8X8
+
AOM_CTRL_USE_TYPE(AV1E_SET_QM_MIN, unsigned int)
#define AOM_CTRL_AV1E_SET_QM_MIN
@@ -728,13 +758,11 @@ AOM_CTRL_USE_TYPE(AV1E_SET_TUNE_CONTENT, int) /* aom_tune_content */
AOM_CTRL_USE_TYPE(AV1E_SET_COLOR_SPACE, int)
#define AOM_CTRL_AV1E_SET_COLOR_SPACE
-#if CONFIG_COLORSPACE_HEADERS
AOM_CTRL_USE_TYPE(AV1E_SET_TRANSFER_FUNCTION, int)
#define AOM_CTRL_AV1E_SET_TRANSFER_FUNCTION
AOM_CTRL_USE_TYPE(AV1E_SET_CHROMA_SAMPLE_POSITION, int)
#define AOM_CTRL_AV1E_SET_CHROMA_SAMPLE_POSITION
-#endif
AOM_CTRL_USE_TYPE(AV1E_SET_MIN_GF_INTERVAL, unsigned int)
#define AOM_CTRL_AV1E_SET_MIN_GF_INTERVAL
diff --git a/third_party/aom/aom/exports_com b/third_party/aom/aom/exports_com
index 0c79fa124..897b712a7 100644
--- a/third_party/aom/aom/exports_com
+++ b/third_party/aom/aom/exports_com
@@ -12,5 +12,7 @@ text aom_codec_version_str
text aom_img_alloc
text aom_img_flip
text aom_img_free
+text aom_img_plane_width
+text aom_img_plane_height
text aom_img_set_rect
text aom_img_wrap
diff --git a/third_party/aom/aom/src/aom_decoder.c b/third_party/aom/aom/src/aom_decoder.c
index 57a9a25d2..75eb81089 100644
--- a/third_party/aom/aom/src/aom_decoder.c
+++ b/third_party/aom/aom/src/aom_decoder.c
@@ -37,9 +37,6 @@ aom_codec_err_t aom_codec_dec_init_ver(aom_codec_ctx_t *ctx,
else if ((flags & AOM_CODEC_USE_POSTPROC) &&
!(iface->caps & AOM_CODEC_CAP_POSTPROC))
res = AOM_CODEC_INCAPABLE;
- else if ((flags & AOM_CODEC_USE_ERROR_CONCEALMENT) &&
- !(iface->caps & AOM_CODEC_CAP_ERROR_CONCEALMENT))
- res = AOM_CODEC_INCAPABLE;
else if ((flags & AOM_CODEC_USE_INPUT_FRAGMENTS) &&
!(iface->caps & AOM_CODEC_CAP_INPUT_FRAGMENTS))
res = AOM_CODEC_INCAPABLE;
diff --git a/third_party/aom/aom/src/aom_image.c b/third_party/aom/aom/src/aom_image.c
index 0d54fd46d..e1176bd45 100644
--- a/third_party/aom/aom/src/aom_image.c
+++ b/third_party/aom/aom/src/aom_image.c
@@ -238,3 +238,17 @@ void aom_img_free(aom_image_t *img) {
if (img->self_allocd) free(img);
}
}
+
+int aom_img_plane_width(const aom_image_t *img, int plane) {
+ if (plane > 0 && img->x_chroma_shift > 0)
+ return (img->d_w + 1) >> img->x_chroma_shift;
+ else
+ return img->d_w;
+}
+
+int aom_img_plane_height(const aom_image_t *img, int plane) {
+ if (plane > 0 && img->y_chroma_shift > 0)
+ return (img->d_h + 1) >> img->y_chroma_shift;
+ else
+ return img->d_h;
+}