John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 1 | /* |
Lester Lu | 6bc30d6 | 2021-12-16 19:13:21 +0000 | [diff] [blame^] | 2 | * Copyright (c) 2021, Alliance for Open Media. All rights reserved |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 3 | * |
Lester Lu | 6bc30d6 | 2021-12-16 19:13:21 +0000 | [diff] [blame^] | 4 | * This source code is subject to the terms of the BSD 3-Clause Clear License |
| 5 | * and the Alliance for Open Media Patent License 1.0. If the BSD 3-Clause Clear |
| 6 | * License was not distributed with this source code in the LICENSE file, you |
| 7 | * can obtain it at aomedia.org/license/software-license/bsd-3-c-c/. If the |
| 8 | * Alliance for Open Media Patent License 1.0 was not distributed with this |
| 9 | * source code in the PATENTS file, you can obtain it at |
| 10 | * aomedia.org/license/patent-license/. |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 11 | */ |
| 12 | |
Elliott Karpilovsky | cbe219b | 2020-04-22 16:21:06 -0700 | [diff] [blame] | 13 | /////////////////////////////////////////////////////////////////////////////// |
| 14 | // Internal implementation details |
| 15 | /////////////////////////////////////////////////////////////////////////////// |
| 16 | // |
| 17 | // There are two levels of interfaces used to access the AOM codec: the |
| 18 | // the aom_codec_iface and the aom_codec_ctx. |
| 19 | // |
| 20 | // 1. aom_codec_iface_t |
| 21 | // (Related files: aom/aom_codec.h, aom/src/aom_codec.c, |
| 22 | // aom/internal/aom_codec_internal.h, av1/av1_cx_iface.c, |
| 23 | // av1/av1_dx_iface.c) |
| 24 | // |
| 25 | // Used to initialize the codec context, which contains the configuration for |
| 26 | // for modifying the encoder/decoder during run-time. See the other |
| 27 | // documentation in this header file for more details. For the most part, |
| 28 | // users will call helper functions, such as aom_codec_iface_name, |
| 29 | // aom_codec_get_caps, etc., to interact with it. |
| 30 | // |
| 31 | // The main purpose of the aom_codec_iface_t is to provide a way to generate |
| 32 | // a default codec config, find out what capabilities the implementation has, |
| 33 | // and create an aom_codec_ctx_t (which is actually used to interact with the |
| 34 | // codec). |
| 35 | // |
| 36 | // Note that the implementations for the AV1 algorithm are located in |
| 37 | // av1/av1_cx_iface.c and av1/av1_dx_iface.c |
| 38 | // |
| 39 | // |
| 40 | // 2. aom_codec_ctx_t |
| 41 | // (Related files: aom/aom_codec.h, av1/av1_cx_iface.c, av1/av1_dx_iface.c, |
| 42 | // aom/aomcx.h, aom/aomdx.h, aom/src/aom_encoder.c, aom/src/aom_decoder.c) |
| 43 | // |
| 44 | // The actual interface between user code and the codec. It stores the name |
| 45 | // of the codec, a pointer back to the aom_codec_iface_t that initialized it, |
| 46 | // initialization flags, a config for either encoder or the decoder, and a |
| 47 | // pointer to internal data. |
| 48 | // |
| 49 | // The codec is configured / queried through calls to aom_codec_control, |
Elliott Karpilovsky | 60dd0f9 | 2020-04-30 19:19:27 -0700 | [diff] [blame] | 50 | // which takes a control ID (listed in aomcx.h and aomdx.h) and a parameter. |
| 51 | // In the case of "getter" control IDs, the parameter is modified to have |
| 52 | // the requested value; in the case of "setter" control IDs, the codec's |
Elliott Karpilovsky | cbe219b | 2020-04-22 16:21:06 -0700 | [diff] [blame] | 53 | // configuration is changed based on the parameter. Note that a aom_codec_err_t |
| 54 | // is returned, which indicates if the operation was successful or not. |
| 55 | // |
| 56 | // Note that for the encoder, the aom_codec_alg_priv_t points to the |
| 57 | // the aom_codec_alg_priv structure in av1/av1_cx_iface.c, and for the decoder, |
| 58 | // the struct in av1/av1_dx_iface.c. Variables such as AV1_COMP cpi are stored |
| 59 | // here and also used in the core algorithm. |
| 60 | // |
| 61 | // At the end, aom_codec_destroy should be called for each initialized |
| 62 | // aom_codec_ctx_t. |
| 63 | |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 64 | /*!\defgroup codec Common Algorithm Interface |
| 65 | * This abstraction allows applications to easily support multiple video |
| 66 | * formats with minimal code duplication. This section describes the interface |
| 67 | * common to all codecs (both encoders and decoders). |
| 68 | * @{ |
| 69 | */ |
| 70 | |
James Zern | f42d52e | 2011-02-16 17:54:49 -0800 | [diff] [blame] | 71 | /*!\file |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 72 | * \brief Describes the codec algorithm interface to applications. |
| 73 | * |
| 74 | * This file describes the interface between an application and a |
| 75 | * video codec algorithm. |
| 76 | * |
| 77 | * An application instantiates a specific codec instance by using |
Wan-Teh Chang | b1b8c68 | 2020-04-24 09:30:52 -0700 | [diff] [blame] | 78 | * aom_codec_dec_init() or aom_codec_enc_init() and a pointer to the |
| 79 | * algorithm's interface structure: |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 80 | * <pre> |
| 81 | * my_app.c: |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 82 | * extern aom_codec_iface_t my_codec; |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 83 | * { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 84 | * aom_codec_ctx_t algo; |
Wan-Teh Chang | b1b8c68 | 2020-04-24 09:30:52 -0700 | [diff] [blame] | 85 | * int threads = 4; |
| 86 | * aom_codec_dec_cfg_t cfg = { threads, 0, 0, 1 }; |
| 87 | * res = aom_codec_dec_init(&algo, &my_codec, &cfg, 0); |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 88 | * } |
| 89 | * </pre> |
| 90 | * |
elliottk | d43b65b | 2018-09-03 16:50:42 -0700 | [diff] [blame] | 91 | * Once initialized, the instance is managed using other functions from |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 92 | * the aom_codec_* family. |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 93 | */ |
James Zern | e1cbb13 | 2018-08-22 14:10:36 -0700 | [diff] [blame] | 94 | #ifndef AOM_AOM_AOM_CODEC_H_ |
| 95 | #define AOM_AOM_AOM_CODEC_H_ |
Adrian Grange | f58eca9 | 2013-10-24 15:11:36 -0700 | [diff] [blame] | 96 | |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 97 | #ifdef __cplusplus |
| 98 | extern "C" { |
| 99 | #endif |
| 100 | |
Tom Finegan | dd3e2a5 | 2018-05-23 14:33:09 -0700 | [diff] [blame] | 101 | #include "aom/aom_image.h" |
| 102 | #include "aom/aom_integer.h" |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 103 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 104 | /*!\brief Decorator indicating a function is deprecated */ |
James Zern | ef9ff45 | 2017-10-05 22:42:45 -0700 | [diff] [blame] | 105 | #ifndef AOM_DEPRECATED |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 106 | #if defined(__GNUC__) && __GNUC__ |
James Zern | ef9ff45 | 2017-10-05 22:42:45 -0700 | [diff] [blame] | 107 | #define AOM_DEPRECATED __attribute__((deprecated)) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 108 | #elif defined(_MSC_VER) |
James Zern | ef9ff45 | 2017-10-05 22:42:45 -0700 | [diff] [blame] | 109 | #define AOM_DEPRECATED |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 110 | #else |
James Zern | ef9ff45 | 2017-10-05 22:42:45 -0700 | [diff] [blame] | 111 | #define AOM_DEPRECATED |
James Zern | d034bfa | 2012-11-27 14:03:36 -0800 | [diff] [blame] | 112 | #endif |
James Zern | ef9ff45 | 2017-10-05 22:42:45 -0700 | [diff] [blame] | 113 | #endif /* AOM_DEPRECATED */ |
James Zern | d034bfa | 2012-11-27 14:03:36 -0800 | [diff] [blame] | 114 | |
James Zern | ef9ff45 | 2017-10-05 22:42:45 -0700 | [diff] [blame] | 115 | #ifndef AOM_DECLSPEC_DEPRECATED |
James Zern | d034bfa | 2012-11-27 14:03:36 -0800 | [diff] [blame] | 116 | #if defined(__GNUC__) && __GNUC__ |
James Zern | ef9ff45 | 2017-10-05 22:42:45 -0700 | [diff] [blame] | 117 | #define AOM_DECLSPEC_DEPRECATED /**< \copydoc #AOM_DEPRECATED */ |
James Zern | d034bfa | 2012-11-27 14:03:36 -0800 | [diff] [blame] | 118 | #elif defined(_MSC_VER) |
James Zern | ef9ff45 | 2017-10-05 22:42:45 -0700 | [diff] [blame] | 119 | /*!\brief \copydoc #AOM_DEPRECATED */ |
| 120 | #define AOM_DECLSPEC_DEPRECATED __declspec(deprecated) |
James Zern | d034bfa | 2012-11-27 14:03:36 -0800 | [diff] [blame] | 121 | #else |
James Zern | ef9ff45 | 2017-10-05 22:42:45 -0700 | [diff] [blame] | 122 | #define AOM_DECLSPEC_DEPRECATED /**< \copydoc #AOM_DEPRECATED */ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 123 | #endif |
James Zern | ef9ff45 | 2017-10-05 22:42:45 -0700 | [diff] [blame] | 124 | #endif /* AOM_DECLSPEC_DEPRECATED */ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 125 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 126 | /*!\brief Decorator indicating a function is potentially unused */ |
James Zern | ef9ff45 | 2017-10-05 22:42:45 -0700 | [diff] [blame] | 127 | #ifdef AOM_UNUSED |
Nico Weber | 8a64f51 | 2015-08-07 13:56:47 -0700 | [diff] [blame] | 128 | #elif defined(__GNUC__) || defined(__clang__) |
James Zern | ef9ff45 | 2017-10-05 22:42:45 -0700 | [diff] [blame] | 129 | #define AOM_UNUSED __attribute__((unused)) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 130 | #else |
James Zern | ef9ff45 | 2017-10-05 22:42:45 -0700 | [diff] [blame] | 131 | #define AOM_UNUSED |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 132 | #endif |
| 133 | |
Urvang Joshi | cb586f3 | 2016-09-20 11:36:33 -0700 | [diff] [blame] | 134 | /*!\brief Decorator indicating that given struct/union/enum is packed */ |
| 135 | #ifndef ATTRIBUTE_PACKED |
| 136 | #if defined(__GNUC__) && __GNUC__ |
| 137 | #define ATTRIBUTE_PACKED __attribute__((packed)) |
| 138 | #elif defined(_MSC_VER) |
| 139 | #define ATTRIBUTE_PACKED |
| 140 | #else |
| 141 | #define ATTRIBUTE_PACKED |
| 142 | #endif |
| 143 | #endif /* ATTRIBUTE_PACKED */ |
| 144 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 145 | /*!\brief Current ABI version number |
| 146 | * |
| 147 | * \internal |
| 148 | * If this file is altered in any way that changes the ABI, this value |
| 149 | * must be bumped. Examples include, but are not limited to, changing |
| 150 | * types, removing or reassigning enums, adding/removing/rearranging |
| 151 | * fields to structures |
| 152 | */ |
Bohan Li | 45ab784 | 2020-12-21 13:27:47 -0800 | [diff] [blame] | 153 | #define AOM_CODEC_ABI_VERSION (6 + AOM_IMAGE_ABI_VERSION) /**<\hideinitializer*/ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 154 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 155 | /*!\brief Algorithm return codes */ |
Satish Kumar Suman | 9b1252e | 2018-12-25 11:21:18 +0530 | [diff] [blame] | 156 | typedef enum { |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 157 | /*!\brief Operation completed without error */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 158 | AOM_CODEC_OK, |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 159 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 160 | /*!\brief Unspecified error */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 161 | AOM_CODEC_ERROR, |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 162 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 163 | /*!\brief Memory operation failed */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 164 | AOM_CODEC_MEM_ERROR, |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 165 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 166 | /*!\brief ABI version mismatch */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 167 | AOM_CODEC_ABI_MISMATCH, |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 168 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 169 | /*!\brief Algorithm does not have required capability */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 170 | AOM_CODEC_INCAPABLE, |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 171 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 172 | /*!\brief The given bitstream is not supported. |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 173 | * |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 174 | * The bitstream was unable to be parsed at the highest level. The decoder |
| 175 | * is unable to proceed. This error \ref SHOULD be treated as fatal to the |
| 176 | * stream. */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 177 | AOM_CODEC_UNSUP_BITSTREAM, |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 178 | |
| 179 | /*!\brief Encoded bitstream uses an unsupported feature |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 180 | * |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 181 | * The decoder does not implement a feature required by the encoder. This |
| 182 | * return code should only be used for features that prevent future |
| 183 | * pictures from being properly decoded. This error \ref MAY be treated as |
| 184 | * fatal to the stream or \ref MAY be treated as fatal to the current GOP. |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 185 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 186 | AOM_CODEC_UNSUP_FEATURE, |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 187 | |
| 188 | /*!\brief The coded data for this stream is corrupt or incomplete |
| 189 | * |
| 190 | * There was a problem decoding the current frame. This return code |
| 191 | * should only be used for failures that prevent future pictures from |
| 192 | * being properly decoded. This error \ref MAY be treated as fatal to the |
| 193 | * stream or \ref MAY be treated as fatal to the current GOP. If decoding |
| 194 | * is continued for the current GOP, artifacts may be present. |
| 195 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 196 | AOM_CODEC_CORRUPT_FRAME, |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 197 | |
| 198 | /*!\brief An application-supplied parameter is not valid. |
| 199 | * |
| 200 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 201 | AOM_CODEC_INVALID_PARAM, |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 202 | |
| 203 | /*!\brief An iterator reached the end of list. |
| 204 | * |
| 205 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 206 | AOM_CODEC_LIST_END |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 207 | |
Satish Kumar Suman | 9b1252e | 2018-12-25 11:21:18 +0530 | [diff] [blame] | 208 | } aom_codec_err_t; |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 209 | |
| 210 | /*! \brief Codec capabilities bitfield |
| 211 | * |
| 212 | * Each codec advertises the capabilities it supports as part of its |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 213 | * ::aom_codec_iface_t interface structure. Capabilities are extra interfaces |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 214 | * or functionality, and are not required to be supported. |
| 215 | * |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 216 | * The available flags are specified by AOM_CODEC_CAP_* defines. |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 217 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 218 | typedef long aom_codec_caps_t; |
| 219 | #define AOM_CODEC_CAP_DECODER 0x1 /**< Is a decoder */ |
| 220 | #define AOM_CODEC_CAP_ENCODER 0x2 /**< Is an encoder */ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 221 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 222 | /*! \brief Initialization-time Feature Enabling |
| 223 | * |
| 224 | * Certain codec features must be known at initialization time, to allow for |
| 225 | * proper memory allocation. |
| 226 | * |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 227 | * The available flags are specified by AOM_CODEC_USE_* defines. |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 228 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 229 | typedef long aom_codec_flags_t; |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 230 | |
Yaowu Xu | 047b7c9 | 2019-11-11 11:21:23 -0800 | [diff] [blame] | 231 | /*!\brief Time Stamp Type |
| 232 | * |
| 233 | * An integer, which when multiplied by the stream's time base, provides |
| 234 | * the absolute time of a sample. |
| 235 | */ |
| 236 | typedef int64_t aom_codec_pts_t; |
| 237 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 238 | /*!\brief Codec interface structure. |
| 239 | * |
| 240 | * Contains function pointers and other data private to the codec |
Elliott Karpilovsky | 7026d4b | 2020-03-22 19:21:51 -0700 | [diff] [blame] | 241 | * implementation. This structure is opaque to the application. Common |
| 242 | * functions used with this structure: |
Elliott Karpilovsky | 675162b | 2020-04-24 17:36:57 -0700 | [diff] [blame] | 243 | * - aom_codec_iface_name(aom_codec_iface_t *iface): get the |
| 244 | * name of the codec |
| 245 | * - aom_codec_get_caps(aom_codec_iface_t *iface): returns |
| 246 | * the capabilities of the codec |
| 247 | * - aom_codec_enc_config_default: generate the default config for |
| 248 | * initializing the encoder (see documention in aom_encoder.h) |
Elliott Karpilovsky | 7026d4b | 2020-03-22 19:21:51 -0700 | [diff] [blame] | 249 | * - aom_codec_dec_init, aom_codec_enc_init: initialize the codec context |
Elliott Karpilovsky | 675162b | 2020-04-24 17:36:57 -0700 | [diff] [blame] | 250 | * structure (see documentation on aom_codec_ctx). |
| 251 | * |
| 252 | * To get access to the AV1 encoder and decoder, use aom_codec_av1_cx() and |
| 253 | * aom_codec_av1_dx(). |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 254 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 255 | typedef const struct aom_codec_iface aom_codec_iface_t; |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 256 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 257 | /*!\brief Codec private data structure. |
| 258 | * |
| 259 | * Contains data private to the codec implementation. This structure is opaque |
| 260 | * to the application. |
| 261 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 262 | typedef struct aom_codec_priv aom_codec_priv_t; |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 263 | |
Mufaddal Chakera | 8f12f7b | 2020-06-23 14:31:50 +0530 | [diff] [blame] | 264 | /*!\brief Compressed Frame Flags |
| 265 | * |
| 266 | * This type represents a bitfield containing information about a compressed |
| 267 | * frame that may be useful to an application. The most significant 16 bits |
| 268 | * can be used by an algorithm to provide additional detail, for example to |
| 269 | * support frame types that are codec specific (MPEG-1 D-frames for example) |
| 270 | */ |
| 271 | typedef uint32_t aom_codec_frame_flags_t; |
| 272 | #define AOM_FRAME_IS_KEY 0x1 /**< frame is the start of a GOP */ |
| 273 | /*!\brief frame can be dropped without affecting the stream (no future frame |
| 274 | * depends on this one) */ |
| 275 | #define AOM_FRAME_IS_DROPPABLE 0x2 |
| 276 | /*!\brief this is an INTRA_ONLY frame */ |
| 277 | #define AOM_FRAME_IS_INTRAONLY 0x10 |
| 278 | /*!\brief this is an S-frame */ |
| 279 | #define AOM_FRAME_IS_SWITCH 0x20 |
| 280 | /*!\brief this is an error-resilient frame */ |
| 281 | #define AOM_FRAME_IS_ERROR_RESILIENT 0x40 |
| 282 | /*!\brief this is a key-frame dependent recovery-point frame */ |
| 283 | #define AOM_FRAME_IS_DELAYED_RANDOM_ACCESS_POINT 0x80 |
| 284 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 285 | /*!\brief Iterator |
| 286 | * |
| 287 | * Opaque storage used for iterating over lists. |
| 288 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 289 | typedef const void *aom_codec_iter_t; |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 290 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 291 | /*!\brief Codec context structure |
| 292 | * |
| 293 | * All codecs \ref MUST support this context structure fully. In general, |
| 294 | * this data should be considered private to the codec algorithm, and |
| 295 | * not be manipulated or examined by the calling application. Applications |
| 296 | * may reference the 'name' member to get a printable description of the |
| 297 | * algorithm. |
| 298 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 299 | typedef struct aom_codec_ctx { |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 300 | const char *name; /**< Printable interface name */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 301 | aom_codec_iface_t *iface; /**< Interface pointers */ |
| 302 | aom_codec_err_t err; /**< Last returned error */ |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 303 | const char *err_detail; /**< Detailed info, if available */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 304 | aom_codec_flags_t init_flags; /**< Flags passed at init time */ |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 305 | union { |
| 306 | /**< Decoder Configuration Pointer */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 307 | const struct aom_codec_dec_cfg *dec; |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 308 | /**< Encoder Configuration Pointer */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 309 | const struct aom_codec_enc_cfg *enc; |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 310 | const void *raw; |
| 311 | } config; /**< Configuration pointer aliasing union */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 312 | aom_codec_priv_t *priv; /**< Algorithm private storage */ |
| 313 | } aom_codec_ctx_t; |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 314 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 315 | /*!\brief Bit depth for codec |
| 316 | * * |
| 317 | * This enumeration determines the bit depth of the codec. |
| 318 | */ |
Satish Kumar Suman | 9b1252e | 2018-12-25 11:21:18 +0530 | [diff] [blame] | 319 | typedef enum aom_bit_depth { |
| 320 | AOM_BITS_8 = 8, /**< 8 bits */ |
| 321 | AOM_BITS_10 = 10, /**< 10 bits */ |
| 322 | AOM_BITS_12 = 12, /**< 12 bits */ |
| 323 | } aom_bit_depth_t; |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 324 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 325 | /*!\brief Superblock size selection. |
| 326 | * |
| 327 | * Defines the superblock size used for encoding. The superblock size can |
| 328 | * either be fixed at 64x64 or 128x128 pixels, or it can be dynamically |
| 329 | * selected by the encoder for each frame. |
| 330 | */ |
Satish Kumar Suman | 9b1252e | 2018-12-25 11:21:18 +0530 | [diff] [blame] | 331 | typedef enum aom_superblock_size { |
| 332 | AOM_SUPERBLOCK_SIZE_64X64, /**< Always use 64x64 superblocks. */ |
| 333 | AOM_SUPERBLOCK_SIZE_128X128, /**< Always use 128x128 superblocks. */ |
| 334 | AOM_SUPERBLOCK_SIZE_DYNAMIC /**< Select superblock size dynamically. */ |
| 335 | } aom_superblock_size_t; |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 336 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 337 | /* |
| 338 | * Library Version Number Interface |
| 339 | * |
| 340 | * For example, see the following sample return values: |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 341 | * aom_codec_version() (1<<16 | 2<<8 | 3) |
| 342 | * aom_codec_version_str() "v1.2.3-rc1-16-gec6a1ba" |
| 343 | * aom_codec_version_extra_str() "rc1-16-gec6a1ba" |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 344 | */ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 345 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 346 | /*!\brief Return the version information (as an integer) |
| 347 | * |
| 348 | * Returns a packed encoding of the library version number. This will only |
Wan-Teh Chang | 9b88e49 | 2020-04-23 21:58:32 -0700 | [diff] [blame] | 349 | * include the major.minor.patch component of the version number. Note that this |
| 350 | * encoded value should be accessed through the macros provided, as the encoding |
| 351 | * may change in the future. |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 352 | * |
| 353 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 354 | int aom_codec_version(void); |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 355 | |
Wan-Teh Chang | 9b88e49 | 2020-04-23 21:58:32 -0700 | [diff] [blame] | 356 | /*!\brief Return the major version number */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 357 | #define aom_codec_version_major() ((aom_codec_version() >> 16) & 0xff) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 358 | |
Wan-Teh Chang | 9b88e49 | 2020-04-23 21:58:32 -0700 | [diff] [blame] | 359 | /*!\brief Return the minor version number */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 360 | #define aom_codec_version_minor() ((aom_codec_version() >> 8) & 0xff) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 361 | |
Wan-Teh Chang | 9b88e49 | 2020-04-23 21:58:32 -0700 | [diff] [blame] | 362 | /*!\brief Return the patch version number */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 363 | #define aom_codec_version_patch() ((aom_codec_version() >> 0) & 0xff) |
Geza Lore | 454989f | 2016-03-24 13:56:05 +0000 | [diff] [blame] | 364 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 365 | /*!\brief Return the version information (as a string) |
| 366 | * |
| 367 | * Returns a printable string containing the full library version number. This |
Wan-Teh Chang | 9b88e49 | 2020-04-23 21:58:32 -0700 | [diff] [blame] | 368 | * may contain additional text following the three digit version number, as to |
| 369 | * indicate release candidates, prerelease versions, etc. |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 370 | * |
| 371 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 372 | const char *aom_codec_version_str(void); |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 373 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 374 | /*!\brief Return the version information (as a string) |
| 375 | * |
| 376 | * Returns a printable "extra string". This is the component of the string |
Wan-Teh Chang | 9b88e49 | 2020-04-23 21:58:32 -0700 | [diff] [blame] | 377 | * returned by aom_codec_version_str() following the three digit version number. |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 378 | * |
| 379 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 380 | const char *aom_codec_version_extra_str(void); |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 381 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 382 | /*!\brief Return the build configuration |
| 383 | * |
| 384 | * Returns a printable string containing an encoded version of the build |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 385 | * configuration. This may be useful to aom support. |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 386 | * |
| 387 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 388 | const char *aom_codec_build_config(void); |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 389 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 390 | /*!\brief Return the name for a given interface |
| 391 | * |
| 392 | * Returns a human readable string for name of the given codec interface. |
| 393 | * |
| 394 | * \param[in] iface Interface pointer |
| 395 | * |
| 396 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 397 | const char *aom_codec_iface_name(aom_codec_iface_t *iface); |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 398 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 399 | /*!\brief Convert error number to printable string |
| 400 | * |
| 401 | * Returns a human readable string for the last error returned by the |
| 402 | * algorithm. The returned error will be one line and will not contain |
| 403 | * any newline characters. |
| 404 | * |
| 405 | * |
| 406 | * \param[in] err Error number. |
| 407 | * |
| 408 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 409 | const char *aom_codec_err_to_string(aom_codec_err_t err); |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 410 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 411 | /*!\brief Retrieve error synopsis for codec context |
| 412 | * |
| 413 | * Returns a human readable string for the last error returned by the |
| 414 | * algorithm. The returned error will be one line and will not contain |
| 415 | * any newline characters. |
| 416 | * |
| 417 | * |
| 418 | * \param[in] ctx Pointer to this instance's context. |
| 419 | * |
| 420 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 421 | const char *aom_codec_error(aom_codec_ctx_t *ctx); |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 422 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 423 | /*!\brief Retrieve detailed error information for codec context |
| 424 | * |
| 425 | * Returns a human readable string providing detailed information about |
| 426 | * the last error. |
| 427 | * |
| 428 | * \param[in] ctx Pointer to this instance's context. |
| 429 | * |
| 430 | * \retval NULL |
| 431 | * No detailed information is available. |
| 432 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 433 | const char *aom_codec_error_detail(aom_codec_ctx_t *ctx); |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 434 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 435 | /* REQUIRED FUNCTIONS |
| 436 | * |
| 437 | * The following functions are required to be implemented for all codecs. |
| 438 | * They represent the base case functionality expected of all codecs. |
| 439 | */ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 440 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 441 | /*!\brief Destroy a codec instance |
| 442 | * |
| 443 | * Destroys a codec context, freeing any associated memory buffers. |
| 444 | * |
| 445 | * \param[in] ctx Pointer to this instance's context |
| 446 | * |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 447 | * \retval #AOM_CODEC_OK |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 448 | * The codec algorithm initialized. |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 449 | * \retval #AOM_CODEC_MEM_ERROR |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 450 | * Memory allocation failed. |
| 451 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 452 | aom_codec_err_t aom_codec_destroy(aom_codec_ctx_t *ctx); |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 453 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 454 | /*!\brief Get the capabilities of an algorithm. |
| 455 | * |
| 456 | * Retrieves the capabilities bitfield from the algorithm's interface. |
| 457 | * |
| 458 | * \param[in] iface Pointer to the algorithm interface |
| 459 | * |
| 460 | */ |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 461 | aom_codec_caps_t aom_codec_get_caps(aom_codec_iface_t *iface); |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 462 | |
Elliott Karpilovsky | 60dd0f9 | 2020-04-30 19:19:27 -0700 | [diff] [blame] | 463 | /*!\name Codec Control |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 464 | * |
Elliott Karpilovsky | 60dd0f9 | 2020-04-30 19:19:27 -0700 | [diff] [blame] | 465 | * The aom_codec_control function exchanges algorithm specific data with the |
| 466 | * codec instance. Additionally, the macro AOM_CODEC_CONTROL_TYPECHECKED is |
| 467 | * provided, which will type-check the parameter against the control ID before |
| 468 | * calling aom_codec_control - note that this macro requires the control ID |
| 469 | * to be directly encoded in it, e.g., |
| 470 | * AOM_CODEC_CONTROL_TYPECHECKED(&ctx, AOME_SET_CPUUSED, 8). |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 471 | * |
Elliott Karpilovsky | 60dd0f9 | 2020-04-30 19:19:27 -0700 | [diff] [blame] | 472 | * The codec control IDs can be found in aom.h, aomcx.h, and aomdx.h |
| 473 | * (defined as aom_com_control_id, aome_enc_control_id, and aom_dec_control_id). |
| 474 | * @{ |
| 475 | */ |
| 476 | /*!\brief Algorithm Control |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 477 | * |
Elliott Karpilovsky | 60dd0f9 | 2020-04-30 19:19:27 -0700 | [diff] [blame] | 478 | * aom_codec_control takes a context, a control ID, and a third parameter |
| 479 | * (with varying type). If the context is non-null and an error occurs, |
| 480 | * ctx->err will be set to the same value as the return value. |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 481 | * |
| 482 | * \param[in] ctx Pointer to this instance's context |
| 483 | * \param[in] ctrl_id Algorithm specific control identifier |
| 484 | * |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 485 | * \retval #AOM_CODEC_OK |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 486 | * The control request was processed. |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 487 | * \retval #AOM_CODEC_ERROR |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 488 | * The control request was not processed. |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 489 | * \retval #AOM_CODEC_INVALID_PARAM |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 490 | * The data was not valid. |
| 491 | */ |
Elliott Karpilovsky | 60dd0f9 | 2020-04-30 19:19:27 -0700 | [diff] [blame] | 492 | aom_codec_err_t aom_codec_control(aom_codec_ctx_t *ctx, int ctrl_id, ...); |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 493 | |
Bohan Li | 45ab784 | 2020-12-21 13:27:47 -0800 | [diff] [blame] | 494 | /*!\brief Key & Value API |
| 495 | * |
| 496 | * aom_codec_set_option() takes a context, a key (option name) and a value. If |
| 497 | * the context is non-null and an error occurs, ctx->err will be set to the same |
| 498 | * value as the return value. |
| 499 | * |
| 500 | * \param[in] ctx Pointer to this instance's context |
| 501 | * \param[in] name The name of the option (key) |
| 502 | * \param[in] value The value of the option |
| 503 | * |
| 504 | * \retval #AOM_CODEC_OK |
| 505 | * The value of the option was set. |
| 506 | * \retval #AOM_CODEC_INVALID_PARAM |
| 507 | * The data was not valid. |
| 508 | * \retval #AOM_CODEC_ERROR |
| 509 | * The option was not successfully set. |
| 510 | */ |
| 511 | aom_codec_err_t aom_codec_set_option(aom_codec_ctx_t *ctx, const char *name, |
| 512 | const char *value); |
| 513 | |
Elliott Karpilovsky | 60dd0f9 | 2020-04-30 19:19:27 -0700 | [diff] [blame] | 514 | /*!\brief aom_codec_control wrapper macro (adds type-checking, less flexible) |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 515 | * |
| 516 | * This macro allows for type safe conversions across the variadic parameter |
Elliott Karpilovsky | 60dd0f9 | 2020-04-30 19:19:27 -0700 | [diff] [blame] | 517 | * to aom_codec_control(). However, it requires the explicit control ID |
| 518 | * be passed in (it cannot be passed in via a variable) -- otherwise a compiler |
| 519 | * error will occur. After the type checking, it calls aom_codec_control. |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 520 | */ |
Elliott Karpilovsky | 60dd0f9 | 2020-04-30 19:19:27 -0700 | [diff] [blame] | 521 | #define AOM_CODEC_CONTROL_TYPECHECKED(ctx, id, data) \ |
| 522 | aom_codec_control_typechecked_##id(ctx, id, data) /**<\hideinitializer*/ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 523 | |
Elliott Karpilovsky | 60dd0f9 | 2020-04-30 19:19:27 -0700 | [diff] [blame] | 524 | /*!\brief Creates typechecking mechanisms for aom_codec_control |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 525 | * |
Elliott Karpilovsky | 60dd0f9 | 2020-04-30 19:19:27 -0700 | [diff] [blame] | 526 | * It defines a static function with the correctly typed arguments as a wrapper |
| 527 | * to the type-unsafe aom_codec_control function. It also creates a typedef |
| 528 | * for each type. |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 529 | */ |
Elliott Karpilovsky | 60dd0f9 | 2020-04-30 19:19:27 -0700 | [diff] [blame] | 530 | #define AOM_CTRL_USE_TYPE(id, typ) \ |
| 531 | static aom_codec_err_t aom_codec_control_typechecked_##id( \ |
| 532 | aom_codec_ctx_t *, int, typ) AOM_UNUSED; \ |
| 533 | static aom_codec_err_t aom_codec_control_typechecked_##id( \ |
| 534 | aom_codec_ctx_t *ctx, int ctrl, typ data) { \ |
| 535 | return aom_codec_control(ctx, ctrl, data); \ |
| 536 | } /**<\hideinitializer*/ \ |
| 537 | typedef typ aom_codec_control_type_##id; |
| 538 | /*!@} end Codec Control group */ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 539 | |
Tom Finegan | 95d900a | 2017-12-01 10:00:50 -0800 | [diff] [blame] | 540 | /*!\brief OBU types. */ |
Satish Kumar Suman | 9b1252e | 2018-12-25 11:21:18 +0530 | [diff] [blame] | 541 | typedef enum ATTRIBUTE_PACKED { |
Tom Finegan | 95d900a | 2017-12-01 10:00:50 -0800 | [diff] [blame] | 542 | OBU_SEQUENCE_HEADER = 1, |
Tom Finegan | 3e63274 | 2017-12-01 10:08:53 -0800 | [diff] [blame] | 543 | OBU_TEMPORAL_DELIMITER = 2, |
Tom Finegan | 95d900a | 2017-12-01 10:00:50 -0800 | [diff] [blame] | 544 | OBU_FRAME_HEADER = 3, |
| 545 | OBU_TILE_GROUP = 4, |
| 546 | OBU_METADATA = 5, |
Vignesh Venkatasubramanian | b2ce34e | 2018-03-05 16:57:40 -0800 | [diff] [blame] | 547 | OBU_FRAME = 6, |
Tom Finegan | f927381 | 2018-03-14 09:49:45 -0700 | [diff] [blame] | 548 | OBU_REDUNDANT_FRAME_HEADER = 7, |
Yunqing Wang | 167b09e | 2018-05-24 16:02:32 -0700 | [diff] [blame] | 549 | OBU_TILE_LIST = 8, |
Tom Finegan | 95d900a | 2017-12-01 10:00:50 -0800 | [diff] [blame] | 550 | OBU_PADDING = 15, |
Satish Kumar Suman | 9b1252e | 2018-12-25 11:21:18 +0530 | [diff] [blame] | 551 | } OBU_TYPE; |
Tom Finegan | 95d900a | 2017-12-01 10:00:50 -0800 | [diff] [blame] | 552 | |
| 553 | /*!\brief OBU metadata types. */ |
Satish Kumar Suman | 9b1252e | 2018-12-25 11:21:18 +0530 | [diff] [blame] | 554 | typedef enum { |
Cyril Concolato | 33c3870 | 2018-05-08 10:17:14 -0700 | [diff] [blame] | 555 | OBU_METADATA_TYPE_AOM_RESERVED_0 = 0, |
Tom Finegan | 3e63274 | 2017-12-01 10:08:53 -0800 | [diff] [blame] | 556 | OBU_METADATA_TYPE_HDR_CLL = 1, |
| 557 | OBU_METADATA_TYPE_HDR_MDCV = 2, |
Soo-Chul Han | f858986 | 2018-01-24 03:13:14 +0000 | [diff] [blame] | 558 | OBU_METADATA_TYPE_SCALABILITY = 3, |
Cyril Concolato | 33c3870 | 2018-05-08 10:17:14 -0700 | [diff] [blame] | 559 | OBU_METADATA_TYPE_ITUT_T35 = 4, |
Ilya Brailovskiy | fe946eb | 2018-04-05 18:09:58 -0700 | [diff] [blame] | 560 | OBU_METADATA_TYPE_TIMECODE = 5, |
Satish Kumar Suman | 9b1252e | 2018-12-25 11:21:18 +0530 | [diff] [blame] | 561 | } OBU_METADATA_TYPE; |
Tom Finegan | 95d900a | 2017-12-01 10:00:50 -0800 | [diff] [blame] | 562 | |
Tom Finegan | 8fe8d51 | 2018-03-14 10:38:49 -0700 | [diff] [blame] | 563 | /*!\brief Returns string representation of OBU_TYPE. |
| 564 | * |
| 565 | * \param[in] type The OBU_TYPE to convert to string. |
| 566 | */ |
| 567 | const char *aom_obu_type_to_string(OBU_TYPE type); |
| 568 | |
clang-format | 83a5207 | 2016-08-08 20:22:13 -0700 | [diff] [blame] | 569 | /*!@} - end defgroup codec*/ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 570 | #ifdef __cplusplus |
| 571 | } |
| 572 | #endif |
James Zern | e1cbb13 | 2018-08-22 14:10:36 -0700 | [diff] [blame] | 573 | #endif // AOM_AOM_AOM_CODEC_H_ |