libaom 编解码项目编码接口文件介绍

在这里插入图片描述

对外头文件:

  • 编码端:aom/aom_encoder.haom/aomcx.h
  • 解码端:aom/aom_decoder.haom/aomdx.h

aom/aom_encoder.h

  1. 该头文件包了aom/aom_codec.haom/aom_external_partition.h
  2. 头文件介绍:当前文件描述了应用程序与视频编码器算法之间的接口。
  3. AOM_ENCODER_ABI_VERSION
  • 关于“ABI(Application Binary Interface,应用程序二进制接口)版本号”的定义和维护。
  1. AOM_CODEC_CAP_PSNR
  • 这个标志表示编码器能够发出PSNR(峰值信噪比)数据包。
  1. AOM_CODEC_CAP_HIGHBITDEPTH
  • 这个标志用于标识编码器是否支持高比特深度输入。
  1. AOM_CODEC_USE_PSNR
  • 这个标志表示在编码过程中,编码器将计算每帧的峰值信噪比(PSNR)。
  1. AOM_CODEC_USE_HIGHBITDEPTH
  • 这个标志用于标识编码器是否使用高比特深度。
  1. struct aom_fixed_buf
  • 这个结构体提供了一种通用的方式来引用固定大小的缓冲区,而不负责管理这些缓冲区的内存。这使得它在需要传递缓冲区引用而不改变数据所有权的情况下非常有用。
  1. aom_codec_er_flags_t
  • 定义提供了编码器错误恢复功能的配置方法,允许开发者根据需要启用或禁用特定的错误恢复技术,以提高视频编码的鲁棒性和容错能力。
  1. AOM_ERROR_RESILIENT_DEFAULT
  • 宏提供了一种简单的方法来启用编码器中针对帧丢失的基本错误恢复功能,以增强视频数据的鲁棒性。
  1. enum aom_codec_cx_pkt_kind
  • 枚举定义提供了编码器输出数据包类型的详细分类,允许应用程序根据返回的数据包类型处理不同的编码器输出,例如提取压缩视频帧、统计信息或者算法特定的数据。
  1. struct aom_codec_cx_pkt
  • 这个结构体提供了一种机制,允许编码器通过aom_codec_get_cx_data()函数返回不同类型的输出数据包,包括压缩帧、统计信息和算法特定的数据。这种设计使得编码器的输出更加灵活,能够适应不同的应用场景和需求。
  1. struct aom_rational
  • 这个结构体提供了一种简单的方式来表示和存储有理数,即可以表示为两个整数比的分数。这种结构在处理需要精确分数表示的情况(如视频编码参数中的帧率)时非常有用。通过使用分子和分母,aom_rational_t可以精确地表示许多不同的值,包括整数和分数。
  1. enum aom_enc_pass
  • 这个枚举提供了一种机制,允许编码器配置为执行单遍编码或多遍编码,并明确指定当前正在进行的是哪一阶段的编码。这对于需要精细控制编码过程,特别是在进行两遍或多遍编码以优化编码效率和质量时非常有用。
  1. enum aom_rc_mode
  • 这个枚举提供了一种机制,允许应用程序根据特定的应用场景和需求选择不同的速率控制模式。这可以用于优化视频编码的效率和质量,以及适应不同的网络和存储条件。
  1. enum aom_kf_mode
  • 这个枚举提供了一种机制,允许应用程序根据特定的应用场景和需求选择不同的关键帧放置模式。这可以用于优化视频编码的效率和质量,以及改善视频流的随机访问性能。
  1. aom_superres_mode
  • 这个枚举提供了一种机制,允许应用程序根据特定的应用场景和需求选择不同的帧超分辨率模式。这可以用于提高视频的视觉质量,或者在保持视觉质量的同时减少所需的带宽和存储空间。
  1. struct cfg_options
  • 允许通过外部配置文件来控制编码器的行为,使得编码器可以更容易地适应不同的应用场景和性能要求。
  1. aom_enc_frame_flags_t
  • 提供了一种机制,允许应用程序通过传递位字段来控制编码器的帧级行为。
  1. AOM_EFLAG_FORCE_KF
  • 宏提供了一种简单的方式来控制编码器输出,确保特定帧被编码为关键帧,这对于视频流的随机访问和编辑非常重要。
  1. struct aom_codec_enc_cfg
  • 这个结构体允许开发者设置和调整编码器的各种参数,以适应不同的编码需求和优化目标。它为编解码器算法提供了一个通用的接口,使得应用程序可以在不知道具体编解码器细节的情况下进行配置。
  1. aom_codec_err_t aom_codec_enc_init_ver
  • 这个函数是编码器初始化的关键步骤,它设置了编码器的配置和准备编码过程。
  1. aom_codec_enc_init
  • 这个宏提供了一种快捷方式来初始化编码器,同时确保ABI版本参数被正确设置,这有助于维护编码器接口的向后兼容性。
  1. aom_codec_err_t aom_codec_enc_config_default
  • 这个函数提供了一种机制,允许应用程序根据特定的使用场景初始化编码器的配置结构,并根据需要进行进一步的定制。
  1. aom_codec_err_t aom_codec_enc_config_set
  • 这个函数提供了一种机制,允许在编码过程中根据需要调整编码器的配置,以适应不同的编码需求或优化编码性能。
  1. aom_fixed_buf_t *aom_codec_get_global_headers
  • 这个函数允许应用程序从编码器中检索全局流头数据,这对于某些视频编码格式是必需的。
  1. AOM_USAGE_GOOD_QUALITY、AOM_USAGE_REALTIME、AOM_USAGE_ALL_INTRA
  • 这些宏定义提供了一种简单的方式来配置编码器的工作模式,允许开发者根据应用场景选择最合适的编码策略。通过设置这些参数,编码器可以自动调整其行为,以满足不同场景下的性能要求。
  1. aom_codec_err_t aom_codec_encode
  • 这个函数允许应用程序向编码器提供视频帧数据以进行编码,并控制编码过程。
  1. aom_codec_err_t aom_codec_set_cx_data_buf
  • 这个函数允许应用程序指定一个缓冲区来接收编码器的输出,并控制输出数据包的填充行为。这对于管理内存和优化数据传输非常有用。
  1. aom_codec_cx_pkt_t *aom_codec_get_cx_data
  • 这个函数允许应用程序逐个获取编码器产生的数据包。
  1. aom_image_t *aom_codec_get_preview_frame
  • 这个函数允许应用程序在编码过程中获取当前帧的预览,这对于实时显示或者预览编码效果非常有用。

aom/aomcx.h

  1. 该头文件包了aom/aom.haom/aom_encoder.haom/aom_external_partition.h
  2. 头文件介绍:
  • 提供了在aom Codec Interface中使用AOM(Alliance for Open Media)或AV1编码器算法的定义。简而言之,它是一个接口,允许开发者在其应用程序中集成AOM或AV1的编码功能。
  • CONFIG_REALTIME_ONLY构建:在这种构建配置下,某些接口和特性被排除或禁用。
    • 排除的接口:
      • 全局运动(Global motion)
      • 扭曲运动(Warped motion)
      • OBMC(Overlapping Block Motion Compensation)
      • TPL模型(Temporal Prediction Loop)
      • 循环恢复(Loop restoration)
    • 禁用的特性:
      • AV1E_SET_QUANT_B_ADAPT:可能是一种量化参数的自适应调整。
      • CNN:卷积神经网络,可能用于图像处理或编码优化。
      • 4X矩形块(4X rectangular blocks):可能指的是编码过程中使用的特定大小的块。
      • 4X矩形变换在内预测中(4X rectangular transform in intra prediction):可能指的是在内预测过程中使用的特定变换。
  1. extern aom_codec_iface_t aom_codec_av1_cx_algo;
  • 代表AV1编码器的一个单一实例。这意味着它可能是一个全局变量或者一个函数,用于访问或创建AV1编码器的一个实例。
  • 这个访问机制已经不再推荐使用,而是为了保持向后兼容性而保留的。开发者被建议使用aom_codec_av1_cx()这个函数来代替。这通常意味着aom_codec_av1_cx()提供了更现代、更高效或者更安全的方式来访问AV1编码器的功能。
  1. extern aom_codec_iface_t *aom_codec_av1_cx(void);
  • 提供对AV1编码器接口的访问。当你需要使用AV1编码器时,你可以调用这个函数来获取一个指向编码器接口的指针,然后通过这个指针来访问编码器提供的各种功能和方法。这种设计模式使得编码器的使用更加灵活,因为你可以根据需要动态地获取和使用编码器接口,而不是直接依赖于特定的全局变量或实例。
  • aom_codec_av1_cx函数是一个工厂函数,用于创建和返回AV1编码器接口的指针,使得开发者可以方便地访问和使用AV1编码器的功能。
  1. 各类算法标志 Flags:各种编码算法的 Flags
  2. enum aome_enc_control_id
  • 为开发者提供一个清晰的编码器控制ID列表,以及如何使用这些ID来控制编码器的行为。通过使用这些宏,开发者可以在编码过程中设置参数,比如调整编码质量、控制编码速度、设置目标比特率等。
  1. enum aom_scaling_mode_1d:代表了AOM(Alliance for Open Media)1-D(一维)缩放模式的不同选项。
  • AOME_NORMAL = 0,:正常模式,不进行缩放。
  • AOME_FOURFIVE = 1,:4:5缩放模式。
  • AOME_THREEFIVE = 2,:3:5缩放模式。
  • AOME_THREEFOUR = 3,:3:4缩放模式。
  • AOME_ONEFOUR = 4,:1:4缩放模式。
  • AOME_ONEEIGHT = 5,:1:8缩放模式。
  • AOME_ONETWO = 6,:1:2缩放模式。
  • AOME_TWOTHREE = 7,:2:3缩放模式。
  • AOME_ONETHREE = 8:1:3缩放模式。
  1. #define AOM_MAX_SEGMENTS 8
  • 该宏代表了在AOM编码框架中,一个帧内允许的最大段数,意味着在AOM编码框架中,一个帧内最多可以有8个段。
  1. struct aom_roi_map
  • 定义了AOM编码器中用于ROI映射的数据结构,它包含了映射的行数、列数、每个8x8区域的ID、量化器和循环滤波器的增量,以及每个段的静态突破阈值。这种结构允许编码器对视频帧的不同区域进行差异化处理,例如,提高某些区域的编码质量,而降低其他区域的质量,以优化整体编码效果。
  1. struct aom_active_map
  • 定义了AOM编码器中用于活动区域映射的数据结构,它包含了映射的行数、列数以及一个指向活动状态数组的指针。这种结构允许编码器对视频帧的不同区域进行差异化处理,例如,只对标记为活动的区域进行编码,从而节省编码资源并提高编码效率。
  1. struct aom_scaling_mode
  • 定义了AOM编码器中用于图像缩放的数据结构,它包含了水平和垂直两个方向的缩放模式。这种结构允许编码器对视频帧进行水平和垂直方向上的不同缩放处理,以适应不同的播放环境或满足特定的编码需求。
  1. aom_tune_content
  • 枚举类型提供了几种不同的内容类型选项,允许开发者根据视频内容的特点来调整编码器的参数,以优化编码效率和质量。例如,屏幕内容可能需要更注重文本和图形的清晰度,而电影内容可能更注重自然场景的渲染和细节保留。通过选择合适的内容类型,编码器可以应用特定的优化策略,以适应不同类型的视频内容。
  1. aom_timing_info_type_t
  • 枚举类型提供了几种不同的时间信息类型选项,允许开发者根据视频编码的需求来指定帧之间的时间间隔是如何确定的。这可以影响视频的播放和同步,特别是在不同的播放环境或网络条件下。通过选择合适的时间信息类型,编码器可以更准确地控制视频的播放时间,确保视频的流畅性和同步性。
  1. aom_tune_metric
  • 枚举类型提供了多种不同的优化目标选项,允许开发者根据视频内容的特点和质量评估的需求来调整编码器的行为。这些调整可以帮助编码器在保持视频质量的同时,优化编码效率和压缩率。
  1. aom_dist_metric
  • 枚举类型提供了不同的失真度量指标选项,允许开发者根据编码需求来调整编码器在块级别上的RD优化行为。这些调整可以帮助编码器在保持视频质量的同时,优化编码效率和压缩率。使用不同的失真度量指标可以影响编码器的决策,例如在编码过程中选择不同的量化级别或预测模式。
  1. svc 编码相关AOM_MAX_LAYERSAOM_MAX_SS_LAYERSAOM_MAX_TS_LAYERSstruct aom_svc_layer_idstruct aom_svc_paramsstruct aom_svc_ref_frame_configstruct aom_svc_ref_frame_comp_predAOM_SVC_FRAME_DROP_MODE
  • #define AOM_MAX_LAYERS 32:定义了最大层数为32。
  • #define AOM_MAX_SS_LAYERS 4:定义了最大空间层数为4。
  • #define AOM_MAX_TS_LAYERS 8:定义了最大时间层数为8。
  • struct aom_svc_layer_id:定义了一个结构体,用于表示空间层ID和时间层ID。
  • struct aom_svc_params:定义了一个结构体,用于配置SVC的参数。
  • struct aom_svc_ref_frame_config:定义了一个结构体,用于设置参考帧配置。
  • struct aom_svc_ref_frame_comp_pred:定义了一个结构体,用于设置参考帧的复合预测。
  • AOM_SVC_FRAME_DROP_MODE:定义了一个枚举类型,用于指定SVC的帧丢弃模式。
  1. 编码器控制函数参数类型:这些控制函数用于调整编码器的行为和性能,例如设置参考帧、活动地图、缩放模式、空间层ID、CPU使用率、自动交替引用帧、锐度、静态阈值等。每个控制ID都有一个对应的宏定义,用于编译时检查该控制ID是否被当前可用的libaom库支持。

源码

  1. aom_encoder.h
/*
 * Copyright (c) 2016, 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_ENCODER_H_
#define AOM_AOM_AOM_ENCODER_H_

/*!\defgroup encoder Encoder Algorithm Interface
 * \ingroup codec
 * This abstraction allows applications using this encoder to easily support
 * multiple video formats with minimal code duplication. This section describes
 * the interface common to all encoders.
 * @{
 */

/*!\file
 * \brief Describes the encoder algorithm interface to applications.
 *
 * This file describes the interface between an application and a
 * video encoder algorithm.
 *
 */
#ifdef __cplusplus
extern "C" {
    
    
#endif

#include "aom/aom_codec.h"  // IWYU pragma: export
#include "aom/aom_external_partition.h"

/*!\brief Current ABI version number
 *
 * \hideinitializer
 * \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
 *
 * Note: In the definition of AOM_ENCODER_ABI_VERSION, 3 is the value of
 * AOM_EXT_PART_ABI_VERSION in libaom v3.2.0. The old value of
 * AOM_EXT_PART_ABI_VERSION is used so as to not break the ABI version check in
 * aom_codec_enc_init_ver() when an application compiled against libaom v3.2.0
 * passes the old value of AOM_ENCODER_ABI_VERSION to aom_codec_enc_init_ver().
 * The external partition API is still experimental. When it is declared stable,
 * we will replace 3 with AOM_EXT_PART_ABI_VERSION in the definition of
 * AOM_ENCODER_ABI_VERSION.
 */
#define AOM_ENCODER_ABI_VERSION \
  (10 + AOM_CODEC_ABI_VERSION + /*AOM_EXT_PART_ABI_VERSION=*/3)

/*! \brief Encoder capabilities bitfield
 *
 *  Each encoder advertises the capabilities it supports as part of its
 *  ::aom_codec_iface_t interface structure. Capabilities are extra
 *  interfaces or functionality, and are not required to be supported
 *  by an encoder.
 *
 *  The available flags are specified by AOM_CODEC_CAP_* defines.
 */
#define AOM_CODEC_CAP_PSNR 0x10000 /**< Can issue PSNR packets */

/*! Can support input images at greater than 8 bitdepth.
 */
#define AOM_CODEC_CAP_HIGHBITDEPTH 0x40000

/*! \brief Initialization-time Feature Enabling
 *
 *  Certain codec features must be known at initialization time, to allow
 *  for proper memory allocation.
 *
 *  The available flags are specified by AOM_CODEC_USE_* defines.
 */
#define AOM_CODEC_USE_PSNR 0x10000         /**< Calculate PSNR on each frame */
#define AOM_CODEC_USE_HIGHBITDEPTH 0x40000 /**< Use high bitdepth */

/*!\brief Generic fixed size buffer structure
 *
 * This structure is able to hold a reference to any fixed size buffer.
 */
typedef struct aom_fixed_buf {
    
    
  void *buf;       /**< Pointer to the data. Does NOT own the data! */
  size_t sz;       /**< Length of the buffer, in chars */
} aom_fixed_buf_t; /**< alias for struct aom_fixed_buf */

/*!\brief Error Resilient flags
 *
 * These flags define which error resilient features to enable in the
 * encoder. The flags are specified through the
 * aom_codec_enc_cfg::g_error_resilient variable.
 */
typedef uint32_t aom_codec_er_flags_t;
/*!\brief Improve resiliency against losses of whole frames */
#define AOM_ERROR_RESILIENT_DEFAULT 0x1

/*!\brief Encoder output packet variants
 *
 * This enumeration lists the different kinds of data packets that can be
 * returned by calls to aom_codec_get_cx_data(). Algorithms \ref MAY
 * extend this list to provide additional functionality.
 */
enum aom_codec_cx_pkt_kind {
    
    
  AOM_CODEC_CX_FRAME_PKT,    /**< Compressed video frame */
  AOM_CODEC_STATS_PKT,       /**< Two-pass statistics for this frame */
  AOM_CODEC_FPMB_STATS_PKT,  /**< first pass mb statistics for this frame */
  AOM_CODEC_PSNR_PKT,        /**< PSNR statistics for this frame */
  AOM_CODEC_CUSTOM_PKT = 256 /**< Algorithm extensions  */
};

/*!\brief Encoder output packet
 *
 * This structure contains the different kinds of output data the encoder
 * may produce while compressing a frame.
 */
typedef struct aom_codec_cx_pkt {
    
    
  enum aom_codec_cx_pkt_kind kind; /**< packet variant */
  union {
    
    
    struct {
    
    
      void *buf; /**< compressed data buffer */
      size_t sz; /**< length of compressed data */
      /*!\brief time stamp to show frame (in timebase units) */
      aom_codec_pts_t pts;
      /*!\brief duration to show frame (in timebase units) */
      unsigned long duration;
      aom_codec_frame_flags_t flags; /**< flags for this frame */
      /*!\brief the partition id defines the decoding order of the partitions.
       * Only applicable when "output partition" mode is enabled. First
       * partition has id 0.*/
      int partition_id;
      /*!\brief size of the visible frame in this packet */
      size_t vis_frame_size;
    } frame;                            /**< data for compressed frame packet */
    aom_fixed_buf_t twopass_stats;      /**< data for two-pass packet */
    aom_fixed_buf_t firstpass_mb_stats; /**< first pass mb packet */
    struct aom_psnr_pkt {
    
    
      unsigned int samples[4]; /**< Number of samples, total/y/u/v */
      uint64_t sse[4];         /**< sum squared error, total/y/u/v */
      double psnr[4];          /**< PSNR, total/y/u/v */
      /*!\brief Number of samples, total/y/u/v when
       * input bit-depth < stream bit-depth.*/
      unsigned int samples_hbd[4];
      /*!\brief sum squared error, total/y/u/v when
       * input bit-depth < stream bit-depth.*/
      uint64_t sse_hbd[4];
      /*!\brief PSNR, total/y/u/v when
       * input bit-depth < stream bit-depth.*/
      double psnr_hbd[4];
    } psnr;              /**< data for PSNR packet */
    aom_fixed_buf_t raw; /**< data for arbitrary packets */
  } data;                /**< packet data */
} aom_codec_cx_pkt_t;    /**< alias for struct aom_codec_cx_pkt */

/*!\brief Rational Number
 *
 * This structure holds a fractional value.
 */
typedef struct aom_rational {
    
    
  int num;        /**< fraction numerator */
  int den;        /**< fraction denominator */
} aom_rational_t; /**< alias for struct aom_rational */

/*!\brief Multi-pass Encoding Pass
 *
 * AOM_RC_LAST_PASS is kept for backward compatibility.
 * If passes is not given and pass==2, the codec will assume passes=2.
 * For new code, it is recommended to use AOM_RC_SECOND_PASS and set
 * the "passes" member to 2 via the key & val API for two-pass encoding.
 */
enum aom_enc_pass {
    
    
  AOM_RC_ONE_PASS = 0,    /**< Single pass mode */
  AOM_RC_FIRST_PASS = 1,  /**< First pass of multi-pass mode */
  AOM_RC_SECOND_PASS = 2, /**< Second pass of multi-pass mode */
  AOM_RC_THIRD_PASS = 3,  /**< Third pass of multi-pass mode */
  AOM_RC_LAST_PASS = 2,   /**< Final pass of two-pass mode */
};

/*!\brief Rate control mode */
enum aom_rc_mode {
    
    
  AOM_VBR, /**< Variable Bit Rate (VBR) mode */
  AOM_CBR, /**< Constant Bit Rate (CBR) mode */
  AOM_CQ,  /**< Constrained Quality (CQ)  mode */
  AOM_Q,   /**< Constant Quality (Q) mode */
};

/*!\brief Keyframe placement mode.
 *
 * This enumeration determines whether keyframes are placed automatically by
 * the encoder or whether this behavior is disabled. Older releases of this
 * SDK were implemented such that AOM_KF_FIXED meant keyframes were disabled.
 * This name is confusing for this behavior, so the new symbols to be used
 * are AOM_KF_AUTO and AOM_KF_DISABLED.
 */
enum aom_kf_mode {
    
    
  AOM_KF_FIXED,       /**< deprecated, implies AOM_KF_DISABLED */
  AOM_KF_AUTO,        /**< Encoder determines optimal placement automatically */
  AOM_KF_DISABLED = 0 /**< Encoder does not place keyframes. */
};

/*!\brief Frame super-resolution mode. */
typedef enum {
    
    
  /**< Frame super-resolution is disabled for all frames. */
  AOM_SUPERRES_NONE,
  /**< All frames are coded at the specified scale and super-resolved. */
  AOM_SUPERRES_FIXED,
  /**< All frames are coded at a random scale and super-resolved. */
  AOM_SUPERRES_RANDOM,
  /**< Super-resolution scale for each frame is determined based on the q index
     of that frame. */
  AOM_SUPERRES_QTHRESH,
  /**< Full-resolution or super-resolution and the scale (in case of
     super-resolution) are automatically selected for each frame. */
  AOM_SUPERRES_AUTO,
} aom_superres_mode;

/*!\brief Encoder Config Options
 *
 * This type allows to enumerate and control flags defined for encoder control
 * via config file at runtime.
 */
typedef struct cfg_options {
    
    
  /*!\brief Indicate init by cfg file
   * 0 or 1
   */
  unsigned int init_by_cfg_file;
  /*!\brief Superblock size
   * 0, 64 or 128
   */
  unsigned int super_block_size;
  /*!\brief max partition size
   * 8, 16, 32, 64, 128
   */
  unsigned int max_partition_size;
  /*!\brief min partition size
   * 8, 16, 32, 64, 128
   */
  unsigned int min_partition_size;
  /*!\brief disable AB Shape partition type
   *
   */
  unsigned int disable_ab_partition_type;
  /*!\brief disable rectangular partition type
   *
   */
  unsigned int disable_rect_partition_type;
  /*!\brief disable 1:4/4:1 partition type
   *
   */
  unsigned int disable_1to4_partition_type;
  /*!\brief disable flip and identity transform type
   *
   */
  unsigned int disable_flip_idtx;
  /*!\brief disable CDEF filter
   *
   */
  unsigned int disable_cdef;
  /*!\brief disable Loop Restoration Filter
   *
   */
  unsigned int disable_lr;
  /*!\brief disable OBMC
   *
   */
  unsigned int disable_obmc;
  /*!\brief disable Warped Motion
   *
   */
  unsigned int disable_warp_motion;
  /*!\brief disable global motion
   *
   */
  unsigned int disable_global_motion;
  /*!\brief disable dist weighted compound
   *
   */
  unsigned int disable_dist_wtd_comp;
  /*!\brief disable diff weighted compound
   *
   */
  unsigned int disable_diff_wtd_comp;
  /*!\brief disable inter/intra compound
   *
   */
  unsigned int disable_inter_intra_comp;
  /*!\brief disable masked compound
   *
   */
  unsigned int disable_masked_comp;
  /*!\brief disable one sided compound
   *
   */
  unsigned int disable_one_sided_comp;
  /*!\brief disable Palette
   *
   */
  unsigned int disable_palette;
  /*!\brief disable Intra Block Copy
   *
   */
  unsigned int disable_intrabc;
  /*!\brief disable chroma from luma
   *
   */
  unsigned int disable_cfl;
  /*!\brief disable intra smooth mode
   *
   */
  unsigned int disable_smooth_intra;
  /*!\brief disable filter intra
   *
   */
  unsigned int disable_filter_intra;
  /*!\brief disable dual filter
   *
   */
  unsigned int disable_dual_filter;
  /*!\brief disable intra angle delta
   *
   */
  unsigned int disable_intra_angle_delta;
  /*!\brief disable intra edge filter
   *
   */
  unsigned int disable_intra_edge_filter;
  /*!\brief disable 64x64 transform
   *
   */
  unsigned int disable_tx_64x64;
  /*!\brief disable smooth inter/intra
   *
   */
  unsigned int disable_smooth_inter_intra;
  /*!\brief disable inter/inter wedge comp
   *
   */
  unsigned int disable_inter_inter_wedge;
  /*!\brief disable inter/intra wedge comp
   *
   */
  unsigned int disable_inter_intra_wedge;
  /*!\brief disable paeth intra
   *
   */
  unsigned int disable_paeth_intra;
  /*!\brief disable trellis quantization
   *
   */
  unsigned int disable_trellis_quant;
  /*!\brief disable ref frame MV
   *
   */
  unsigned int disable_ref_frame_mv;
  /*!\brief use reduced reference frame set
   *
   */
  unsigned int reduced_reference_set;
  /*!\brief use reduced transform type set
   *
   */
  unsigned int reduced_tx_type_set;
} cfg_options_t;

/*!\brief Encoded Frame Flags
 *
 * This type indicates a bitfield to be passed to aom_codec_encode(), defining
 * per-frame boolean values. By convention, bits common to all codecs will be
 * named AOM_EFLAG_*, and bits specific to an algorithm will be named
 * /algo/_eflag_*. The lower order 16 bits are reserved for common use.
 */
typedef long aom_enc_frame_flags_t;
/*!\brief Force this frame to be a keyframe */
#define AOM_EFLAG_FORCE_KF (1 << 0)

/*!\brief Encoder configuration structure
 *
 * This structure contains the encoder settings that have common representations
 * across all codecs. This doesn't imply that all codecs support all features,
 * however.
 */
typedef struct aom_codec_enc_cfg {
    
    
  /*
   * generic settings (g)
   */

  /*!\brief Algorithm specific "usage" value
   *
   * Algorithms may define multiple values for usage, which may convey the
   * intent of how the application intends to use the stream. If this value
   * is non-zero, consult the documentation for the codec to determine its
   * meaning.
   */
  unsigned int g_usage;

  /*!\brief Maximum number of threads to use
   *
   * For multi-threaded implementations, use no more than this number of
   * threads. The codec may use fewer threads than allowed. The value
   * 0 is equivalent to the value 1.
   */
  unsigned int g_threads;

  /*!\brief Bitstream profile to use
   *
   * Some codecs support a notion of multiple bitstream profiles. Typically
   * this maps to a set of features that are turned on or off. Often the
   * profile to use is determined by the features of the intended decoder.
   * Consult the documentation for the codec to determine the valid values
   * for this parameter, or set to zero for a sane default.
   */
  unsigned int g_profile; /**< profile of bitstream to use */

  /*!\brief Width of the frame
   *
   * This value identifies the presentation resolution of the frame,
   * in pixels. Note that the frames passed as input to the encoder must
   * have this resolution. Frames will be presented by the decoder in this
   * resolution, independent of any spatial resampling the encoder may do.
   */
  unsigned int g_w;

  /*!\brief Height of the frame
   *
   * This value identifies the presentation resolution of the frame,
   * in pixels. Note that the frames passed as input to the encoder must
   * have this resolution. Frames will be presented by the decoder in this
   * resolution, independent of any spatial resampling the encoder may do.
   */
  unsigned int g_h;

  /*!\brief Max number of frames to encode
   *
   * If force video mode is off (the default) and g_limit is 1, the encoder
   * will encode a still picture (still_picture is set to 1 in the sequence
   * header OBU). If in addition full_still_picture_hdr is 0 (the default),
   * the encoder will use a reduced header (reduced_still_picture_header is
   * set to 1 in the sequence header OBU) for the still picture.
   */
  unsigned int g_limit;

  /*!\brief Forced maximum width of the frame
   *
   * If this value is non-zero then it is used to force the maximum frame
   * width written in write_sequence_header().
   */
  unsigned int g_forced_max_frame_width;

  /*!\brief Forced maximum height of the frame
   *
   * If this value is non-zero then it is used to force the maximum frame
   * height written in write_sequence_header().
   */
  unsigned int g_forced_max_frame_height;

  /*!\brief Bit-depth of the codec
   *
   * This value identifies the bit_depth of the codec,
   * Only certain bit-depths are supported as identified in the
   * aom_bit_depth_t enum.
   */
  aom_bit_depth_t g_bit_depth;

  /*!\brief Bit-depth of the input frames
   *
   * This value identifies the bit_depth of the input frames in bits.
   * Note that the frames passed as input to the encoder must have
   * this bit-depth.
   */
  unsigned int g_input_bit_depth;

  /*!\brief Stream timebase units
   *
   * Indicates the smallest interval of time, in seconds, used by the stream.
   * For fixed frame rate material, or variable frame rate material where
   * frames are timed at a multiple of a given clock (ex: video capture),
   * the \ref RECOMMENDED method is to set the timebase to the reciprocal
   * of the frame rate (ex: 1001/30000 for 29.970 Hz NTSC). This allows the
   * pts to correspond to the frame number, which can be handy. For
   * re-encoding video from containers with absolute time timestamps, the
   * \ref RECOMMENDED method is to set the timebase to that of the parent
   * container or multimedia framework (ex: 1/1000 for ms, as in FLV).
   */
  struct aom_rational g_timebase;

  /*!\brief Enable error resilient modes.
   *
   * The error resilient bitfield indicates to the encoder which features
   * it should enable to take measures for streaming over lossy or noisy
   * links.
   */
  aom_codec_er_flags_t g_error_resilient;

  /*!\brief Multi-pass Encoding Mode
   *
   * This value should be set to the current phase for multi-pass encoding.
   * For single pass, set to #AOM_RC_ONE_PASS.
   */
  enum aom_enc_pass g_pass;

  /*!\brief Allow lagged encoding
   *
   * If set, this value allows the encoder to consume a number of input
   * frames before producing output frames. This allows the encoder to
   * base decisions for the current frame on future frames. This does
   * increase the latency of the encoding pipeline, so it is not appropriate
   * in all situations (ex: realtime encoding).
   *
   * Note that this is a maximum value -- the encoder may produce frames
   * sooner than the given limit. Set this value to 0 to disable this
   * feature.
   */
  unsigned int g_lag_in_frames;

  /*
   * rate control settings (rc)
   */

  /*!\brief Temporal resampling configuration, if supported by the codec.
   *
   * Temporal resampling allows the codec to "drop" frames as a strategy to
   * meet its target data rate. This can cause temporal discontinuities in
   * the encoded video, which may appear as stuttering during playback. This
   * trade-off is often acceptable, but for many applications is not. It can
   * be disabled in these cases.
   *
   * Note that not all codecs support this feature. All aom AVx codecs do.
   * For other codecs, consult the documentation for that algorithm.
   *
   * This threshold is described as a percentage of the target data buffer.
   * When the data buffer falls below this percentage of fullness, a
   * dropped frame is indicated. Set the threshold to zero (0) to disable
   * this feature.
   */
  unsigned int rc_dropframe_thresh;

  /*!\brief Mode for spatial resampling, if supported by the codec.
   *
   * Spatial resampling allows the codec to compress a lower resolution
   * version of the frame, which is then upscaled by the decoder to the
   * correct presentation resolution. This increases visual quality at
   * low data rates, at the expense of CPU time on the encoder/decoder.
   */
  unsigned int rc_resize_mode;

  /*!\brief Frame resize denominator.
   *
   * The denominator for resize to use, assuming 8 as the numerator.
   *
   * Valid denominators are  8 - 16 for now.
   */
  unsigned int rc_resize_denominator;

  /*!\brief Keyframe resize denominator.
   *
   * The denominator for resize to use, assuming 8 as the numerator.
   *
   * Valid denominators are  8 - 16 for now.
   */
  unsigned int rc_resize_kf_denominator;

  /*!\brief Frame super-resolution scaling mode.
   *
   * Similar to spatial resampling, frame super-resolution integrates
   * upscaling after the encode/decode process. Taking control of upscaling and
   * using restoration filters should allow it to outperform normal resizing.
   */
  aom_superres_mode rc_superres_mode;

  /*!\brief Frame super-resolution denominator.
   *
   * 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 denominators are 8 to 16.
   *
   * Used only by AOM_SUPERRES_FIXED.
   */
  unsigned int rc_superres_denominator;

  /*!\brief Keyframe super-resolution denominator.
   *
   * 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 denominators are 8 - 16 for now.
   */
  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 AOM_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 AOM_SUPERRES_QTHRESH
   */
  unsigned int rc_superres_kf_qthresh;

  /*!\brief Rate control algorithm to use.
   *
   * Indicates whether the end usage of this stream is to be streamed over
   * a bandwidth constrained link, indicating that Constant Bit Rate (CBR)
   * mode should be used, or whether it will be played back on a high
   * bandwidth link, as from a local disk, where higher variations in
   * bitrate are acceptable.
   */
  enum aom_rc_mode rc_end_usage;

  /*!\brief Two-pass stats buffer.
   *
   * A buffer containing all of the stats packets produced in the first
   * pass, concatenated.
   */
  aom_fixed_buf_t rc_twopass_stats_in;

  /*!\brief first pass mb stats buffer.
   *
   * A buffer containing all of the first pass mb stats packets produced
   * in the first pass, concatenated.
   */
  aom_fixed_buf_t rc_firstpass_mb_stats_in;

  /*!\brief Target data rate
   *
   * Target bitrate to use for this stream, in kilobits per second.
   * Max allowed value is 2000000
   */
  unsigned int rc_target_bitrate;

  /*
   * quantizer settings
   */

  /*!\brief Minimum (Best Quality) Quantizer
   *
   * The quantizer is the most direct control over the quality of the
   * encoded image. The range of valid values for the quantizer is codec
   * specific. Consult the documentation for the codec to determine the
   * values to use. To determine the range programmatically, call
   * aom_codec_enc_config_default() with a usage value of 0.
   */
  unsigned int rc_min_quantizer;

  /*!\brief Maximum (Worst Quality) Quantizer
   *
   * The quantizer is the most direct control over the quality of the
   * encoded image. The range of valid values for the quantizer is codec
   * specific. Consult the documentation for the codec to determine the
   * values to use. To determine the range programmatically, call
   * aom_codec_enc_config_default() with a usage value of 0.
   */
  unsigned int rc_max_quantizer;

  /*
   * bitrate tolerance
   */

  /*!\brief Rate control adaptation undershoot control
   *
   * This value, controls the tolerance of the VBR algorithm to undershoot
   * and is used as a trigger threshold for more aggressive adaptation of Q.
   *
   * Valid values in the range 0-100.
   */
  unsigned int rc_undershoot_pct;

  /*!\brief Rate control adaptation overshoot control
   *
   * This value, controls the tolerance of the VBR algorithm to overshoot
   * and is used as a trigger threshold for more aggressive adaptation of Q.
   *
   * Valid values in the range 0-100.
   */
  unsigned int rc_overshoot_pct;

  /*
   * decoder buffer model parameters
   */

  /*!\brief Decoder Buffer Size
   *
   * This value indicates the amount of data that may be buffered by the
   * decoding application. Note that this value is expressed in units of
   * time (milliseconds). For example, a value of 5000 indicates that the
   * client will buffer (at least) 5000ms worth of encoded data. Use the
   * target bitrate (#rc_target_bitrate) to convert to bits/bytes, if
   * necessary.
   */
  unsigned int rc_buf_sz;

  /*!\brief Decoder Buffer Initial Size
   *
   * This value indicates the amount of data that will be buffered by the
   * decoding application prior to beginning playback. This value is
   * expressed in units of time (milliseconds). Use the target bitrate
   * (#rc_target_bitrate) to convert to bits/bytes, if necessary.
   */
  unsigned int rc_buf_initial_sz;

  /*!\brief Decoder Buffer Optimal Size
   *
   * This value indicates the amount of data that the encoder should try
   * to maintain in the decoder's buffer. This value is expressed in units
   * of time (milliseconds). Use the target bitrate (#rc_target_bitrate)
   * to convert to bits/bytes, if necessary.
   */
  unsigned int rc_buf_optimal_sz;

  /*
   * 2 pass rate control parameters
   */

  /*!\brief Two-pass mode CBR/VBR bias
   *
   * Bias, expressed on a scale of 0 to 100, for determining target size
   * for the current frame. The value 0 indicates the optimal CBR mode
   * value should be used. The value 100 indicates the optimal VBR mode
   * value should be used. Values in between indicate which way the
   * encoder should "lean."
   */
  unsigned int rc_2pass_vbr_bias_pct;

  /*!\brief Two-pass mode per-GOP minimum bitrate
   *
   * This value, expressed as a percentage of the target bitrate, indicates
   * the minimum bitrate to be used for a single GOP (aka "section")
   */
  unsigned int rc_2pass_vbr_minsection_pct;

  /*!\brief Two-pass mode per-GOP maximum bitrate
   *
   * This value, expressed as a percentage of the target bitrate, indicates
   * the maximum bitrate to be used for a single GOP (aka "section")
   */
  unsigned int rc_2pass_vbr_maxsection_pct;

  /*
   * keyframing settings (kf)
   */

  /*!\brief Option to enable forward reference key frame
   *
   */
  int fwd_kf_enabled;

  /*!\brief Keyframe placement mode
   *
   * This value indicates whether the encoder should place keyframes at a
   * fixed interval, or determine the optimal placement automatically
   * (as governed by the #kf_min_dist and #kf_max_dist parameters)
   */
  enum aom_kf_mode kf_mode;

  /*!\brief Keyframe minimum interval
   *
   * This value, expressed as a number of frames, prevents the encoder from
   * placing a keyframe nearer than kf_min_dist to the previous keyframe. At
   * least kf_min_dist frames non-keyframes will be coded before the next
   * keyframe. Set kf_min_dist equal to kf_max_dist for a fixed interval.
   */
  unsigned int kf_min_dist;

  /*!\brief Keyframe maximum interval
   *
   * This value, expressed as a number of frames, forces the encoder to code
   * a keyframe if one has not been coded in the last kf_max_dist frames.
   * A value of 0 implies all frames will be keyframes. Set kf_min_dist
   * equal to kf_max_dist for a fixed interval.
   */
  unsigned int kf_max_dist;

  /*!\brief sframe interval
   *
   * This value, expressed as a number of frames, forces the encoder to code
   * an S-Frame every sframe_dist frames.
   */
  unsigned int sframe_dist;

  /*!\brief sframe insertion mode
   *
   * This value must be set to 1 or 2, and tells the encoder how to insert
   * S-Frames. It will only have an effect if sframe_dist != 0.
   *
   * If altref is enabled:
   *   - if sframe_mode == 1, the considered frame will be made into an
   *     S-Frame only if it is an altref frame
   *   - if sframe_mode == 2, the next altref frame will be made into an
   *     S-Frame.
   *
   * Otherwise: the considered frame will be made into an S-Frame.
   */
  unsigned int sframe_mode;

  /*!\brief Tile coding mode
   *
   * This value indicates the tile coding mode.
   * A value of 0 implies a normal non-large-scale tile coding. A value of 1
   * implies a large-scale tile coding.
   */
  unsigned int large_scale_tile;

  /*!\brief Monochrome mode
   *
   * If this is nonzero, the encoder will generate a monochrome stream
   * with no chroma planes.
   */
  unsigned int monochrome;

  /*!\brief full_still_picture_hdr
   *
   * If this is nonzero, the encoder will generate a full header
   * (reduced_still_picture_header is set to 0 in the sequence header OBU) even
   * for still picture encoding. If this is zero (the default), a reduced
   * header (reduced_still_picture_header is set to 1 in the sequence header
   * OBU) is used for still picture encoding. This flag has no effect when a
   * regular video with more than a single frame is encoded.
   */
  unsigned int full_still_picture_hdr;

  /*!\brief Bitstream syntax mode
   *
   * This value indicates the bitstream syntax mode.
   * A value of 0 indicates bitstream is saved as Section 5 bitstream. A value
   * of 1 indicates the bitstream is saved in Annex-B format
   */
  unsigned int save_as_annexb;

  /*!\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];

  /*!\brief Whether encoder should use fixed QP offsets.
   *
   * If a value of 1 is provided, encoder will use fixed QP offsets for frames
   * at different levels of the pyramid.
   * If a value of 0 is provided, encoder will NOT use fixed QP offsets.
   * Note: This option is only relevant for --end-usage=q.
   */
  unsigned int use_fixed_qp_offsets;

  /*!\brief Deprecated and ignored. DO NOT USE.
   *
   * TODO(aomedia:3269): Remove fixed_qp_offsets in libaom v4.0.0.
   */
  int fixed_qp_offsets[5];

  /*!\brief Options defined per config file
   *
   */
  cfg_options_t encoder_cfg;
} aom_codec_enc_cfg_t; /**< alias for struct aom_codec_enc_cfg */

/*!\brief Initialize an encoder instance
 *
 * Initializes an encoder context using the given interface. Applications
 * should call the aom_codec_enc_init convenience macro instead of this
 * function directly, to ensure that the ABI version number parameter
 * is properly initialized.
 *
 * If the library was configured with -DCONFIG_MULTITHREAD=0, this call
 * is not thread safe and should be guarded with a lock if being used
 * in a multithreaded context.
 *
 * If aom_codec_enc_init_ver() fails, it is not necessary to call
 * aom_codec_destroy() on the encoder context.
 *
 * \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.
 * \param[in]    flags   Bitfield of AOM_CODEC_USE_* flags
 * \param[in]    ver     ABI version number. Must be set to
 *                       AOM_ENCODER_ABI_VERSION
 * \retval #AOM_CODEC_OK
 *     The encoder algorithm has been initialized.
 * \retval #AOM_CODEC_MEM_ERROR
 *     Memory allocation failed.
 */
aom_codec_err_t aom_codec_enc_init_ver(aom_codec_ctx_t *ctx,
                                       aom_codec_iface_t *iface,
                                       const aom_codec_enc_cfg_t *cfg,
                                       aom_codec_flags_t flags, int ver);

/*!\brief Convenience macro for aom_codec_enc_init_ver()
 *
 * Ensures the ABI version parameter is properly set.
 */
#define aom_codec_enc_init(ctx, iface, cfg, flags) \
  aom_codec_enc_init_ver(ctx, iface, cfg, flags, AOM_ENCODER_ABI_VERSION)

/*!\brief Get the default configuration for a usage.
 *
 * Initializes an encoder configuration structure with default values. Supports
 * the notion of "usages" so that an algorithm may offer different default
 * settings depending on the user's intended goal. This function \ref SHOULD
 * be called by all applications to initialize the configuration structure
 * before specializing the configuration with application specific values.
 *
 * \param[in]    iface     Pointer to the algorithm interface to use.
 * \param[out]   cfg       Configuration buffer to populate.
 * \param[in]    usage     Algorithm specific usage value. For AV1, must be
 *                         set to AOM_USAGE_GOOD_QUALITY (0),
 *                         AOM_USAGE_REALTIME (1), or AOM_USAGE_ALL_INTRA (2).
 *
 * \retval #AOM_CODEC_OK
 *     The configuration was populated.
 * \retval #AOM_CODEC_INCAPABLE
 *     Interface is not an encoder interface.
 * \retval #AOM_CODEC_INVALID_PARAM
 *     A parameter was NULL, or the usage value was not recognized.
 */
aom_codec_err_t aom_codec_enc_config_default(aom_codec_iface_t *iface,
                                             aom_codec_enc_cfg_t *cfg,
                                             unsigned int usage);

/*!\brief Set or change configuration
 *
 * Reconfigures an encoder instance according to the given configuration.
 *
 * \param[in]    ctx     Pointer to this instance's context
 * \param[in]    cfg     Configuration buffer to use
 *
 * \retval #AOM_CODEC_OK
 *     The configuration was populated.
 * \retval #AOM_CODEC_INCAPABLE
 *     Interface is not an encoder interface.
 * \retval #AOM_CODEC_INVALID_PARAM
 *     A parameter was NULL, or the usage value was not recognized.
 */
aom_codec_err_t aom_codec_enc_config_set(aom_codec_ctx_t *ctx,
                                         const aom_codec_enc_cfg_t *cfg);

/*!\brief Get global stream headers
 *
 * Retrieves a stream level global header packet, if supported by the codec.
 * Calls to this function should be deferred until all configuration information
 * has been passed to libaom. Otherwise the global header data may be
 * invalidated by additional configuration changes.
 *
 * The AV1 implementation of this function returns an OBU. The OBU returned is
 * in Low Overhead Bitstream Format. Specifically, the obu_has_size_field bit is
 * set, and the buffer contains the obu_size field for the returned OBU.
 *
 * \param[in]    ctx     Pointer to this instance's context
 *
 * \retval NULL
 *     Encoder does not support global header, or an error occurred while
 *     generating the global header.
 *
 * \retval Non-NULL
 *     Pointer to buffer containing global header packet. The caller owns the
 *     memory associated with this buffer, and must free the 'buf' member of the
 *     aom_fixed_buf_t as well as the aom_fixed_buf_t pointer. Memory returned
 *     must be freed via call to free().
 */
aom_fixed_buf_t *aom_codec_get_global_headers(aom_codec_ctx_t *ctx);

/*!\brief usage parameter analogous to AV1 GOOD QUALITY mode. */
#define AOM_USAGE_GOOD_QUALITY 0u
/*!\brief usage parameter analogous to AV1 REALTIME mode. */
#define AOM_USAGE_REALTIME 1u
/*!\brief usage parameter analogous to AV1 all intra mode. */
#define AOM_USAGE_ALL_INTRA 2u

/*!\brief Encode a frame
 *
 * Encodes a video frame at the given "presentation time." The presentation
 * time stamp (PTS) \ref MUST be strictly increasing.
 *
 * When the last frame has been passed to the encoder, this function should
 * continue to be called in a loop, with the img parameter set to NULL. This
 * will signal the end-of-stream condition to the encoder and allow it to
 * encode any held buffers. Encoding is complete when aom_codec_encode() is
 * called with img set to NULL and aom_codec_get_cx_data() returns no data.
 *
 * \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<<img->bit_depth)-1] is undefined behavior.
 *                         Note: Although img is declared as a const pointer,
 *                         if AV1E_SET_DENOISE_NOISE_LEVEL is set to a nonzero
 *                         value aom_codec_encode() modifies (denoises) the
 *                         samples in img->planes[i] .
 * \param[in]    pts       Presentation time stamp, in timebase units. If img
 *                         is NULL, pts is ignored.
 * \param[in]    duration  Duration to show frame, in timebase units. If img
 *                         is not NULL, duration must be nonzero. If img is
 *                         NULL, duration is ignored.
 * \param[in]    flags     Flags to use for encoding this frame.
 *
 * \retval #AOM_CODEC_OK
 *     The configuration was populated.
 * \retval #AOM_CODEC_INCAPABLE
 *     Interface is not an encoder interface.
 * \retval #AOM_CODEC_INVALID_PARAM
 *     A parameter was NULL, the image format is unsupported, etc.
 *
 * \note
 * `duration` is of the unsigned long type, which can be 32 or 64 bits.
 * `duration` must be less than or equal to UINT32_MAX so that its range is
 * independent of the size of unsigned long.
 */
aom_codec_err_t aom_codec_encode(aom_codec_ctx_t *ctx, const aom_image_t *img,
                                 aom_codec_pts_t pts, unsigned long duration,
                                 aom_enc_frame_flags_t flags);

/*!\brief Set compressed data output buffer
 *
 * Sets the buffer that the codec should output the compressed data
 * into. This call effectively sets the buffer pointer returned in the
 * next AOM_CODEC_CX_FRAME_PKT packet. Subsequent packets will be
 * appended into this buffer. The buffer is preserved across frames,
 * so applications must periodically call this function after flushing
 * the accumulated compressed data to disk or to the network to reset
 * the pointer to the buffer's head.
 *
 * `pad_before` bytes will be skipped before writing the compressed
 * data, and `pad_after` bytes will be appended to the packet. The size
 * of the packet will be the sum of the size of the actual compressed
 * data, pad_before, and pad_after. The padding bytes will be preserved
 * (not overwritten).
 *
 * Note that calling this function does not guarantee that the returned
 * compressed data will be placed into the specified buffer. In the
 * event that the encoded data will not fit into the buffer provided,
 * the returned packet \ref MAY point to an internal buffer, as it would
 * if this call were never used. In this event, the output packet will
 * NOT have any padding, and the application must free space and copy it
 * to the proper place. This is of particular note in configurations
 * that may output multiple packets for a single encoded frame (e.g., lagged
 * encoding) or if the application does not reset the buffer periodically.
 *
 * Applications may restore the default behavior of the codec providing
 * the compressed data buffer by calling this function with a NULL
 * buffer.
 *
 * Applications \ref MUSTNOT call this function during iteration of
 * aom_codec_get_cx_data().
 *
 * \param[in]    ctx         Pointer to this instance's context
 * \param[in]    buf         Buffer to store compressed data into
 * \param[in]    pad_before  Bytes to skip before writing compressed data
 * \param[in]    pad_after   Bytes to skip after writing compressed data
 *
 * \retval #AOM_CODEC_OK
 *     The buffer was set successfully.
 * \retval #AOM_CODEC_INVALID_PARAM
 *     A parameter was NULL, the image format is unsupported, etc.
 */
aom_codec_err_t aom_codec_set_cx_data_buf(aom_codec_ctx_t *ctx,
                                          const aom_fixed_buf_t *buf,
                                          unsigned int pad_before,
                                          unsigned int pad_after);

/*!\brief Encoded data iterator
 *
 * Iterates over a list of data packets to be passed from the encoder to the
 * application. The different kinds of packets available are enumerated in
 * #aom_codec_cx_pkt_kind.
 *
 * #AOM_CODEC_CX_FRAME_PKT packets should be passed to the application's
 * muxer. Multiple compressed frames may be in the list.
 * #AOM_CODEC_STATS_PKT packets should be appended to a global buffer.
 *
 * The application \ref MUST silently ignore any packet kinds that it does
 * not recognize or support.
 *
 * The data buffers returned from this function are only guaranteed to be
 * valid until the application makes another call to any aom_codec_* function.
 *
 * \param[in]     ctx      Pointer to this instance's context
 * \param[in,out] iter     Iterator storage, initialized to NULL
 *
 * \return Returns a pointer to an output data packet (compressed frame data,
 *         two-pass statistics, etc.) or NULL to signal end-of-list.
 *
 */
const aom_codec_cx_pkt_t *aom_codec_get_cx_data(aom_codec_ctx_t *ctx,
                                                aom_codec_iter_t *iter);

/*!\brief Get Preview Frame
 *
 * Returns an image that can be used as a preview. Shows the image as it would
 * exist at the decompressor. The application \ref MUST NOT write into this
 * image buffer.
 *
 * \param[in]     ctx      Pointer to this instance's context
 *
 * \return Returns a pointer to a preview image, or NULL if no image is
 *         available.
 *
 */
const aom_image_t *aom_codec_get_preview_frame(aom_codec_ctx_t *ctx);

/*!@} - end defgroup encoder*/
#ifdef __cplusplus
}
#endif
#endif  // AOM_AOM_AOM_ENCODER_H_

  1. aomcx.h
/*
 * Copyright (c) 2016, 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_AOMCX_H_
#define AOM_AOM_AOMCX_H_

/*!\defgroup aom_encoder AOMedia AOM/AV1 Encoder
 * \ingroup aom
 *
 * @{
 */
#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
 *        aom Codec Interface.
 *
 * Several interfaces are excluded with CONFIG_REALTIME_ONLY build:
 * Global motion
 * Warped motion
 * OBMC
 * TPL model
 * Loop restoration
 *
 * The following features are also disabled with CONFIG_REALTIME_ONLY:
 * AV1E_SET_QUANT_B_ADAPT
 * CNN
 * 4X rectangular blocks
 * 4X rectangular transform in intra prediction
 */

#ifdef __cplusplus
extern "C" {
    
    
#endif

/*!\name Algorithm interface for AV1
 *
 * This interface provides the capability to encode raw AV1 streams.
 *@{
 */

/*!\brief A single instance of the AV1 encoder.
 *\deprecated This access mechanism is provided for backwards compatibility;
 * prefer aom_codec_av1_cx().
 */
extern aom_codec_iface_t aom_codec_av1_cx_algo;

/*!\brief The interface to the AV1 encoder.
 */
extern aom_codec_iface_t *aom_codec_av1_cx(void);
/*!@} - end algorithm interface member group */

/*
 * Algorithm Flags
 */

/*!\brief Don't reference the last frame
 *
 * When this flag is set, the encoder will not use the last frame as a
 * predictor. When not set, the encoder will choose whether to use the
 * last frame or not automatically.
 */
#define AOM_EFLAG_NO_REF_LAST (1 << 16)
/*!\brief Don't reference the last2 frame
 *
 * When this flag is set, the encoder will not use the last2 frame as a
 * predictor. When not set, the encoder will choose whether to use the
 * last2 frame or not automatically.
 */
#define AOM_EFLAG_NO_REF_LAST2 (1 << 17)
/*!\brief Don't reference the last3 frame
 *
 * When this flag is set, the encoder will not use the last3 frame as a
 * predictor. When not set, the encoder will choose whether to use the
 * last3 frame or not automatically.
 */
#define AOM_EFLAG_NO_REF_LAST3 (1 << 18)
/*!\brief Don't reference the golden frame
 *
 * When this flag is set, the encoder will not use the golden frame as a
 * predictor. When not set, the encoder will choose whether to use the
 * golden frame or not automatically.
 */
#define AOM_EFLAG_NO_REF_GF (1 << 19)

/*!\brief Don't reference the alternate reference frame
 *
 * When this flag is set, the encoder will not use the alt ref frame as a
 * predictor. When not set, the encoder will choose whether to use the
 * alt ref frame or not automatically.
 */
#define AOM_EFLAG_NO_REF_ARF (1 << 20)
/*!\brief Don't reference the bwd reference frame
 *
 * When this flag is set, the encoder will not use the bwd ref frame as a
 * predictor. When not set, the encoder will choose whether to use the
 * bwd ref frame or not automatically.
 */
#define AOM_EFLAG_NO_REF_BWD (1 << 21)
/*!\brief Don't reference the alt2 reference frame
 *
 * When this flag is set, the encoder will not use the alt2 ref frame as a
 * predictor. When not set, the encoder will choose whether to use the
 * alt2 ref frame or not automatically.
 */
#define AOM_EFLAG_NO_REF_ARF2 (1 << 22)

/*!\brief Don't update the last frame
 *
 * When this flag is set, the encoder will not update the last frame with
 * the contents of the current frame.
 */
#define AOM_EFLAG_NO_UPD_LAST (1 << 23)

/*!\brief Don't update the golden frame
 *
 * When this flag is set, the encoder will not update the golden frame with
 * the contents of the current frame.
 */
#define AOM_EFLAG_NO_UPD_GF (1 << 24)

/*!\brief Don't update the alternate reference frame
 *
 * When this flag is set, the encoder will not update the alt ref frame with
 * the contents of the current frame.
 */
#define AOM_EFLAG_NO_UPD_ARF (1 << 25)
/*!\brief Disable entropy update
 *
 * When this flag is set, the encoder will not update its internal entropy
 * model based on the entropy of this frame.
 */
#define AOM_EFLAG_NO_UPD_ENTROPY (1 << 26)
/*!\brief Disable ref frame mvs
 *
 * When this flag is set, the encoder will not allow frames to
 * be encoded using mfmv.
 */
#define AOM_EFLAG_NO_REF_FRAME_MVS (1 << 27)
/*!\brief Enable error resilient frame
 *
 * When this flag is set, the encoder will code frames as error
 * resilient.
 */
#define AOM_EFLAG_ERROR_RESILIENT (1 << 28)
/*!\brief Enable s frame mode
 *
 * When this flag is set, the encoder will code frames as an
 * s frame.
 */
#define AOM_EFLAG_SET_S_FRAME (1 << 29)
/*!\brief Force primary_ref_frame to PRIMARY_REF_NONE
 *
 * When this flag is set, the encoder will set a frame's primary_ref_frame
 * to PRIMARY_REF_NONE
 */
#define AOM_EFLAG_SET_PRIMARY_REF_NONE (1 << 30)

/*!\brief AVx encoder control functions
 *
 * 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, ...)
 */
enum aome_enc_control_id {
    
    
  /*!\brief Codec control function to set which reference frame encoder can use,
   * int parameter.
   */
  AOME_USE_REFERENCE = 7,

  /*!\brief Codec control function to pass an ROI map to encoder, aom_roi_map_t*
   * parameter.
   */
  AOME_SET_ROI_MAP = 8,

  /*!\brief Codec control function to pass an Active map to encoder,
   * aom_active_map_t* parameter.
   */
  AOME_SET_ACTIVEMAP = 9,

  /* NOTE: enum 10 unused */

  /*!\brief Codec control function to set encoder scaling mode for the next
   * frame to be coded, aom_scaling_mode_t* parameter.
   */
  AOME_SET_SCALEMODE = 11,

  /*!\brief Codec control function to set encoder spatial layer id, int
   * parameter.
   */
  AOME_SET_SPATIAL_LAYER_ID = 12,

  /*!\brief Codec control function to set encoder internal speed settings,
   * int parameter
   *
   * Changes in this value influences the complexity of algorithms used in
   * encoding process, values greater than 0 will increase encoder speed at
   * the expense of quality.
   *
   * Valid range: 0..11. 0 runs the slowest, and 11 runs the fastest;
   * quality improves as speed decreases (since more compression
   * possibilities are explored).
   *
   * NOTE: 10 and 11 are only allowed in AOM_USAGE_REALTIME. In
   * AOM_USAGE_GOOD_QUALITY and AOM_USAGE_ALL_INTRA, 9 is the highest allowed
   * value. However, AOM_USAGE_GOOD_QUALITY treats 7..9 the same as 6. Also,
   * AOM_USAGE_REALTIME treats 0..4 the same as 5.
   */
  AOME_SET_CPUUSED = 13,

  /*!\brief Codec control function to enable automatic set and use alf frames,
   * unsigned int parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AOME_SET_ENABLEAUTOALTREF = 14,

  /* NOTE: enum 15 unused */

  /*!\brief Codec control function to set the sharpness parameter,
   * unsigned int parameter.
   *
   * 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

  /*!\brief Codec control function to set the threshold for MBs treated static,
   * unsigned int parameter
   */
  AOME_SET_STATIC_THRESHOLD = 17,

  /* NOTE: enum 18 unused */

  /*!\brief Codec control function to get last quantizer chosen by the encoder,
   * int* parameter
   *
   * Return value uses internal quantizer scale defined by the codec.
   */
  AOME_GET_LAST_QUANTIZER = AOME_SET_STATIC_THRESHOLD + 2,  // 19

  /*!\brief Codec control function to get last quantizer chosen by the encoder,
   * int* parameter
   *
   * Return value uses the 0..63 scale as used by the rc_*_quantizer config
   * parameters.
   */
  AOME_GET_LAST_QUANTIZER_64 = 20,

  /*!\brief Codec control function to set the max no of frames to create arf,
   * unsigned int parameter
   */
  AOME_SET_ARNR_MAXFRAMES = 21,

  /*!\brief Codec control function to set the filter strength for the arf,
   * unsigned int parameter
   */
  AOME_SET_ARNR_STRENGTH = 22,

  /* NOTE: enum 23 unused */

  /*!\brief Codec control function to set visual tuning, aom_tune_metric (int)
   * parameter
   *
   * The default is AOM_TUNE_PSNR.
   */
  AOME_SET_TUNING = AOME_SET_ARNR_STRENGTH + 2,  // 24

  /*!\brief Codec control function to set constrained / constant quality level,
   * unsigned int parameter
   *
   * Valid range: 0..63
   *
   * \attention For this value to be used aom_codec_enc_cfg_t::rc_end_usage
   *            must be set to #AOM_CQ or #AOM_Q.
   */
  AOME_SET_CQ_LEVEL = 25,

  /*!\brief Codec control function to set max data rate for intra frames,
   * unsigned int parameter
   *
   * This value controls additional clamping on the maximum size of a
   * keyframe. It is expressed as a percentage of the average
   * per-frame bitrate, with the special (and default) value 0 meaning
   * unlimited, or no additional clamping beyond the codec's built-in
   * algorithm.
   *
   * For example, to allocate no more than 4.5 frames worth of bitrate
   * to a keyframe, set this to 450.
   */
  AOME_SET_MAX_INTRA_BITRATE_PCT = 26,

  /*!\brief Codec control function to set number of spatial layers, int
   * parameter
   */
  AOME_SET_NUMBER_SPATIAL_LAYERS = 27,

  /*!\brief Codec control function to set max data rate for inter frames,
   * unsigned int parameter
   *
   * This value controls additional clamping on the maximum size of an
   * inter frame. It is expressed as a percentage of the average
   * per-frame bitrate, with the special (and default) value 0 meaning
   * unlimited, or no additional clamping beyond the codec's built-in
   * algorithm.
   *
   * For example, to allow no more than 4.5 frames worth of bitrate
   * to an inter frame, set this to 450.
   */
  AV1E_SET_MAX_INTER_BITRATE_PCT = AOME_SET_MAX_INTRA_BITRATE_PCT + 2,  // 28

  /*!\brief Boost percentage for Golden Frame in CBR mode, unsigned int
   * parameter
   *
   * This value controls the amount of boost given to Golden Frame in
   * CBR mode. It is expressed as a percentage of the average
   * per-frame bitrate, with the special (and default) value 0 meaning
   * the feature is off, i.e., no golden frame boost in CBR mode and
   * average bitrate target is used.
   *
   * For example, to allow 100% more bits, i.e, 2X, in a golden frame
   * than average frame, set this to 100.
   */
  AV1E_SET_GF_CBR_BOOST_PCT = 29,

  /* NOTE: enum 30 unused */

  /*!\brief Codec control function to set lossless encoding mode, unsigned int
   * parameter
   *
   * AV1 can operate in lossless encoding mode, in which the bitstream
   * produced will be able to decode and reconstruct a perfect copy of
   * input source.
   *
   * - 0 = normal coding mode, may be lossy (default)
   * - 1 = lossless coding mode
   */
  AV1E_SET_LOSSLESS = AV1E_SET_GF_CBR_BOOST_PCT + 2,  // 31

  /*!\brief Codec control function to enable the row based multi-threading
   * of the encoder, unsigned int parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ROW_MT = 32,

  /*!\brief Codec control function to set number of tile columns. unsigned int
   * parameter
   *
   * In encoding and decoding, AV1 allows an input image frame be partitioned
   * into separate vertical tile columns, which can be encoded or decoded
   * independently. This enables easy implementation of parallel encoding and
   * decoding. The parameter for this control describes the number of tile
   * columns (in log2 units), which has a valid range of [0, 6]:
   * \verbatim
                 0 = 1 tile column
                 1 = 2 tile columns
                 2 = 4 tile columns
                 .....
                 n = 2**n tile columns
     \endverbatim
   * By default, the value is 0, i.e. one single column tile for entire image.
   */
  AV1E_SET_TILE_COLUMNS = 33,

  /*!\brief Codec control function to set number of tile rows, unsigned int
   * parameter
   *
   * In encoding and decoding, AV1 allows an input image frame be partitioned
   * into separate horizontal tile rows, which can be encoded or decoded
   * independently. The parameter for this control describes the number of tile
   * rows (in log2 units), which has a valid range of [0, 6]:
   * \verbatim
                0 = 1 tile row
                1 = 2 tile rows
                2 = 4 tile rows
                .....
                n = 2**n tile rows
   \endverbatim
   * By default, the value is 0, i.e. one single row tile for entire image.
   */
  AV1E_SET_TILE_ROWS = 34,

  /*!\brief Codec control function to enable RDO modulated by frame temporal
   * dependency, unsigned int parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   *
   * \note Excluded from CONFIG_REALTIME_ONLY build.
   */
  AV1E_SET_ENABLE_TPL_MODEL = 35,

  /*!\brief Codec control function to enable temporal filtering on key frame,
   * unsigned int parameter
   *
   * - 0 = disable
   * - 1 = enable without overlay (default)
   * - 2 = enable with overlay
   */
  AV1E_SET_ENABLE_KEYFRAME_FILTERING = 36,

  /*!\brief Codec control function to enable frame parallel decoding feature,
   * unsigned int parameter
   *
   * AV1 has a bitstream feature to reduce decoding dependency between frames
   * by turning off backward update of probability context used in encoding
   * and decoding. This allows staged parallel processing of more than one
   * video frames in the decoder. This control function provides a means to
   * turn this feature on or off for bitstreams produced by encoder.
   *
   * - 0 = disable (default)
   * - 1 = enable
   */
  AV1E_SET_FRAME_PARALLEL_DECODING = 37,

  /*!\brief Codec control function to enable error_resilient_mode, int parameter
   *
   * AV1 has a bitstream feature to guarantee parsability of a frame
   * by turning on the error_resilient_decoding mode, even though the
   * reference buffers are unreliable or not received.
   *
   * - 0 = disable (default)
   * - 1 = enable
   */
  AV1E_SET_ERROR_RESILIENT_MODE = 38,

  /*!\brief Codec control function to enable s_frame_mode, int parameter
   *
   * AV1 has a bitstream feature to designate certain frames as S-frames,
   * from where we can switch to a different stream,
   * even though the reference buffers may not be exactly identical.
   *
   * - 0 = disable (default)
   * - 1 = enable
   */
  AV1E_SET_S_FRAME_MODE = 39,

  /*!\brief Codec control function to set adaptive quantization mode, unsigned
   * int parameter
   *
   * AV1 has a segment based feature that allows encoder to adaptively change
   * quantization parameter for each segment within a frame to improve the
   * subjective quality. This control makes encoder operate in one of the
   * several AQ modes supported.
   *
   * - 0 = disable (default)
   * - 1 = variance
   * - 2 = complexity
   * - 3 = cyclic refresh
   */
  AV1E_SET_AQ_MODE = 40,

  /*!\brief Codec control function to enable/disable periodic Q boost, unsigned
   * int parameter
   *
   * One AV1 encoder speed feature is to enable quality boost by lowering
   * frame level Q periodically. This control function provides a means to
   * turn on/off this feature.
   *
   * - 0 = disable (default)
   * - 1 = enable
   */
  AV1E_SET_FRAME_PERIODIC_BOOST = 41,

  /*!\brief Codec control function to set noise sensitivity, unsigned int
   * parameter
   *
   * - 0 = disable (default)
   * - 1 = enable (Y only)
   */
  AV1E_SET_NOISE_SENSITIVITY = 42,

  /*!\brief Codec control function to set content type, aom_tune_content
   * parameter
   *
   *  - AOM_CONTENT_DEFAULT = Regular video content (default)
   *  - AOM_CONTENT_SCREEN  = Screen capture content
   *  - AOM_CONTENT_FILM = Film content
   */
  AV1E_SET_TUNE_CONTENT = 43,

  /*!\brief Codec control function to set CDF update mode, unsigned int
   * parameter
   *
   *  - 0: no update
   *  - 1: update on every frame (default)
   *  - 2: selectively update
   */
  AV1E_SET_CDF_UPDATE_MODE = 44,

  /*!\brief Codec control function to set color space info, int parameter
   *
   *  - 0 = For future use
   *  - 1 = BT.709
   *  - 2 = Unspecified (default)
   *  - 3 = For future use
   *  - 4 = BT.470 System M (historical)
   *  - 5 = BT.470 System B, G (historical)
   *  - 6 = BT.601
   *  - 7 = SMPTE 240
   *  - 8 = Generic film (color filters using illuminant C)
   *  - 9 = BT.2020, BT.2100
   *  - 10 = SMPTE 428 (CIE 1921 XYZ)
   *  - 11 = SMPTE RP 431-2
   *  - 12 = SMPTE EG 432-1
   *  - 13..21 = For future use
   *  - 22 = EBU Tech. 3213-E
   *  - 23 = For future use
   */
  AV1E_SET_COLOR_PRIMARIES = 45,

  /*!\brief Codec control function to set transfer function info, int parameter
   *
   * - 0 = For future use
   * - 1 = BT.709
   * - 2 = Unspecified (default)
   * - 3 = For future use
   * - 4 = BT.470 System M (historical)
   * - 5 = BT.470 System B, G (historical)
   * - 6 = BT.601
   * - 7 = SMPTE 240 M
   * - 8 = Linear
   * - 9 = Logarithmic (100 : 1 range)
   * - 10 = Logarithmic (100 * Sqrt(10) : 1 range)
   * - 11 = IEC 61966-2-4
   * - 12 = BT.1361
   * - 13 = sRGB or sYCC
   * - 14 = BT.2020 10-bit systems
   * - 15 = BT.2020 12-bit systems
   * - 16 = SMPTE ST 2084, ITU BT.2100 PQ
   * - 17 = SMPTE ST 428
   * - 18 = BT.2100 HLG, ARIB STD-B67
   * - 19 = For future use
   */
  AV1E_SET_TRANSFER_CHARACTERISTICS = 46,

  /*!\brief Codec control function to set transfer function info, int parameter
   *
   * - 0 = Identity matrix
   * - 1 = BT.709
   * - 2 = Unspecified (default)
   * - 3 = For future use
   * - 4 = US FCC 73.628
   * - 5 = BT.470 System B, G (historical)
   * - 6 = BT.601
   * - 7 = SMPTE 240 M
   * - 8 = YCgCo
   * - 9 = BT.2020 non-constant luminance, BT.2100 YCbCr
   * - 10 = BT.2020 constant luminance
   * - 11 = SMPTE ST 2085 YDzDx
   * - 12 = Chromaticity-derived non-constant luminance
   * - 13 = Chromaticity-derived constant luminance
   * - 14 = BT.2100 ICtCp
   * - 15 = For future use
   */
  AV1E_SET_MATRIX_COEFFICIENTS = 47,

  /*!\brief Codec control function to set chroma 4:2:0 sample position info,
   * aom_chroma_sample_position_t parameter
   *
   * AOM_CSP_UNKNOWN is default
   */
  AV1E_SET_CHROMA_SAMPLE_POSITION = 48,

  /*!\brief Codec control function to set minimum interval between GF/ARF
   * frames, unsigned int parameter
   *
   * By default the value is set as 4.
   */
  AV1E_SET_MIN_GF_INTERVAL = 49,

  /*!\brief Codec control function to set minimum interval between GF/ARF
   * frames, unsigned int parameter
   *
   * By default the value is set as 16.
   */
  AV1E_SET_MAX_GF_INTERVAL = 50,

  /*!\brief Codec control function to get an active map back from the encoder,
    aom_active_map_t* parameter
   */
  AV1E_GET_ACTIVEMAP = 51,

  /*!\brief Codec control function to set color range bit, int parameter
   *
   * - 0 = Limited range, 16..235 or HBD equivalent (default)
   * - 1 = Full range, 0..255 or HBD equivalent
   */
  AV1E_SET_COLOR_RANGE = 52,

  /*!\brief Codec control function to set intended rendering image size,
   * int32_t[2] parameter
   *
   * By default, this is identical to the image size in pixels.
   */
  AV1E_SET_RENDER_SIZE = 53,

  /*!\brief Control to set target sequence level index for a certain operating
   * point (OP), int parameter
   * Possible values are in the form of "ABxy".
   *  - AB: OP index.
   *  - xy: Target level index for the OP. Possible values are:
   *    + 0~27: corresponding to level 2.0 ~ 8.3. Note:
   *      > Levels 2.2 (2), 2.3 (3), 3.2 (6), 3.3 (7), 4.2 (10) & 4.3 (11) are
   *        undefined.
   *      > Levels 7.x and 8.x (20~27) are in draft status, available under the
   *        config flag CONFIG_CWG_C013.
   *    + 31: maximum parameters level, no level-based constraints.
   *    + 32: keep level stats only for level monitoring.
   *
   * E.g.:
   * - "0" means target level index 0 (2.0) for the 0th OP;
   * - "109" means target level index 9 (4.1) for the 1st OP;
   * - "1019" means target level index 19 (6.3) for the 10th OP.
   *
   * If the target level is not specified for an OP, the maximum parameters
   * level of 31 is used as default.
   */
  AV1E_SET_TARGET_SEQ_LEVEL_IDX = 54,

  /*!\brief Codec control function to get sequence level index for each
   * operating point. int* parameter. There can be at most 32 operating points.
   * The results will be written into a provided integer array of sufficient
   * size.
   */
  AV1E_GET_SEQ_LEVEL_IDX = 55,

  /*!\brief Codec control function to set intended superblock size, unsigned int
   * parameter
   *
   * By default, the superblock size is determined separately for each
   * frame by the encoder.
   */
  AV1E_SET_SUPERBLOCK_SIZE = 56,

  /*!\brief Codec control function to enable automatic set and use of
   * bwd-pred frames, unsigned int parameter
   *
   * - 0 = disable (default)
   * - 1 = enable
   */
  AOME_SET_ENABLEAUTOBWDREF = 57,

  /*!\brief Codec control function to encode with CDEF, unsigned int parameter
   *
   * CDEF is the constrained directional enhancement filter which is an
   * in-loop filter aiming to remove coding artifacts
   *
   * - 0 = disable
   * - 1 = enable for all frames (default)
   * - 2 = disable for non-reference frames
   */
  AV1E_SET_ENABLE_CDEF = 58,

  /*!\brief Codec control function to encode with Loop Restoration Filter,
   * unsigned int parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   *
   * \note Excluded from CONFIG_REALTIME_ONLY build.
   */
  AV1E_SET_ENABLE_RESTORATION = 59,

  /*!\brief Codec control function to force video mode, unsigned int parameter
   *
   * - 0 = do not force video mode (default)
   * - 1 = force video mode even for a single frame
   */
  AV1E_SET_FORCE_VIDEO_MODE = 60,

  /*!\brief Codec control function to predict with OBMC mode, unsigned int
   * parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   *
   * \note Excluded from CONFIG_REALTIME_ONLY build.
   */
  AV1E_SET_ENABLE_OBMC = 61,

  /*!\brief Codec control function to encode without trellis quantization,
   * unsigned int parameter
   *
   * - 0 = apply trellis quantization (default)
   * - 1 = do not apply trellis quantization
   * - 2 = disable trellis quantization in rd search
   * - 3 = disable trellis quantization in estimate yrd
   */
  AV1E_SET_DISABLE_TRELLIS_QUANT = 62,

  /*!\brief Codec control function to encode with quantisation matrices,
   * unsigned int parameter
   *
   * AOM can operate with default quantisation matrices dependent on
   * quantisation level and block type.
   *
   * - 0 = disable (default)
   * - 1 = enable
   */
  AV1E_SET_ENABLE_QM = 63,

  /*!\brief Codec control function to set the min quant matrix flatness,
   * unsigned int parameter
   *
   * AOM can operate with different ranges of quantisation matrices.
   * As quantisation levels increase, the matrices get flatter. This
   * control sets the minimum level of flatness from which the matrices
   * are determined.
   *
   * By default, the encoder sets this minimum at half the available
   * range.
   */
  AV1E_SET_QM_MIN = 64,

  /*!\brief Codec control function to set the max quant matrix flatness,
   * unsigned int parameter
   *
   * AOM can operate with different ranges of quantisation matrices.
   * As quantisation levels increase, the matrices get flatter. This
   * control sets the maximum level of flatness possible.
   *
   * By default, the encoder sets this maximum at the top of the
   * available range.
   */
  AV1E_SET_QM_MAX = 65,

  /*!\brief Codec control function to set the min quant matrix flatness,
   * unsigned int parameter
   *
   * AOM can operate with different ranges of quantisation matrices.
   * As quantisation levels increase, the matrices get flatter. This
   * control sets the flatness for luma (Y).
   *
   * By default, the encoder sets this minimum at half the available
   * range.
   */
  AV1E_SET_QM_Y = 66,

  /*!\brief Codec control function to set the min quant matrix flatness,
   * unsigned int parameter
   *
   * AOM can operate with different ranges of quantisation matrices.
   * As quantisation levels increase, the matrices get flatter. This
   * control sets the flatness for chroma (U).
   *
   * By default, the encoder sets this minimum at half the available
   * range.
   */
  AV1E_SET_QM_U = 67,

  /*!\brief Codec control function to set the min quant matrix flatness,
   * unsigned int parameter
   *
   * AOM can operate with different ranges of quantisation matrices.
   * As quantisation levels increase, the matrices get flatter. This
   * control sets the flatness for chrome (V).
   *
   * By default, the encoder sets this minimum at half the available
   * range.
   */
  AV1E_SET_QM_V = 68,

  /* NOTE: enum 69 unused */

  /*!\brief Codec control function to set a maximum number of tile groups,
   * unsigned int parameter
   *
   * This will set the maximum number of tile groups. This will be
   * overridden if an MTU size is set. The default value is 1.
   */
  AV1E_SET_NUM_TG = 70,

  /*!\brief Codec control function to set an MTU size for a tile group, unsigned
   * int parameter
   *
   * This will set the maximum number of bytes in a tile group. This can be
   * exceeded only if a single tile is larger than this amount.
   *
   * By default, the value is 0, in which case a fixed number of tile groups
   * is used.
   */
  AV1E_SET_MTU = 71,

  /* NOTE: enum 72 unused */

  /*!\brief Codec control function to enable/disable rectangular partitions, int
   * parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_RECT_PARTITIONS = 73,

  /*!\brief Codec control function to enable/disable AB partitions, int
   * parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_AB_PARTITIONS = 74,

  /*!\brief Codec control function to enable/disable 1:4 and 4:1 partitions, int
   * parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_1TO4_PARTITIONS = 75,

  /*!\brief Codec control function to set min partition size, int parameter
   *
   * min_partition_size is applied to both width and height of the partition.
   * i.e, both width and height of a partition can not be smaller than
   * the min_partition_size, except the partition at the picture boundary.
   *
   * Valid values: [4, 8, 16, 32, 64, 128]. The default value is 4 for
   * 4x4.
   */
  AV1E_SET_MIN_PARTITION_SIZE = 76,

  /*!\brief Codec control function to set max partition size, int parameter
   *
   * max_partition_size is applied to both width and height of the partition.
   * i.e, both width and height of a partition can not be larger than
   * the max_partition_size.
   *
   * Valid values:[4, 8, 16, 32, 64, 128] The default value is 128 for
   * 128x128.
   */
  AV1E_SET_MAX_PARTITION_SIZE = 77,

  /*!\brief Codec control function to turn on / off intra edge filter
   * at sequence level, int parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_INTRA_EDGE_FILTER = 78,

  /*!\brief Codec control function to turn on / off frame order hint (int
   * parameter). Affects: joint compound mode, motion field motion vector,
   * ref frame sign bias
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_ORDER_HINT = 79,

  /*!\brief Codec control function to turn on / off 64-length transforms, int
   * parameter
   *
   * This will enable or disable usage of length 64 transforms in any
   * direction.
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_TX64 = 80,

  /*!\brief Codec control function to turn on / off flip and identity
   * transforms, int parameter
   *
   * This will enable or disable usage of flip and identity transform
   * types in any direction. If enabled, this includes:
   * - FLIPADST_DCT
   * - DCT_FLIPADST
   * - FLIPADST_FLIPADST
   * - ADST_FLIPADST
   * - FLIPADST_ADST
   * - IDTX
   * - V_DCT
   * - H_DCT
   * - V_ADST
   * - H_ADST
   * - V_FLIPADST
   * - H_FLIPADST
   *
   * Valid values:
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_FLIP_IDTX = 81,

  /*!\brief Codec control function to turn on / off rectangular transforms, int
   * parameter
   *
   * This will enable or disable usage of rectangular transforms. NOTE:
   * Rectangular transforms only enabled when corresponding rectangular
   * partitions are.
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_RECT_TX = 82,

  /*!\brief Codec control function to turn on / off dist-wtd compound mode
   * at sequence level, int parameter
   *
   * This will enable or disable distance-weighted compound mode.
   * \attention If AV1E_SET_ENABLE_ORDER_HINT is 0, then this flag is forced
   * to 0.
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_DIST_WTD_COMP = 83,

  /*!\brief Codec control function to turn on / off ref frame mvs (mfmv) usage
   * at sequence level, int parameter
   *
   * \attention If AV1E_SET_ENABLE_ORDER_HINT is 0, then this flag is forced
   * to 0.
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_REF_FRAME_MVS = 84,

  /*!\brief Codec control function to set temporal mv prediction
   * enabling/disabling at frame level, int parameter
   *
   * \attention If AV1E_SET_ENABLE_REF_FRAME_MVS is 0, then this flag is
   * forced to 0.
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ALLOW_REF_FRAME_MVS = 85,

  /*!\brief Codec control function to turn on / off dual interpolation filter
   * for a sequence, int parameter
   *
   * - 0 = disable
   * - 1 = enable
   */
  AV1E_SET_ENABLE_DUAL_FILTER = 86,

  /*!\brief Codec control function to turn on / off delta quantization in chroma
   * planes for a sequence, int parameter
   *
   * - 0 = disable (default)
   * - 1 = enable
   */
  AV1E_SET_ENABLE_CHROMA_DELTAQ = 87,

  /*!\brief Codec control function to turn on / off masked compound usage
   * (wedge and diff-wtd compound modes) for a sequence, int parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_MASKED_COMP = 88,

  /*!\brief Codec control function to turn on / off one sided compound usage
   * for a sequence, int parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_ONESIDED_COMP = 89,

  /*!\brief Codec control function to turn on / off interintra compound
   * for a sequence, int parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_INTERINTRA_COMP = 90,

  /*!\brief Codec control function to turn on / off smooth inter-intra
   * mode for a sequence, int parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_SMOOTH_INTERINTRA = 91,

  /*!\brief Codec control function to turn on / off difference weighted
   * compound, int parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_DIFF_WTD_COMP = 92,

  /*!\brief Codec control function to turn on / off interinter wedge
   * compound, int parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_INTERINTER_WEDGE = 93,

  /*!\brief Codec control function to turn on / off interintra wedge
   * compound, int parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_INTERINTRA_WEDGE = 94,

  /*!\brief Codec control function to turn on / off global motion usage
   * for a sequence, int parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   *
   * \note Excluded from CONFIG_REALTIME_ONLY build.
   */
  AV1E_SET_ENABLE_GLOBAL_MOTION = 95,

  /*!\brief Codec control function to turn on / off warped motion usage
   * at sequence level, int parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   *
   * \note Excluded from CONFIG_REALTIME_ONLY build.
   */
  AV1E_SET_ENABLE_WARPED_MOTION = 96,

  /*!\brief Codec control function to turn on / off warped motion usage
   * at frame level, int parameter
   *
   * \attention If AV1E_SET_ENABLE_WARPED_MOTION is 0, then this flag is
   * forced to 0.
   *
   * - 0 = disable
   * - 1 = enable (default)
   *
   * \note Excluded from CONFIG_REALTIME_ONLY build.
   */
  AV1E_SET_ALLOW_WARPED_MOTION = 97,

  /*!\brief Codec control function to turn on / off filter intra usage at
   * sequence level, int parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_FILTER_INTRA = 98,

  /*!\brief Codec control function to turn on / off smooth intra modes usage,
   * int parameter
   *
   * This will enable or disable usage of smooth, smooth_h and smooth_v intra
   * modes.
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_SMOOTH_INTRA = 99,

  /*!\brief Codec control function to turn on / off Paeth intra mode usage, int
   * parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_PAETH_INTRA = 100,

  /*!\brief Codec control function to turn on / off CFL uv intra mode usage, int
   * parameter
   *
   * This will enable or disable usage of chroma-from-luma intra mode.
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_CFL_INTRA = 101,

  /*!\brief Codec control function to turn on / off frame superresolution, int
   * parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_SUPERRES = 102,

  /*!\brief Codec control function to turn on / off overlay frames for
   * filtered ALTREF frames, int parameter
   *
   * This will enable or disable coding of overlay frames for filtered ALTREF
   * frames. When set to 0, overlay frames are not used but show existing frame
   * is used to display the filtered ALTREF frame as is. As a result the decoded
   * frame rate remains the same as the display frame rate. The default is 1.
   */
  AV1E_SET_ENABLE_OVERLAY = 103,

  /*!\brief Codec control function to turn on/off palette mode, int parameter */
  AV1E_SET_ENABLE_PALETTE = 104,

  /*!\brief Codec control function to turn on/off intra block copy mode, int
     parameter */
  AV1E_SET_ENABLE_INTRABC = 105,

  /*!\brief Codec control function to turn on/off intra angle delta, int
     parameter */
  AV1E_SET_ENABLE_ANGLE_DELTA = 106,

  /*!\brief Codec control function to set the delta q mode, unsigned int
   * parameter
   *
   * AV1 supports a delta q mode feature, that allows modulating q per
   * superblock.
   *
   * - 0 = deltaq signaling off
   * - 1 = use modulation to maximize objective quality (default)
   * - 2 = use modulation for local test
   * - 3 = use modulation for key frame perceptual quality optimization
   * - 4 = use modulation for user rating based perceptual quality optimization
   */
  AV1E_SET_DELTAQ_MODE = 107,

  /*!\brief Codec control function to turn on/off loopfilter modulation
   * when delta q modulation is enabled, unsigned int parameter.
   *
   * \attention AV1 only supports loopfilter modulation when delta q
   * modulation is enabled as well.
   */
  AV1E_SET_DELTALF_MODE = 108,

  /*!\brief Codec control function to set the single tile decoding mode,
   * unsigned int parameter
   *
   * \attention Only applicable if large scale tiling is on.
   *
   * - 0 = single tile decoding is off
   * - 1 = single tile decoding is on (default)
   */
  AV1E_SET_SINGLE_TILE_DECODING = 109,

  /*!\brief Codec control function to enable the extreme motion vector unit
   * test, unsigned int parameter
   *
   * - 0 = off
   * - 1 = MAX_EXTREME_MV
   * - 2 = MIN_EXTREME_MV
   *
   * \note This is only used in motion vector unit test.
   */
  AV1E_ENABLE_MOTION_VECTOR_UNIT_TEST = 110,

  /*!\brief Codec control function to signal picture timing info in the
   * bitstream, aom_timing_info_type_t parameter. Default is
   * AOM_TIMING_UNSPECIFIED.
   */
  AV1E_SET_TIMING_INFO_TYPE = 111,

  /*!\brief Codec control function to add film grain parameters (one of several
   * preset types) info in the bitstream, int parameter
   *
   Valid range: 0..16, 0 is unknown, 1..16 are test vectors
   */
  AV1E_SET_FILM_GRAIN_TEST_VECTOR = 112,

  /*!\brief Codec control function to set the path to the film grain parameters,
   * const char* parameter
   */
  AV1E_SET_FILM_GRAIN_TABLE = 113,

  /*!\brief Sets the noise level, int parameter */
  AV1E_SET_DENOISE_NOISE_LEVEL = 114,

  /*!\brief Sets the denoisers block size, unsigned int parameter */
  AV1E_SET_DENOISE_BLOCK_SIZE = 115,

  /*!\brief Sets the chroma subsampling x value, unsigned int parameter */
  AV1E_SET_CHROMA_SUBSAMPLING_X = 116,

  /*!\brief Sets the chroma subsampling y value, unsigned int parameter */
  AV1E_SET_CHROMA_SUBSAMPLING_Y = 117,

  /*!\brief Control to use a reduced tx type set, int parameter */
  AV1E_SET_REDUCED_TX_TYPE_SET = 118,

  /*!\brief Control to use dct only for intra modes, int parameter */
  AV1E_SET_INTRA_DCT_ONLY = 119,

  /*!\brief Control to use dct only for inter modes, int parameter */
  AV1E_SET_INTER_DCT_ONLY = 120,

  /*!\brief Control to use default tx type only for intra modes, int parameter
   */
  AV1E_SET_INTRA_DEFAULT_TX_ONLY = 121,

  /*!\brief Control to use adaptive quantize_b, int parameter */
  AV1E_SET_QUANT_B_ADAPT = 122,

  /*!\brief Control to select maximum height for the GF group pyramid structure,
   * unsigned int parameter
   *
   * Valid range: 0..5
   */
  AV1E_SET_GF_MAX_PYRAMID_HEIGHT = 123,

  /*!\brief Control to select maximum reference frames allowed per frame, int
   * parameter
   *
   * Valid range: 3..7
   */
  AV1E_SET_MAX_REFERENCE_FRAMES = 124,

  /*!\brief Control to use reduced set of single and compound references, int
     parameter */
  AV1E_SET_REDUCED_REFERENCE_SET = 125,

  /*!\brief Control to set frequency of the cost updates for coefficients,
   * 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_COEFF_COST_UPD_FREQ = 126,

  /*!\brief Control to set frequency of the cost updates for mode, 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_MODE_COST_UPD_FREQ = 127,

  /*!\brief Control to set frequency of the cost updates for 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_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
   *
   * - 0 = main tier (default)
   * - 1 = high tier
   */
  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 = 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 = 131,

  /*!\brief Codec control function to set SVC parameters, aom_svc_params_t*
   * parameter
   */
  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 = 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 = 134,

  /*!\brief Codec control function to enable EXT_TILE_DEBUG in AV1 encoder,
   * unsigned int parameter
   *
   * - 0 = disable (default)
   * - 1 = enable
   *
   * \note This is only used in lightfield example test.
   */
  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
   * passes. unsigned int parameter.
   *
   * - 0 = disable (default)
   * - 1 = enable
   *
   * \note This is only used in sb_multipass unit test.
   */
  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 = 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 = 138,

  /*!\brief Control to get baseline gf interval
   */
  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 = 140,

  /*!\brief Codec control function to turn on / off D45 to D203 intra mode
   * usage, int parameter
   *
   * This will enable or disable usage of D45 to D203 intra modes, which are a
   * subset of directional modes. This control has no effect if directional
   * modes are disabled (AV1E_SET_ENABLE_DIRECTIONAL_INTRA set to 0).
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  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,

  /*!\brief Codec control function to turn on / off directional intra mode
   * usage, int parameter
   *
   * - 0 = disable
   * - 1 = enable (default)
   */
  AV1E_SET_ENABLE_DIRECTIONAL_INTRA = 145,

  /*!\brief Control to turn on / off transform size search.
   * Note: it can not work with non RD pick mode in real-time encoding,
   * where the max transform size is only 16x16.
   * It will be ignored if non RD pick mode is set.
   *
   * - 0 = disable, transforms always have the largest possible size
   * - 1 = enable, search for the best transform size for each block (default)
   */
  AV1E_SET_ENABLE_TX_SIZE_SEARCH = 146,

  /*!\brief Codec control function to set reference frame compound prediction.
   * aom_svc_ref_frame_comp_pred_t* parameter
   */
  AV1E_SET_SVC_REF_FRAME_COMP_PRED = 147,

  /*!\brief Set --deltaq-mode strength.
   *
   * Valid range: [0, 1000]
   */
  AV1E_SET_DELTAQ_STRENGTH = 148,

  /*!\brief Codec control to control loop filter
   *
   * - 0 = Loop filter is disabled for all frames
   * - 1 = Loop filter is enabled for all frames
   * - 2 = Loop filter is disabled for non-reference frames
   * - 3 = Loop filter is disabled for the frames with low motion
   */
  AV1E_SET_LOOPFILTER_CONTROL = 149,

  /*!\brief Codec control function to get the loopfilter chosen by the encoder,
   * int* parameter
   */
  AOME_GET_LOOPFILTER_LEVEL = 150,

  /*!\brief Codec control to automatically turn off several intra coding tools,
   * unsigned int parameter
   * - 0 = do not use the feature
   * - 1 = enable the automatic decision to turn off several intra tools
   */
  AV1E_SET_AUTO_INTRA_TOOLS_OFF = 151,

  /*!\brief Codec control function to set flag for rate control used by external
   * encoders.
   * - 1 = Enable rate control for external encoders. This will disable content
   * dependency in rate control and cyclic refresh.
   * - 0 = Default. Disable rate control for external encoders.
   */
  AV1E_SET_RTC_EXTERNAL_RC = 152,

  /*!\brief Codec control function to enable frame parallel multi-threading
   * of the encoder, unsigned int parameter
   *
   * - 0 = disable (default)
   * - 1 = enable
   */
  AV1E_SET_FP_MT = 153,

  /*!\brief Codec control to enable actual frame parallel encode or
   * simulation of frame parallel encode in FPMT unit test, unsigned int
   * parameter
   *
   * - 0 = simulate frame parallel encode
   * - 1 = actual frame parallel encode (default)
   *
   * \note This is only used in FPMT unit test.
   */
  AV1E_SET_FP_MT_UNIT_TEST = 154,

  /*!\brief Codec control function to get the target sequence level index for
   * each operating point. int* parameter. There can be at most 32 operating
   * points. The results will be written into a provided integer array of
   * sufficient size. If a target level is not set, the result will be 31.
   * Please refer to https://aomediacodec.github.io/av1-spec/#levels for more
   * details on level definitions and indices.
   */
  AV1E_GET_TARGET_SEQ_LEVEL_IDX = 155,

  /*!\brief Codec control function to get the number of operating points. int*
   * parameter.
   */
  AV1E_GET_NUM_OPERATING_POINTS = 156,

  /*!\brief Codec control function to skip the application of post-processing
   * filters on reconstructed frame, unsigned int parameter
   *
   * - 0 = disable (default)
   * - 1 = enable
   *
   * \attention For this value to be used aom_codec_enc_cfg_t::g_usage
   *            must be set to AOM_USAGE_ALL_INTRA.
   */
  AV1E_SET_SKIP_POSTPROC_FILTERING = 157,

  /*!\brief Codec control function to enable the superblock level
   * qp sweep in AV1 to ensure that end-to-end test runs well,
   * unsigned int parameter.
   *
   * - 0 = disable (default)
   * - 1 = enable
   *
   * \note This is only used in sb_qp_sweep unit test.
   */
  AV1E_ENABLE_SB_QP_SWEEP = 158,

  /*!\brief Codec control to set quantizer for the next frame, int parameter.
   *
   * - Valid range [0, 63]
   *
   * This will turn off cyclic refresh. Only applicable to 1-pass.
   */
  AV1E_SET_QUANTIZER_ONE_PASS = 159,

  /*!\brief Codec control to enable the rate distribution guided delta
   * quantization in all intra mode, unsigned int parameter
   *
   * - 0 = disable (default)
   * - 1 = enable
   *
   * \attention This feature requires --deltaq-mode=3, also an input file
   *            which contains rate distribution for each 16x16 block,
   *            passed in by --rate-distribution-info=rate_distribution.txt.
   */
  AV1E_ENABLE_RATE_GUIDE_DELTAQ = 160,

  /*!\brief Codec control to set the input file for rate distribution used
   * in all intra mode, const char * parameter
   * The input should be the name of a text file, which
   * contains (rows x cols) float values separated by space.
   * Each float value represent the number of bits for each 16x16 block.
   * rows = (frame_height + 15) / 16
   * cols = (frame_width + 15) / 16
   *
   * \attention This feature requires --enable-rate-guide-deltaq=1.
   */
  AV1E_SET_RATE_DISTRIBUTION_INFO = 161,

  /*!\brief Codec control to get the CDEF strength for Y / luma plane,
   * int * parameter.
   * Returns an integer array of CDEF_MAX_STRENGTHS elements.
   */
  AV1E_GET_LUMA_CDEF_STRENGTH = 162,

  /*!\brief Codec control to set the target bitrate in kilobits per second,
   * unsigned int parameter. For 1 pass CBR mode, single layer encoding.
   * This controls replaces the call aom_codec_enc_config_set(&codec, &cfg)
   * when only target bitrate is changed, and so is much cheaper as it
   * bypasses a lot of unneeded code checks.
   */
  AV1E_SET_BITRATE_ONE_PASS_CBR = 163,

  /*!\brief Codec control to set the maximum number of consecutive frame drops
   * allowed for the frame dropper in 1 pass CBR mode, int parameter. Value of
   * zero has no effect.
   */
  AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR = 164,

  /*!\brief Codec control to set the frame drop mode for SVC,
   * unsigned int parameter. The valid values are constants of the
   * AOM_SVC_FRAME_DROP_MODE enum: AOM_LAYER_DROP or AOM_FULL_SUPERFRAME_DROP.
   */
  AV1E_SET_SVC_FRAME_DROP_MODE = 165,

  /*!\brief Codec control to set auto tiling, unsigned int parameter.
   * Value of 1 means encoder will set number of tile_columns and tile_rows,
   * based on the number of threads and resolution. This will override any
   * settings set via SET_TILE_COLUMNS/ROWS. If the value is 0 no change is
   * done, the previous setting (if any) for tile_columns/rows is preserved.
   */
  AV1E_SET_AUTO_TILES = 166,

  // 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
 *
 * This set of constants define 1-D aom scaling modes
 */
typedef enum aom_scaling_mode_1d {
    
    
  AOME_NORMAL = 0,
  AOME_FOURFIVE = 1,
  AOME_THREEFIVE = 2,
  AOME_THREEFOUR = 3,
  AOME_ONEFOUR = 4,
  AOME_ONEEIGHT = 5,
  AOME_ONETWO = 6,
  AOME_TWOTHREE = 7,
  AOME_ONETHREE = 8
} 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 7 for each 8x8 region within a frame. */
  unsigned char *roi_map;
  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[AOM_MAX_SEGMENTS];
} aom_roi_map_t;

/*!\brief  aom active region map
 *
 * These defines the data structures for active region map
 *
 */

typedef struct aom_active_map {
    
    
  /*!\brief specify an on (1) or off (0) each 16x16 region within a frame */
  unsigned char *active_map;
  unsigned int rows; /**< number of rows */
  unsigned int cols; /**< number of cols */
} aom_active_map_t;

/*!\brief  aom image scaling mode
 *
 * This defines the data structure for image scaling mode
 *
 */
typedef struct aom_scaling_mode {
    
    
  AOM_SCALING_MODE h_scaling_mode; /**< horizontal scaling mode */
  AOM_SCALING_MODE v_scaling_mode; /**< vertical scaling mode   */
} aom_scaling_mode_t;

/*!brief AV1 encoder content type */
typedef enum {
    
    
  AOM_CONTENT_DEFAULT,
  AOM_CONTENT_SCREEN,
  AOM_CONTENT_FILM,
  AOM_CONTENT_INVALID
} aom_tune_content;

/*!brief AV1 encoder timing info type signaling */
typedef enum {
    
    
  AOM_TIMING_UNSPECIFIED,
  AOM_TIMING_EQUAL,
  AOM_TIMING_DEC_MODEL
} aom_timing_info_type_t;

/*!\brief Model tuning parameters
 *
 * Changes the encoder to tune for certain types of input material.
 *
 */
typedef enum {
    
    
  AOM_TUNE_PSNR = 0,
  AOM_TUNE_SSIM = 1,
  /* NOTE: enums 2 and 3 unused */
  AOM_TUNE_VMAF_WITH_PREPROCESSING = 4,
  AOM_TUNE_VMAF_WITHOUT_PREPROCESSING = 5,
  AOM_TUNE_VMAF_MAX_GAIN = 6,
  AOM_TUNE_VMAF_NEG_MAX_GAIN = 7,
  AOM_TUNE_BUTTERAUGLI = 8,
  AOM_TUNE_VMAF_SALIENCY_MAP = 9,
} aom_tune_metric;

/*!\brief Distortion metric to use for RD optimization.
 *
 * Changes the encoder to use a different distortion metric for RD search. Note
 * that this value operates on a "lower level" compared to aom_tune_metric - it
 * affects the distortion metric inside a block, while aom_tune_metric only
 * affects RD across blocks.
 *
 */
typedef enum {
    
    
  // Use PSNR for in-block rate-distortion optimization.
  AOM_DIST_METRIC_PSNR,
  // Use quantization matrix-weighted PSNR for in-block rate-distortion
  // optimization. If --enable-qm=1 is not specified, this falls back to
  // behaving in the same way as AOM_DIST_METRIC_PSNR.
  AOM_DIST_METRIC_QM_PSNR,
} aom_dist_metric;

#define AOM_MAX_LAYERS 32   /**< Max number of layers */
#define AOM_MAX_SS_LAYERS 4 /**< Max number of spatial layers */
#define AOM_MAX_TS_LAYERS 8 /**< Max number of temporal layers */

/*!brief Struct for spatial and temporal layer ID */
typedef struct aom_svc_layer_id {
    
    
  int spatial_layer_id;  /**< Spatial layer ID */
  int temporal_layer_id; /**< Temporal layer ID */
} aom_svc_layer_id_t;

/*!brief Parameter type for SVC
 *
 * In the arrays of size AOM_MAX_LAYERS, the index for spatial layer `sl` and
 * temporal layer `tl` is sl * number_temporal_layers + tl.
 *
 */
typedef struct aom_svc_params {
    
    
  int number_spatial_layers;                 /**< Number of spatial layers */
  int number_temporal_layers;                /**< Number of temporal layers */
  int max_quantizers[AOM_MAX_LAYERS];        /**< Max Q for each layer */
  int min_quantizers[AOM_MAX_LAYERS];        /**< Min Q for each layer */
  int scaling_factor_num[AOM_MAX_SS_LAYERS]; /**< Scaling factor-numerator */
  int scaling_factor_den[AOM_MAX_SS_LAYERS]; /**< Scaling factor-denominator */
  /*! Target bitrate for each layer, in kilobits per second */
  int layer_target_bitrate[AOM_MAX_LAYERS];
  /*! Frame rate factor for each temporal layer */
  int framerate_factor[AOM_MAX_TS_LAYERS];
} aom_svc_params_t;

/*!brief Parameters for setting ref frame config */
typedef struct aom_svc_ref_frame_config {
    
    
  // 7 references: The index 0 - 6 refers to the references:
  // last(0), last2(1), last3(2), golden(3), bwdref(4), altref2(5), altref(6).
  int reference[7]; /**< Reference flag for each of the 7 references. */
  /*! Buffer slot index for each of 7 references indexed above. */
  int ref_idx[7];
  int refresh[8]; /**< Refresh flag for each of the 8 slots. */
} aom_svc_ref_frame_config_t;

/*!brief Parameters for setting ref frame compound prediction */
typedef struct aom_svc_ref_frame_comp_pred {
    
    
  // Use compound prediction for the ref_frame pairs GOLDEN_LAST (0),
  // LAST2_LAST (1), and ALTREF_LAST (2).
  int use_comp_pred[3]; /**<Compound reference flag. */
} aom_svc_ref_frame_comp_pred_t;

/*!brief Frame drop modes for spatial/quality layer SVC */
typedef enum {
    
    
  AOM_LAYER_DROP,           /**< Any spatial layer can drop. */
  AOM_FULL_SUPERFRAME_DROP, /**< Only full superframe can drop. */
} AOM_SVC_FRAME_DROP_MODE;

/*!\cond */
/*!\brief Encoder control function parameter type
 *
 * Defines the data types that AOME/AV1E control functions take.
 *
 * \note Additional common controls are defined in aom.h.
 *
 * \note For each control ID "X", a macro-define of
 * AOM_CTRL_X is provided. It is used at compile time to determine
 * if the control ID is supported by the libaom library available,
 * when the libaom version cannot be controlled.
 */
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

AOM_CTRL_USE_TYPE(AOME_SET_ACTIVEMAP, aom_active_map_t *)
#define AOM_CTRL_AOME_SET_ACTIVEMAP

AOM_CTRL_USE_TYPE(AOME_SET_SCALEMODE, aom_scaling_mode_t *)
#define AOM_CTRL_AOME_SET_SCALEMODE

AOM_CTRL_USE_TYPE(AOME_SET_SPATIAL_LAYER_ID, int)
#define AOM_CTRL_AOME_SET_SPATIAL_LAYER_ID

AOM_CTRL_USE_TYPE(AOME_SET_CPUUSED, int)
#define AOM_CTRL_AOME_SET_CPUUSED

AOM_CTRL_USE_TYPE(AOME_SET_ENABLEAUTOALTREF, unsigned int)
#define AOM_CTRL_AOME_SET_ENABLEAUTOALTREF

AOM_CTRL_USE_TYPE(AOME_SET_SHARPNESS, unsigned int)
#define AOM_CTRL_AOME_SET_SHARPNESS

AOM_CTRL_USE_TYPE(AOME_SET_STATIC_THRESHOLD, unsigned int)
#define AOM_CTRL_AOME_SET_STATIC_THRESHOLD

AOM_CTRL_USE_TYPE(AOME_GET_LAST_QUANTIZER, int *)
#define AOM_CTRL_AOME_GET_LAST_QUANTIZER

AOM_CTRL_USE_TYPE(AOME_GET_LAST_QUANTIZER_64, int *)
#define AOM_CTRL_AOME_GET_LAST_QUANTIZER_64

AOM_CTRL_USE_TYPE(AOME_SET_ARNR_MAXFRAMES, unsigned int)
#define AOM_CTRL_AOME_SET_ARNR_MAXFRAMES

AOM_CTRL_USE_TYPE(AOME_SET_ARNR_STRENGTH, unsigned int)
#define AOM_CTRL_AOME_SET_ARNR_STRENGTH

AOM_CTRL_USE_TYPE(AOME_SET_TUNING, int) /* aom_tune_metric */
#define AOM_CTRL_AOME_SET_TUNING

AOM_CTRL_USE_TYPE(AOME_SET_CQ_LEVEL, unsigned int)
#define AOM_CTRL_AOME_SET_CQ_LEVEL

AOM_CTRL_USE_TYPE(AOME_SET_MAX_INTRA_BITRATE_PCT, unsigned int)
#define AOM_CTRL_AOME_SET_MAX_INTRA_BITRATE_PCT

AOM_CTRL_USE_TYPE(AOME_SET_NUMBER_SPATIAL_LAYERS, int)
#define AOM_CTRL_AOME_SET_NUMBER_SPATIAL_LAYERS
// TODO(aomedia:3231): Deprecated. Remove it.
#define AOME_CTRL_AOME_SET_NUMBER_SPATIAL_LAYERS

AOM_CTRL_USE_TYPE(AOME_SET_MAX_INTER_BITRATE_PCT, unsigned int)
#define AOM_CTRL_AV1E_SET_MAX_INTER_BITRATE_PCT
// TODO(aomedia:3231): Deprecated. Remove it.
#define AOM_CTRL_AOME_SET_MAX_INTER_BITRATE_PCT

AOM_CTRL_USE_TYPE(AV1E_SET_GF_CBR_BOOST_PCT, unsigned int)
#define AOM_CTRL_AV1E_SET_GF_CBR_BOOST_PCT

AOM_CTRL_USE_TYPE(AV1E_SET_LOSSLESS, unsigned int)
#define AOM_CTRL_AV1E_SET_LOSSLESS

AOM_CTRL_USE_TYPE(AV1E_SET_ROW_MT, unsigned int)
#define AOM_CTRL_AV1E_SET_ROW_MT

AOM_CTRL_USE_TYPE(AV1E_SET_TILE_COLUMNS, unsigned int)
#define AOM_CTRL_AV1E_SET_TILE_COLUMNS

AOM_CTRL_USE_TYPE(AV1E_SET_TILE_ROWS, unsigned int)
#define AOM_CTRL_AV1E_SET_TILE_ROWS

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_TPL_MODEL, unsigned int)
#define AOM_CTRL_AV1E_SET_ENABLE_TPL_MODEL

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_KEYFRAME_FILTERING, unsigned int)
#define AOM_CTRL_AV1E_SET_ENABLE_KEYFRAME_FILTERING

AOM_CTRL_USE_TYPE(AV1E_SET_FRAME_PARALLEL_DECODING, unsigned int)
#define AOM_CTRL_AV1E_SET_FRAME_PARALLEL_DECODING

AOM_CTRL_USE_TYPE(AV1E_SET_ERROR_RESILIENT_MODE, int)
#define AOM_CTRL_AV1E_SET_ERROR_RESILIENT_MODE

AOM_CTRL_USE_TYPE(AV1E_SET_S_FRAME_MODE, int)
#define AOM_CTRL_AV1E_SET_S_FRAME_MODE

AOM_CTRL_USE_TYPE(AV1E_SET_AQ_MODE, unsigned int)
#define AOM_CTRL_AV1E_SET_AQ_MODE

AOM_CTRL_USE_TYPE(AV1E_SET_FRAME_PERIODIC_BOOST, unsigned int)
#define AOM_CTRL_AV1E_SET_FRAME_PERIODIC_BOOST

AOM_CTRL_USE_TYPE(AV1E_SET_NOISE_SENSITIVITY, unsigned int)
#define AOM_CTRL_AV1E_SET_NOISE_SENSITIVITY

AOM_CTRL_USE_TYPE(AV1E_SET_TUNE_CONTENT, int) /* aom_tune_content */
#define AOM_CTRL_AV1E_SET_TUNE_CONTENT

AOM_CTRL_USE_TYPE(AV1E_SET_CDF_UPDATE_MODE, unsigned int)
#define AOM_CTRL_AV1E_SET_CDF_UPDATE_MODE

AOM_CTRL_USE_TYPE(AV1E_SET_COLOR_PRIMARIES, int)
#define AOM_CTRL_AV1E_SET_COLOR_PRIMARIES

AOM_CTRL_USE_TYPE(AV1E_SET_TRANSFER_CHARACTERISTICS, int)
#define AOM_CTRL_AV1E_SET_TRANSFER_CHARACTERISTICS

AOM_CTRL_USE_TYPE(AV1E_SET_MATRIX_COEFFICIENTS, int)
#define AOM_CTRL_AV1E_SET_MATRIX_COEFFICIENTS

AOM_CTRL_USE_TYPE(AV1E_SET_CHROMA_SAMPLE_POSITION, int)
#define AOM_CTRL_AV1E_SET_CHROMA_SAMPLE_POSITION

AOM_CTRL_USE_TYPE(AV1E_SET_MIN_GF_INTERVAL, unsigned int)
#define AOM_CTRL_AV1E_SET_MIN_GF_INTERVAL

AOM_CTRL_USE_TYPE(AV1E_SET_MAX_GF_INTERVAL, unsigned int)
#define AOM_CTRL_AV1E_SET_MAX_GF_INTERVAL

AOM_CTRL_USE_TYPE(AV1E_GET_ACTIVEMAP, aom_active_map_t *)
#define AOM_CTRL_AV1E_GET_ACTIVEMAP

AOM_CTRL_USE_TYPE(AV1E_SET_COLOR_RANGE, int)
#define AOM_CTRL_AV1E_SET_COLOR_RANGE

AOM_CTRL_USE_TYPE(AV1E_SET_RENDER_SIZE, int *)
#define AOM_CTRL_AV1E_SET_RENDER_SIZE

AOM_CTRL_USE_TYPE(AV1E_SET_TARGET_SEQ_LEVEL_IDX, int)
#define AOM_CTRL_AV1E_SET_TARGET_SEQ_LEVEL_IDX

AOM_CTRL_USE_TYPE(AV1E_GET_SEQ_LEVEL_IDX, int *)
#define AOM_CTRL_AV1E_GET_SEQ_LEVEL_IDX

AOM_CTRL_USE_TYPE(AV1E_SET_SUPERBLOCK_SIZE, unsigned int)
#define AOM_CTRL_AV1E_SET_SUPERBLOCK_SIZE

AOM_CTRL_USE_TYPE(AOME_SET_ENABLEAUTOBWDREF, unsigned int)
#define AOM_CTRL_AOME_SET_ENABLEAUTOBWDREF

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_CDEF, unsigned int)
#define AOM_CTRL_AV1E_SET_ENABLE_CDEF

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_RESTORATION, unsigned int)
#define AOM_CTRL_AV1E_SET_ENABLE_RESTORATION

AOM_CTRL_USE_TYPE(AV1E_SET_FORCE_VIDEO_MODE, unsigned int)
#define AOM_CTRL_AV1E_SET_FORCE_VIDEO_MODE

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_OBMC, unsigned int)
#define AOM_CTRL_AV1E_SET_ENABLE_OBMC

AOM_CTRL_USE_TYPE(AV1E_SET_DISABLE_TRELLIS_QUANT, unsigned int)
#define AOM_CTRL_AV1E_SET_DISABLE_TRELLIS_QUANT

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_QM, unsigned int)
#define AOM_CTRL_AV1E_SET_ENABLE_QM

// TODO(aomedia:3231): Remove these two lines.
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

AOM_CTRL_USE_TYPE(AV1E_SET_QM_MAX, unsigned int)
#define AOM_CTRL_AV1E_SET_QM_MAX

AOM_CTRL_USE_TYPE(AV1E_SET_QM_Y, unsigned int)
#define AOM_CTRL_AV1E_SET_QM_Y

AOM_CTRL_USE_TYPE(AV1E_SET_QM_U, unsigned int)
#define AOM_CTRL_AV1E_SET_QM_U

AOM_CTRL_USE_TYPE(AV1E_SET_QM_V, unsigned int)
#define AOM_CTRL_AV1E_SET_QM_V

AOM_CTRL_USE_TYPE(AV1E_SET_NUM_TG, unsigned int)
#define AOM_CTRL_AV1E_SET_NUM_TG

AOM_CTRL_USE_TYPE(AV1E_SET_MTU, unsigned int)
#define AOM_CTRL_AV1E_SET_MTU

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_RECT_PARTITIONS, int)
#define AOM_CTRL_AV1E_SET_ENABLE_RECT_PARTITIONS

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_AB_PARTITIONS, int)
#define AOM_CTRL_AV1E_SET_ENABLE_AB_PARTITIONS

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_1TO4_PARTITIONS, int)
#define AOM_CTRL_AV1E_SET_ENABLE_1TO4_PARTITIONS

AOM_CTRL_USE_TYPE(AV1E_SET_MIN_PARTITION_SIZE, int)
#define AOM_CTRL_AV1E_SET_MIN_PARTITION_SIZE

AOM_CTRL_USE_TYPE(AV1E_SET_MAX_PARTITION_SIZE, int)
#define AOM_CTRL_AV1E_SET_MAX_PARTITION_SIZE

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_INTRA_EDGE_FILTER, int)
#define AOM_CTRL_AV1E_SET_ENABLE_INTRA_EDGE_FILTER

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_ORDER_HINT, int)
#define AOM_CTRL_AV1E_SET_ENABLE_ORDER_HINT

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_TX64, int)
#define AOM_CTRL_AV1E_SET_ENABLE_TX64

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_FLIP_IDTX, int)
#define AOM_CTRL_AV1E_SET_ENABLE_FLIP_IDTX

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_RECT_TX, int)
#define AOM_CTRL_AV1E_SET_ENABLE_RECT_TX

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_DIST_WTD_COMP, int)
#define AOM_CTRL_AV1E_SET_ENABLE_DIST_WTD_COMP

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_REF_FRAME_MVS, int)
#define AOM_CTRL_AV1E_SET_ENABLE_REF_FRAME_MVS

AOM_CTRL_USE_TYPE(AV1E_SET_ALLOW_REF_FRAME_MVS, int)
#define AOM_CTRL_AV1E_SET_ALLOW_REF_FRAME_MVS

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_DUAL_FILTER, int)
#define AOM_CTRL_AV1E_SET_ENABLE_DUAL_FILTER

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_CHROMA_DELTAQ, int)
#define AOM_CTRL_AV1E_SET_ENABLE_CHROMA_DELTAQ

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_MASKED_COMP, int)
#define AOM_CTRL_AV1E_SET_ENABLE_MASKED_COMP

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_ONESIDED_COMP, int)
#define AOM_CTRL_AV1E_SET_ENABLE_ONESIDED_COMP

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_INTERINTRA_COMP, int)
#define AOM_CTRL_AV1E_SET_ENABLE_INTERINTRA_COMP

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_SMOOTH_INTERINTRA, int)
#define AOM_CTRL_AV1E_SET_ENABLE_SMOOTH_INTERINTRA

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_DIFF_WTD_COMP, int)
#define AOM_CTRL_AV1E_SET_ENABLE_DIFF_WTD_COMP

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_INTERINTER_WEDGE, int)
#define AOM_CTRL_AV1E_SET_ENABLE_INTERINTER_WEDGE

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_INTERINTRA_WEDGE, int)
#define AOM_CTRL_AV1E_SET_ENABLE_INTERINTRA_WEDGE

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_GLOBAL_MOTION, int)
#define AOM_CTRL_AV1E_SET_ENABLE_GLOBAL_MOTION

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_WARPED_MOTION, int)
#define AOM_CTRL_AV1E_SET_ENABLE_WARPED_MOTION

AOM_CTRL_USE_TYPE(AV1E_SET_ALLOW_WARPED_MOTION, int)
#define AOM_CTRL_AV1E_SET_ALLOW_WARPED_MOTION

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_FILTER_INTRA, int)
#define AOM_CTRL_AV1E_SET_ENABLE_FILTER_INTRA

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_SMOOTH_INTRA, int)
#define AOM_CTRL_AV1E_SET_ENABLE_SMOOTH_INTRA

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_PAETH_INTRA, int)
#define AOM_CTRL_AV1E_SET_ENABLE_PAETH_INTRA

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_CFL_INTRA, int)
#define AOM_CTRL_AV1E_SET_ENABLE_CFL_INTRA

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_SUPERRES, int)
#define AOM_CTRL_AV1E_SET_ENABLE_SUPERRES

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_OVERLAY, int)
#define AOM_CTRL_AV1E_SET_ENABLE_OVERLAY

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_PALETTE, int)
#define AOM_CTRL_AV1E_SET_ENABLE_PALETTE

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_INTRABC, int)
#define AOM_CTRL_AV1E_SET_ENABLE_INTRABC

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_ANGLE_DELTA, int)
#define AOM_CTRL_AV1E_SET_ENABLE_ANGLE_DELTA

AOM_CTRL_USE_TYPE(AV1E_SET_DELTAQ_MODE, unsigned int)
#define AOM_CTRL_AV1E_SET_DELTAQ_MODE

AOM_CTRL_USE_TYPE(AV1E_SET_DELTALF_MODE, unsigned int)
#define AOM_CTRL_AV1E_SET_DELTALF_MODE

AOM_CTRL_USE_TYPE(AV1E_SET_SINGLE_TILE_DECODING, unsigned int)
#define AOM_CTRL_AV1E_SET_SINGLE_TILE_DECODING

AOM_CTRL_USE_TYPE(AV1E_ENABLE_MOTION_VECTOR_UNIT_TEST, unsigned int)
#define AOM_CTRL_AV1E_ENABLE_MOTION_VECTOR_UNIT_TEST

AOM_CTRL_USE_TYPE(AV1E_SET_TIMING_INFO_TYPE, int) /* aom_timing_info_type_t */
#define AOM_CTRL_AV1E_SET_TIMING_INFO_TYPE

AOM_CTRL_USE_TYPE(AV1E_SET_FILM_GRAIN_TEST_VECTOR, int)
#define AOM_CTRL_AV1E_SET_FILM_GRAIN_TEST_VECTOR

AOM_CTRL_USE_TYPE(AV1E_SET_FILM_GRAIN_TABLE, const char *)
#define AOM_CTRL_AV1E_SET_FILM_GRAIN_TABLE

AOM_CTRL_USE_TYPE(AV1E_SET_DENOISE_NOISE_LEVEL, int)
#define AOM_CTRL_AV1E_SET_DENOISE_NOISE_LEVEL

AOM_CTRL_USE_TYPE(AV1E_SET_DENOISE_BLOCK_SIZE, unsigned int)
#define AOM_CTRL_AV1E_SET_DENOISE_BLOCK_SIZE

AOM_CTRL_USE_TYPE(AV1E_SET_CHROMA_SUBSAMPLING_X, unsigned int)
#define AOM_CTRL_AV1E_SET_CHROMA_SUBSAMPLING_X

AOM_CTRL_USE_TYPE(AV1E_SET_CHROMA_SUBSAMPLING_Y, unsigned int)
#define AOM_CTRL_AV1E_SET_CHROMA_SUBSAMPLING_Y

AOM_CTRL_USE_TYPE(AV1E_SET_REDUCED_TX_TYPE_SET, int)
#define AOM_CTRL_AV1E_SET_REDUCED_TX_TYPE_SET

AOM_CTRL_USE_TYPE(AV1E_SET_INTRA_DCT_ONLY, int)
#define AOM_CTRL_AV1E_SET_INTRA_DCT_ONLY

AOM_CTRL_USE_TYPE(AV1E_SET_INTER_DCT_ONLY, int)
#define AOM_CTRL_AV1E_SET_INTER_DCT_ONLY

AOM_CTRL_USE_TYPE(AV1E_SET_INTRA_DEFAULT_TX_ONLY, int)
#define AOM_CTRL_AV1E_SET_INTRA_DEFAULT_TX_ONLY

AOM_CTRL_USE_TYPE(AV1E_SET_QUANT_B_ADAPT, int)
#define AOM_CTRL_AV1E_SET_QUANT_B_ADAPT

AOM_CTRL_USE_TYPE(AV1E_SET_GF_MAX_PYRAMID_HEIGHT, unsigned int)
#define AOM_CTRL_AV1E_SET_GF_MAX_PYRAMID_HEIGHT

AOM_CTRL_USE_TYPE(AV1E_SET_MAX_REFERENCE_FRAMES, int)
#define AOM_CTRL_AV1E_SET_MAX_REFERENCE_FRAMES

AOM_CTRL_USE_TYPE(AV1E_SET_REDUCED_REFERENCE_SET, int)
#define AOM_CTRL_AV1E_SET_REDUCED_REFERENCE_SET

AOM_CTRL_USE_TYPE(AV1E_SET_COEFF_COST_UPD_FREQ, unsigned int)
#define AOM_CTRL_AV1E_SET_COEFF_COST_UPD_FREQ

AOM_CTRL_USE_TYPE(AV1E_SET_MODE_COST_UPD_FREQ, unsigned int)
#define AOM_CTRL_AV1E_SET_MODE_COST_UPD_FREQ

AOM_CTRL_USE_TYPE(AV1E_SET_MV_COST_UPD_FREQ, unsigned int)
#define AOM_CTRL_AV1E_SET_MV_COST_UPD_FREQ

AOM_CTRL_USE_TYPE(AV1E_SET_TIER_MASK, unsigned int)
#define AOM_CTRL_AV1E_SET_TIER_MASK

AOM_CTRL_USE_TYPE(AV1E_SET_MIN_CR, unsigned int)
#define AOM_CTRL_AV1E_SET_MIN_CR

AOM_CTRL_USE_TYPE(AV1E_SET_SVC_LAYER_ID, aom_svc_layer_id_t *)
#define AOM_CTRL_AV1E_SET_SVC_LAYER_ID
// TODO(aomedia:3231): Deprecated. Remove it.
#define AOME_CTRL_AV1E_SET_SVC_LAYER_ID

AOM_CTRL_USE_TYPE(AV1E_SET_SVC_PARAMS, aom_svc_params_t *)
#define AOM_CTRL_AV1E_SET_SVC_PARAMS
// TODO(aomedia:3231): Deprecated. Remove it.
#define AOME_CTRL_AV1E_SET_SVC_PARAMS

AOM_CTRL_USE_TYPE(AV1E_SET_SVC_REF_FRAME_CONFIG, aom_svc_ref_frame_config_t *)
#define AOM_CTRL_AV1E_SET_SVC_REF_FRAME_CONFIG
// TODO(aomedia:3231): Deprecated. Remove it.
#define AOME_CTRL_AV1E_SET_SVC_REF_FRAME_CONFIG

AOM_CTRL_USE_TYPE(AV1E_SET_VMAF_MODEL_PATH, const char *)
#define AOM_CTRL_AV1E_SET_VMAF_MODEL_PATH

AOM_CTRL_USE_TYPE(AV1E_ENABLE_EXT_TILE_DEBUG, unsigned int)
#define AOM_CTRL_AV1E_ENABLE_EXT_TILE_DEBUG

AOM_CTRL_USE_TYPE(AV1E_ENABLE_SB_MULTIPASS_UNIT_TEST, unsigned int)
#define AOM_CTRL_AV1E_ENABLE_SB_MULTIPASS_UNIT_TEST

AOM_CTRL_USE_TYPE(AV1E_SET_GF_MIN_PYRAMID_HEIGHT, unsigned int)
#define AOM_CTRL_AV1E_SET_GF_MIN_PYRAMID_HEIGHT

AOM_CTRL_USE_TYPE(AV1E_SET_VBR_CORPUS_COMPLEXITY_LAP, unsigned int)
#define AOM_CTRL_AV1E_SET_VBR_CORPUS_COMPLEXITY_LAP

AOM_CTRL_USE_TYPE(AV1E_GET_BASELINE_GF_INTERVAL, int *)
#define AOM_CTRL_AV1E_GET_BASELINE_GF_INTERVAL

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_DNL_DENOISING, int)
#define AOM_CTRL_AV1E_SET_ENABLE_DNL_DENOISING

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_DIAGONAL_INTRA, int)
#define AOM_CTRL_AV1E_SET_ENABLE_DIAGONAL_INTRA

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_EXTERNAL_PARTITION

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_DIRECTIONAL_INTRA, int)
#define AOM_CTRL_AV1E_SET_ENABLE_DIRECTIONAL_INTRA

AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_TX_SIZE_SEARCH, int)
#define AOM_CTRL_AV1E_SET_ENABLE_TX_SIZE_SEARCH

AOM_CTRL_USE_TYPE(AV1E_SET_SVC_REF_FRAME_COMP_PRED,
                  aom_svc_ref_frame_comp_pred_t *)
#define AOM_CTRL_AV1E_SET_SVC_REF_FRAME_COMP_PRED
// TODO(aomedia:3231): Deprecated. Remove it.
#define AOME_CTRL_AV1E_SET_SVC_REF_FRAME_COMP_PRED

AOM_CTRL_USE_TYPE(AV1E_SET_DELTAQ_STRENGTH, unsigned int)
#define AOM_CTRL_AV1E_SET_DELTAQ_STRENGTH

AOM_CTRL_USE_TYPE(AV1E_SET_LOOPFILTER_CONTROL, int)
#define AOM_CTRL_AV1E_SET_LOOPFILTER_CONTROL

AOM_CTRL_USE_TYPE(AOME_GET_LOOPFILTER_LEVEL, int *)
#define AOM_CTRL_AOME_GET_LOOPFILTER_LEVEL

AOM_CTRL_USE_TYPE(AV1E_SET_AUTO_INTRA_TOOLS_OFF, unsigned int)
#define AOM_CTRL_AV1E_SET_AUTO_INTRA_TOOLS_OFF

AOM_CTRL_USE_TYPE(AV1E_SET_RTC_EXTERNAL_RC, int)
#define AOM_CTRL_AV1E_SET_RTC_EXTERNAL_RC

AOM_CTRL_USE_TYPE(AV1E_SET_FP_MT, unsigned int)
#define AOM_CTRL_AV1E_SET_FP_MT

AOM_CTRL_USE_TYPE(AV1E_SET_FP_MT_UNIT_TEST, unsigned int)
#define AOM_CTRL_AV1E_SET_FP_MT_UNIT_TEST

AOM_CTRL_USE_TYPE(AV1E_GET_TARGET_SEQ_LEVEL_IDX, int *)
#define AOM_CTRL_AV1E_GET_TARGET_SEQ_LEVEL_IDX

AOM_CTRL_USE_TYPE(AV1E_GET_NUM_OPERATING_POINTS, int *)
#define AOM_CTRL_AV1E_GET_NUM_OPERATING_POINTS

AOM_CTRL_USE_TYPE(AV1E_SET_SKIP_POSTPROC_FILTERING, unsigned int)
#define AOM_CTRL_AV1E_SET_SKIP_POSTPROC_FILTERING

AOM_CTRL_USE_TYPE(AV1E_ENABLE_SB_QP_SWEEP, unsigned int)
#define AOM_CTRL_AV1E_ENABLE_SB_QP_SWEEP

AOM_CTRL_USE_TYPE(AV1E_SET_QUANTIZER_ONE_PASS, int)
#define AOM_CTRL_AV1E_SET_QUANTIZER_ONE_PASS

AOM_CTRL_USE_TYPE(AV1E_ENABLE_RATE_GUIDE_DELTAQ, unsigned int)
#define AOM_CTRL_AV1E_ENABLE_RATE_GUIDE_DELTAQ

AOM_CTRL_USE_TYPE(AV1E_SET_RATE_DISTRIBUTION_INFO, const char *)
#define AOM_CTRL_AV1E_SET_RATE_DISTRIBUTION_INFO

AOM_CTRL_USE_TYPE(AV1E_GET_LUMA_CDEF_STRENGTH, int *)
#define AOM_CTRL_AV1E_GET_LUMA_CDEF_STRENGTH

AOM_CTRL_USE_TYPE(AV1E_SET_BITRATE_ONE_PASS_CBR, unsigned int)
#define AOM_CTRL_AV1E_SET_BITRATE_ONE_PASS_CBR

AOM_CTRL_USE_TYPE(AV1E_SET_SVC_FRAME_DROP_MODE, unsigned int)
#define AOM_CTRL_AV1E_SET_SVC_FRAME_DROP_MODE

AOM_CTRL_USE_TYPE(AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR, int)
#define AOM_CTRL_AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR

AOM_CTRL_USE_TYPE(AV1E_SET_AUTO_TILES, unsigned int)
#define AOM_CTRL_AV1E_SET_AUTO_TILES

/*!\endcond */
/*! @} - end defgroup aom_encoder */
#ifdef __cplusplus
}  // extern "C"
#endif

#endif  // AOM_AOM_AOMCX_H_

猜你喜欢

转载自blog.csdn.net/yanceyxin/article/details/143193140