blob: 098b2585ef0484a8a505e2fda62ec3e03298fcaf [file] [log] [blame]
John Koleszar0ea50ce2010-05-18 11:58:33 -04001/*
Yaowu Xu9c01aa12016-09-01 14:32:49 -07002 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
John Koleszar0ea50ce2010-05-18 11:58:33 -04003 *
Yaowu Xu9c01aa12016-09-01 14:32:49 -07004 * This source code is subject to the terms of the BSD 2 Clause License and
5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6 * was not distributed with this source code in the LICENSE file, you can
7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8 * Media Patent License 1.0 was not distributed with this source code in the
9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
John Koleszar0ea50ce2010-05-18 11:58:33 -040010 */
Yaowu Xuf883b422016-08-30 14:01:10 -070011#ifndef AOM_AOMCX_H_
12#define AOM_AOMCX_H_
John Koleszar0ea50ce2010-05-18 11:58:33 -040013
Yaowu Xu9c01aa12016-09-01 14:32:49 -070014/*!\defgroup aom_encoder AOMedia AOM/AV1 Encoder
15 * \ingroup aom
John Koleszar0ea50ce2010-05-18 11:58:33 -040016 *
17 * @{
18 */
Yaowu Xuf883b422016-08-30 14:01:10 -070019#include "./aom.h"
20#include "./aom_encoder.h"
John Koleszar0ea50ce2010-05-18 11:58:33 -040021
James Zernf42d52e2011-02-16 17:54:49 -080022/*!\file
Yaowu Xu9c01aa12016-09-01 14:32:49 -070023 * \brief Provides definitions for using AOM or AV1 encoder algorithm within the
Yaowu Xuf883b422016-08-30 14:01:10 -070024 * aom Codec Interface.
John Koleszar0ea50ce2010-05-18 11:58:33 -040025 */
Dmitry Kovaleve288c602013-09-29 18:00:15 -070026
27#ifdef __cplusplus
28extern "C" {
29#endif
John Koleszar0ea50ce2010-05-18 11:58:33 -040030
Yaowu Xuf883b422016-08-30 14:01:10 -070031/*!\name Algorithm interface for AV1
Jingning Han3ee6db62015-08-05 19:00:31 -070032 *
Yaowu Xuf883b422016-08-30 14:01:10 -070033 * This interface provides the capability to encode raw AV1 streams.
Jingning Han3ee6db62015-08-05 19:00:31 -070034 * @{
35 */
Yaowu Xuf883b422016-08-30 14:01:10 -070036extern aom_codec_iface_t aom_codec_av1_cx_algo;
37extern aom_codec_iface_t *aom_codec_av1_cx(void);
Jingning Han3ee6db62015-08-05 19:00:31 -070038/*!@} - end algorithm interface member group*/
John Koleszar0952acb2010-06-01 11:14:25 -040039
John Koleszar0ea50ce2010-05-18 11:58:33 -040040/*
41 * Algorithm Flags
42 */
43
44/*!\brief Don't reference the last frame
45 *
46 * When this flag is set, the encoder will not use the last frame as a
47 * predictor. When not set, the encoder will choose whether to use the
48 * last frame or not automatically.
49 */
Yaowu Xuf883b422016-08-30 14:01:10 -070050#define AOM_EFLAG_NO_REF_LAST (1 << 16)
Yunqing Wang9a50fec2017-11-02 17:02:00 -070051/*!\brief Don't reference the last2 frame
52 *
53 * When this flag is set, the encoder will not use the last2 frame as a
54 * predictor. When not set, the encoder will choose whether to use the
55 * last2 frame or not automatically.
56 */
57#define AOM_EFLAG_NO_REF_LAST2 (1 << 17)
58/*!\brief Don't reference the last3 frame
59 *
60 * When this flag is set, the encoder will not use the last3 frame as a
61 * predictor. When not set, the encoder will choose whether to use the
62 * last3 frame or not automatically.
63 */
64#define AOM_EFLAG_NO_REF_LAST3 (1 << 18)
John Koleszar0ea50ce2010-05-18 11:58:33 -040065/*!\brief Don't reference the golden frame
66 *
67 * When this flag is set, the encoder will not use the golden frame as a
68 * predictor. When not set, the encoder will choose whether to use the
69 * golden frame or not automatically.
70 */
Yunqing Wang9a50fec2017-11-02 17:02:00 -070071#define AOM_EFLAG_NO_REF_GF (1 << 19)
John Koleszar0ea50ce2010-05-18 11:58:33 -040072
73/*!\brief Don't reference the alternate reference frame
74 *
75 * When this flag is set, the encoder will not use the alt ref frame as a
76 * predictor. When not set, the encoder will choose whether to use the
77 * alt ref frame or not automatically.
78 */
Yunqing Wang9a50fec2017-11-02 17:02:00 -070079#define AOM_EFLAG_NO_REF_ARF (1 << 20)
80/*!\brief Don't reference the bwd reference frame
81 *
82 * When this flag is set, the encoder will not use the bwd ref frame as a
83 * predictor. When not set, the encoder will choose whether to use the
84 * bwd ref frame or not automatically.
85 */
86#define AOM_EFLAG_NO_REF_BWD (1 << 21)
87/*!\brief Don't reference the alt2 reference frame
88 *
89 * When this flag is set, the encoder will not use the alt2 ref frame as a
90 * predictor. When not set, the encoder will choose whether to use the
91 * alt2 ref frame or not automatically.
92 */
93#define AOM_EFLAG_NO_REF_ARF2 (1 << 22)
John Koleszar0ea50ce2010-05-18 11:58:33 -040094
95/*!\brief Don't update the last frame
96 *
97 * When this flag is set, the encoder will not update the last frame with
98 * the contents of the current frame.
99 */
Yunqing Wang9a50fec2017-11-02 17:02:00 -0700100#define AOM_EFLAG_NO_UPD_LAST (1 << 23)
John Koleszar0ea50ce2010-05-18 11:58:33 -0400101
102/*!\brief Don't update the golden frame
103 *
104 * When this flag is set, the encoder will not update the golden frame with
105 * the contents of the current frame.
106 */
Yunqing Wang9a50fec2017-11-02 17:02:00 -0700107#define AOM_EFLAG_NO_UPD_GF (1 << 24)
John Koleszar0ea50ce2010-05-18 11:58:33 -0400108
109/*!\brief Don't update the alternate reference frame
110 *
111 * When this flag is set, the encoder will not update the alt ref frame with
112 * the contents of the current frame.
113 */
Yunqing Wang9a50fec2017-11-02 17:02:00 -0700114#define AOM_EFLAG_NO_UPD_ARF (1 << 25)
John Koleszar0ea50ce2010-05-18 11:58:33 -0400115/*!\brief Disable entropy update
116 *
117 * When this flag is set, the encoder will not update its internal entropy
118 * model based on the entropy of this frame.
119 */
Yunqing Wang9a50fec2017-11-02 17:02:00 -0700120#define AOM_EFLAG_NO_UPD_ENTROPY (1 << 26)
John Koleszar0ea50ce2010-05-18 11:58:33 -0400121
Yaowu Xuf883b422016-08-30 14:01:10 -0700122/*!\brief AVx encoder control functions
John Koleszar0ea50ce2010-05-18 11:58:33 -0400123 *
Yaowu Xuf883b422016-08-30 14:01:10 -0700124 * This set of macros define the control functions available for AVx
James Zern8e17e822011-02-24 14:12:57 -0800125 * encoder interface.
126 *
Yaowu Xuf883b422016-08-30 14:01:10 -0700127 * \sa #aom_codec_control
John Koleszar0ea50ce2010-05-18 11:58:33 -0400128 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700129enum aome_enc_control_id {
Yunqing Wangbdcc1402016-03-25 09:05:25 -0700130 /*!\brief Codec control function to set which reference frame encoder can use.
Yunqing Wangbdcc1402016-03-25 09:05:25 -0700131 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700132 AOME_USE_REFERENCE = 7,
Yunqing Wangbdcc1402016-03-25 09:05:25 -0700133
Yaowu Xu268f1062015-03-13 09:42:57 -0700134 /*!\brief Codec control function to pass an ROI map to encoder.
Yaowu Xu268f1062015-03-13 09:42:57 -0700135 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700136 AOME_SET_ROI_MAP = 8,
Yaowu Xu268f1062015-03-13 09:42:57 -0700137
138 /*!\brief Codec control function to pass an Active map to encoder.
Yaowu Xu268f1062015-03-13 09:42:57 -0700139 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700140 AOME_SET_ACTIVEMAP,
Yaowu Xu268f1062015-03-13 09:42:57 -0700141
142 /*!\brief Codec control function to set encoder scaling mode.
Yaowu Xu268f1062015-03-13 09:42:57 -0700143 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700144 AOME_SET_SCALEMODE = 11,
Yaowu Xu268f1062015-03-13 09:42:57 -0700145
Soo-Chul Hanf8589862018-01-24 03:13:14 +0000146 /*!\brief Codec control function to set encoder enhancement layer id.
Johann3c30fb42018-02-08 14:33:20 -0800147 */
Soo-Chul Hanf8589862018-01-24 03:13:14 +0000148 AOME_SET_ENHANCEMENT_LAYER_ID = 12,
149
Yaowu Xu268f1062015-03-13 09:42:57 -0700150 /*!\brief Codec control function to set encoder internal speed settings.
John Koleszarc6b90392012-07-13 15:21:29 -0700151 *
152 * Changes in this value influences, among others, the encoder's selection
153 * of motion estimation methods. Values greater than 0 will increase encoder
154 * speed at the expense of quality.
John Koleszarc6b90392012-07-13 15:21:29 -0700155 *
Alex Converse561d0af2017-03-23 12:58:04 -0700156 * \note Valid range: 0..8
John Koleszarc6b90392012-07-13 15:21:29 -0700157 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700158 AOME_SET_CPUUSED = 13,
Yaowu Xu268f1062015-03-13 09:42:57 -0700159
Jingning Hanb49c6ae2017-11-27 18:14:05 -0800160 /*!\brief Speed features for codec development
161 */
162 AOME_SET_DEVSF,
163
Yaowu Xu268f1062015-03-13 09:42:57 -0700164 /*!\brief Codec control function to enable automatic set and use alf frames.
Yaowu Xu268f1062015-03-13 09:42:57 -0700165 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700166 AOME_SET_ENABLEAUTOALTREF,
Yaowu Xu268f1062015-03-13 09:42:57 -0700167
Yaowu Xu268f1062015-03-13 09:42:57 -0700168 /*!\brief Codec control function to set sharpness.
Yaowu Xu268f1062015-03-13 09:42:57 -0700169 */
Alex Converse0f4bcda2016-12-12 15:43:35 -0800170 AOME_SET_SHARPNESS = AOME_SET_ENABLEAUTOALTREF + 2,
Yaowu Xu268f1062015-03-13 09:42:57 -0700171
172 /*!\brief Codec control function to set the threshold for MBs treated static.
Yaowu Xu268f1062015-03-13 09:42:57 -0700173 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700174 AOME_SET_STATIC_THRESHOLD,
Yaowu Xu268f1062015-03-13 09:42:57 -0700175
Yaowu Xu268f1062015-03-13 09:42:57 -0700176 /*!\brief Codec control function to get last quantizer chosen by the encoder.
177 *
178 * Return value uses internal quantizer scale defined by the codec.
Yaowu Xu268f1062015-03-13 09:42:57 -0700179 */
Alex Converse0f4bcda2016-12-12 15:43:35 -0800180 AOME_GET_LAST_QUANTIZER = AOME_SET_STATIC_THRESHOLD + 2,
Yaowu Xu268f1062015-03-13 09:42:57 -0700181
182 /*!\brief Codec control function to get last quantizer chosen by the encoder.
183 *
184 * Return value uses the 0..63 scale as used by the rc_*_quantizer config
185 * parameters.
Yaowu Xu268f1062015-03-13 09:42:57 -0700186 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700187 AOME_GET_LAST_QUANTIZER_64,
Yaowu Xu268f1062015-03-13 09:42:57 -0700188
189 /*!\brief Codec control function to set the max no of frames to create arf.
Yaowu Xu268f1062015-03-13 09:42:57 -0700190 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700191 AOME_SET_ARNR_MAXFRAMES,
Yaowu Xu268f1062015-03-13 09:42:57 -0700192
193 /*!\brief Codec control function to set the filter strength for the arf.
Yaowu Xu268f1062015-03-13 09:42:57 -0700194 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700195 AOME_SET_ARNR_STRENGTH,
Yaowu Xu268f1062015-03-13 09:42:57 -0700196
Yaowu Xu268f1062015-03-13 09:42:57 -0700197 /*!\brief Codec control function to set visual tuning.
Yaowu Xu268f1062015-03-13 09:42:57 -0700198 */
Alex Conversefab62242016-12-13 10:09:15 -0800199 AOME_SET_TUNING = AOME_SET_ARNR_STRENGTH + 2,
Yaowu Xu268f1062015-03-13 09:42:57 -0700200
201 /*!\brief Codec control function to set constrained quality level.
John Koleszarc6b90392012-07-13 15:21:29 -0700202 *
Yaowu Xuf883b422016-08-30 14:01:10 -0700203 * \attention For this value to be used aom_codec_enc_cfg_t::g_usage must be
204 * set to #AOM_CQ.
John Koleszarc6b90392012-07-13 15:21:29 -0700205 * \note Valid range: 0..63
206 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700207 AOME_SET_CQ_LEVEL,
John Koleszar1654ae92011-07-28 09:17:32 -0400208
Yaowu Xu268f1062015-03-13 09:42:57 -0700209 /*!\brief Codec control function to set Max data rate for Intra frames.
John Koleszarc6b90392012-07-13 15:21:29 -0700210 *
211 * This value controls additional clamping on the maximum size of a
212 * keyframe. It is expressed as a percentage of the average
213 * per-frame bitrate, with the special (and default) value 0 meaning
214 * unlimited, or no additional clamping beyond the codec's built-in
215 * algorithm.
216 *
217 * For example, to allocate no more than 4.5 frames worth of bitrate
218 * to a keyframe, set this to 450.
John Koleszarc6b90392012-07-13 15:21:29 -0700219 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700220 AOME_SET_MAX_INTRA_BITRATE_PCT,
John Koleszar83b1d902012-11-05 12:37:14 -0800221
Soo-Chul Hanf8589862018-01-24 03:13:14 +0000222 /*!\brief Codec control function to set number of spatial layers.
Johann3c30fb42018-02-08 14:33:20 -0800223 */
Soo-Chul Hanf8589862018-01-24 03:13:14 +0000224 AOME_SET_NUMBER_SPATIAL_LAYERS,
225
Yaowu Xu268f1062015-03-13 09:42:57 -0700226 /*!\brief Codec control function to set max data rate for Inter frames.
Yaowu Xu636099f2014-10-24 09:31:16 -0700227 *
228 * This value controls additional clamping on the maximum size of an
229 * inter frame. It is expressed as a percentage of the average
230 * per-frame bitrate, with the special (and default) value 0 meaning
231 * unlimited, or no additional clamping beyond the codec's built-in
232 * algorithm.
233 *
234 * For example, to allow no more than 4.5 frames worth of bitrate
235 * to an inter frame, set this to 450.
Yaowu Xu636099f2014-10-24 09:31:16 -0700236 */
Alex Converse0f4bcda2016-12-12 15:43:35 -0800237 AV1E_SET_MAX_INTER_BITRATE_PCT = AOME_SET_MAX_INTRA_BITRATE_PCT + 2,
Yaowu Xu636099f2014-10-24 09:31:16 -0700238
Yaowu Xu268f1062015-03-13 09:42:57 -0700239 /*!\brief Boost percentage for Golden Frame in CBR mode.
Yaowu Xu03a60b72014-10-27 13:13:14 -0700240 *
241 * This value controls the amount of boost given to Golden Frame in
242 * CBR mode. It is expressed as a percentage of the average
243 * per-frame bitrate, with the special (and default) value 0 meaning
244 * the feature is off, i.e., no golden frame boost in CBR mode and
245 * average bitrate target is used.
246 *
247 * For example, to allow 100% more bits, i.e, 2X, in a golden frame
248 * than average frame, set this to 100.
Yaowu Xu03a60b72014-10-27 13:13:14 -0700249 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700250 AV1E_SET_GF_CBR_BOOST_PCT,
John Koleszar83b1d902012-11-05 12:37:14 -0800251
Yaowu Xu268f1062015-03-13 09:42:57 -0700252 /*!\brief Codec control function to set lossless encoding mode.
Yaowu Xu87c436f2015-01-13 12:39:42 -0800253 *
Yaowu Xuf883b422016-08-30 14:01:10 -0700254 * AV1 can operate in lossless encoding mode, in which the bitstream
Yaowu Xu87c436f2015-01-13 12:39:42 -0800255 * produced will be able to decode and reconstruct a perfect copy of
256 * input source. This control function provides a mean to switch encoder
257 * into lossless coding mode(1) or normal coding mode(0) that may be lossy.
258 * 0 = lossy coding mode
259 * 1 = lossless coding mode
260 *
261 * By default, encoder operates in normal coding mode (maybe lossy).
262 */
Alex Converse0f4bcda2016-12-12 15:43:35 -0800263 AV1E_SET_LOSSLESS = AV1E_SET_GF_CBR_BOOST_PCT + 2,
Thomas Daviesaf6df172016-11-09 14:04:18 +0000264
Yaowu Xu268f1062015-03-13 09:42:57 -0700265 /*!\brief Codec control function to set number of tile columns.
Yaowu Xu87c436f2015-01-13 12:39:42 -0800266 *
Yaowu Xuf883b422016-08-30 14:01:10 -0700267 * In encoding and decoding, AV1 allows an input image frame be partitioned
Yaowu Xu87c436f2015-01-13 12:39:42 -0800268 * into separated vertical tile columns, which can be encoded or decoded
269 * independently. This enables easy implementation of parallel encoding and
270 * decoding. This control requests the encoder to use column tiles in
271 * encoding an input frame, with number of tile columns (in Log2 unit) as
272 * the parameter:
273 * 0 = 1 tile column
274 * 1 = 2 tile columns
275 * 2 = 4 tile columns
276 * .....
277 * n = 2**n tile columns
278 * The requested tile columns will be capped by encoder based on image size
279 * limitation (The minimum width of a tile column is 256 pixel, the maximum
280 * is 4096).
281 *
282 * By default, the value is 0, i.e. one single column tile for entire image.
283 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700284 AV1E_SET_TILE_COLUMNS,
Yaowu Xu87c436f2015-01-13 12:39:42 -0800285
Yaowu Xu268f1062015-03-13 09:42:57 -0700286 /*!\brief Codec control function to set number of tile rows.
Yaowu Xu87c436f2015-01-13 12:39:42 -0800287 *
Yaowu Xuf883b422016-08-30 14:01:10 -0700288 * In encoding and decoding, AV1 allows an input image frame be partitioned
Yaowu Xu87c436f2015-01-13 12:39:42 -0800289 * into separated horizontal tile rows. Tile rows are encoded or decoded
290 * sequentially. Even though encoding/decoding of later tile rows depends on
291 * earlier ones, this allows the encoder to output data packets for tile rows
292 * prior to completely processing all tile rows in a frame, thereby reducing
293 * the latency in processing between input and output. The parameter
294 * for this control describes the number of tile rows, which has a valid
295 * range [0, 2]:
296 * 0 = 1 tile row
297 * 1 = 2 tile rows
298 * 2 = 4 tile rows
299 *
300 * By default, the value is 0, i.e. one single row tile for entire image.
301 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700302 AV1E_SET_TILE_ROWS,
Ryan Lei7386eda2016-12-08 21:08:31 -0800303
Yaowu Xu268f1062015-03-13 09:42:57 -0700304 /*!\brief Codec control function to enable frame parallel decoding feature.
Yaowu Xu87c436f2015-01-13 12:39:42 -0800305 *
Yaowu Xuf883b422016-08-30 14:01:10 -0700306 * AV1 has a bitstream feature to reduce decoding dependency between frames
Yaowu Xu87c436f2015-01-13 12:39:42 -0800307 * by turning off backward update of probability context used in encoding
308 * and decoding. This allows staged parallel processing of more than one
309 * video frames in the decoder. This control function provides a mean to
310 * turn this feature on or off for bitstreams produced by encoder.
311 *
312 * By default, this feature is off.
313 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700314 AV1E_SET_FRAME_PARALLEL_DECODING,
Yaowu Xu87c436f2015-01-13 12:39:42 -0800315
Debargha Mukherjee921cc4c2018-03-24 12:01:12 -0700316 /*!\brief Codec control function to enable error_resilient_mode
317 *
318 * AV1 has a bitstream feature to guarantee parseability of a frame
319 * by turning on the error_resilient_decoding mode, even though the
320 * reference buffers are unreliable or not received.
321 *
322 * By default, this feature is off.
323 */
324 AV1E_SET_ERROR_RESILIENT_MODE,
325
Yaowu Xu268f1062015-03-13 09:42:57 -0700326 /*!\brief Codec control function to set adaptive quantization mode.
Yaowu Xu87c436f2015-01-13 12:39:42 -0800327 *
Yaowu Xuf883b422016-08-30 14:01:10 -0700328 * AV1 has a segment based feature that allows encoder to adaptively change
Yaowu Xu87c436f2015-01-13 12:39:42 -0800329 * quantization parameter for each segment within a frame to improve the
330 * subjective quality. This control makes encoder operate in one of the
331 * several AQ_modes supported.
332 *
333 * By default, encoder operates with AQ_Mode 0(adaptive quantization off).
334 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700335 AV1E_SET_AQ_MODE,
Yaowu Xu4ab39e12015-01-14 09:07:02 -0800336
Yaowu Xu268f1062015-03-13 09:42:57 -0700337 /*!\brief Codec control function to enable/disable periodic Q boost.
Yaowu Xu4ab39e12015-01-14 09:07:02 -0800338 *
Yaowu Xuf883b422016-08-30 14:01:10 -0700339 * One AV1 encoder speed feature is to enable quality boost by lowering
Yaowu Xu4ab39e12015-01-14 09:07:02 -0800340 * frame level Q periodically. This control function provides a mean to
341 * turn on/off this feature.
342 * 0 = off
343 * 1 = on
344 *
345 * By default, the encoder is allowed to use this feature for appropriate
346 * encoding modes.
347 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700348 AV1E_SET_FRAME_PERIODIC_BOOST,
Yaowu Xu4ab39e12015-01-14 09:07:02 -0800349
Yaowu Xu268f1062015-03-13 09:42:57 -0700350 /*!\brief Codec control function to set noise sensitivity.
JackyChenbb1a2362014-09-12 11:48:44 -0700351 *
Yaowu Xu268f1062015-03-13 09:42:57 -0700352 * 0: off, 1: On(YOnly)
JackyChenbb1a2362014-09-12 11:48:44 -0700353 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700354 AV1E_SET_NOISE_SENSITIVITY,
Ivan Maltz01b35c32013-09-05 08:55:47 -0700355
Yaowu Xu268f1062015-03-13 09:42:57 -0700356 /*!\brief Codec control function to set content type.
Yaowu Xudc08b202015-01-14 11:17:09 -0800357 * \note Valid parameter range:
Yaowu Xuf883b422016-08-30 14:01:10 -0700358 * AOM_CONTENT_DEFAULT = Regular video content (Default)
359 * AOM_CONTENT_SCREEN = Screen capture content
Yaowu Xudc08b202015-01-14 11:17:09 -0800360 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700361 AV1E_SET_TUNE_CONTENT,
Yaowu Xu193ca4b2015-01-14 11:48:29 -0800362
Hui Su1cb1c002018-02-05 18:21:20 -0800363 /*!\brief Codec control function to set CDF update mode.
364 *
James Zern4427d652018-03-08 18:17:31 -0800365 * 0: no update 1: update on every frame
366 * 2: selectively update
Hui Su1cb1c002018-02-05 18:21:20 -0800367 */
368 AV1E_SET_CDF_UPDATE_MODE,
369
Andrey Norkin9e694632017-12-21 18:50:57 -0800370 /*!\brief Codec control function to set color space info.
371 * \note Valid ranges: 0..23, default is "Unspecified".
372 * 0 = For future use
373 * 1 = BT.709
374 * 2 = Unspecified
375 * 3 = For future use
376 * 4 = BT.470 System M (historical)
377 * 5 = BT.470 System B, G (historical)
378 * 6 = BT.601
379 * 7 = SMPTE 240
380 * 8 = Generic film (color filters using illuminant C)
381 * 9 = BT.2020, BT.2100
382 * 10 = SMPTE 428 (CIE 1921 XYZ)
383 * 11 = SMPTE RP 431-2
384 * 12 = SMPTE EG 432-1
385 * 13 = For future use (values 13 - 21)
386 * 22 = EBU Tech. 3213-E
387 * 23 = For future use
Edward Hervey24e47832018-01-11 12:17:12 +0100388 *
389 * Experiment: CICP
Andrey Norkin9e694632017-12-21 18:50:57 -0800390 */
391 AV1E_SET_COLOR_PRIMARIES,
392
393 /*!\brief Codec control function to set transfer function info.
394 * \note Valid ranges: 0..19, default is "Unspecified".
395 * 0 = For future use
396 * 1 = BT.709
397 * 2 = Unspecified
398 * 3 = For future use
399 * 4 = BT.470 System M (historical)
400 * 5 = BT.470 System B, G (historical)
401 * 6 = BT.601
402 * 7 = SMPTE 240 M
403 * 8 = Linear
404 * 9 = Logarithmic (100 : 1 range)
405 * 10 = Logarithmic (100 * Sqrt(10) : 1 range)
406 * 11 = IEC 61966-2-4
407 * 12 = BT.1361
408 * 13 = sRGB or sYCC
409 * 14 = BT.2020 10-bit systems
410 * 15 = BT.2020 12-bit systems
411 * 16 = SMPTE ST 2084, ITU BT.2100 PQ
412 * 17 = SMPTE ST 428
413 * 18 = BT.2100 HLG, ARIB STD-B67
414 * 19 = For future use
Edward Hervey24e47832018-01-11 12:17:12 +0100415 *
416 * Experiment: CICP
Andrey Norkin9e694632017-12-21 18:50:57 -0800417 */
418 AV1E_SET_TRANSFER_CHARACTERISTICS,
419
420 /*!\brief Codec control function to set transfer function info.
421 * \note Valid ranges: 0..15, default is "Unspecified".
422 * 0 = Identity matrix
423 * 1 = BT.709
424 * 2 = Unspecified
425 * 3 = For future use
426 * 4 = US FCC 73.628
427 * 5 = BT.470 System B, G (historical)
428 * 6 = BT.601
429 * 7 = SMPTE 240 M
430 * 8 = YCgCo
431 * 9 = BT.2020 non-constant luminance, BT.2100 YCbCr
432 * 10 = BT.2020 constant luminance
433 * 11 = SMPTE ST 2085 YDzDx
434 * 12 = Chromaticity-derived non-constant luminance
435 * 13 = Chromaticity-derived constant luminance
436 * 14 = BT.2100 ICtCp
437 * 15 = For future use
Edward Hervey24e47832018-01-11 12:17:12 +0100438 *
439 * Experiment: CICP
Andrey Norkin9e694632017-12-21 18:50:57 -0800440 */
441 AV1E_SET_MATRIX_COEFFICIENTS,
Edward Hervey24e47832018-01-11 12:17:12 +0100442
Yaowu Xu268f1062015-03-13 09:42:57 -0700443 /*!\brief Codec control function to set color space info.
anorkin76fb1262017-03-22 15:12:12 -0700444 * \note Valid ranges: 0..9, default is "UNKNOWN".
Yaowu Xue94b4152015-01-13 10:07:20 -0800445 * 0 = UNKNOWN,
446 * 1 = BT_601
447 * 2 = BT_709
448 * 3 = SMPTE_170
449 * 4 = SMPTE_240
anorkin76fb1262017-03-22 15:12:12 -0700450 * 5 = BT_2020_NCL
451 * 6 = BT_2020_CL
Yaowu Xue94b4152015-01-13 10:07:20 -0800452 * 7 = SRGB
anorkin76fb1262017-03-22 15:12:12 -0700453 * 8 = ICtCp
454 * 9 = RESERVED
Yaowu Xue94b4152015-01-13 10:07:20 -0800455 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700456 AV1E_SET_COLOR_SPACE,
Alex Converse4dcb8392015-03-20 14:55:43 -0700457
anorkin76fb1262017-03-22 15:12:12 -0700458 /*!\brief Codec control function to set transfer function info.
459 * \note Valid ranges: 0..4, default is "UNKNOWN".
460 * 0 = UNKNOWN,
461 * 1 = BT_709
462 * 2 = PQ
463 * 3 = HLG
464 * 4 = RESERVED
465 */
466 AV1E_SET_TRANSFER_FUNCTION,
467
468 /*!\brief Codec control function to set chroma 4:2:0 sample position info.
469 * \note Valid ranges: 0..3, default is "UNKNOWN".
470 * 0 = UNKNOWN,
471 * 1 = VERTICAL
472 * 2 = COLOCATED
473 * 3 = RESERVED
474 */
475 AV1E_SET_CHROMA_SAMPLE_POSITION,
anorkin76fb1262017-03-22 15:12:12 -0700476
Debargha Mukherjee98526432015-04-01 16:39:06 -0700477 /*!\brief Codec control function to set minimum interval between GF/ARF frames
478 *
479 * By default the value is set as 4.
Debargha Mukherjee98526432015-04-01 16:39:06 -0700480 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700481 AV1E_SET_MIN_GF_INTERVAL,
Debargha Mukherjee98526432015-04-01 16:39:06 -0700482
483 /*!\brief Codec control function to set minimum interval between GF/ARF frames
484 *
485 * By default the value is set as 16.
Debargha Mukherjee98526432015-04-01 16:39:06 -0700486 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700487 AV1E_SET_MAX_GF_INTERVAL,
Debargha Mukherjee98526432015-04-01 16:39:06 -0700488
Alex Converse4dcb8392015-03-20 14:55:43 -0700489 /*!\brief Codec control function to get an Active map back from the encoder.
Alex Converse4dcb8392015-03-20 14:55:43 -0700490 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700491 AV1E_GET_ACTIVEMAP,
Ronald S. Bultjeeeb5ef02015-09-15 21:56:51 -0400492
493 /*!\brief Codec control function to set color range bit.
494 * \note Valid ranges: 0..1, default is 0
495 * 0 = Limited range (16..235 or HBD equivalent)
496 * 1 = Full range (0..255 or HBD equivalent)
Ronald S. Bultjeeeb5ef02015-09-15 21:56:51 -0400497 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700498 AV1E_SET_COLOR_RANGE,
Yaowu Xu7c514e22015-09-28 15:55:46 -0700499
Yaowu Xu7c514e22015-09-28 15:55:46 -0700500 /*!\brief Codec control function to set intended rendering image size.
501 *
502 * By default, this is identical to the image size in pixels.
Yaowu Xu7c514e22015-09-28 15:55:46 -0700503 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700504 AV1E_SET_RENDER_SIZE,
Geza Lore454989f2016-03-24 13:56:05 +0000505
hui sube3f0692016-05-05 15:37:37 -0700506 /*!\brief Codec control function to set target level.
507 *
508 * 255: off (default); 0: only keep level stats; 10: target for level 1.0;
509 * 11: target for level 1.1; ... 62: target for level 6.2
hui sube3f0692016-05-05 15:37:37 -0700510 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700511 AV1E_SET_TARGET_LEVEL,
hui su72d48902016-05-05 12:04:42 -0700512
513 /*!\brief Codec control function to get bitstream level.
hui su72d48902016-05-05 12:04:42 -0700514 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700515 AV1E_GET_LEVEL,
Yaowu Xu6fe07a22016-07-14 10:57:35 -0700516
Geza Lore454989f2016-03-24 13:56:05 +0000517 /*!\brief Codec control function to set intended superblock size.
518 *
519 * By default, the superblock size is determined separately for each
520 * frame by the encoder.
Alex Converse85370ae2016-12-13 11:18:28 -0800521 *
522 * Experiment: EXT_PARTITION
Geza Lore454989f2016-03-24 13:56:05 +0000523 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700524 AV1E_SET_SUPERBLOCK_SIZE,
Alex Converse85370ae2016-12-13 11:18:28 -0800525
526 /*!\brief Codec control function to enable automatic set and use
527 * bwd-pred frames.
528 *
Alex Converse85370ae2016-12-13 11:18:28 -0800529 */
530 AOME_SET_ENABLEAUTOBWDREF,
531
Steinar Midtskogene44c6222017-11-09 13:22:09 +0100532 /*!\brief Codec control function to encode with CDEF.
533 *
534 * CDEF is the constrained directional enhancement filter which is an
535 * in-loop filter aiming to remove coding artifacts
536 * 0 = do not apply CDEF
537 * 1 = apply CDEF
538 *
539 * By default, the encoder applies CDEF.
540 *
541 * Experiment: AOM_CDEF
542 */
543 AV1E_SET_ENABLE_CDEF,
544
Sebastien Alaiwan1ed20242018-02-20 14:47:18 +0100545 /*!\brief Codec control function to encode with Loop Restoration Filter.
546 *
547 * 0 = do not apply Restoration Filter
548 * 1 = apply Restoration Filter
549 *
550 * By default, the encoder applies Restoration Filter.
551 *
552 */
553 AV1E_SET_ENABLE_RESTORATION,
554
Alex Converse85370ae2016-12-13 11:18:28 -0800555 /*!\brief Codec control function to encode with quantisation matrices.
556 *
557 * AOM can operate with default quantisation matrices dependent on
558 * quantisation level and block type.
559 * 0 = do not use quantisation matrices
560 * 1 = use quantisation matrices
561 *
562 * By default, the encoder operates without quantisation matrices.
563 *
564 * Experiment: AOM_QM
565 */
566 AV1E_SET_ENABLE_QM,
567
568 /*!\brief Codec control function to set the min quant matrix flatness.
569 *
570 * AOM can operate with different ranges of quantisation matrices.
571 * As quantisation levels increase, the matrices get flatter. This
572 * control sets the minimum level of flatness from which the matrices
573 * are determined.
574 *
575 * By default, the encoder sets this minimum at half the available
576 * range.
577 *
578 * Experiment: AOM_QM
579 */
580 AV1E_SET_QM_MIN,
581
582 /*!\brief Codec control function to set the max quant matrix flatness.
583 *
584 * AOM can operate with different ranges of quantisation matrices.
585 * As quantisation levels increase, the matrices get flatter. This
586 * control sets the maximum level of flatness possible.
587 *
588 * By default, the encoder sets this maximum at the top of the
589 * available range.
590 *
591 * Experiment: AOM_QM
592 */
593 AV1E_SET_QM_MAX,
594
Yaowu Xuf7a12422018-01-31 15:29:20 -0800595 /*!\brief Codec control function to set the min quant matrix flatness.
596 *
597 * AOM can operate with different ranges of quantisation matrices.
598 * As quantisation levels increase, the matrices get flatter. This
599 * control sets the flatness for luma (Y).
600 *
601 * By default, the encoder sets this minimum at half the available
602 * range.
603 *
604 * Experiment: AOM_QM
605 */
606 AV1E_SET_QM_Y,
607
608 /*!\brief Codec control function to set the min quant matrix flatness.
609 *
610 * AOM can operate with different ranges of quantisation matrices.
611 * As quantisation levels increase, the matrices get flatter. This
612 * control sets the flatness for chroma (U).
613 *
614 * By default, the encoder sets this minimum at half the available
615 * range.
616 *
617 * Experiment: AOM_QM
618 */
619 AV1E_SET_QM_U,
620
621 /*!\brief Codec control function to set the min quant matrix flatness.
622 *
623 * AOM can operate with different ranges of quantisation matrices.
624 * As quantisation levels increase, the matrices get flatter. This
625 * control sets the flatness for chrome (V).
626 *
627 * By default, the encoder sets this minimum at half the available
628 * range.
629 *
630 * Experiment: AOM_QM
631 */
632 AV1E_SET_QM_V,
633
Yushin Chod808bfc2017-08-10 15:54:36 -0700634 /*!\brief Codec control function to encode with dist_8x8.
635 *
636 * The dist_8x8 is enabled automatically for model tuning parameters that
637 * require measuring distortion at the 8x8 level. This control also allows
638 * measuring distortion at the 8x8 level for other tuning options
639 * (e.g., PSNR), for testing purposes.
640 * 0 = do not use dist_8x8
641 * 1 = use dist_8x8
642 *
643 * By default, the encoder does not use dist_8x8
644 *
645 * Experiment: DIST_8X8
646 */
647 AV1E_SET_ENABLE_DIST_8X8,
648
Alex Converse85370ae2016-12-13 11:18:28 -0800649 /*!\brief Codec control function to set a maximum number of tile groups.
650 *
651 * This will set the maximum number of tile groups. This will be
652 * overridden if an MTU size is set. The default value is 1.
653 *
654 * Experiment: TILE_GROUPS
655 */
656 AV1E_SET_NUM_TG,
657
658 /*!\brief Codec control function to set an MTU size for a tile group.
659 *
660 * This will set the maximum number of bytes in a tile group. This can be
661 * exceeded only if a single tile is larger than this amount.
662 *
663 * By default, the value is 0, in which case a fixed number of tile groups
664 * is used.
665 *
666 * Experiment: TILE_GROUPS
667 */
668 AV1E_SET_MTU,
Alex Converseeb780e72016-12-13 12:46:41 -0800669
Fangwen Fu7b9f2b32017-01-17 14:01:52 -0800670 /*!\brief Codec control function to set dependent_horz_tiles.
Andrey Norkin9e694632017-12-21 18:50:57 -0800671 *
672 * In encoding and decoding, AV1 allows enabling dependent horizontal tile
673 * The parameter for this control describes the value of this flag,
674 * which has a valid range [0, 1]:
675 * 0 = disable dependent horizontal tile
676 * 1 = enable dependent horizontal tile,
677 *
678 * By default, the value is 0, i.e. disable dependent horizontal tile.
679 */
Fangwen Fu7b9f2b32017-01-17 14:01:52 -0800680 AV1E_SET_TILE_DEPENDENT_ROWS,
681
Alex Converseeb780e72016-12-13 12:46:41 -0800682 /*!\brief Codec control function to set the number of symbols in an ANS data
683 * window.
684 *
685 * The number of ANS symbols (both boolean and non-booleans alphabets) in an
686 * ANS data window is set to 1 << value.
687 *
688 * \note Valid range: [8, 23]
689 *
690 * Experiment: ANS
691 */
692 AV1E_SET_ANS_WINDOW_SIZE_LOG2,
Alex Converse00b7e272017-03-22 18:14:08 -0700693
694 /*!\brief Codec control function to set temporal mv prediction
Andrey Norkin9e694632017-12-21 18:50:57 -0800695 * enabling/disabling.
696 *
697 * This will enable or disable temporal mv predicton. The default value is 0.
698 *
699 * Experiment: TEMPMV_SIGNALING
700 */
Alex Converse00b7e272017-03-22 18:14:08 -0700701 AV1E_SET_DISABLE_TEMPMV,
702
Jingning Hana446f552018-02-22 15:42:12 -0800703 /*!\brief Codec control function to turn on / off dual filter
704 * enabling/disabling.
705 *
706 * This will enable or disable dual filter. The default value is 1
707 *
708 */
709 AV1E_SET_ENABLE_DF,
710
Cheng Chenfecd9a72018-03-08 15:23:51 -0800711 /*!\brief Codec control function to turn on / off frame order hint for a
712 * few tools:
713 *
714 * joint compound mode
715 * motion field motion vector
716 * ref frame sign bias
717 *
718 * The default value is 1.
719 *
720 */
721 AV1E_SET_ENABLE_ORDER_HINT,
722
Cheng Chene0c918a2018-02-22 19:38:31 -0800723 /*!\brief Codec control function to turn on / off joint compound mode
724 * enabling/disabling.
725 *
726 * This will enable or disable joint compound mode. The default value is 1
Cheng Chenfecd9a72018-03-08 15:23:51 -0800727 * If AV1E_SET_ENABLE_ORDER_HINT is 0, then this flag is forced to 0.
Cheng Chene0c918a2018-02-22 19:38:31 -0800728 *
729 */
730 AV1E_SET_ENABLE_JNT_COMP,
731
Urvang Joshi2c92b072018-03-19 17:23:31 -0700732 /*!\brief Codec control function to turn on / off frame superresolution.
733 *
734 * This will enable or disable frame superresolution. The default value is 1
735 * If AV1E_SET_ENABLE_SUPERRES is 0, then this flag is forced to 0.
736 */
737 AV1E_SET_ENABLE_SUPERRES,
738
Lei7bb501d2017-12-13 15:10:34 -0800739 /*!\brief Codec control function to set loop_filter_across_tiles_v_enabled
740 * and loop_filter_across_tiles_h_enabled.
741 * In encoding and decoding, AV1 allows disabling loop filter across tile
742 * boundary The parameter for this control describes the value of this flag,
743 * which has a valid range [0, 1]:
744 * 0 = disable loop filter across tile boundary
745 * 1 = enable loop filter across tile boundary
746 *
747 * By default, the value is 1, i.e. enable loop filter across tile boundary.
748 *
749 * Experiment: LOOPFILTERING_ACROSS_TILES_EXT
750 */
751 AV1E_SET_TILE_LOOPFILTER_V,
752 AV1E_SET_TILE_LOOPFILTER_H,
753
Alex Converse00b7e272017-03-22 18:14:08 -0700754 /*!\brief Codec control function to set loop_filter_across_tiles_enabled.
755 *
756 * In encoding and decoding, AV1 allows disabling loop filter across tile
757 * boundary The parameter for this control describes the value of this flag,
758 * which has a valid range [0, 1]:
759 * 0 = disable loop filter across tile boundary
760 * 1 = enable loop filter across tile boundary
761 *
762 * By default, the value is 1, i.e. enable loop filter across tile boundary.
763 *
764 * Experiment: LOOPFILTERING_ACROSS_TILES
765 */
766 AV1E_SET_TILE_LOOPFILTER,
Yunqing Wangd8cd55f2017-02-27 12:16:00 -0800767
Fangwen Fu6160df22017-04-24 09:45:51 -0700768 /*!\brief Codec control function to set the delta q mode
Andrey Norkin9e694632017-12-21 18:50:57 -0800769 *
770 * AV1 has a segment based feature that allows encoder to adaptively change
771 * quantization parameter for each segment within a frame to improve the
772 * subjective quality. the delta q mode is added on top of segment based
773 * feature, and allows control per 64x64 q and lf delta.This control makes
774 * encoder operate in one of the several DELTA_Q_modes supported.
775 *
776 * By default, encoder operates with DELTAQ_Mode 0(deltaq signaling off).
777 */
Fangwen Fu6160df22017-04-24 09:45:51 -0700778 AV1E_SET_DELTAQ_MODE,
779
Yunqing Wangeeb08a92017-07-07 21:25:18 -0700780 /*!\brief Codec control function to set the single tile decoding mode to 0 or
781 * 1.
Yunqing Wangd8cd55f2017-02-27 12:16:00 -0800782 *
Yunqing Wangeeb08a92017-07-07 21:25:18 -0700783 * 0 means that the single tile decoding is off, and 1 means that the single
784 * tile decoding is on.
Yunqing Wangd8cd55f2017-02-27 12:16:00 -0800785 *
786 * Experiment: EXT_TILE
787 */
Yunqing Wangeeb08a92017-07-07 21:25:18 -0700788 AV1E_SET_SINGLE_TILE_DECODING,
Yunqing Wangff4fa062017-04-21 10:56:08 -0700789
790 /*!\brief Codec control function to enable the extreme motion vector unit test
791 * in AV1. Please note that this is only used in motion vector unit test.
792 *
793 * 0 : off, 1 : MAX_EXTREME_MV, 2 : MIN_EXTREME_MV
794 */
795 AV1E_ENABLE_MOTION_VECTOR_UNIT_TEST,
Andrey Norkin28e9ce22018-01-08 10:11:21 -0800796
797 /*!\brief Codec control function to signal picture timing info in the
798 * bitstream. \note Valid ranges: 0..1, default is "UNKNOWN". 0 = UNKNOWN, 1 =
799 * EQUAL
800 */
801 AV1E_SET_TIMING_INFO,
Andrey Norkin6f1c2f72018-01-15 20:08:52 -0800802
803 /*!\brief Codec control function to add film grain parameters (one of several
804 * preset types) info in the bitstream.
805 * \note Valid ranges: 0..11, default is "0". 0 = UNKNOWN,
806 * 1..16 = different test vectors for grain
807 */
808 AV1E_SET_FILM_GRAIN_TEST_VECTOR,
Neil Birkbeckeb895ef2018-03-14 17:51:03 -0700809
810 /*!\brief Codec control function to set the path to the film grain parameters
811 */
812 AV1E_SET_FILM_GRAIN_TABLE,
John Koleszarb0da9b32010-12-17 09:43:39 -0500813};
John Koleszar0ea50ce2010-05-18 11:58:33 -0400814
Yaowu Xuf883b422016-08-30 14:01:10 -0700815/*!\brief aom 1-D scaling mode
John Koleszar0ea50ce2010-05-18 11:58:33 -0400816 *
Yaowu Xuf883b422016-08-30 14:01:10 -0700817 * This set of constants define 1-D aom scaling modes
John Koleszar0ea50ce2010-05-18 11:58:33 -0400818 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700819typedef enum aom_scaling_mode_1d {
820 AOME_NORMAL = 0,
821 AOME_FOURFIVE = 1,
822 AOME_THREEFIVE = 2,
823 AOME_ONETWO = 3
824} AOM_SCALING_MODE;
John Koleszar0ea50ce2010-05-18 11:58:33 -0400825
Yaowu Xuc5bf1e02017-09-26 13:51:29 -0700826/*!\brief Max number of segments
827 *
828 * This is the limit of number of segments allowed within a frame.
829 *
830 * Currently same as "MAX_SEGMENTS" in AV1, the maximum that AV1 supports.
831 *
832 */
833#define AOM_MAX_SEGMENTS 8
834
Yaowu Xuf883b422016-08-30 14:01:10 -0700835/*!\brief aom region of interest map
John Koleszar0ea50ce2010-05-18 11:58:33 -0400836 *
837 * These defines the data structures for the region of interest map
838 *
Yaowu Xuc5bf1e02017-09-26 13:51:29 -0700839 * TODO(yaowu): create a unit test for ROI map related APIs
840 *
John Koleszar0ea50ce2010-05-18 11:58:33 -0400841 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700842typedef struct aom_roi_map {
Yaowu Xuc5bf1e02017-09-26 13:51:29 -0700843 /*! An id between 0 and 7 for each 8x8 region within a frame. */
Adrian Grangef58eca92013-10-24 15:11:36 -0700844 unsigned char *roi_map;
Yaowu Xuc5bf1e02017-09-26 13:51:29 -0700845 unsigned int rows; /**< Number of rows. */
846 unsigned int cols; /**< Number of columns. */
847 int delta_q[AOM_MAX_SEGMENTS]; /**< Quantizer deltas. */
848 int delta_lf[AOM_MAX_SEGMENTS]; /**< Loop filter deltas. */
Adrian Grangef58eca92013-10-24 15:11:36 -0700849 /*! Static breakout threshold for each segment. */
Yaowu Xuc5bf1e02017-09-26 13:51:29 -0700850 unsigned int static_threshold[AOM_MAX_SEGMENTS];
Yaowu Xuf883b422016-08-30 14:01:10 -0700851} aom_roi_map_t;
John Koleszar0ea50ce2010-05-18 11:58:33 -0400852
Yaowu Xuf883b422016-08-30 14:01:10 -0700853/*!\brief aom active region map
John Koleszar0ea50ce2010-05-18 11:58:33 -0400854 *
855 * These defines the data structures for active region map
856 *
857 */
858
Yaowu Xuf883b422016-08-30 14:01:10 -0700859typedef struct aom_active_map {
clang-format83a52072016-08-08 20:22:13 -0700860 /*!\brief specify an on (1) or off (0) each 16x16 region within a frame */
861 unsigned char *active_map;
862 unsigned int rows; /**< number of rows */
863 unsigned int cols; /**< number of cols */
Yaowu Xuf883b422016-08-30 14:01:10 -0700864} aom_active_map_t;
John Koleszar0ea50ce2010-05-18 11:58:33 -0400865
Yaowu Xuf883b422016-08-30 14:01:10 -0700866/*!\brief aom image scaling mode
John Koleszar0ea50ce2010-05-18 11:58:33 -0400867 *
868 * This defines the data structure for image scaling mode
869 *
870 */
Yaowu Xuf883b422016-08-30 14:01:10 -0700871typedef struct aom_scaling_mode {
872 AOM_SCALING_MODE h_scaling_mode; /**< horizontal scaling mode */
873 AOM_SCALING_MODE v_scaling_mode; /**< vertical scaling mode */
874} aom_scaling_mode_t;
John Koleszar0ea50ce2010-05-18 11:58:33 -0400875
Yaowu Xuf883b422016-08-30 14:01:10 -0700876/*!brief AV1 encoder content type */
Alex Converse572de922014-07-31 08:27:32 -0700877typedef enum {
Yaowu Xuf883b422016-08-30 14:01:10 -0700878 AOM_CONTENT_DEFAULT,
879 AOM_CONTENT_SCREEN,
880 AOM_CONTENT_INVALID
881} aom_tune_content;
John Koleszar0ea50ce2010-05-18 11:58:33 -0400882
Andrey Norkin28e9ce22018-01-08 10:11:21 -0800883/*!brief AV1 encoder timing info signaling */
884typedef enum { AOM_TIMING_UNSPECIFIED, AOM_TIMING_EQUAL } aom_timing_info_t;
885
Alex Converse6e3c8052016-12-16 09:48:56 -0800886/*!\brief Model tuning parameters
John Koleszarb0da9b32010-12-17 09:43:39 -0500887 *
888 * Changes the encoder to tune for certain types of input material.
889 *
890 */
Yushin Chod808bfc2017-08-10 15:54:36 -0700891typedef enum {
892 AOM_TUNE_PSNR,
893 AOM_TUNE_SSIM,
Yushin Chod808bfc2017-08-10 15:54:36 -0700894 AOM_TUNE_CDEF_DIST,
895 AOM_TUNE_DAALA_DIST
Yushin Chod808bfc2017-08-10 15:54:36 -0700896} aom_tune_metric;
John Koleszarb0da9b32010-12-17 09:43:39 -0500897
James Zern7dd7a7d2015-10-09 16:31:17 -0700898/*!\cond */
Alex Converse6e3c8052016-12-16 09:48:56 -0800899/*!\brief Encoder control function parameter type
John Koleszar0ea50ce2010-05-18 11:58:33 -0400900 *
Alex Converse6e3c8052016-12-16 09:48:56 -0800901 * Defines the data types that AOME/AV1E control functions take. Note that
Yaowu Xuf883b422016-08-30 14:01:10 -0700902 * additional common controls are defined in aom.h
John Koleszar0ea50ce2010-05-18 11:58:33 -0400903 *
904 */
905
Ryan Overbecka5fefa72017-09-19 11:39:10 -0700906AOM_CTRL_USE_TYPE(AOME_USE_REFERENCE, int)
Yaowu Xuf883b422016-08-30 14:01:10 -0700907#define AOM_CTRL_AOME_USE_REFERENCE
Yaowu Xuf883b422016-08-30 14:01:10 -0700908AOM_CTRL_USE_TYPE(AOME_SET_ROI_MAP, aom_roi_map_t *)
909#define AOM_CTRL_AOME_SET_ROI_MAP
910AOM_CTRL_USE_TYPE(AOME_SET_ACTIVEMAP, aom_active_map_t *)
911#define AOM_CTRL_AOME_SET_ACTIVEMAP
912AOM_CTRL_USE_TYPE(AOME_SET_SCALEMODE, aom_scaling_mode_t *)
913#define AOM_CTRL_AOME_SET_SCALEMODE
John Koleszar0ea50ce2010-05-18 11:58:33 -0400914
Soo-Chul Hanf8589862018-01-24 03:13:14 +0000915AOM_CTRL_USE_TYPE(AOME_SET_ENHANCEMENT_LAYER_ID, int)
916#define AOM_CTRL_AOME_SET_ENHANCEMENT_LAYER_ID
917
Yaowu Xuf883b422016-08-30 14:01:10 -0700918AOM_CTRL_USE_TYPE(AOME_SET_CPUUSED, int)
919#define AOM_CTRL_AOME_SET_CPUUSED
Jingning Hanb49c6ae2017-11-27 18:14:05 -0800920AOM_CTRL_USE_TYPE(AOME_SET_DEVSF, int)
921#define AOM_CTRL_AOME_SET_DEVSF
Yaowu Xuf883b422016-08-30 14:01:10 -0700922AOM_CTRL_USE_TYPE(AOME_SET_ENABLEAUTOALTREF, unsigned int)
923#define AOM_CTRL_AOME_SET_ENABLEAUTOALTREF
Zoe Liucf5083d2016-02-04 09:47:46 -0800924
Yaowu Xuf883b422016-08-30 14:01:10 -0700925AOM_CTRL_USE_TYPE(AOME_SET_ENABLEAUTOBWDREF, unsigned int)
926#define AOM_CTRL_AOME_SET_ENABLEAUTOBWDREF
Zoe Liucf5083d2016-02-04 09:47:46 -0800927
Yaowu Xuf883b422016-08-30 14:01:10 -0700928AOM_CTRL_USE_TYPE(AOME_SET_SHARPNESS, unsigned int)
929#define AOM_CTRL_AOME_SET_SHARPNESS
930AOM_CTRL_USE_TYPE(AOME_SET_STATIC_THRESHOLD, unsigned int)
931#define AOM_CTRL_AOME_SET_STATIC_THRESHOLD
John Koleszar0ea50ce2010-05-18 11:58:33 -0400932
Yaowu Xuf883b422016-08-30 14:01:10 -0700933AOM_CTRL_USE_TYPE(AOME_SET_ARNR_MAXFRAMES, unsigned int)
934#define AOM_CTRL_AOME_SET_ARNR_MAXFRAMES
935AOM_CTRL_USE_TYPE(AOME_SET_ARNR_STRENGTH, unsigned int)
936#define AOM_CTRL_AOME_SET_ARNR_STRENGTH
Yaowu Xuf883b422016-08-30 14:01:10 -0700937AOM_CTRL_USE_TYPE(AOME_SET_TUNING, int) /* aom_tune_metric */
938#define AOM_CTRL_AOME_SET_TUNING
939AOM_CTRL_USE_TYPE(AOME_SET_CQ_LEVEL, unsigned int)
940#define AOM_CTRL_AOME_SET_CQ_LEVEL
John Koleszar0ea50ce2010-05-18 11:58:33 -0400941
Yaowu Xuf883b422016-08-30 14:01:10 -0700942AOM_CTRL_USE_TYPE(AV1E_SET_TILE_COLUMNS, int)
943#define AOM_CTRL_AV1E_SET_TILE_COLUMNS
944AOM_CTRL_USE_TYPE(AV1E_SET_TILE_ROWS, int)
945#define AOM_CTRL_AV1E_SET_TILE_ROWS
Fangwen Fu7b9f2b32017-01-17 14:01:52 -0800946
Fangwen Fu7b9f2b32017-01-17 14:01:52 -0800947AOM_CTRL_USE_TYPE(AV1E_SET_TILE_DEPENDENT_ROWS, int)
948#define AOM_CTRL_AV1E_SET_TILE_DEPENDENT_ROWS
Fangwen Fu7b9f2b32017-01-17 14:01:52 -0800949
Lei7bb501d2017-12-13 15:10:34 -0800950AOM_CTRL_USE_TYPE(AV1E_SET_TILE_LOOPFILTER_V, int)
951#define AOM_CTRL_AV1E_SET_TILE_LOOPFILTER_V
952AOM_CTRL_USE_TYPE(AV1E_SET_TILE_LOOPFILTER_H, int)
953#define AOM_CTRL_AV1E_SET_TILE_LOOPFILTER_H
Ryan Lei7386eda2016-12-08 21:08:31 -0800954AOM_CTRL_USE_TYPE(AV1E_SET_TILE_LOOPFILTER, int)
955#define AOM_CTRL_AV1E_SET_TILE_LOOPFILTER
Ronald S. Bultje1407bdc2013-02-01 09:35:28 -0800956
Yaowu Xuf883b422016-08-30 14:01:10 -0700957AOM_CTRL_USE_TYPE(AOME_GET_LAST_QUANTIZER, int *)
958#define AOM_CTRL_AOME_GET_LAST_QUANTIZER
959AOM_CTRL_USE_TYPE(AOME_GET_LAST_QUANTIZER_64, int *)
960#define AOM_CTRL_AOME_GET_LAST_QUANTIZER_64
John Koleszar0ea50ce2010-05-18 11:58:33 -0400961
Yaowu Xuf883b422016-08-30 14:01:10 -0700962AOM_CTRL_USE_TYPE(AOME_SET_MAX_INTRA_BITRATE_PCT, unsigned int)
963#define AOM_CTRL_AOME_SET_MAX_INTRA_BITRATE_PCT
964AOM_CTRL_USE_TYPE(AOME_SET_MAX_INTER_BITRATE_PCT, unsigned int)
965#define AOM_CTRL_AOME_SET_MAX_INTER_BITRATE_PCT
John Koleszar1654ae92011-07-28 09:17:32 -0400966
Soo-Chul Hanf8589862018-01-24 03:13:14 +0000967AOM_CTRL_USE_TYPE(AOME_SET_NUMBER_SPATIAL_LAYERS, int)
968#define AOME_CTRL_AOME_SET_NUMBER_SPATIAL_LAYERS
969
Yaowu Xuf883b422016-08-30 14:01:10 -0700970AOM_CTRL_USE_TYPE(AV1E_SET_GF_CBR_BOOST_PCT, unsigned int)
971#define AOM_CTRL_AV1E_SET_GF_CBR_BOOST_PCT
Yaowu Xu41652902015-03-12 17:59:18 -0700972
Yaowu Xuf883b422016-08-30 14:01:10 -0700973AOM_CTRL_USE_TYPE(AV1E_SET_LOSSLESS, unsigned int)
974#define AOM_CTRL_AV1E_SET_LOSSLESS
John Koleszar1654ae92011-07-28 09:17:32 -0400975
Steinar Midtskogene44c6222017-11-09 13:22:09 +0100976AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_CDEF, unsigned int)
977#define AOM_CTRL_AV1E_SET_ENABLE_CDEF
978
Sebastien Alaiwan1ed20242018-02-20 14:47:18 +0100979AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_RESTORATION, unsigned int)
980#define AOM_CTRL_AV1E_SET_ENABLE_RESTORATION
981
Yaowu Xuf883b422016-08-30 14:01:10 -0700982AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_QM, unsigned int)
983#define AOM_CTRL_AV1E_SET_ENABLE_QM
Yaowu Xu0818a7c2016-08-11 09:39:47 -0700984
Yushin Chod808bfc2017-08-10 15:54:36 -0700985AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_DIST_8X8, unsigned int)
986#define AOM_CTRL_AV1E_SET_ENABLE_DIST_8X8
987
Yaowu Xuf883b422016-08-30 14:01:10 -0700988AOM_CTRL_USE_TYPE(AV1E_SET_QM_MIN, unsigned int)
989#define AOM_CTRL_AV1E_SET_QM_MIN
Yaowu Xu0818a7c2016-08-11 09:39:47 -0700990
Yaowu Xuf883b422016-08-30 14:01:10 -0700991AOM_CTRL_USE_TYPE(AV1E_SET_QM_MAX, unsigned int)
992#define AOM_CTRL_AV1E_SET_QM_MAX
Yaowu Xu0818a7c2016-08-11 09:39:47 -0700993
Yaowu Xuf7a12422018-01-31 15:29:20 -0800994AOM_CTRL_USE_TYPE(AV1E_SET_QM_Y, unsigned int)
995#define AOM_CTRL_AV1E_SET_QM_Y
996
997AOM_CTRL_USE_TYPE(AV1E_SET_QM_U, unsigned int)
998#define AOM_CTRL_AV1E_SET_QM_U
999
1000AOM_CTRL_USE_TYPE(AV1E_SET_QM_V, unsigned int)
1001#define AOM_CTRL_AV1E_SET_QM_V
1002
Thomas Daviesaf6df172016-11-09 14:04:18 +00001003AOM_CTRL_USE_TYPE(AV1E_SET_NUM_TG, unsigned int)
1004#define AOM_CTRL_AV1E_SET_NUM_TG
1005AOM_CTRL_USE_TYPE(AV1E_SET_MTU, unsigned int)
1006#define AOM_CTRL_AV1E_SET_MTU
Thomas Daviesaf6df172016-11-09 14:04:18 +00001007
Andrey Norkin28e9ce22018-01-08 10:11:21 -08001008AOM_CTRL_USE_TYPE(AV1E_SET_TIMING_INFO, aom_timing_info_t)
1009#define AOM_CTRL_AV1E_SET_TIMING_INFO
1010
Fangwen Fu8d164de2016-12-14 13:40:54 -08001011AOM_CTRL_USE_TYPE(AV1E_SET_DISABLE_TEMPMV, unsigned int)
1012#define AOM_CTRL_AV1E_SET_DISABLE_TEMPMV
Fangwen Fu8d164de2016-12-14 13:40:54 -08001013
Jingning Hana446f552018-02-22 15:42:12 -08001014AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_DF, unsigned int)
1015#define AOM_CTRL_AV1E_SET_ENABLE_DF
1016
Cheng Chenfecd9a72018-03-08 15:23:51 -08001017AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_ORDER_HINT, unsigned int)
1018#define AOM_CTRL_AV1E_SET_ENABLE_ORDER_HINT
1019
Cheng Chene0c918a2018-02-22 19:38:31 -08001020AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_JNT_COMP, unsigned int)
1021#define AOM_CTRL_AV1E_SET_ENABLE_JNT_COMP
1022
Urvang Joshi2c92b072018-03-19 17:23:31 -07001023AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_SUPERRES, unsigned int)
1024#define AOM_CTRL_AV1E_SET_ENABLE_SUPERRES
1025
Yaowu Xuf883b422016-08-30 14:01:10 -07001026AOM_CTRL_USE_TYPE(AV1E_SET_FRAME_PARALLEL_DECODING, unsigned int)
1027#define AOM_CTRL_AV1E_SET_FRAME_PARALLEL_DECODING
Ivan Maltz01b35c32013-09-05 08:55:47 -07001028
Debargha Mukherjee921cc4c2018-03-24 12:01:12 -07001029AOM_CTRL_USE_TYPE(AV1E_SET_ERROR_RESILIENT_MODE, unsigned int)
1030#define AOM_CTRL_AV1E_SET_ERROR_RESILIENT_MODE
1031
Yaowu Xuf883b422016-08-30 14:01:10 -07001032AOM_CTRL_USE_TYPE(AV1E_SET_AQ_MODE, unsigned int)
1033#define AOM_CTRL_AV1E_SET_AQ_MODE
Guillaume Martres17084652013-11-14 19:23:57 +01001034
Fangwen Fu6160df22017-04-24 09:45:51 -07001035AOM_CTRL_USE_TYPE(AV1E_SET_DELTAQ_MODE, unsigned int)
1036#define AOM_CTRL_AV1E_SET_DELTAQ_MODE
1037
Yaowu Xuf883b422016-08-30 14:01:10 -07001038AOM_CTRL_USE_TYPE(AV1E_SET_FRAME_PERIODIC_BOOST, unsigned int)
1039#define AOM_CTRL_AV1E_SET_FRAME_PERIODIC_BOOST
Marco Paniconi0eb88c92014-04-03 15:49:03 -07001040
Yaowu Xuf883b422016-08-30 14:01:10 -07001041AOM_CTRL_USE_TYPE(AV1E_SET_NOISE_SENSITIVITY, unsigned int)
1042#define AOM_CTRL_AV1E_SET_NOISE_SENSITIVITY
JackyChenbb1a2362014-09-12 11:48:44 -07001043
Yaowu Xuf883b422016-08-30 14:01:10 -07001044AOM_CTRL_USE_TYPE(AV1E_SET_TUNE_CONTENT, int) /* aom_tune_content */
1045#define AOM_CTRL_AV1E_SET_TUNE_CONTENT
Yaowu Xue94b4152015-01-13 10:07:20 -08001046
Andrey Norkin9e694632017-12-21 18:50:57 -08001047AOM_CTRL_USE_TYPE(AV1E_SET_COLOR_PRIMARIES, int)
1048#define AOM_CTRL_AV1E_SET_COLOR_PRIMARIES
1049
1050AOM_CTRL_USE_TYPE(AV1E_SET_TRANSFER_CHARACTERISTICS, int)
1051#define AOM_CTRL_AV1E_SET_TRANSFER_CHARACTERISTICS
1052
1053AOM_CTRL_USE_TYPE(AV1E_SET_MATRIX_COEFFICIENTS, int)
1054#define AOM_CTRL_AV1E_SET_MATRIX_COEFFICIENTS
1055
Yaowu Xuf883b422016-08-30 14:01:10 -07001056AOM_CTRL_USE_TYPE(AV1E_SET_COLOR_SPACE, int)
1057#define AOM_CTRL_AV1E_SET_COLOR_SPACE
Alex Converse4dcb8392015-03-20 14:55:43 -07001058
anorkin76fb1262017-03-22 15:12:12 -07001059AOM_CTRL_USE_TYPE(AV1E_SET_TRANSFER_FUNCTION, int)
1060#define AOM_CTRL_AV1E_SET_TRANSFER_FUNCTION
1061
1062AOM_CTRL_USE_TYPE(AV1E_SET_CHROMA_SAMPLE_POSITION, int)
1063#define AOM_CTRL_AV1E_SET_CHROMA_SAMPLE_POSITION
anorkin76fb1262017-03-22 15:12:12 -07001064
Yaowu Xuf883b422016-08-30 14:01:10 -07001065AOM_CTRL_USE_TYPE(AV1E_SET_MIN_GF_INTERVAL, unsigned int)
1066#define AOM_CTRL_AV1E_SET_MIN_GF_INTERVAL
Debargha Mukherjee98526432015-04-01 16:39:06 -07001067
Yaowu Xuf883b422016-08-30 14:01:10 -07001068AOM_CTRL_USE_TYPE(AV1E_SET_MAX_GF_INTERVAL, unsigned int)
1069#define AOM_CTRL_AV1E_SET_MAX_GF_INTERVAL
Debargha Mukherjee98526432015-04-01 16:39:06 -07001070
Yaowu Xuf883b422016-08-30 14:01:10 -07001071AOM_CTRL_USE_TYPE(AV1E_GET_ACTIVEMAP, aom_active_map_t *)
1072#define AOM_CTRL_AV1E_GET_ACTIVEMAP
Ronald S. Bultjeeeb5ef02015-09-15 21:56:51 -04001073
Yaowu Xuf883b422016-08-30 14:01:10 -07001074AOM_CTRL_USE_TYPE(AV1E_SET_COLOR_RANGE, int)
1075#define AOM_CTRL_AV1E_SET_COLOR_RANGE
Yaowu Xu7c514e22015-09-28 15:55:46 -07001076
Yaowu Xu7c514e22015-09-28 15:55:46 -07001077/*!\brief
1078 *
1079 * TODO(rbultje) : add support of the control in ffmpeg
1080 */
Yaowu Xuf883b422016-08-30 14:01:10 -07001081#define AOM_CTRL_AV1E_SET_RENDER_SIZE
1082AOM_CTRL_USE_TYPE(AV1E_SET_RENDER_SIZE, int *)
Geza Lore454989f2016-03-24 13:56:05 +00001083
Yaowu Xuf883b422016-08-30 14:01:10 -07001084AOM_CTRL_USE_TYPE(AV1E_SET_SUPERBLOCK_SIZE, unsigned int)
1085#define AOM_CTRL_AV1E_SET_SUPERBLOCK_SIZE
James Zern7dd7a7d2015-10-09 16:31:17 -07001086
Yaowu Xuf883b422016-08-30 14:01:10 -07001087AOM_CTRL_USE_TYPE(AV1E_SET_TARGET_LEVEL, unsigned int)
1088#define AOM_CTRL_AV1E_SET_TARGET_LEVEL
hui sube3f0692016-05-05 15:37:37 -07001089
Yaowu Xuf883b422016-08-30 14:01:10 -07001090AOM_CTRL_USE_TYPE(AV1E_GET_LEVEL, int *)
1091#define AOM_CTRL_AV1E_GET_LEVEL
Alex Converseeb780e72016-12-13 12:46:41 -08001092
1093AOM_CTRL_USE_TYPE(AV1E_SET_ANS_WINDOW_SIZE_LOG2, unsigned int)
1094#define AOM_CTRL_AV1E_SET_ANS_WINDOW_SIZE_LOG2
Yunqing Wangd8cd55f2017-02-27 12:16:00 -08001095
Yunqing Wangeeb08a92017-07-07 21:25:18 -07001096AOM_CTRL_USE_TYPE(AV1E_SET_SINGLE_TILE_DECODING, unsigned int)
1097#define AOM_CTRL_AV1E_SET_SINGLE_TILE_DECODING
Yunqing Wangff4fa062017-04-21 10:56:08 -07001098
1099AOM_CTRL_USE_TYPE(AV1E_ENABLE_MOTION_VECTOR_UNIT_TEST, unsigned int)
1100#define AOM_CTRL_AV1E_ENABLE_MOTION_VECTOR_UNIT_TEST
1101
Andrey Norkin6f1c2f72018-01-15 20:08:52 -08001102AOM_CTRL_USE_TYPE(AV1E_SET_FILM_GRAIN_TEST_VECTOR, unsigned int)
1103#define AOM_CTRL_AV1E_SET_FILM_GRAIN_TEST_VECTOR
1104
Neil Birkbeckeb895ef2018-03-14 17:51:03 -07001105AOM_CTRL_USE_TYPE(AV1E_SET_FILM_GRAIN_TABLE, const char *)
1106#define AOM_CTRL_AV1E_SET_FILM_GRAIN_TABLE
1107
Hui Su1cb1c002018-02-05 18:21:20 -08001108AOM_CTRL_USE_TYPE(AV1E_SET_CDF_UPDATE_MODE, int)
1109#define AOM_CTRL_AV1E_SET_CDF_UPDATE_MODE
1110
James Zern7dd7a7d2015-10-09 16:31:17 -07001111/*!\endcond */
Alex Conversec77b2ff2016-12-12 17:29:32 -08001112/*! @} - end defgroup aom_encoder */
Dmitry Kovaleve288c602013-09-29 18:00:15 -07001113#ifdef __cplusplus
1114} // extern "C"
1115#endif
1116
Yaowu Xuf883b422016-08-30 14:01:10 -07001117#endif // AOM_AOMCX_H_