John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 1 | /* |
John Koleszar | c2140b8 | 2010-09-09 08:16:39 -0400 | [diff] [blame] | 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 3 | * |
John Koleszar | 94c52e4 | 2010-06-18 12:39:21 -0400 | [diff] [blame] | 4 | * Use of this source code is governed by a BSD-style license |
John Koleszar | 09202d8 | 2010-06-04 16:19:40 -0400 | [diff] [blame] | 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
John Koleszar | 94c52e4 | 2010-06-18 12:39:21 -0400 | [diff] [blame] | 7 | * in the file PATENTS. All contributing project authors may |
John Koleszar | 09202d8 | 2010-06-04 16:19:40 -0400 | [diff] [blame] | 8 | * be found in the AUTHORS file in the root of the source tree. |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 9 | */ |
James Zern | 7386bde | 2013-12-15 18:26:15 -0800 | [diff] [blame] | 10 | #ifndef VPX_VP8CX_H_ |
| 11 | #define VPX_VP8CX_H_ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 12 | |
Yaowu Xu | f5bbe24 | 2015-01-15 14:32:42 -0800 | [diff] [blame] | 13 | /*!\defgroup vp8_encoder WebM VP8/VP9 Encoder |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 14 | * \ingroup vp8 |
| 15 | * |
| 16 | * @{ |
| 17 | */ |
Johann | e883c74 | 2013-12-16 13:15:26 -0800 | [diff] [blame] | 18 | #include "./vp8.h" |
James Zern | 7999c07 | 2015-03-23 16:07:21 -0700 | [diff] [blame] | 19 | #include "./vpx_encoder.h" |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 20 | |
James Zern | f42d52e | 2011-02-16 17:54:49 -0800 | [diff] [blame] | 21 | /*!\file |
Yaowu Xu | f5bbe24 | 2015-01-15 14:32:42 -0800 | [diff] [blame] | 22 | * \brief Provides definitions for using VP8 or VP9 encoder algorithm within the |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 23 | * vpx Codec Interface. |
| 24 | */ |
Dmitry Kovalev | e288c60 | 2013-09-29 18:00:15 -0700 | [diff] [blame] | 25 | |
| 26 | #ifdef __cplusplus |
| 27 | extern "C" { |
| 28 | #endif |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 29 | |
James Zern | 8e17e82 | 2011-02-24 14:12:57 -0800 | [diff] [blame] | 30 | /*!\name Algorithm interface for VP8 |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 31 | * |
Yaowu Xu | f5bbe24 | 2015-01-15 14:32:42 -0800 | [diff] [blame] | 32 | * This interface provides the capability to encode raw VP8 streams. |
James Zern | 8e17e82 | 2011-02-24 14:12:57 -0800 | [diff] [blame] | 33 | * @{ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 34 | */ |
John Koleszar | fa7a55b | 2010-09-21 10:35:52 -0400 | [diff] [blame] | 35 | extern vpx_codec_iface_t vpx_codec_vp8_cx_algo; |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 36 | extern vpx_codec_iface_t *vpx_codec_vp8_cx(void); |
Yaowu Xu | f5bbe24 | 2015-01-15 14:32:42 -0800 | [diff] [blame] | 37 | /*!@} - end algorithm interface member group*/ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 38 | |
Yaowu Xu | f5bbe24 | 2015-01-15 14:32:42 -0800 | [diff] [blame] | 39 | /*!\name Algorithm interface for VP9 |
| 40 | * |
| 41 | * This interface provides the capability to encode raw VP9 streams. |
| 42 | * @{ |
| 43 | */ |
John Koleszar | a9c7597 | 2012-11-08 17:09:30 -0800 | [diff] [blame] | 44 | extern vpx_codec_iface_t vpx_codec_vp9_cx_algo; |
| 45 | extern vpx_codec_iface_t *vpx_codec_vp9_cx(void); |
John Koleszar | 83b1d90 | 2012-11-05 12:37:14 -0800 | [diff] [blame] | 46 | /*!@} - end algorithm interface member group*/ |
John Koleszar | 0952acb | 2010-06-01 11:14:25 -0400 | [diff] [blame] | 47 | |
Jingning Han | 3ee6db6 | 2015-08-05 19:00:31 -0700 | [diff] [blame] | 48 | /*!\name Algorithm interface for VP10 |
| 49 | * |
| 50 | * This interface provides the capability to encode raw VP9 streams. |
| 51 | * @{ |
| 52 | */ |
| 53 | extern vpx_codec_iface_t vpx_codec_vp10_cx_algo; |
| 54 | extern vpx_codec_iface_t *vpx_codec_vp10_cx(void); |
| 55 | /*!@} - end algorithm interface member group*/ |
John Koleszar | 0952acb | 2010-06-01 11:14:25 -0400 | [diff] [blame] | 56 | |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 57 | /* |
| 58 | * Algorithm Flags |
| 59 | */ |
| 60 | |
| 61 | /*!\brief Don't reference the last frame |
| 62 | * |
| 63 | * When this flag is set, the encoder will not use the last frame as a |
| 64 | * predictor. When not set, the encoder will choose whether to use the |
| 65 | * last frame or not automatically. |
| 66 | */ |
| 67 | #define VP8_EFLAG_NO_REF_LAST (1<<16) |
| 68 | |
| 69 | |
| 70 | /*!\brief Don't reference the golden frame |
| 71 | * |
| 72 | * When this flag is set, the encoder will not use the golden frame as a |
| 73 | * predictor. When not set, the encoder will choose whether to use the |
| 74 | * golden frame or not automatically. |
| 75 | */ |
| 76 | #define VP8_EFLAG_NO_REF_GF (1<<17) |
| 77 | |
| 78 | |
| 79 | /*!\brief Don't reference the alternate reference frame |
| 80 | * |
| 81 | * When this flag is set, the encoder will not use the alt ref frame as a |
| 82 | * predictor. When not set, the encoder will choose whether to use the |
| 83 | * alt ref frame or not automatically. |
| 84 | */ |
| 85 | #define VP8_EFLAG_NO_REF_ARF (1<<21) |
| 86 | |
| 87 | |
| 88 | /*!\brief Don't update the last frame |
| 89 | * |
| 90 | * When this flag is set, the encoder will not update the last frame with |
| 91 | * the contents of the current frame. |
| 92 | */ |
| 93 | #define VP8_EFLAG_NO_UPD_LAST (1<<18) |
| 94 | |
| 95 | |
| 96 | /*!\brief Don't update the golden frame |
| 97 | * |
| 98 | * When this flag is set, the encoder will not update the golden frame with |
| 99 | * the contents of the current frame. |
| 100 | */ |
| 101 | #define VP8_EFLAG_NO_UPD_GF (1<<22) |
| 102 | |
| 103 | |
| 104 | /*!\brief Don't update the alternate reference frame |
| 105 | * |
| 106 | * When this flag is set, the encoder will not update the alt ref frame with |
| 107 | * the contents of the current frame. |
| 108 | */ |
| 109 | #define VP8_EFLAG_NO_UPD_ARF (1<<23) |
| 110 | |
| 111 | |
| 112 | /*!\brief Force golden frame update |
| 113 | * |
| 114 | * When this flag is set, the encoder copy the contents of the current frame |
| 115 | * to the golden frame buffer. |
| 116 | */ |
| 117 | #define VP8_EFLAG_FORCE_GF (1<<19) |
| 118 | |
| 119 | |
| 120 | /*!\brief Force alternate reference frame update |
| 121 | * |
| 122 | * When this flag is set, the encoder copy the contents of the current frame |
| 123 | * to the alternate reference frame buffer. |
| 124 | */ |
| 125 | #define VP8_EFLAG_FORCE_ARF (1<<24) |
| 126 | |
| 127 | |
| 128 | /*!\brief Disable entropy update |
| 129 | * |
| 130 | * When this flag is set, the encoder will not update its internal entropy |
| 131 | * model based on the entropy of this frame. |
| 132 | */ |
| 133 | #define VP8_EFLAG_NO_UPD_ENTROPY (1<<20) |
| 134 | |
| 135 | |
Yaowu Xu | 4165290 | 2015-03-12 17:59:18 -0700 | [diff] [blame] | 136 | /*!\brief VPx encoder control functions |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 137 | * |
Yaowu Xu | 4165290 | 2015-03-12 17:59:18 -0700 | [diff] [blame] | 138 | * This set of macros define the control functions available for VPx |
James Zern | 8e17e82 | 2011-02-24 14:12:57 -0800 | [diff] [blame] | 139 | * encoder interface. |
| 140 | * |
| 141 | * \sa #vpx_codec_control |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 142 | */ |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 143 | enum vp8e_enc_control_id { |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 144 | /*!\brief Codec control function to pass an ROI map to encoder. |
| 145 | * |
| 146 | * Supported in codecs: VP8, VP9 |
| 147 | */ |
James Zern | a046f56 | 2015-10-16 16:47:38 -0700 | [diff] [blame] | 148 | VP8E_SET_ROI_MAP = 8, |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 149 | |
| 150 | /*!\brief Codec control function to pass an Active map to encoder. |
| 151 | * |
| 152 | * Supported in codecs: VP8, VP9 |
| 153 | */ |
| 154 | VP8E_SET_ACTIVEMAP, |
| 155 | |
| 156 | /*!\brief Codec control function to set encoder scaling mode. |
| 157 | * |
| 158 | * Supported in codecs: VP8, VP9 |
| 159 | */ |
| 160 | VP8E_SET_SCALEMODE = 11, |
| 161 | |
| 162 | /*!\brief Codec control function to set encoder internal speed settings. |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 163 | * |
| 164 | * Changes in this value influences, among others, the encoder's selection |
| 165 | * of motion estimation methods. Values greater than 0 will increase encoder |
| 166 | * speed at the expense of quality. |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 167 | * |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 168 | * \note Valid range for VP8: -16..16 |
| 169 | * \note Valid range for VP9: -8..8 |
| 170 | * |
| 171 | * Supported in codecs: VP8, VP9 |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 172 | */ |
| 173 | VP8E_SET_CPUUSED = 13, |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 174 | |
| 175 | /*!\brief Codec control function to enable automatic set and use alf frames. |
| 176 | * |
| 177 | * Supported in codecs: VP8, VP9 |
| 178 | */ |
| 179 | VP8E_SET_ENABLEAUTOALTREF, |
| 180 | |
JackyChen | bb1a236 | 2014-09-12 11:48:44 -0700 | [diff] [blame] | 181 | /*!\brief control function to set noise sensitivity |
| 182 | * |
| 183 | * 0: off, 1: OnYOnly, 2: OnYUV, |
| 184 | * 3: OnYUVAggressive, 4: Adaptive |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 185 | * |
| 186 | * Supported in codecs: VP8 |
JackyChen | bb1a236 | 2014-09-12 11:48:44 -0700 | [diff] [blame] | 187 | */ |
| 188 | VP8E_SET_NOISE_SENSITIVITY, |
Adrian Grange | a765705 | 2014-05-05 11:31:55 -0700 | [diff] [blame] | 189 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 190 | /*!\brief Codec control function to set sharpness. |
| 191 | * |
| 192 | * Supported in codecs: VP8, VP9 |
| 193 | */ |
| 194 | VP8E_SET_SHARPNESS, |
| 195 | |
| 196 | /*!\brief Codec control function to set the threshold for MBs treated static. |
| 197 | * |
| 198 | * Supported in codecs: VP8, VP9 |
| 199 | */ |
| 200 | VP8E_SET_STATIC_THRESHOLD, |
| 201 | |
| 202 | /*!\brief Codec control function to set the number of token partitions. |
| 203 | * |
| 204 | * Supported in codecs: VP8 |
| 205 | */ |
| 206 | VP8E_SET_TOKEN_PARTITIONS, |
| 207 | |
| 208 | /*!\brief Codec control function to get last quantizer chosen by the encoder. |
| 209 | * |
| 210 | * Return value uses internal quantizer scale defined by the codec. |
| 211 | * |
| 212 | * Supported in codecs: VP8, VP9 |
| 213 | */ |
| 214 | VP8E_GET_LAST_QUANTIZER, |
| 215 | |
| 216 | /*!\brief Codec control function to get last quantizer chosen by the encoder. |
| 217 | * |
| 218 | * Return value uses the 0..63 scale as used by the rc_*_quantizer config |
| 219 | * parameters. |
| 220 | * |
| 221 | * Supported in codecs: VP8, VP9 |
| 222 | */ |
| 223 | VP8E_GET_LAST_QUANTIZER_64, |
| 224 | |
| 225 | /*!\brief Codec control function to set the max no of frames to create arf. |
| 226 | * |
| 227 | * Supported in codecs: VP8, VP9 |
| 228 | */ |
| 229 | VP8E_SET_ARNR_MAXFRAMES, |
| 230 | |
| 231 | /*!\brief Codec control function to set the filter strength for the arf. |
| 232 | * |
| 233 | * Supported in codecs: VP8, VP9 |
| 234 | */ |
| 235 | VP8E_SET_ARNR_STRENGTH, |
| 236 | |
| 237 | /*!\deprecated control function to set the filter type to use for the arf. */ |
Adrian Grange | a765705 | 2014-05-05 11:31:55 -0700 | [diff] [blame] | 238 | VP8E_SET_ARNR_TYPE, |
| 239 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 240 | /*!\brief Codec control function to set visual tuning. |
| 241 | * |
| 242 | * Supported in codecs: VP8, VP9 |
| 243 | */ |
| 244 | VP8E_SET_TUNING, |
| 245 | |
| 246 | /*!\brief Codec control function to set constrained quality level. |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 247 | * |
| 248 | * \attention For this value to be used vpx_codec_enc_cfg_t::g_usage must be |
| 249 | * set to #VPX_CQ. |
| 250 | * \note Valid range: 0..63 |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 251 | * |
| 252 | * Supported in codecs: VP8, VP9 |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 253 | */ |
| 254 | VP8E_SET_CQ_LEVEL, |
John Koleszar | 1654ae9 | 2011-07-28 09:17:32 -0400 | [diff] [blame] | 255 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 256 | /*!\brief Codec control function to set Max data rate for Intra frames. |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 257 | * |
| 258 | * This value controls additional clamping on the maximum size of a |
| 259 | * keyframe. It is expressed as a percentage of the average |
| 260 | * per-frame bitrate, with the special (and default) value 0 meaning |
| 261 | * unlimited, or no additional clamping beyond the codec's built-in |
| 262 | * algorithm. |
| 263 | * |
| 264 | * For example, to allocate no more than 4.5 frames worth of bitrate |
| 265 | * to a keyframe, set this to 450. |
| 266 | * |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 267 | * Supported in codecs: VP8, VP9 |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 268 | */ |
| 269 | VP8E_SET_MAX_INTRA_BITRATE_PCT, |
John Koleszar | 83b1d90 | 2012-11-05 12:37:14 -0800 | [diff] [blame] | 270 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 271 | /*!\brief Codec control function to set reference and update frame flags. |
| 272 | * |
| 273 | * Supported in codecs: VP8 |
| 274 | */ |
| 275 | VP8E_SET_FRAME_FLAGS, |
| 276 | |
| 277 | /*!\brief Codec control function to set max data rate for Inter frames. |
Yaowu Xu | 636099f | 2014-10-24 09:31:16 -0700 | [diff] [blame] | 278 | * |
| 279 | * This value controls additional clamping on the maximum size of an |
| 280 | * inter frame. It is expressed as a percentage of the average |
| 281 | * per-frame bitrate, with the special (and default) value 0 meaning |
| 282 | * unlimited, or no additional clamping beyond the codec's built-in |
| 283 | * algorithm. |
| 284 | * |
| 285 | * For example, to allow no more than 4.5 frames worth of bitrate |
| 286 | * to an inter frame, set this to 450. |
| 287 | * |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 288 | * Supported in codecs: VP9 |
Yaowu Xu | 636099f | 2014-10-24 09:31:16 -0700 | [diff] [blame] | 289 | */ |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 290 | VP9E_SET_MAX_INTER_BITRATE_PCT, |
Yaowu Xu | 636099f | 2014-10-24 09:31:16 -0700 | [diff] [blame] | 291 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 292 | /*!\brief Boost percentage for Golden Frame in CBR mode. |
Yaowu Xu | 03a60b7 | 2014-10-27 13:13:14 -0700 | [diff] [blame] | 293 | * |
| 294 | * This value controls the amount of boost given to Golden Frame in |
| 295 | * CBR mode. It is expressed as a percentage of the average |
| 296 | * per-frame bitrate, with the special (and default) value 0 meaning |
| 297 | * the feature is off, i.e., no golden frame boost in CBR mode and |
| 298 | * average bitrate target is used. |
| 299 | * |
| 300 | * For example, to allow 100% more bits, i.e, 2X, in a golden frame |
| 301 | * than average frame, set this to 100. |
| 302 | * |
Yaowu Xu | 4165290 | 2015-03-12 17:59:18 -0700 | [diff] [blame] | 303 | * Supported in codecs: VP9 |
Yaowu Xu | 03a60b7 | 2014-10-27 13:13:14 -0700 | [diff] [blame] | 304 | */ |
Yaowu Xu | 4165290 | 2015-03-12 17:59:18 -0700 | [diff] [blame] | 305 | VP9E_SET_GF_CBR_BOOST_PCT, |
John Koleszar | 83b1d90 | 2012-11-05 12:37:14 -0800 | [diff] [blame] | 306 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 307 | /*!\brief Codec control function to set the temporal layer id. |
Marco | af898b5 | 2014-11-10 13:07:05 -0800 | [diff] [blame] | 308 | * |
| 309 | * For temporal scalability: this control allows the application to set the |
| 310 | * layer id for each frame to be encoded. Note that this control must be set |
| 311 | * for every frame prior to encoding. The usage of this control function |
| 312 | * supersedes the internal temporal pattern counter, which is now deprecated. |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 313 | * |
| 314 | * Supported in codecs: VP8 |
Marco | af898b5 | 2014-11-10 13:07:05 -0800 | [diff] [blame] | 315 | */ |
| 316 | VP8E_SET_TEMPORAL_LAYER_ID, |
| 317 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 318 | /*!\brief Codec control function to set encoder screen content mode. |
| 319 | * |
Marco | 976f7f4 | 2015-04-28 08:29:48 -0700 | [diff] [blame] | 320 | * 0: off, 1: On, 2: On with more aggressive rate control. |
| 321 | * |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 322 | * Supported in codecs: VP8 |
| 323 | */ |
| 324 | VP8E_SET_SCREEN_CONTENT_MODE, |
Marco | af898b5 | 2014-11-10 13:07:05 -0800 | [diff] [blame] | 325 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 326 | /*!\brief Codec control function to set lossless encoding mode. |
Yaowu Xu | 87c436f | 2015-01-13 12:39:42 -0800 | [diff] [blame] | 327 | * |
| 328 | * VP9 can operate in lossless encoding mode, in which the bitstream |
| 329 | * produced will be able to decode and reconstruct a perfect copy of |
| 330 | * input source. This control function provides a mean to switch encoder |
| 331 | * into lossless coding mode(1) or normal coding mode(0) that may be lossy. |
| 332 | * 0 = lossy coding mode |
| 333 | * 1 = lossless coding mode |
| 334 | * |
| 335 | * By default, encoder operates in normal coding mode (maybe lossy). |
Yaowu Xu | 5dd146c | 2015-03-12 18:14:43 -0700 | [diff] [blame] | 336 | * |
| 337 | * Supported in codecs: VP9 |
Yaowu Xu | 87c436f | 2015-01-13 12:39:42 -0800 | [diff] [blame] | 338 | */ |
Ronald S. Bultje | 1407bdc | 2013-02-01 09:35:28 -0800 | [diff] [blame] | 339 | VP9E_SET_LOSSLESS, |
Yaowu Xu | 87c436f | 2015-01-13 12:39:42 -0800 | [diff] [blame] | 340 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 341 | /*!\brief Codec control function to set number of tile columns. |
Yaowu Xu | 87c436f | 2015-01-13 12:39:42 -0800 | [diff] [blame] | 342 | * |
| 343 | * In encoding and decoding, VP9 allows an input image frame be partitioned |
| 344 | * into separated vertical tile columns, which can be encoded or decoded |
| 345 | * independently. This enables easy implementation of parallel encoding and |
| 346 | * decoding. This control requests the encoder to use column tiles in |
| 347 | * encoding an input frame, with number of tile columns (in Log2 unit) as |
| 348 | * the parameter: |
| 349 | * 0 = 1 tile column |
| 350 | * 1 = 2 tile columns |
| 351 | * 2 = 4 tile columns |
| 352 | * ..... |
| 353 | * n = 2**n tile columns |
| 354 | * The requested tile columns will be capped by encoder based on image size |
| 355 | * limitation (The minimum width of a tile column is 256 pixel, the maximum |
| 356 | * is 4096). |
| 357 | * |
| 358 | * By default, the value is 0, i.e. one single column tile for entire image. |
Yaowu Xu | 5dd146c | 2015-03-12 18:14:43 -0700 | [diff] [blame] | 359 | * |
| 360 | * Supported in codecs: VP9 |
Yaowu Xu | 87c436f | 2015-01-13 12:39:42 -0800 | [diff] [blame] | 361 | */ |
Ronald S. Bultje | 89a206e | 2013-02-08 11:33:11 -0800 | [diff] [blame] | 362 | VP9E_SET_TILE_COLUMNS, |
Yaowu Xu | 87c436f | 2015-01-13 12:39:42 -0800 | [diff] [blame] | 363 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 364 | /*!\brief Codec control function to set number of tile rows. |
Yaowu Xu | 87c436f | 2015-01-13 12:39:42 -0800 | [diff] [blame] | 365 | * |
| 366 | * In encoding and decoding, VP9 allows an input image frame be partitioned |
| 367 | * into separated horizontal tile rows. Tile rows are encoded or decoded |
| 368 | * sequentially. Even though encoding/decoding of later tile rows depends on |
| 369 | * earlier ones, this allows the encoder to output data packets for tile rows |
| 370 | * prior to completely processing all tile rows in a frame, thereby reducing |
| 371 | * the latency in processing between input and output. The parameter |
| 372 | * for this control describes the number of tile rows, which has a valid |
| 373 | * range [0, 2]: |
| 374 | * 0 = 1 tile row |
| 375 | * 1 = 2 tile rows |
| 376 | * 2 = 4 tile rows |
| 377 | * |
| 378 | * By default, the value is 0, i.e. one single row tile for entire image. |
Yaowu Xu | 5dd146c | 2015-03-12 18:14:43 -0700 | [diff] [blame] | 379 | * |
| 380 | * Supported in codecs: VP9 |
Yaowu Xu | 87c436f | 2015-01-13 12:39:42 -0800 | [diff] [blame] | 381 | */ |
Ronald S. Bultje | 89a206e | 2013-02-08 11:33:11 -0800 | [diff] [blame] | 382 | VP9E_SET_TILE_ROWS, |
Yaowu Xu | 87c436f | 2015-01-13 12:39:42 -0800 | [diff] [blame] | 383 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 384 | /*!\brief Codec control function to enable frame parallel decoding feature. |
Yaowu Xu | 87c436f | 2015-01-13 12:39:42 -0800 | [diff] [blame] | 385 | * |
| 386 | * VP9 has a bitstream feature to reduce decoding dependency between frames |
| 387 | * by turning off backward update of probability context used in encoding |
| 388 | * and decoding. This allows staged parallel processing of more than one |
| 389 | * video frames in the decoder. This control function provides a mean to |
| 390 | * turn this feature on or off for bitstreams produced by encoder. |
| 391 | * |
| 392 | * By default, this feature is off. |
Yaowu Xu | 5dd146c | 2015-03-12 18:14:43 -0700 | [diff] [blame] | 393 | * |
| 394 | * Supported in codecs: VP9 |
Yaowu Xu | 87c436f | 2015-01-13 12:39:42 -0800 | [diff] [blame] | 395 | */ |
Ivan Maltz | 01b35c3 | 2013-09-05 08:55:47 -0700 | [diff] [blame] | 396 | VP9E_SET_FRAME_PARALLEL_DECODING, |
Yaowu Xu | 87c436f | 2015-01-13 12:39:42 -0800 | [diff] [blame] | 397 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 398 | /*!\brief Codec control function to set adaptive quantization mode. |
Yaowu Xu | 87c436f | 2015-01-13 12:39:42 -0800 | [diff] [blame] | 399 | * |
| 400 | * VP9 has a segment based feature that allows encoder to adaptively change |
| 401 | * quantization parameter for each segment within a frame to improve the |
| 402 | * subjective quality. This control makes encoder operate in one of the |
| 403 | * several AQ_modes supported. |
| 404 | * |
| 405 | * By default, encoder operates with AQ_Mode 0(adaptive quantization off). |
Yaowu Xu | 5dd146c | 2015-03-12 18:14:43 -0700 | [diff] [blame] | 406 | * |
| 407 | * Supported in codecs: VP9 |
Yaowu Xu | 87c436f | 2015-01-13 12:39:42 -0800 | [diff] [blame] | 408 | */ |
Guillaume Martres | 1708465 | 2013-11-14 19:23:57 +0100 | [diff] [blame] | 409 | VP9E_SET_AQ_MODE, |
Yaowu Xu | 4ab39e1 | 2015-01-14 09:07:02 -0800 | [diff] [blame] | 410 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 411 | /*!\brief Codec control function to enable/disable periodic Q boost. |
Yaowu Xu | 4ab39e1 | 2015-01-14 09:07:02 -0800 | [diff] [blame] | 412 | * |
| 413 | * One VP9 encoder speed feature is to enable quality boost by lowering |
| 414 | * frame level Q periodically. This control function provides a mean to |
| 415 | * turn on/off this feature. |
| 416 | * 0 = off |
| 417 | * 1 = on |
| 418 | * |
| 419 | * By default, the encoder is allowed to use this feature for appropriate |
| 420 | * encoding modes. |
Yaowu Xu | 5dd146c | 2015-03-12 18:14:43 -0700 | [diff] [blame] | 421 | * |
| 422 | * Supported in codecs: VP9 |
Yaowu Xu | 4ab39e1 | 2015-01-14 09:07:02 -0800 | [diff] [blame] | 423 | */ |
Marco Paniconi | 0eb88c9 | 2014-04-03 15:49:03 -0700 | [diff] [blame] | 424 | VP9E_SET_FRAME_PERIODIC_BOOST, |
Yaowu Xu | 4ab39e1 | 2015-01-14 09:07:02 -0800 | [diff] [blame] | 425 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 426 | /*!\brief Codec control function to set noise sensitivity. |
JackyChen | bb1a236 | 2014-09-12 11:48:44 -0700 | [diff] [blame] | 427 | * |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 428 | * 0: off, 1: On(YOnly) |
Yaowu Xu | 5dd146c | 2015-03-12 18:14:43 -0700 | [diff] [blame] | 429 | * |
| 430 | * Supported in codecs: VP9 |
JackyChen | bb1a236 | 2014-09-12 11:48:44 -0700 | [diff] [blame] | 431 | */ |
| 432 | VP9E_SET_NOISE_SENSITIVITY, |
Ivan Maltz | 01b35c3 | 2013-09-05 08:55:47 -0700 | [diff] [blame] | 433 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 434 | /*!\brief Codec control function to turn on/off SVC in encoder. |
Yaowu Xu | 3ca15a8 | 2015-01-14 12:02:46 -0800 | [diff] [blame] | 435 | * \note Return value is VPX_CODEC_INVALID_PARAM if the encoder does not |
| 436 | * support SVC in its current encoding mode |
| 437 | * 0: off, 1: on |
Yaowu Xu | 5dd146c | 2015-03-12 18:14:43 -0700 | [diff] [blame] | 438 | * |
| 439 | * Supported in codecs: VP9 |
Yaowu Xu | 3ca15a8 | 2015-01-14 12:02:46 -0800 | [diff] [blame] | 440 | */ |
Ivan Maltz | 01b35c3 | 2013-09-05 08:55:47 -0700 | [diff] [blame] | 441 | VP9E_SET_SVC, |
Yaowu Xu | 3ca15a8 | 2015-01-14 12:02:46 -0800 | [diff] [blame] | 442 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 443 | /*!\brief Codec control function to set parameters for SVC. |
Yaowu Xu | 3ca15a8 | 2015-01-14 12:02:46 -0800 | [diff] [blame] | 444 | * \note Parameters contain min_q, max_q, scaling factor for each of the |
| 445 | * SVC layers. |
Yaowu Xu | 5dd146c | 2015-03-12 18:14:43 -0700 | [diff] [blame] | 446 | * |
| 447 | * Supported in codecs: VP9 |
Yaowu Xu | 3ca15a8 | 2015-01-14 12:02:46 -0800 | [diff] [blame] | 448 | */ |
Marco Paniconi | 4864ab2 | 2014-02-06 09:23:17 -0800 | [diff] [blame] | 449 | VP9E_SET_SVC_PARAMETERS, |
Deb Mukherjee | 0ba1542 | 2014-11-07 11:01:53 -0800 | [diff] [blame] | 450 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 451 | /*!\brief Codec control function to set svc layer for spatial and temporal. |
James Zern | 53a11c9 | 2014-02-20 20:36:28 -0800 | [diff] [blame] | 452 | * \note Valid ranges: 0..#vpx_codec_enc_cfg::ss_number_layers for spatial |
| 453 | * layer and 0..#vpx_codec_enc_cfg::ts_number_layers for |
| 454 | * temporal layer. |
Yaowu Xu | 5dd146c | 2015-03-12 18:14:43 -0700 | [diff] [blame] | 455 | * |
| 456 | * Supported in codecs: VP9 |
James Zern | 53a11c9 | 2014-02-20 20:36:28 -0800 | [diff] [blame] | 457 | */ |
Alex Converse | 572de92 | 2014-07-31 08:27:32 -0700 | [diff] [blame] | 458 | VP9E_SET_SVC_LAYER_ID, |
Yaowu Xu | dc08b20 | 2015-01-14 11:17:09 -0800 | [diff] [blame] | 459 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 460 | /*!\brief Codec control function to set content type. |
Yaowu Xu | dc08b20 | 2015-01-14 11:17:09 -0800 | [diff] [blame] | 461 | * \note Valid parameter range: |
| 462 | * VP9E_CONTENT_DEFAULT = Regular video content (Default) |
| 463 | * VP9E_CONTENT_SCREEN = Screen capture content |
Yaowu Xu | 5dd146c | 2015-03-12 18:14:43 -0700 | [diff] [blame] | 464 | * |
| 465 | * Supported in codecs: VP9 |
Yaowu Xu | dc08b20 | 2015-01-14 11:17:09 -0800 | [diff] [blame] | 466 | */ |
Deb Mukherjee | 0ba1542 | 2014-11-07 11:01:53 -0800 | [diff] [blame] | 467 | VP9E_SET_TUNE_CONTENT, |
Yaowu Xu | 193ca4b | 2015-01-14 11:48:29 -0800 | [diff] [blame] | 468 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 469 | /*!\brief Codec control function to get svc layer ID. |
Yaowu Xu | 193ca4b | 2015-01-14 11:48:29 -0800 | [diff] [blame] | 470 | * \note The layer ID returned is for the data packet from the registered |
| 471 | * callback function. |
Yaowu Xu | 5dd146c | 2015-03-12 18:14:43 -0700 | [diff] [blame] | 472 | * |
| 473 | * Supported in codecs: VP9 |
Yaowu Xu | 193ca4b | 2015-01-14 11:48:29 -0800 | [diff] [blame] | 474 | */ |
Deb Mukherjee | 0ba1542 | 2014-11-07 11:01:53 -0800 | [diff] [blame] | 475 | VP9E_GET_SVC_LAYER_ID, |
Yaowu Xu | 193ca4b | 2015-01-14 11:48:29 -0800 | [diff] [blame] | 476 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 477 | /*!\brief Codec control function to register callback to get per layer packet. |
Yaowu Xu | 193ca4b | 2015-01-14 11:48:29 -0800 | [diff] [blame] | 478 | * \note Parameter for this control function is a structure with a callback |
| 479 | * function and a pointer to private data used by the callback. |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 480 | * |
| 481 | * Supported in codecs: VP9 |
Yaowu Xu | 193ca4b | 2015-01-14 11:48:29 -0800 | [diff] [blame] | 482 | */ |
Deb Mukherjee | 0ba1542 | 2014-11-07 11:01:53 -0800 | [diff] [blame] | 483 | VP9E_REGISTER_CX_CALLBACK, |
Yaowu Xu | e94b415 | 2015-01-13 10:07:20 -0800 | [diff] [blame] | 484 | |
Yaowu Xu | 268f106 | 2015-03-13 09:42:57 -0700 | [diff] [blame] | 485 | /*!\brief Codec control function to set color space info. |
Yaowu Xu | e94b415 | 2015-01-13 10:07:20 -0800 | [diff] [blame] | 486 | * \note Valid ranges: 0..7, default is "UNKNOWN". |
| 487 | * 0 = UNKNOWN, |
| 488 | * 1 = BT_601 |
| 489 | * 2 = BT_709 |
| 490 | * 3 = SMPTE_170 |
| 491 | * 4 = SMPTE_240 |
| 492 | * 5 = BT_2020 |
| 493 | * 6 = RESERVED |
| 494 | * 7 = SRGB |
Yaowu Xu | 5dd146c | 2015-03-12 18:14:43 -0700 | [diff] [blame] | 495 | * |
| 496 | * Supported in codecs: VP9 |
Yaowu Xu | e94b415 | 2015-01-13 10:07:20 -0800 | [diff] [blame] | 497 | */ |
| 498 | VP9E_SET_COLOR_SPACE, |
Alex Converse | 4dcb839 | 2015-03-20 14:55:43 -0700 | [diff] [blame] | 499 | |
Marco | c139b81 | 2015-05-21 16:15:37 -0700 | [diff] [blame] | 500 | /*!\brief Codec control function to set temporal layering mode. |
| 501 | * \note Valid ranges: 0..3, default is "0" (VP9E_TEMPORAL_LAYERING_MODE_NOLAYERING). |
| 502 | * 0 = VP9E_TEMPORAL_LAYERING_MODE_NOLAYERING |
| 503 | * 1 = VP9E_TEMPORAL_LAYERING_MODE_BYPASS |
| 504 | * 2 = VP9E_TEMPORAL_LAYERING_MODE_0101 |
| 505 | * 3 = VP9E_TEMPORAL_LAYERING_MODE_0212 |
| 506 | * |
| 507 | * Supported in codecs: VP9 |
| 508 | */ |
| 509 | VP9E_SET_TEMPORAL_LAYERING_MODE, |
| 510 | |
Debargha Mukherjee | 9852643 | 2015-04-01 16:39:06 -0700 | [diff] [blame] | 511 | /*!\brief Codec control function to set minimum interval between GF/ARF frames |
| 512 | * |
| 513 | * By default the value is set as 4. |
| 514 | * |
| 515 | * Supported in codecs: VP9 |
| 516 | */ |
| 517 | VP9E_SET_MIN_GF_INTERVAL, |
| 518 | |
| 519 | /*!\brief Codec control function to set minimum interval between GF/ARF frames |
| 520 | * |
| 521 | * By default the value is set as 16. |
| 522 | * |
| 523 | * Supported in codecs: VP9 |
| 524 | */ |
| 525 | VP9E_SET_MAX_GF_INTERVAL, |
| 526 | |
Alex Converse | 4dcb839 | 2015-03-20 14:55:43 -0700 | [diff] [blame] | 527 | /*!\brief Codec control function to get an Active map back from the encoder. |
| 528 | * |
| 529 | * Supported in codecs: VP9 |
| 530 | */ |
| 531 | VP9E_GET_ACTIVEMAP, |
Ronald S. Bultje | eeb5ef0 | 2015-09-15 21:56:51 -0400 | [diff] [blame] | 532 | |
| 533 | /*!\brief Codec control function to set color range bit. |
| 534 | * \note Valid ranges: 0..1, default is 0 |
| 535 | * 0 = Limited range (16..235 or HBD equivalent) |
| 536 | * 1 = Full range (0..255 or HBD equivalent) |
| 537 | * |
| 538 | * Supported in codecs: VP9 |
| 539 | */ |
| 540 | VP9E_SET_COLOR_RANGE, |
Yaowu Xu | 7c514e2 | 2015-09-28 15:55:46 -0700 | [diff] [blame] | 541 | |
| 542 | /*!\brief Codec control function to set the frame flags and buffer indices |
| 543 | * for spatial layers. The frame flags and buffer indices are set using the |
| 544 | * struct #vpx_svc_ref_frame_config defined below. |
| 545 | * |
| 546 | * Supported in codecs: VP9 |
| 547 | */ |
| 548 | VP9E_SET_SVC_REF_FRAME_CONFIG, |
| 549 | |
| 550 | /*!\brief Codec control function to set intended rendering image size. |
| 551 | * |
| 552 | * By default, this is identical to the image size in pixels. |
| 553 | * |
| 554 | * Supported in codecs: VP9 |
| 555 | */ |
| 556 | VP9E_SET_RENDER_SIZE, |
John Koleszar | b0da9b3 | 2010-12-17 09:43:39 -0500 | [diff] [blame] | 557 | }; |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 558 | |
| 559 | /*!\brief vpx 1-D scaling mode |
| 560 | * |
| 561 | * This set of constants define 1-D vpx scaling modes |
| 562 | */ |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 563 | typedef enum vpx_scaling_mode_1d { |
| 564 | VP8E_NORMAL = 0, |
| 565 | VP8E_FOURFIVE = 1, |
| 566 | VP8E_THREEFIVE = 2, |
| 567 | VP8E_ONETWO = 3 |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 568 | } VPX_SCALING_MODE; |
| 569 | |
Marco | c139b81 | 2015-05-21 16:15:37 -0700 | [diff] [blame] | 570 | /*!\brief Temporal layering mode enum for VP9 SVC. |
| 571 | * |
| 572 | * This set of macros define the different temporal layering modes. |
| 573 | * Supported codecs: VP9 (in SVC mode) |
| 574 | * |
| 575 | */ |
| 576 | typedef enum vp9e_temporal_layering_mode { |
| 577 | /*!\brief No temporal layering. |
| 578 | * Used when only spatial layering is used. |
| 579 | */ |
| 580 | VP9E_TEMPORAL_LAYERING_MODE_NOLAYERING = 0, |
| 581 | |
| 582 | /*!\brief Bypass mode. |
| 583 | * Used when application needs to control temporal layering. |
| 584 | * This will only work when the number of spatial layers equals 1. |
| 585 | */ |
| 586 | VP9E_TEMPORAL_LAYERING_MODE_BYPASS = 1, |
| 587 | |
| 588 | /*!\brief 0-1-0-1... temporal layering scheme with two temporal layers. |
| 589 | */ |
| 590 | VP9E_TEMPORAL_LAYERING_MODE_0101 = 2, |
| 591 | |
| 592 | /*!\brief 0-2-1-2... temporal layering scheme with three temporal layers. |
| 593 | */ |
| 594 | VP9E_TEMPORAL_LAYERING_MODE_0212 = 3 |
| 595 | } VP9E_TEMPORAL_LAYERING_MODE; |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 596 | |
| 597 | /*!\brief vpx region of interest map |
| 598 | * |
| 599 | * These defines the data structures for the region of interest map |
| 600 | * |
| 601 | */ |
| 602 | |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 603 | typedef struct vpx_roi_map { |
Adrian Grange | f58eca9 | 2013-10-24 15:11:36 -0700 | [diff] [blame] | 604 | /*! An id between 0 and 3 for each 16x16 region within a frame. */ |
| 605 | unsigned char *roi_map; |
| 606 | unsigned int rows; /**< Number of rows. */ |
| 607 | unsigned int cols; /**< Number of columns. */ |
Paul Wilkins | 31ee193 | 2013-04-24 13:04:45 +0100 | [diff] [blame] | 608 | // TODO(paulwilkins): broken for VP9 which has 8 segments |
| 609 | // q and loop filter deltas for each segment |
| 610 | // (see MAX_MB_SEGMENTS) |
Adrian Grange | f58eca9 | 2013-10-24 15:11:36 -0700 | [diff] [blame] | 611 | int delta_q[4]; /**< Quantizer deltas. */ |
| 612 | int delta_lf[4]; /**< Loop filter deltas. */ |
| 613 | /*! Static breakout threshold for each segment. */ |
| 614 | unsigned int static_threshold[4]; |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 615 | } vpx_roi_map_t; |
| 616 | |
| 617 | /*!\brief vpx active region map |
| 618 | * |
| 619 | * These defines the data structures for active region map |
| 620 | * |
| 621 | */ |
| 622 | |
| 623 | |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 624 | typedef struct vpx_active_map { |
| 625 | unsigned char *active_map; /**< specify an on (1) or off (0) each 16x16 region within a frame */ |
| 626 | unsigned int rows; /**< number of rows */ |
| 627 | unsigned int cols; /**< number of cols */ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 628 | } vpx_active_map_t; |
| 629 | |
| 630 | /*!\brief vpx image scaling mode |
| 631 | * |
| 632 | * This defines the data structure for image scaling mode |
| 633 | * |
| 634 | */ |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 635 | typedef struct vpx_scaling_mode { |
| 636 | VPX_SCALING_MODE h_scaling_mode; /**< horizontal scaling mode */ |
| 637 | VPX_SCALING_MODE v_scaling_mode; /**< vertical scaling mode */ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 638 | } vpx_scaling_mode_t; |
| 639 | |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 640 | /*!\brief VP8 token partition mode |
| 641 | * |
| 642 | * This defines VP8 partitioning mode for compressed data, i.e., the number of |
Dmitry Kovalev | 116e0a1 | 2013-12-27 14:01:12 -0800 | [diff] [blame] | 643 | * sub-streams in the bitstream. Used for parallelized decoding. |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 644 | * |
| 645 | */ |
| 646 | |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 647 | typedef enum { |
| 648 | VP8_ONE_TOKENPARTITION = 0, |
| 649 | VP8_TWO_TOKENPARTITION = 1, |
| 650 | VP8_FOUR_TOKENPARTITION = 2, |
John Koleszar | 83b1d90 | 2012-11-05 12:37:14 -0800 | [diff] [blame] | 651 | VP8_EIGHT_TOKENPARTITION = 3 |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 652 | } vp8e_token_partitions; |
| 653 | |
Alex Converse | 572de92 | 2014-07-31 08:27:32 -0700 | [diff] [blame] | 654 | /*!brief VP9 encoder content type */ |
| 655 | typedef enum { |
| 656 | VP9E_CONTENT_DEFAULT, |
| 657 | VP9E_CONTENT_SCREEN, |
| 658 | VP9E_CONTENT_INVALID |
| 659 | } vp9e_tune_content; |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 660 | |
John Koleszar | b0da9b3 | 2010-12-17 09:43:39 -0500 | [diff] [blame] | 661 | /*!\brief VP8 model tuning parameters |
| 662 | * |
| 663 | * Changes the encoder to tune for certain types of input material. |
| 664 | * |
| 665 | */ |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 666 | typedef enum { |
| 667 | VP8_TUNE_PSNR, |
| 668 | VP8_TUNE_SSIM |
John Koleszar | b0da9b3 | 2010-12-17 09:43:39 -0500 | [diff] [blame] | 669 | } vp8e_tuning; |
| 670 | |
Marco Paniconi | 89ec990 | 2014-02-18 17:31:57 -0800 | [diff] [blame] | 671 | /*!\brief vp9 svc layer parameters |
| 672 | * |
| 673 | * This defines the spatial and temporal layer id numbers for svc encoding. |
| 674 | * This is used with the #VP9E_SET_SVC_LAYER_ID control to set the spatial and |
| 675 | * temporal layer id for the current frame. |
| 676 | * |
| 677 | */ |
Marco Paniconi | 4864ab2 | 2014-02-06 09:23:17 -0800 | [diff] [blame] | 678 | typedef struct vpx_svc_layer_id { |
Marco Paniconi | 89ec990 | 2014-02-18 17:31:57 -0800 | [diff] [blame] | 679 | int spatial_layer_id; /**< Spatial layer id number. */ |
| 680 | int temporal_layer_id; /**< Temporal layer id number. */ |
Marco Paniconi | 4864ab2 | 2014-02-06 09:23:17 -0800 | [diff] [blame] | 681 | } vpx_svc_layer_id_t; |
| 682 | |
Yaowu Xu | 7c514e2 | 2015-09-28 15:55:46 -0700 | [diff] [blame] | 683 | /*!\brief vp9 svc frame flag parameters. |
| 684 | * |
| 685 | * This defines the frame flags and buffer indices for each spatial layer for |
| 686 | * svc encoding. |
| 687 | * This is used with the #VP9E_SET_SVC_REF_FRAME_CONFIG control to set frame |
| 688 | * flags and buffer indices for each spatial layer for the current (super)frame. |
| 689 | * |
| 690 | */ |
| 691 | typedef struct vpx_svc_ref_frame_config { |
| 692 | int frame_flags[VPX_TS_MAX_LAYERS]; /**< Frame flags. */ |
| 693 | int lst_fb_idx[VPX_TS_MAX_LAYERS]; /**< Last buffer index. */ |
| 694 | int gld_fb_idx[VPX_TS_MAX_LAYERS]; /**< Golden buffer index. */ |
| 695 | int alt_fb_idx[VPX_TS_MAX_LAYERS]; /**< Altref buffer index. */ |
| 696 | } vpx_svc_ref_frame_config_t; |
| 697 | |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 698 | /*!\cond */ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 699 | /*!\brief VP8 encoder control function parameter type |
| 700 | * |
| 701 | * Defines the data types that VP8E control functions take. Note that |
| 702 | * additional common controls are defined in vp8.h |
| 703 | * |
| 704 | */ |
| 705 | |
Marco | af898b5 | 2014-11-10 13:07:05 -0800 | [diff] [blame] | 706 | VPX_CTRL_USE_TYPE(VP8E_SET_FRAME_FLAGS, int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 707 | #define VPX_CTRL_VP8E_SET_FRAME_FLAGS |
Marco | af898b5 | 2014-11-10 13:07:05 -0800 | [diff] [blame] | 708 | VPX_CTRL_USE_TYPE(VP8E_SET_TEMPORAL_LAYER_ID, int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 709 | #define VPX_CTRL_VP8E_SET_TEMPORAL_LAYER_ID |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 710 | VPX_CTRL_USE_TYPE(VP8E_SET_ROI_MAP, vpx_roi_map_t *) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 711 | #define VPX_CTRL_VP8E_SET_ROI_MAP |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 712 | VPX_CTRL_USE_TYPE(VP8E_SET_ACTIVEMAP, vpx_active_map_t *) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 713 | #define VPX_CTRL_VP8E_SET_ACTIVEMAP |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 714 | VPX_CTRL_USE_TYPE(VP8E_SET_SCALEMODE, vpx_scaling_mode_t *) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 715 | #define VPX_CTRL_VP8E_SET_SCALEMODE |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 716 | |
Ivan Maltz | 01b35c3 | 2013-09-05 08:55:47 -0700 | [diff] [blame] | 717 | VPX_CTRL_USE_TYPE(VP9E_SET_SVC, int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 718 | #define VPX_CTRL_VP9E_SET_SVC |
Minghai Shang | 209ee12 | 2014-09-18 18:05:07 -0700 | [diff] [blame] | 719 | VPX_CTRL_USE_TYPE(VP9E_SET_SVC_PARAMETERS, void *) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 720 | #define VPX_CTRL_VP9E_SET_SVC_PARAMETERS |
Deb Mukherjee | 0ba1542 | 2014-11-07 11:01:53 -0800 | [diff] [blame] | 721 | VPX_CTRL_USE_TYPE(VP9E_REGISTER_CX_CALLBACK, void *) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 722 | #define VPX_CTRL_VP9E_REGISTER_CX_CALLBACK |
Marco Paniconi | 4864ab2 | 2014-02-06 09:23:17 -0800 | [diff] [blame] | 723 | VPX_CTRL_USE_TYPE(VP9E_SET_SVC_LAYER_ID, vpx_svc_layer_id_t *) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 724 | #define VPX_CTRL_VP9E_SET_SVC_LAYER_ID |
Ivan Maltz | 01b35c3 | 2013-09-05 08:55:47 -0700 | [diff] [blame] | 725 | |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 726 | VPX_CTRL_USE_TYPE(VP8E_SET_CPUUSED, int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 727 | #define VPX_CTRL_VP8E_SET_CPUUSED |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 728 | VPX_CTRL_USE_TYPE(VP8E_SET_ENABLEAUTOALTREF, unsigned int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 729 | #define VPX_CTRL_VP8E_SET_ENABLEAUTOALTREF |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 730 | VPX_CTRL_USE_TYPE(VP8E_SET_NOISE_SENSITIVITY, unsigned int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 731 | #define VPX_CTRL_VP8E_SET_NOISE_SENSITIVITY |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 732 | VPX_CTRL_USE_TYPE(VP8E_SET_SHARPNESS, unsigned int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 733 | #define VPX_CTRL_VP8E_SET_SHARPNESS |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 734 | VPX_CTRL_USE_TYPE(VP8E_SET_STATIC_THRESHOLD, unsigned int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 735 | #define VPX_CTRL_VP8E_SET_STATIC_THRESHOLD |
John Koleszar | 83b1d90 | 2012-11-05 12:37:14 -0800 | [diff] [blame] | 736 | VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS, int) /* vp8e_token_partitions */ |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 737 | #define VPX_CTRL_VP8E_SET_TOKEN_PARTITIONS |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 738 | |
| 739 | VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_MAXFRAMES, unsigned int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 740 | #define VPX_CTRL_VP8E_SET_ARNR_MAXFRAMES |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 741 | VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_STRENGTH, unsigned int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 742 | #define VPX_CTRL_VP8E_SET_ARNR_STRENGTH |
Adrian Grange | a765705 | 2014-05-05 11:31:55 -0700 | [diff] [blame] | 743 | VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_SET_ARNR_TYPE, unsigned int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 744 | #define VPX_CTRL_VP8E_SET_ARNR_TYPE |
John Koleszar | 83b1d90 | 2012-11-05 12:37:14 -0800 | [diff] [blame] | 745 | VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */ |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 746 | #define VPX_CTRL_VP8E_SET_TUNING |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 747 | VPX_CTRL_USE_TYPE(VP8E_SET_CQ_LEVEL, unsigned int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 748 | #define VPX_CTRL_VP8E_SET_CQ_LEVEL |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 749 | |
Ronald S. Bultje | 1407bdc | 2013-02-01 09:35:28 -0800 | [diff] [blame] | 750 | VPX_CTRL_USE_TYPE(VP9E_SET_TILE_COLUMNS, int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 751 | #define VPX_CTRL_VP9E_SET_TILE_COLUMNS |
Ronald S. Bultje | 89a206e | 2013-02-08 11:33:11 -0800 | [diff] [blame] | 752 | VPX_CTRL_USE_TYPE(VP9E_SET_TILE_ROWS, int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 753 | #define VPX_CTRL_VP9E_SET_TILE_ROWS |
Ronald S. Bultje | 1407bdc | 2013-02-01 09:35:28 -0800 | [diff] [blame] | 754 | |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 755 | VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER, int *) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 756 | #define VPX_CTRL_VP8E_GET_LAST_QUANTIZER |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 757 | VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER_64, int *) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 758 | #define VPX_CTRL_VP8E_GET_LAST_QUANTIZER_64 |
Deb Mukherjee | 0ba1542 | 2014-11-07 11:01:53 -0800 | [diff] [blame] | 759 | VPX_CTRL_USE_TYPE(VP9E_GET_SVC_LAYER_ID, vpx_svc_layer_id_t *) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 760 | #define VPX_CTRL_VP9E_GET_SVC_LAYER_ID |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 761 | |
John Koleszar | 1654ae9 | 2011-07-28 09:17:32 -0400 | [diff] [blame] | 762 | VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTRA_BITRATE_PCT, unsigned int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 763 | #define VPX_CTRL_VP8E_SET_MAX_INTRA_BITRATE_PCT |
Yaowu Xu | 636099f | 2014-10-24 09:31:16 -0700 | [diff] [blame] | 764 | VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTER_BITRATE_PCT, unsigned int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 765 | #define VPX_CTRL_VP8E_SET_MAX_INTER_BITRATE_PCT |
John Koleszar | 1654ae9 | 2011-07-28 09:17:32 -0400 | [diff] [blame] | 766 | |
Marco | af898b5 | 2014-11-10 13:07:05 -0800 | [diff] [blame] | 767 | VPX_CTRL_USE_TYPE(VP8E_SET_SCREEN_CONTENT_MODE, unsigned int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 768 | #define VPX_CTRL_VP8E_SET_SCREEN_CONTENT_MODE |
Marco | af898b5 | 2014-11-10 13:07:05 -0800 | [diff] [blame] | 769 | |
Yaowu Xu | 4165290 | 2015-03-12 17:59:18 -0700 | [diff] [blame] | 770 | VPX_CTRL_USE_TYPE(VP9E_SET_GF_CBR_BOOST_PCT, unsigned int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 771 | #define VPX_CTRL_VP9E_SET_GF_CBR_BOOST_PCT |
Yaowu Xu | 4165290 | 2015-03-12 17:59:18 -0700 | [diff] [blame] | 772 | |
John Koleszar | 83b1d90 | 2012-11-05 12:37:14 -0800 | [diff] [blame] | 773 | VPX_CTRL_USE_TYPE(VP9E_SET_LOSSLESS, unsigned int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 774 | #define VPX_CTRL_VP9E_SET_LOSSLESS |
John Koleszar | 1654ae9 | 2011-07-28 09:17:32 -0400 | [diff] [blame] | 775 | |
John Koleszar | 81708cc | 2013-03-27 11:07:26 -0700 | [diff] [blame] | 776 | VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PARALLEL_DECODING, unsigned int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 777 | #define VPX_CTRL_VP9E_SET_FRAME_PARALLEL_DECODING |
Ivan Maltz | 01b35c3 | 2013-09-05 08:55:47 -0700 | [diff] [blame] | 778 | |
Guillaume Martres | 1708465 | 2013-11-14 19:23:57 +0100 | [diff] [blame] | 779 | VPX_CTRL_USE_TYPE(VP9E_SET_AQ_MODE, unsigned int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 780 | #define VPX_CTRL_VP9E_SET_AQ_MODE |
Guillaume Martres | 1708465 | 2013-11-14 19:23:57 +0100 | [diff] [blame] | 781 | |
Marco Paniconi | 0eb88c9 | 2014-04-03 15:49:03 -0700 | [diff] [blame] | 782 | VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PERIODIC_BOOST, unsigned int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 783 | #define VPX_CTRL_VP9E_SET_FRAME_PERIODIC_BOOST |
Marco Paniconi | 0eb88c9 | 2014-04-03 15:49:03 -0700 | [diff] [blame] | 784 | |
JackyChen | bb1a236 | 2014-09-12 11:48:44 -0700 | [diff] [blame] | 785 | VPX_CTRL_USE_TYPE(VP9E_SET_NOISE_SENSITIVITY, unsigned int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 786 | #define VPX_CTRL_VP9E_SET_NOISE_SENSITIVITY |
JackyChen | bb1a236 | 2014-09-12 11:48:44 -0700 | [diff] [blame] | 787 | |
Alex Converse | 572de92 | 2014-07-31 08:27:32 -0700 | [diff] [blame] | 788 | VPX_CTRL_USE_TYPE(VP9E_SET_TUNE_CONTENT, int) /* vp9e_tune_content */ |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 789 | #define VPX_CTRL_VP9E_SET_TUNE_CONTENT |
Yaowu Xu | e94b415 | 2015-01-13 10:07:20 -0800 | [diff] [blame] | 790 | |
| 791 | VPX_CTRL_USE_TYPE(VP9E_SET_COLOR_SPACE, int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 792 | #define VPX_CTRL_VP9E_SET_COLOR_SPACE |
Alex Converse | 4dcb839 | 2015-03-20 14:55:43 -0700 | [diff] [blame] | 793 | |
Debargha Mukherjee | 9852643 | 2015-04-01 16:39:06 -0700 | [diff] [blame] | 794 | VPX_CTRL_USE_TYPE(VP9E_SET_MIN_GF_INTERVAL, unsigned int) |
Debargha Mukherjee | e8a3abe | 2015-07-06 16:07:53 -0700 | [diff] [blame] | 795 | #define VPX_CTRL_VP9E_SET_MIN_GF_INTERVAL |
Debargha Mukherjee | 9852643 | 2015-04-01 16:39:06 -0700 | [diff] [blame] | 796 | |
| 797 | VPX_CTRL_USE_TYPE(VP9E_SET_MAX_GF_INTERVAL, unsigned int) |
Debargha Mukherjee | e8a3abe | 2015-07-06 16:07:53 -0700 | [diff] [blame] | 798 | #define VPX_CTRL_VP9E_SET_MAX_GF_INTERVAL |
Debargha Mukherjee | 9852643 | 2015-04-01 16:39:06 -0700 | [diff] [blame] | 799 | |
Alex Converse | 4dcb839 | 2015-03-20 14:55:43 -0700 | [diff] [blame] | 800 | VPX_CTRL_USE_TYPE(VP9E_GET_ACTIVEMAP, vpx_active_map_t *) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 801 | #define VPX_CTRL_VP9E_GET_ACTIVEMAP |
Ronald S. Bultje | eeb5ef0 | 2015-09-15 21:56:51 -0400 | [diff] [blame] | 802 | |
Ronald S. Bultje | eeb5ef0 | 2015-09-15 21:56:51 -0400 | [diff] [blame] | 803 | VPX_CTRL_USE_TYPE(VP9E_SET_COLOR_RANGE, int) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 804 | #define VPX_CTRL_VP9E_SET_COLOR_RANGE |
Yaowu Xu | 7c514e2 | 2015-09-28 15:55:46 -0700 | [diff] [blame] | 805 | |
| 806 | VPX_CTRL_USE_TYPE(VP9E_SET_SVC_REF_FRAME_CONFIG, vpx_svc_ref_frame_config_t *) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 807 | #define VPX_CTRL_VP9E_SET_SVC_REF_FRAME_CONFIG |
Yaowu Xu | 7c514e2 | 2015-09-28 15:55:46 -0700 | [diff] [blame] | 808 | |
| 809 | /*!\brief |
| 810 | * |
| 811 | * TODO(rbultje) : add support of the control in ffmpeg |
| 812 | */ |
| 813 | #define VPX_CTRL_VP9E_SET_RENDER_SIZE |
| 814 | VPX_CTRL_USE_TYPE(VP9E_SET_RENDER_SIZE, int *) |
James Zern | 7dd7a7d | 2015-10-09 16:31:17 -0700 | [diff] [blame] | 815 | /*!\endcond */ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 816 | /*! @} - end defgroup vp8_encoder */ |
Dmitry Kovalev | e288c60 | 2013-09-29 18:00:15 -0700 | [diff] [blame] | 817 | #ifdef __cplusplus |
| 818 | } // extern "C" |
| 819 | #endif |
| 820 | |
James Zern | 7386bde | 2013-12-15 18:26:15 -0800 | [diff] [blame] | 821 | #endif // VPX_VP8CX_H_ |