@pproenca/ffmpeg-darwin-arm64-lgpl 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/include/aom/aom.h +127 -0
  2. package/include/aom/aom_codec.h +594 -0
  3. package/include/aom/aom_decoder.h +257 -0
  4. package/include/aom/aom_encoder.h +1154 -0
  5. package/include/aom/aom_external_partition.h +452 -0
  6. package/include/aom/aom_frame_buffer.h +84 -0
  7. package/include/aom/aom_image.h +462 -0
  8. package/include/aom/aom_integer.h +60 -0
  9. package/include/aom/aomcx.h +2288 -0
  10. package/include/aom/aomdx.h +607 -0
  11. package/include/dav1d/common.h +94 -0
  12. package/include/dav1d/data.h +117 -0
  13. package/include/dav1d/dav1d.h +329 -0
  14. package/include/dav1d/headers.h +444 -0
  15. package/include/dav1d/picture.h +157 -0
  16. package/include/dav1d/version.h +50 -0
  17. package/include/index.js +1 -0
  18. package/include/lame/lame.h +1342 -0
  19. package/include/libavcodec/ac3_parser.h +36 -0
  20. package/include/libavcodec/adts_parser.h +37 -0
  21. package/include/libavcodec/avcodec.h +3128 -0
  22. package/include/libavcodec/avdct.h +88 -0
  23. package/include/libavcodec/avfft.h +149 -0
  24. package/include/libavcodec/bsf.h +332 -0
  25. package/include/libavcodec/codec.h +382 -0
  26. package/include/libavcodec/codec_desc.h +134 -0
  27. package/include/libavcodec/codec_id.h +669 -0
  28. package/include/libavcodec/codec_par.h +248 -0
  29. package/include/libavcodec/d3d11va.h +109 -0
  30. package/include/libavcodec/defs.h +337 -0
  31. package/include/libavcodec/dirac.h +135 -0
  32. package/include/libavcodec/dv_profile.h +82 -0
  33. package/include/libavcodec/dxva2.h +90 -0
  34. package/include/libavcodec/jni.h +67 -0
  35. package/include/libavcodec/mediacodec.h +103 -0
  36. package/include/libavcodec/packet.h +887 -0
  37. package/include/libavcodec/qsv.h +109 -0
  38. package/include/libavcodec/vdpau.h +171 -0
  39. package/include/libavcodec/version.h +45 -0
  40. package/include/libavcodec/version_major.h +52 -0
  41. package/include/libavcodec/videotoolbox.h +85 -0
  42. package/include/libavcodec/vorbis_parser.h +74 -0
  43. package/include/libavdevice/avdevice.h +397 -0
  44. package/include/libavdevice/version.h +45 -0
  45. package/include/libavdevice/version_major.h +43 -0
  46. package/include/libavfilter/avfilter.h +1379 -0
  47. package/include/libavfilter/buffersink.h +173 -0
  48. package/include/libavfilter/buffersrc.h +215 -0
  49. package/include/libavfilter/version.h +48 -0
  50. package/include/libavfilter/version_major.h +40 -0
  51. package/include/libavformat/avformat.h +3107 -0
  52. package/include/libavformat/avio.h +831 -0
  53. package/include/libavformat/version.h +47 -0
  54. package/include/libavformat/version_major.h +54 -0
  55. package/include/libavutil/adler32.h +63 -0
  56. package/include/libavutil/aes.h +69 -0
  57. package/include/libavutil/aes_ctr.h +99 -0
  58. package/include/libavutil/ambient_viewing_environment.h +72 -0
  59. package/include/libavutil/attributes.h +173 -0
  60. package/include/libavutil/audio_fifo.h +187 -0
  61. package/include/libavutil/avassert.h +78 -0
  62. package/include/libavutil/avconfig.h +6 -0
  63. package/include/libavutil/avstring.h +428 -0
  64. package/include/libavutil/avutil.h +362 -0
  65. package/include/libavutil/base64.h +72 -0
  66. package/include/libavutil/blowfish.h +82 -0
  67. package/include/libavutil/bprint.h +254 -0
  68. package/include/libavutil/bswap.h +105 -0
  69. package/include/libavutil/buffer.h +322 -0
  70. package/include/libavutil/camellia.h +70 -0
  71. package/include/libavutil/cast5.h +80 -0
  72. package/include/libavutil/channel_layout.h +751 -0
  73. package/include/libavutil/common.h +589 -0
  74. package/include/libavutil/cpu.h +145 -0
  75. package/include/libavutil/crc.h +102 -0
  76. package/include/libavutil/csp.h +150 -0
  77. package/include/libavutil/des.h +81 -0
  78. package/include/libavutil/detection_bbox.h +108 -0
  79. package/include/libavutil/dict.h +241 -0
  80. package/include/libavutil/display.h +109 -0
  81. package/include/libavutil/dovi_meta.h +396 -0
  82. package/include/libavutil/downmix_info.h +115 -0
  83. package/include/libavutil/encryption_info.h +205 -0
  84. package/include/libavutil/error.h +129 -0
  85. package/include/libavutil/eval.h +140 -0
  86. package/include/libavutil/executor.h +67 -0
  87. package/include/libavutil/ffversion.h +5 -0
  88. package/include/libavutil/fifo.h +242 -0
  89. package/include/libavutil/file.h +62 -0
  90. package/include/libavutil/film_grain_params.h +322 -0
  91. package/include/libavutil/frame.h +1175 -0
  92. package/include/libavutil/hash.h +264 -0
  93. package/include/libavutil/hdr_dynamic_metadata.h +376 -0
  94. package/include/libavutil/hdr_dynamic_vivid_metadata.h +346 -0
  95. package/include/libavutil/hmac.h +99 -0
  96. package/include/libavutil/hwcontext.h +598 -0
  97. package/include/libavutil/hwcontext_cuda.h +74 -0
  98. package/include/libavutil/hwcontext_d3d11va.h +178 -0
  99. package/include/libavutil/hwcontext_d3d12va.h +142 -0
  100. package/include/libavutil/hwcontext_drm.h +169 -0
  101. package/include/libavutil/hwcontext_dxva2.h +75 -0
  102. package/include/libavutil/hwcontext_mediacodec.h +61 -0
  103. package/include/libavutil/hwcontext_opencl.h +100 -0
  104. package/include/libavutil/hwcontext_qsv.h +87 -0
  105. package/include/libavutil/hwcontext_vaapi.h +117 -0
  106. package/include/libavutil/hwcontext_vdpau.h +44 -0
  107. package/include/libavutil/hwcontext_videotoolbox.h +106 -0
  108. package/include/libavutil/hwcontext_vulkan.h +382 -0
  109. package/include/libavutil/iamf.h +690 -0
  110. package/include/libavutil/imgutils.h +377 -0
  111. package/include/libavutil/intfloat.h +77 -0
  112. package/include/libavutil/intreadwrite.h +677 -0
  113. package/include/libavutil/lfg.h +81 -0
  114. package/include/libavutil/log.h +387 -0
  115. package/include/libavutil/lzo.h +66 -0
  116. package/include/libavutil/macros.h +80 -0
  117. package/include/libavutil/mastering_display_metadata.h +137 -0
  118. package/include/libavutil/mathematics.h +300 -0
  119. package/include/libavutil/md5.h +89 -0
  120. package/include/libavutil/mem.h +607 -0
  121. package/include/libavutil/motion_vector.h +57 -0
  122. package/include/libavutil/murmur3.h +115 -0
  123. package/include/libavutil/opt.h +1187 -0
  124. package/include/libavutil/parseutils.h +197 -0
  125. package/include/libavutil/pixdesc.h +440 -0
  126. package/include/libavutil/pixelutils.h +51 -0
  127. package/include/libavutil/pixfmt.h +716 -0
  128. package/include/libavutil/random_seed.h +57 -0
  129. package/include/libavutil/rational.h +225 -0
  130. package/include/libavutil/rc4.h +69 -0
  131. package/include/libavutil/replaygain.h +50 -0
  132. package/include/libavutil/ripemd.h +83 -0
  133. package/include/libavutil/samplefmt.h +269 -0
  134. package/include/libavutil/sha.h +90 -0
  135. package/include/libavutil/sha512.h +92 -0
  136. package/include/libavutil/spherical.h +243 -0
  137. package/include/libavutil/stereo3d.h +325 -0
  138. package/include/libavutil/tea.h +71 -0
  139. package/include/libavutil/threadmessage.h +115 -0
  140. package/include/libavutil/time.h +56 -0
  141. package/include/libavutil/timecode.h +199 -0
  142. package/include/libavutil/timestamp.h +85 -0
  143. package/include/libavutil/tree.h +137 -0
  144. package/include/libavutil/twofish.h +70 -0
  145. package/include/libavutil/tx.h +210 -0
  146. package/include/libavutil/uuid.h +146 -0
  147. package/include/libavutil/version.h +124 -0
  148. package/include/libavutil/video_enc_params.h +171 -0
  149. package/include/libavutil/video_hint.h +107 -0
  150. package/include/libavutil/xtea.h +94 -0
  151. package/include/libswresample/swresample.h +587 -0
  152. package/include/libswresample/version.h +46 -0
  153. package/include/libswresample/version_major.h +31 -0
  154. package/include/libswscale/swscale.h +460 -0
  155. package/include/libswscale/version.h +44 -0
  156. package/include/libswscale/version_major.h +35 -0
  157. package/include/ogg/config_types.h +26 -0
  158. package/include/ogg/ogg.h +209 -0
  159. package/include/ogg/os_types.h +158 -0
  160. package/include/opus/opus.h +1099 -0
  161. package/include/opus/opus_defines.h +830 -0
  162. package/include/opus/opus_multistream.h +660 -0
  163. package/include/opus/opus_projection.h +568 -0
  164. package/include/opus/opus_types.h +166 -0
  165. package/include/svt-av1/EbDebugMacros.h +88 -0
  166. package/include/svt-av1/EbSvtAv1.h +462 -0
  167. package/include/svt-av1/EbSvtAv1Enc.h +1112 -0
  168. package/include/svt-av1/EbSvtAv1ErrorCodes.h +67 -0
  169. package/include/svt-av1/EbSvtAv1ExtFrameBuf.h +64 -0
  170. package/include/svt-av1/EbSvtAv1Formats.h +126 -0
  171. package/include/svt-av1/EbSvtAv1Metadata.h +156 -0
  172. package/include/vorbis/codec.h +242 -0
  173. package/include/vorbis/vorbisenc.h +435 -0
  174. package/include/vorbis/vorbisfile.h +205 -0
  175. package/include/vpx/vp8.h +136 -0
  176. package/include/vpx/vp8cx.h +1118 -0
  177. package/include/vpx/vp8dx.h +228 -0
  178. package/include/vpx/vpx_codec.h +475 -0
  179. package/include/vpx/vpx_decoder.h +367 -0
  180. package/include/vpx/vpx_encoder.h +1150 -0
  181. package/include/vpx/vpx_ext_ratectrl.h +590 -0
  182. package/include/vpx/vpx_frame_buffer.h +83 -0
  183. package/include/vpx/vpx_image.h +221 -0
  184. package/include/vpx/vpx_integer.h +40 -0
  185. package/include/vpx/vpx_tpl.h +68 -0
  186. package/lib/index.js +1 -0
  187. package/lib/libSvtAv1Enc.a +0 -0
  188. package/lib/libaom.a +0 -0
  189. package/lib/libavcodec.a +0 -0
  190. package/lib/libavdevice.a +0 -0
  191. package/lib/libavfilter.a +0 -0
  192. package/lib/libavformat.a +0 -0
  193. package/lib/libavutil.a +0 -0
  194. package/lib/libdav1d.a +0 -0
  195. package/lib/libmp3lame.a +0 -0
  196. package/lib/libogg.a +0 -0
  197. package/lib/libopus.a +0 -0
  198. package/lib/libswresample.a +0 -0
  199. package/lib/libswscale.a +0 -0
  200. package/lib/libvorbis.a +0 -0
  201. package/lib/libvorbisenc.a +0 -0
  202. package/lib/libvorbisfile.a +0 -0
  203. package/lib/libvpx.a +0 -0
  204. package/package.json +35 -0
  205. package/versions.json +1 -0
@@ -0,0 +1,1154 @@
1
+ /*
2
+ * Copyright (c) 2016, Alliance for Open Media. All rights reserved.
3
+ *
4
+ * This source code is subject to the terms of the BSD 2 Clause License and
5
+ * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6
+ * was not distributed with this source code in the LICENSE file, you can
7
+ * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8
+ * Media Patent License 1.0 was not distributed with this source code in the
9
+ * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10
+ */
11
+ #ifndef AOM_AOM_AOM_ENCODER_H_
12
+ #define AOM_AOM_AOM_ENCODER_H_
13
+
14
+ /*!\defgroup encoder Encoder Algorithm Interface
15
+ * \ingroup codec
16
+ * This abstraction allows applications using this encoder to easily support
17
+ * multiple video formats with minimal code duplication. This section describes
18
+ * the interface common to all encoders.
19
+ * @{
20
+ */
21
+
22
+ /*!\file
23
+ * \brief Describes the encoder algorithm interface to applications.
24
+ *
25
+ * This file describes the interface between an application and a
26
+ * video encoder algorithm.
27
+ *
28
+ */
29
+ #ifdef __cplusplus
30
+ extern "C" {
31
+ #endif
32
+
33
+ #include "aom/aom_codec.h" // IWYU pragma: export
34
+ #include "aom/aom_external_partition.h"
35
+
36
+ /*!\brief Current ABI version number
37
+ *
38
+ * \hideinitializer
39
+ * \internal
40
+ * If this file is altered in any way that changes the ABI, this value
41
+ * must be bumped. Examples include, but are not limited to, changing
42
+ * types, removing or reassigning enums, adding/removing/rearranging
43
+ * fields to structures
44
+ *
45
+ * Note: In the definition of AOM_ENCODER_ABI_VERSION, 3 is the value of
46
+ * AOM_EXT_PART_ABI_VERSION in libaom v3.2.0. The old value of
47
+ * AOM_EXT_PART_ABI_VERSION is used so as to not break the ABI version check in
48
+ * aom_codec_enc_init_ver() when an application compiled against libaom v3.2.0
49
+ * passes the old value of AOM_ENCODER_ABI_VERSION to aom_codec_enc_init_ver().
50
+ * The external partition API is still experimental. When it is declared stable,
51
+ * we will replace 3 with AOM_EXT_PART_ABI_VERSION in the definition of
52
+ * AOM_ENCODER_ABI_VERSION.
53
+ */
54
+ #define AOM_ENCODER_ABI_VERSION \
55
+ (10 + AOM_CODEC_ABI_VERSION + /*AOM_EXT_PART_ABI_VERSION=*/3)
56
+
57
+ /*! \brief Encoder capabilities bitfield
58
+ *
59
+ * Each encoder advertises the capabilities it supports as part of its
60
+ * ::aom_codec_iface_t interface structure. Capabilities are extra
61
+ * interfaces or functionality, and are not required to be supported
62
+ * by an encoder.
63
+ *
64
+ * The available flags are specified by AOM_CODEC_CAP_* defines.
65
+ */
66
+ #define AOM_CODEC_CAP_PSNR 0x10000 /**< Can issue PSNR packets */
67
+
68
+ /*! Can support input images at greater than 8 bitdepth.
69
+ */
70
+ #define AOM_CODEC_CAP_HIGHBITDEPTH 0x40000
71
+
72
+ /*! \brief Initialization-time Feature Enabling
73
+ *
74
+ * Certain codec features must be known at initialization time, to allow
75
+ * for proper memory allocation.
76
+ *
77
+ * The available flags are specified by AOM_CODEC_USE_* defines.
78
+ */
79
+ #define AOM_CODEC_USE_PSNR 0x10000 /**< Calculate PSNR on each frame */
80
+ #define AOM_CODEC_USE_HIGHBITDEPTH 0x40000 /**< Use high bitdepth */
81
+ // 0x80000 was used for the experimental feature AOM_CODEC_USE_PRESET during
82
+ // libaom v3.11.0 development but was removed before the release.
83
+
84
+ /*!\brief Generic fixed size buffer structure
85
+ *
86
+ * This structure is able to hold a reference to any fixed size buffer.
87
+ */
88
+ typedef struct aom_fixed_buf {
89
+ void *buf; /**< Pointer to the data. Does NOT own the data! */
90
+ size_t sz; /**< Length of the buffer, in chars */
91
+ } aom_fixed_buf_t; /**< alias for struct aom_fixed_buf */
92
+
93
+ /*!\brief Error Resilient flags
94
+ *
95
+ * These flags define which error resilient features to enable in the
96
+ * encoder. The flags are specified through the
97
+ * aom_codec_enc_cfg::g_error_resilient variable.
98
+ */
99
+ typedef uint32_t aom_codec_er_flags_t;
100
+ /*!\brief Improve resiliency against losses of whole frames */
101
+ #define AOM_ERROR_RESILIENT_DEFAULT 0x1
102
+
103
+ /*!\brief Encoder output packet variants
104
+ *
105
+ * This enumeration lists the different kinds of data packets that can be
106
+ * returned by calls to aom_codec_get_cx_data(). Algorithms \ref MAY
107
+ * extend this list to provide additional functionality.
108
+ */
109
+ enum aom_codec_cx_pkt_kind {
110
+ AOM_CODEC_CX_FRAME_PKT, /**< Compressed video frame */
111
+ AOM_CODEC_STATS_PKT, /**< Two-pass statistics for this frame */
112
+ AOM_CODEC_FPMB_STATS_PKT, /**< first pass mb statistics for this frame */
113
+ AOM_CODEC_PSNR_PKT, /**< PSNR statistics for this frame */
114
+ AOM_CODEC_CUSTOM_PKT = 256 /**< Algorithm extensions */
115
+ };
116
+
117
+ /*!\brief Encoder output packet
118
+ *
119
+ * This structure contains the different kinds of output data the encoder
120
+ * may produce while compressing a frame.
121
+ */
122
+ typedef struct aom_codec_cx_pkt {
123
+ enum aom_codec_cx_pkt_kind kind; /**< packet variant */
124
+ union {
125
+ struct {
126
+ void *buf; /**< compressed data buffer */
127
+ size_t sz; /**< length of compressed data */
128
+ /*!\brief time stamp to show frame (in timebase units) */
129
+ aom_codec_pts_t pts;
130
+ /*!\brief duration to show frame (in timebase units) */
131
+ unsigned long duration;
132
+ aom_codec_frame_flags_t flags; /**< flags for this frame */
133
+ /*!\brief the partition id defines the decoding order of the partitions.
134
+ * Only applicable when "output partition" mode is enabled. First
135
+ * partition has id 0.*/
136
+ int partition_id;
137
+ /*!\brief size of the visible frame in this packet */
138
+ size_t vis_frame_size;
139
+ } frame; /**< data for compressed frame packet */
140
+ aom_fixed_buf_t twopass_stats; /**< data for two-pass packet */
141
+ aom_fixed_buf_t firstpass_mb_stats; /**< first pass mb packet */
142
+ struct aom_psnr_pkt {
143
+ unsigned int samples[4]; /**< Number of samples, total/y/u/v */
144
+ uint64_t sse[4]; /**< sum squared error, total/y/u/v */
145
+ double psnr[4]; /**< PSNR, total/y/u/v */
146
+ /*!\brief Number of samples, total/y/u/v when
147
+ * input bit-depth < stream bit-depth.*/
148
+ unsigned int samples_hbd[4];
149
+ /*!\brief sum squared error, total/y/u/v when
150
+ * input bit-depth < stream bit-depth.*/
151
+ uint64_t sse_hbd[4];
152
+ /*!\brief PSNR, total/y/u/v when
153
+ * input bit-depth < stream bit-depth.*/
154
+ double psnr_hbd[4];
155
+ } psnr; /**< data for PSNR packet */
156
+ aom_fixed_buf_t raw; /**< data for arbitrary packets */
157
+ } data; /**< packet data */
158
+ } aom_codec_cx_pkt_t; /**< alias for struct aom_codec_cx_pkt */
159
+
160
+ /*!\brief Rational Number
161
+ *
162
+ * This structure holds a fractional value.
163
+ */
164
+ typedef struct aom_rational {
165
+ int num; /**< fraction numerator */
166
+ int den; /**< fraction denominator */
167
+ } aom_rational_t; /**< alias for struct aom_rational */
168
+
169
+ /*!\brief Multi-pass Encoding Pass
170
+ *
171
+ * AOM_RC_LAST_PASS is kept for backward compatibility.
172
+ * If passes is not given and pass==2, the codec will assume passes=2.
173
+ * For new code, it is recommended to use AOM_RC_SECOND_PASS and set
174
+ * the "passes" member to 2 via the key & val API for two-pass encoding.
175
+ */
176
+ enum aom_enc_pass {
177
+ AOM_RC_ONE_PASS = 0, /**< Single pass mode */
178
+ AOM_RC_FIRST_PASS = 1, /**< First pass of multi-pass mode */
179
+ AOM_RC_SECOND_PASS = 2, /**< Second pass of multi-pass mode */
180
+ AOM_RC_THIRD_PASS = 3, /**< Third pass of multi-pass mode */
181
+ AOM_RC_LAST_PASS = 2, /**< Final pass of two-pass mode */
182
+ };
183
+
184
+ /*!\brief Rate control mode */
185
+ enum aom_rc_mode {
186
+ AOM_VBR, /**< Variable Bit Rate (VBR) mode */
187
+ AOM_CBR, /**< Constant Bit Rate (CBR) mode */
188
+ AOM_CQ, /**< Constrained Quality (CQ) mode */
189
+ AOM_Q, /**< Constant Quality (Q) mode */
190
+ };
191
+
192
+ /*!\brief Keyframe placement mode.
193
+ *
194
+ * This enumeration determines whether keyframes are placed automatically by
195
+ * the encoder or whether this behavior is disabled. Older releases of this
196
+ * SDK were implemented such that AOM_KF_FIXED meant keyframes were disabled.
197
+ * This name is confusing for this behavior, so the new symbols to be used
198
+ * are AOM_KF_AUTO and AOM_KF_DISABLED.
199
+ */
200
+ enum aom_kf_mode {
201
+ AOM_KF_FIXED, /**< deprecated, implies AOM_KF_DISABLED */
202
+ AOM_KF_AUTO, /**< Encoder determines optimal placement automatically */
203
+ AOM_KF_DISABLED = 0 /**< Encoder does not place keyframes. */
204
+ };
205
+
206
+ /*!\brief Frame super-resolution mode. */
207
+ typedef enum {
208
+ /**< Frame super-resolution is disabled for all frames. */
209
+ AOM_SUPERRES_NONE,
210
+ /**< All frames are coded at the specified scale and super-resolved. */
211
+ AOM_SUPERRES_FIXED,
212
+ /**< All frames are coded at a random scale and super-resolved. */
213
+ AOM_SUPERRES_RANDOM,
214
+ /**< Super-resolution scale for each frame is determined based on the q index
215
+ of that frame. */
216
+ AOM_SUPERRES_QTHRESH,
217
+ /**< Full-resolution or super-resolution and the scale (in case of
218
+ super-resolution) are automatically selected for each frame. */
219
+ AOM_SUPERRES_AUTO,
220
+ } aom_superres_mode;
221
+
222
+ /*!\brief Encoder Config Options
223
+ *
224
+ * This type allows to enumerate and control flags defined for encoder control
225
+ * via config file at runtime.
226
+ */
227
+ typedef struct cfg_options {
228
+ /*!\brief Indicate init by cfg file
229
+ * 0 or 1
230
+ */
231
+ unsigned int init_by_cfg_file;
232
+ /*!\brief Superblock size
233
+ * 0, 64 or 128
234
+ */
235
+ unsigned int super_block_size;
236
+ /*!\brief max partition size
237
+ * 8, 16, 32, 64, 128
238
+ */
239
+ unsigned int max_partition_size;
240
+ /*!\brief min partition size
241
+ * 8, 16, 32, 64, 128
242
+ */
243
+ unsigned int min_partition_size;
244
+ /*!\brief disable AB Shape partition type
245
+ *
246
+ */
247
+ unsigned int disable_ab_partition_type;
248
+ /*!\brief disable rectangular partition type
249
+ *
250
+ */
251
+ unsigned int disable_rect_partition_type;
252
+ /*!\brief disable 1:4/4:1 partition type
253
+ *
254
+ */
255
+ unsigned int disable_1to4_partition_type;
256
+ /*!\brief disable flip and identity transform type
257
+ *
258
+ */
259
+ unsigned int disable_flip_idtx;
260
+ /*!\brief disable CDEF filter
261
+ *
262
+ */
263
+ unsigned int disable_cdef;
264
+ /*!\brief disable Loop Restoration Filter
265
+ *
266
+ */
267
+ unsigned int disable_lr;
268
+ /*!\brief disable OBMC
269
+ *
270
+ */
271
+ unsigned int disable_obmc;
272
+ /*!\brief disable Warped Motion
273
+ *
274
+ */
275
+ unsigned int disable_warp_motion;
276
+ /*!\brief disable global motion
277
+ *
278
+ */
279
+ unsigned int disable_global_motion;
280
+ /*!\brief disable dist weighted compound
281
+ *
282
+ */
283
+ unsigned int disable_dist_wtd_comp;
284
+ /*!\brief disable diff weighted compound
285
+ *
286
+ */
287
+ unsigned int disable_diff_wtd_comp;
288
+ /*!\brief disable inter/intra compound
289
+ *
290
+ */
291
+ unsigned int disable_inter_intra_comp;
292
+ /*!\brief disable masked compound
293
+ *
294
+ */
295
+ unsigned int disable_masked_comp;
296
+ /*!\brief disable one sided compound
297
+ *
298
+ */
299
+ unsigned int disable_one_sided_comp;
300
+ /*!\brief disable Palette
301
+ *
302
+ */
303
+ unsigned int disable_palette;
304
+ /*!\brief disable Intra Block Copy
305
+ *
306
+ */
307
+ unsigned int disable_intrabc;
308
+ /*!\brief disable chroma from luma
309
+ *
310
+ */
311
+ unsigned int disable_cfl;
312
+ /*!\brief disable intra smooth mode
313
+ *
314
+ */
315
+ unsigned int disable_smooth_intra;
316
+ /*!\brief disable filter intra
317
+ *
318
+ */
319
+ unsigned int disable_filter_intra;
320
+ /*!\brief disable dual filter
321
+ *
322
+ */
323
+ unsigned int disable_dual_filter;
324
+ /*!\brief disable intra angle delta
325
+ *
326
+ */
327
+ unsigned int disable_intra_angle_delta;
328
+ /*!\brief disable intra edge filter
329
+ *
330
+ */
331
+ unsigned int disable_intra_edge_filter;
332
+ /*!\brief disable 64x64 transform
333
+ *
334
+ */
335
+ unsigned int disable_tx_64x64;
336
+ /*!\brief disable smooth inter/intra
337
+ *
338
+ */
339
+ unsigned int disable_smooth_inter_intra;
340
+ /*!\brief disable inter/inter wedge comp
341
+ *
342
+ */
343
+ unsigned int disable_inter_inter_wedge;
344
+ /*!\brief disable inter/intra wedge comp
345
+ *
346
+ */
347
+ unsigned int disable_inter_intra_wedge;
348
+ /*!\brief disable paeth intra
349
+ *
350
+ */
351
+ unsigned int disable_paeth_intra;
352
+ /*!\brief disable trellis quantization
353
+ *
354
+ */
355
+ unsigned int disable_trellis_quant;
356
+ /*!\brief disable ref frame MV
357
+ *
358
+ */
359
+ unsigned int disable_ref_frame_mv;
360
+ /*!\brief use reduced reference frame set
361
+ *
362
+ */
363
+ unsigned int reduced_reference_set;
364
+ /*!\brief use reduced transform type set
365
+ *
366
+ */
367
+ unsigned int reduced_tx_type_set;
368
+ } cfg_options_t;
369
+
370
+ /*!\brief Encoded Frame Flags
371
+ *
372
+ * This type indicates a bitfield to be passed to aom_codec_encode(), defining
373
+ * per-frame boolean values. By convention, bits common to all codecs will be
374
+ * named AOM_EFLAG_*, and bits specific to an algorithm will be named
375
+ * /algo/_eflag_*. The lower order 16 bits are reserved for common use.
376
+ */
377
+ typedef long aom_enc_frame_flags_t;
378
+ /*!\brief Force this frame to be a keyframe */
379
+ #define AOM_EFLAG_FORCE_KF (1 << 0)
380
+
381
+ /*!\brief Encoder configuration structure
382
+ *
383
+ * This structure contains the encoder settings that have common representations
384
+ * across all codecs. This doesn't imply that all codecs support all features,
385
+ * however.
386
+ */
387
+ typedef struct aom_codec_enc_cfg {
388
+ /*
389
+ * generic settings (g)
390
+ */
391
+
392
+ /*!\brief Algorithm specific "usage" value
393
+ *
394
+ * Algorithms may define multiple values for usage, which may convey the
395
+ * intent of how the application intends to use the stream. If this value
396
+ * is non-zero, consult the documentation for the codec to determine its
397
+ * meaning.
398
+ */
399
+ unsigned int g_usage;
400
+
401
+ /*!\brief Maximum number of threads to use
402
+ *
403
+ * For multi-threaded implementations, use no more than this number of
404
+ * threads. The codec may use fewer threads than allowed. The value
405
+ * 0 is equivalent to the value 1.
406
+ */
407
+ unsigned int g_threads;
408
+
409
+ /*!\brief Bitstream profile to use
410
+ *
411
+ * Some codecs support a notion of multiple bitstream profiles. Typically
412
+ * this maps to a set of features that are turned on or off. Often the
413
+ * profile to use is determined by the features of the intended decoder.
414
+ * Consult the documentation for the codec to determine the valid values
415
+ * for this parameter, or set to zero for a sane default.
416
+ */
417
+ unsigned int g_profile; /**< profile of bitstream to use */
418
+
419
+ /*!\brief Width of the frame
420
+ *
421
+ * This value identifies the presentation resolution of the frame,
422
+ * in pixels. Note that the frames passed as input to the encoder must
423
+ * have this resolution. Frames will be presented by the decoder in this
424
+ * resolution, independent of any spatial resampling the encoder may do.
425
+ */
426
+ unsigned int g_w;
427
+
428
+ /*!\brief Height of the frame
429
+ *
430
+ * This value identifies the presentation resolution of the frame,
431
+ * in pixels. Note that the frames passed as input to the encoder must
432
+ * have this resolution. Frames will be presented by the decoder in this
433
+ * resolution, independent of any spatial resampling the encoder may do.
434
+ */
435
+ unsigned int g_h;
436
+
437
+ /*!\brief Max number of frames to encode
438
+ *
439
+ * If force video mode is off (the default) and g_limit is 1, the encoder
440
+ * will encode a still picture (still_picture is set to 1 in the sequence
441
+ * header OBU). If in addition full_still_picture_hdr is 0 (the default),
442
+ * the encoder will use a reduced header (reduced_still_picture_header is
443
+ * set to 1 in the sequence header OBU) for the still picture.
444
+ */
445
+ unsigned int g_limit;
446
+
447
+ /*!\brief Forced maximum width of the frame
448
+ *
449
+ * If this value is non-zero then it is used to force the maximum frame
450
+ * width written in write_sequence_header().
451
+ */
452
+ unsigned int g_forced_max_frame_width;
453
+
454
+ /*!\brief Forced maximum height of the frame
455
+ *
456
+ * If this value is non-zero then it is used to force the maximum frame
457
+ * height written in write_sequence_header().
458
+ */
459
+ unsigned int g_forced_max_frame_height;
460
+
461
+ /*!\brief Bit-depth of the codec
462
+ *
463
+ * This value identifies the bit_depth of the codec,
464
+ * Only certain bit-depths are supported as identified in the
465
+ * aom_bit_depth_t enum.
466
+ */
467
+ aom_bit_depth_t g_bit_depth;
468
+
469
+ /*!\brief Bit-depth of the input frames
470
+ *
471
+ * This value identifies the bit_depth of the input frames in bits.
472
+ * Note that the frames passed as input to the encoder must have
473
+ * this bit-depth.
474
+ */
475
+ unsigned int g_input_bit_depth;
476
+
477
+ /*!\brief Stream timebase units
478
+ *
479
+ * Indicates the smallest interval of time, in seconds, used by the stream.
480
+ * For fixed frame rate material, or variable frame rate material where
481
+ * frames are timed at a multiple of a given clock (ex: video capture),
482
+ * the \ref RECOMMENDED method is to set the timebase to the reciprocal
483
+ * of the frame rate (ex: 1001/30000 for 29.970 Hz NTSC). This allows the
484
+ * pts to correspond to the frame number, which can be handy. For
485
+ * re-encoding video from containers with absolute time timestamps, the
486
+ * \ref RECOMMENDED method is to set the timebase to that of the parent
487
+ * container or multimedia framework (ex: 1/1000 for ms, as in FLV).
488
+ */
489
+ struct aom_rational g_timebase;
490
+
491
+ /*!\brief Enable error resilient modes.
492
+ *
493
+ * The error resilient bitfield indicates to the encoder which features
494
+ * it should enable to take measures for streaming over lossy or noisy
495
+ * links.
496
+ */
497
+ aom_codec_er_flags_t g_error_resilient;
498
+
499
+ /*!\brief Multi-pass Encoding Mode
500
+ *
501
+ * This value should be set to the current phase for multi-pass encoding.
502
+ * For single pass, set to #AOM_RC_ONE_PASS.
503
+ */
504
+ enum aom_enc_pass g_pass;
505
+
506
+ /*!\brief Allow lagged encoding
507
+ *
508
+ * If set, this value allows the encoder to consume a number of input
509
+ * frames before producing output frames. This allows the encoder to
510
+ * base decisions for the current frame on future frames. This does
511
+ * increase the latency of the encoding pipeline, so it is not appropriate
512
+ * in all situations (ex: realtime encoding).
513
+ *
514
+ * Note that this is a maximum value -- the encoder may produce frames
515
+ * sooner than the given limit. Set this value to 0 to disable this
516
+ * feature.
517
+ */
518
+ unsigned int g_lag_in_frames;
519
+
520
+ /*
521
+ * rate control settings (rc)
522
+ */
523
+
524
+ /*!\brief Temporal resampling configuration, if supported by the codec.
525
+ *
526
+ * Temporal resampling allows the codec to "drop" frames as a strategy to
527
+ * meet its target data rate. This can cause temporal discontinuities in
528
+ * the encoded video, which may appear as stuttering during playback. This
529
+ * trade-off is often acceptable, but for many applications is not. It can
530
+ * be disabled in these cases.
531
+ *
532
+ * Note that not all codecs support this feature. All aom AVx codecs do.
533
+ * For other codecs, consult the documentation for that algorithm.
534
+ *
535
+ * This threshold is described as a percentage of the target data buffer.
536
+ * When the data buffer falls below this percentage of fullness, a
537
+ * dropped frame is indicated. Set the threshold to zero (0) to disable
538
+ * this feature.
539
+ */
540
+ unsigned int rc_dropframe_thresh;
541
+
542
+ /*!\brief Mode for spatial resampling, if supported by the codec.
543
+ *
544
+ * Spatial resampling allows the codec to compress a lower resolution
545
+ * version of the frame, which is then upscaled by the decoder to the
546
+ * correct presentation resolution. This increases visual quality at
547
+ * low data rates, at the expense of CPU time on the encoder/decoder.
548
+ */
549
+ unsigned int rc_resize_mode;
550
+
551
+ /*!\brief Frame resize denominator.
552
+ *
553
+ * The denominator for resize to use, assuming 8 as the numerator.
554
+ *
555
+ * Valid denominators are 8 - 16 for now.
556
+ */
557
+ unsigned int rc_resize_denominator;
558
+
559
+ /*!\brief Keyframe resize denominator.
560
+ *
561
+ * The denominator for resize to use, assuming 8 as the numerator.
562
+ *
563
+ * Valid denominators are 8 - 16 for now.
564
+ */
565
+ unsigned int rc_resize_kf_denominator;
566
+
567
+ /*!\brief Frame super-resolution scaling mode.
568
+ *
569
+ * Similar to spatial resampling, frame super-resolution integrates
570
+ * upscaling after the encode/decode process. Taking control of upscaling and
571
+ * using restoration filters should allow it to outperform normal resizing.
572
+ */
573
+ aom_superres_mode rc_superres_mode;
574
+
575
+ /*!\brief Frame super-resolution denominator.
576
+ *
577
+ * The denominator for superres to use. If fixed it will only change if the
578
+ * cumulative scale change over resizing and superres is greater than 1/2;
579
+ * this forces superres to reduce scaling.
580
+ *
581
+ * Valid denominators are 8 to 16.
582
+ *
583
+ * Used only by AOM_SUPERRES_FIXED.
584
+ */
585
+ unsigned int rc_superres_denominator;
586
+
587
+ /*!\brief Keyframe super-resolution denominator.
588
+ *
589
+ * The denominator for superres to use. If fixed it will only change if the
590
+ * cumulative scale change over resizing and superres is greater than 1/2;
591
+ * this forces superres to reduce scaling.
592
+ *
593
+ * Valid denominators are 8 - 16 for now.
594
+ */
595
+ unsigned int rc_superres_kf_denominator;
596
+
597
+ /*!\brief Frame super-resolution q threshold.
598
+ *
599
+ * The q level threshold after which superres is used.
600
+ * Valid values are 1 to 63.
601
+ *
602
+ * Used only by AOM_SUPERRES_QTHRESH
603
+ */
604
+ unsigned int rc_superres_qthresh;
605
+
606
+ /*!\brief Keyframe super-resolution q threshold.
607
+ *
608
+ * The q level threshold after which superres is used for key frames.
609
+ * Valid values are 1 to 63.
610
+ *
611
+ * Used only by AOM_SUPERRES_QTHRESH
612
+ */
613
+ unsigned int rc_superres_kf_qthresh;
614
+
615
+ /*!\brief Rate control algorithm to use.
616
+ *
617
+ * Indicates whether the end usage of this stream is to be streamed over
618
+ * a bandwidth constrained link, indicating that Constant Bit Rate (CBR)
619
+ * mode should be used, or whether it will be played back on a high
620
+ * bandwidth link, as from a local disk, where higher variations in
621
+ * bitrate are acceptable.
622
+ */
623
+ enum aom_rc_mode rc_end_usage;
624
+
625
+ /*!\brief Two-pass stats buffer.
626
+ *
627
+ * A buffer containing all of the stats packets produced in the first
628
+ * pass, concatenated.
629
+ */
630
+ aom_fixed_buf_t rc_twopass_stats_in;
631
+
632
+ /*!\brief first pass mb stats buffer.
633
+ *
634
+ * A buffer containing all of the first pass mb stats packets produced
635
+ * in the first pass, concatenated.
636
+ */
637
+ aom_fixed_buf_t rc_firstpass_mb_stats_in;
638
+
639
+ /*!\brief Target data rate
640
+ *
641
+ * Target bitrate to use for this stream, in kilobits per second.
642
+ * Max allowed value is 2000000
643
+ */
644
+ unsigned int rc_target_bitrate;
645
+
646
+ /*
647
+ * quantizer settings
648
+ */
649
+
650
+ /*!\brief Minimum (Best Quality) Quantizer
651
+ *
652
+ * The quantizer is the most direct control over the quality of the
653
+ * encoded image. The range of valid values for the quantizer is codec
654
+ * specific. Consult the documentation for the codec to determine the
655
+ * values to use. To determine the range programmatically, call
656
+ * aom_codec_enc_config_default() with a usage value of 0.
657
+ */
658
+ unsigned int rc_min_quantizer;
659
+
660
+ /*!\brief Maximum (Worst Quality) Quantizer
661
+ *
662
+ * The quantizer is the most direct control over the quality of the
663
+ * encoded image. The range of valid values for the quantizer is codec
664
+ * specific. Consult the documentation for the codec to determine the
665
+ * values to use. To determine the range programmatically, call
666
+ * aom_codec_enc_config_default() with a usage value of 0.
667
+ */
668
+ unsigned int rc_max_quantizer;
669
+
670
+ /*
671
+ * bitrate tolerance
672
+ */
673
+
674
+ /*!\brief Rate control adaptation undershoot control
675
+ *
676
+ * This value, controls the tolerance of the VBR algorithm to undershoot
677
+ * and is used as a trigger threshold for more aggressive adaptation of Q.
678
+ *
679
+ * Valid values in the range 0-100.
680
+ */
681
+ unsigned int rc_undershoot_pct;
682
+
683
+ /*!\brief Rate control adaptation overshoot control
684
+ *
685
+ * This value, controls the tolerance of the VBR algorithm to overshoot
686
+ * and is used as a trigger threshold for more aggressive adaptation of Q.
687
+ *
688
+ * Valid values in the range 0-100.
689
+ */
690
+ unsigned int rc_overshoot_pct;
691
+
692
+ /*
693
+ * decoder buffer model parameters
694
+ */
695
+
696
+ /*!\brief Decoder Buffer Size
697
+ *
698
+ * This value indicates the amount of data that may be buffered by the
699
+ * decoding application. Note that this value is expressed in units of
700
+ * time (milliseconds). For example, a value of 5000 indicates that the
701
+ * client will buffer (at least) 5000ms worth of encoded data. Use the
702
+ * target bitrate (#rc_target_bitrate) to convert to bits/bytes, if
703
+ * necessary.
704
+ */
705
+ unsigned int rc_buf_sz;
706
+
707
+ /*!\brief Decoder Buffer Initial Size
708
+ *
709
+ * This value indicates the amount of data that will be buffered by the
710
+ * decoding application prior to beginning playback. This value is
711
+ * expressed in units of time (milliseconds). Use the target bitrate
712
+ * (#rc_target_bitrate) to convert to bits/bytes, if necessary.
713
+ */
714
+ unsigned int rc_buf_initial_sz;
715
+
716
+ /*!\brief Decoder Buffer Optimal Size
717
+ *
718
+ * This value indicates the amount of data that the encoder should try
719
+ * to maintain in the decoder's buffer. This value is expressed in units
720
+ * of time (milliseconds). Use the target bitrate (#rc_target_bitrate)
721
+ * to convert to bits/bytes, if necessary.
722
+ */
723
+ unsigned int rc_buf_optimal_sz;
724
+
725
+ /*
726
+ * 2 pass rate control parameters
727
+ */
728
+
729
+ /*!\brief Two-pass mode CBR/VBR bias
730
+ *
731
+ * Bias, expressed on a scale of 0 to 100, for determining target size
732
+ * for the current frame. The value 0 indicates the optimal CBR mode
733
+ * value should be used. The value 100 indicates the optimal VBR mode
734
+ * value should be used. Values in between indicate which way the
735
+ * encoder should "lean."
736
+ */
737
+ unsigned int rc_2pass_vbr_bias_pct;
738
+
739
+ /*!\brief Two-pass mode per-GOP minimum bitrate
740
+ *
741
+ * This value, expressed as a percentage of the target bitrate, indicates
742
+ * the minimum bitrate to be used for a single GOP (aka "section")
743
+ */
744
+ unsigned int rc_2pass_vbr_minsection_pct;
745
+
746
+ /*!\brief Two-pass mode per-GOP maximum bitrate
747
+ *
748
+ * This value, expressed as a percentage of the target bitrate, indicates
749
+ * the maximum bitrate to be used for a single GOP (aka "section")
750
+ */
751
+ unsigned int rc_2pass_vbr_maxsection_pct;
752
+
753
+ /*
754
+ * keyframing settings (kf)
755
+ */
756
+
757
+ /*!\brief Option to enable forward reference key frame
758
+ *
759
+ */
760
+ int fwd_kf_enabled;
761
+
762
+ /*!\brief Keyframe placement mode
763
+ *
764
+ * This value indicates whether the encoder should place keyframes at a
765
+ * fixed interval, or determine the optimal placement automatically
766
+ * (as governed by the #kf_min_dist and #kf_max_dist parameters)
767
+ */
768
+ enum aom_kf_mode kf_mode;
769
+
770
+ /*!\brief Keyframe minimum interval
771
+ *
772
+ * This value, expressed as a number of frames, prevents the encoder from
773
+ * placing a keyframe nearer than kf_min_dist to the previous keyframe. At
774
+ * least kf_min_dist frames non-keyframes will be coded before the next
775
+ * keyframe. Set kf_min_dist equal to kf_max_dist for a fixed interval.
776
+ */
777
+ unsigned int kf_min_dist;
778
+
779
+ /*!\brief Keyframe maximum interval
780
+ *
781
+ * This value, expressed as a number of frames, forces the encoder to code
782
+ * a keyframe if one has not been coded in the last kf_max_dist frames.
783
+ * A value of 0 implies all frames will be keyframes. Set kf_min_dist
784
+ * equal to kf_max_dist for a fixed interval.
785
+ */
786
+ unsigned int kf_max_dist;
787
+
788
+ /*!\brief sframe interval
789
+ *
790
+ * This value, expressed as a number of frames, forces the encoder to code
791
+ * an S-Frame every sframe_dist frames.
792
+ */
793
+ unsigned int sframe_dist;
794
+
795
+ /*!\brief sframe insertion mode
796
+ *
797
+ * This value must be set to 1 or 2, and tells the encoder how to insert
798
+ * S-Frames. It will only have an effect if sframe_dist != 0.
799
+ *
800
+ * If altref is enabled:
801
+ * - if sframe_mode == 1, the considered frame will be made into an
802
+ * S-Frame only if it is an altref frame
803
+ * - if sframe_mode == 2, the next altref frame will be made into an
804
+ * S-Frame.
805
+ *
806
+ * Otherwise: the considered frame will be made into an S-Frame.
807
+ *
808
+ * \attention Not implemented.
809
+ */
810
+ unsigned int sframe_mode;
811
+
812
+ /*!\brief Tile coding mode
813
+ *
814
+ * This value indicates the tile coding mode.
815
+ * A value of 0 implies a normal non-large-scale tile coding. A value of 1
816
+ * implies a large-scale tile coding.
817
+ */
818
+ unsigned int large_scale_tile;
819
+
820
+ /*!\brief Monochrome mode
821
+ *
822
+ * If this is nonzero, the encoder will generate a monochrome stream
823
+ * with no chroma planes.
824
+ */
825
+ unsigned int monochrome;
826
+
827
+ /*!\brief full_still_picture_hdr
828
+ *
829
+ * If this is nonzero, the encoder will generate a full header
830
+ * (reduced_still_picture_header is set to 0 in the sequence header OBU) even
831
+ * for still picture encoding. If this is zero (the default), a reduced
832
+ * header (reduced_still_picture_header is set to 1 in the sequence header
833
+ * OBU) is used for still picture encoding. This flag has no effect when a
834
+ * regular video with more than a single frame is encoded.
835
+ */
836
+ unsigned int full_still_picture_hdr;
837
+
838
+ /*!\brief Bitstream syntax mode
839
+ *
840
+ * This value indicates the bitstream syntax mode.
841
+ * A value of 0 indicates bitstream is saved as Section 5 bitstream. A value
842
+ * of 1 indicates the bitstream is saved in Annex-B format
843
+ */
844
+ unsigned int save_as_annexb;
845
+
846
+ /*!\brief Number of explicit tile widths specified
847
+ *
848
+ * This value indicates the number of tile widths specified
849
+ * A value of 0 implies no tile widths are specified.
850
+ * Tile widths are given in the array tile_widths[]
851
+ */
852
+ int tile_width_count;
853
+
854
+ /*!\brief Number of explicit tile heights specified
855
+ *
856
+ * This value indicates the number of tile heights specified
857
+ * A value of 0 implies no tile heights are specified.
858
+ * Tile heights are given in the array tile_heights[]
859
+ */
860
+ int tile_height_count;
861
+
862
+ /*!\brief Maximum number of tile widths in tile widths array
863
+ *
864
+ * This define gives the maximum number of elements in the tile_widths array.
865
+ */
866
+ #define MAX_TILE_WIDTHS 64 // maximum tile width array length
867
+
868
+ /*!\brief Array of specified tile widths
869
+ *
870
+ * This array specifies tile widths (and may be empty)
871
+ * The number of widths specified is given by tile_width_count
872
+ */
873
+ int tile_widths[MAX_TILE_WIDTHS];
874
+
875
+ /*!\brief Maximum number of tile heights in tile heights array.
876
+ *
877
+ * This define gives the maximum number of elements in the tile_heights array.
878
+ */
879
+ #define MAX_TILE_HEIGHTS 64 // maximum tile height array length
880
+
881
+ /*!\brief Array of specified tile heights
882
+ *
883
+ * This array specifies tile heights (and may be empty)
884
+ * The number of heights specified is given by tile_height_count
885
+ */
886
+ int tile_heights[MAX_TILE_HEIGHTS];
887
+
888
+ /*!\brief Whether encoder should use fixed QP offsets.
889
+ *
890
+ * If a value of 1 is provided, encoder will use fixed QP offsets for frames
891
+ * at different levels of the pyramid.
892
+ * If a value of 0 is provided, encoder will NOT use fixed QP offsets.
893
+ * Note: This option is only relevant for --end-usage=q.
894
+ */
895
+ unsigned int use_fixed_qp_offsets;
896
+
897
+ /*!\brief Deprecated and ignored. DO NOT USE.
898
+ *
899
+ * TODO(aomedia:3269): Remove fixed_qp_offsets in libaom v4.0.0.
900
+ */
901
+ int fixed_qp_offsets[5];
902
+
903
+ /*!\brief Options defined per config file
904
+ *
905
+ */
906
+ cfg_options_t encoder_cfg;
907
+ } aom_codec_enc_cfg_t; /**< alias for struct aom_codec_enc_cfg */
908
+
909
+ /*!\brief Initialize an encoder instance
910
+ *
911
+ * Initializes an encoder context using the given interface. Applications
912
+ * should call the aom_codec_enc_init convenience macro instead of this
913
+ * function directly, to ensure that the ABI version number parameter
914
+ * is properly initialized.
915
+ *
916
+ * If the library was configured with -DCONFIG_MULTITHREAD=0, this call
917
+ * is not thread safe and should be guarded with a lock if being used
918
+ * in a multithreaded context.
919
+ *
920
+ * If aom_codec_enc_init_ver() fails, it is not necessary to call
921
+ * aom_codec_destroy() on the encoder context.
922
+ *
923
+ * \param[in] ctx Pointer to this instance's context.
924
+ * \param[in] iface Pointer to the algorithm interface to use.
925
+ * \param[in] cfg Configuration to use, if known.
926
+ * \param[in] flags Bitfield of AOM_CODEC_USE_* flags
927
+ * \param[in] ver ABI version number. Must be set to
928
+ * AOM_ENCODER_ABI_VERSION
929
+ * \retval #AOM_CODEC_OK
930
+ * The encoder algorithm has been initialized.
931
+ * \retval #AOM_CODEC_MEM_ERROR
932
+ * Memory allocation failed.
933
+ */
934
+ aom_codec_err_t aom_codec_enc_init_ver(aom_codec_ctx_t *ctx,
935
+ aom_codec_iface_t *iface,
936
+ const aom_codec_enc_cfg_t *cfg,
937
+ aom_codec_flags_t flags, int ver);
938
+
939
+ /*!\brief Convenience macro for aom_codec_enc_init_ver()
940
+ *
941
+ * Ensures the ABI version parameter is properly set.
942
+ */
943
+ #define aom_codec_enc_init(ctx, iface, cfg, flags) \
944
+ aom_codec_enc_init_ver(ctx, iface, cfg, flags, AOM_ENCODER_ABI_VERSION)
945
+
946
+ /*!\brief Get the default configuration for a usage.
947
+ *
948
+ * Initializes an encoder configuration structure with default values. Supports
949
+ * the notion of "usages" so that an algorithm may offer different default
950
+ * settings depending on the user's intended goal. This function \ref SHOULD
951
+ * be called by all applications to initialize the configuration structure
952
+ * before specializing the configuration with application specific values.
953
+ *
954
+ * \param[in] iface Pointer to the algorithm interface to use.
955
+ * \param[out] cfg Configuration buffer to populate.
956
+ * \param[in] usage Algorithm specific usage value. For AV1, must be
957
+ * set to AOM_USAGE_GOOD_QUALITY (0),
958
+ * AOM_USAGE_REALTIME (1), or AOM_USAGE_ALL_INTRA (2).
959
+ *
960
+ * \retval #AOM_CODEC_OK
961
+ * The configuration was populated.
962
+ * \retval #AOM_CODEC_INCAPABLE
963
+ * Interface is not an encoder interface.
964
+ * \retval #AOM_CODEC_INVALID_PARAM
965
+ * A parameter was NULL, or the usage value was not recognized.
966
+ */
967
+ aom_codec_err_t aom_codec_enc_config_default(aom_codec_iface_t *iface,
968
+ aom_codec_enc_cfg_t *cfg,
969
+ unsigned int usage);
970
+
971
+ /*!\brief Set or change configuration
972
+ *
973
+ * Reconfigures an encoder instance according to the given configuration.
974
+ *
975
+ * \param[in] ctx Pointer to this instance's context
976
+ * \param[in] cfg Configuration buffer to use
977
+ *
978
+ * \retval #AOM_CODEC_OK
979
+ * The configuration was populated.
980
+ * \retval #AOM_CODEC_INCAPABLE
981
+ * Interface is not an encoder interface.
982
+ * \retval #AOM_CODEC_INVALID_PARAM
983
+ * A parameter was NULL, or the usage value was not recognized.
984
+ */
985
+ aom_codec_err_t aom_codec_enc_config_set(aom_codec_ctx_t *ctx,
986
+ const aom_codec_enc_cfg_t *cfg);
987
+
988
+ /*!\brief Get global stream headers
989
+ *
990
+ * Retrieves a stream level global header packet, if supported by the codec.
991
+ * Calls to this function should be deferred until all configuration information
992
+ * has been passed to libaom. Otherwise the global header data may be
993
+ * invalidated by additional configuration changes.
994
+ *
995
+ * The AV1 implementation of this function returns an OBU. The OBU returned is
996
+ * in Low Overhead Bitstream Format. Specifically, the obu_has_size_field bit is
997
+ * set, and the buffer contains the obu_size field for the returned OBU.
998
+ *
999
+ * \param[in] ctx Pointer to this instance's context
1000
+ *
1001
+ * \retval NULL
1002
+ * Encoder does not support global header, or an error occurred while
1003
+ * generating the global header.
1004
+ *
1005
+ * \retval Non-NULL
1006
+ * Pointer to buffer containing global header packet. The caller owns the
1007
+ * memory associated with this buffer, and must free the 'buf' member of the
1008
+ * aom_fixed_buf_t as well as the aom_fixed_buf_t pointer. Memory returned
1009
+ * must be freed via call to free().
1010
+ */
1011
+ aom_fixed_buf_t *aom_codec_get_global_headers(aom_codec_ctx_t *ctx);
1012
+
1013
+ /*!\brief usage parameter analogous to AV1 GOOD QUALITY mode. */
1014
+ #define AOM_USAGE_GOOD_QUALITY 0u
1015
+ /*!\brief usage parameter analogous to AV1 REALTIME mode. */
1016
+ #define AOM_USAGE_REALTIME 1u
1017
+ /*!\brief usage parameter analogous to AV1 all intra mode. */
1018
+ #define AOM_USAGE_ALL_INTRA 2u
1019
+
1020
+ /*!\brief Encode a frame
1021
+ *
1022
+ * Encodes a video frame at the given "presentation time." The presentation
1023
+ * time stamp (PTS) \ref MUST be strictly increasing.
1024
+ *
1025
+ * When the last frame has been passed to the encoder, this function should
1026
+ * continue to be called in a loop, with the img parameter set to NULL. This
1027
+ * will signal the end-of-stream condition to the encoder and allow it to
1028
+ * encode any held buffers. Encoding is complete when aom_codec_encode() is
1029
+ * called with img set to NULL and aom_codec_get_cx_data() returns no data.
1030
+ *
1031
+ * \param[in] ctx Pointer to this instance's context
1032
+ * \param[in] img Image data to encode, NULL to flush.
1033
+ * Encoding sample values outside the range
1034
+ * [0..(1<<img->bit_depth)-1] is undefined behavior.
1035
+ * Note: Although img is declared as a const pointer,
1036
+ * if AV1E_SET_DENOISE_NOISE_LEVEL is set to a nonzero
1037
+ * value aom_codec_encode() modifies (denoises) the
1038
+ * samples in img->planes[i] .
1039
+ * \param[in] pts Presentation time stamp, in timebase units. If img
1040
+ * is NULL, pts is ignored.
1041
+ * \param[in] duration Duration to show frame, in timebase units. If img
1042
+ * is not NULL, duration must be nonzero. If img is
1043
+ * NULL, duration is ignored.
1044
+ * \param[in] flags Flags to use for encoding this frame.
1045
+ *
1046
+ * \retval #AOM_CODEC_OK
1047
+ * The configuration was populated.
1048
+ * \retval #AOM_CODEC_INCAPABLE
1049
+ * Interface is not an encoder interface.
1050
+ * \retval #AOM_CODEC_INVALID_PARAM
1051
+ * A parameter was NULL, the image format is unsupported, etc.
1052
+ *
1053
+ * \note
1054
+ * `duration` is of the unsigned long type, which can be 32 or 64 bits.
1055
+ * `duration` must be less than or equal to UINT32_MAX so that its range is
1056
+ * independent of the size of unsigned long.
1057
+ */
1058
+ aom_codec_err_t aom_codec_encode(aom_codec_ctx_t *ctx, const aom_image_t *img,
1059
+ aom_codec_pts_t pts, unsigned long duration,
1060
+ aom_enc_frame_flags_t flags);
1061
+
1062
+ /*!\brief Set compressed data output buffer
1063
+ *
1064
+ * Sets the buffer that the codec should output the compressed data
1065
+ * into. This call effectively sets the buffer pointer returned in the
1066
+ * next AOM_CODEC_CX_FRAME_PKT packet. Subsequent packets will be
1067
+ * appended into this buffer. The buffer is preserved across frames,
1068
+ * so applications must periodically call this function after flushing
1069
+ * the accumulated compressed data to disk or to the network to reset
1070
+ * the pointer to the buffer's head.
1071
+ *
1072
+ * `pad_before` bytes will be skipped before writing the compressed
1073
+ * data, and `pad_after` bytes will be appended to the packet. The size
1074
+ * of the packet will be the sum of the size of the actual compressed
1075
+ * data, pad_before, and pad_after. The padding bytes will be preserved
1076
+ * (not overwritten).
1077
+ *
1078
+ * Note that calling this function does not guarantee that the returned
1079
+ * compressed data will be placed into the specified buffer. In the
1080
+ * event that the encoded data will not fit into the buffer provided,
1081
+ * the returned packet \ref MAY point to an internal buffer, as it would
1082
+ * if this call were never used. In this event, the output packet will
1083
+ * NOT have any padding, and the application must free space and copy it
1084
+ * to the proper place. This is of particular note in configurations
1085
+ * that may output multiple packets for a single encoded frame (e.g., lagged
1086
+ * encoding) or if the application does not reset the buffer periodically.
1087
+ *
1088
+ * Applications may restore the default behavior of the codec providing
1089
+ * the compressed data buffer by calling this function with a NULL
1090
+ * buffer.
1091
+ *
1092
+ * Applications \ref MUSTNOT call this function during iteration of
1093
+ * aom_codec_get_cx_data().
1094
+ *
1095
+ * \param[in] ctx Pointer to this instance's context
1096
+ * \param[in] buf Buffer to store compressed data into
1097
+ * \param[in] pad_before Bytes to skip before writing compressed data
1098
+ * \param[in] pad_after Bytes to skip after writing compressed data
1099
+ *
1100
+ * \retval #AOM_CODEC_OK
1101
+ * The buffer was set successfully.
1102
+ * \retval #AOM_CODEC_INVALID_PARAM
1103
+ * A parameter was NULL, the image format is unsupported, etc.
1104
+ */
1105
+ aom_codec_err_t aom_codec_set_cx_data_buf(aom_codec_ctx_t *ctx,
1106
+ const aom_fixed_buf_t *buf,
1107
+ unsigned int pad_before,
1108
+ unsigned int pad_after);
1109
+
1110
+ /*!\brief Encoded data iterator
1111
+ *
1112
+ * Iterates over a list of data packets to be passed from the encoder to the
1113
+ * application. The different kinds of packets available are enumerated in
1114
+ * #aom_codec_cx_pkt_kind.
1115
+ *
1116
+ * #AOM_CODEC_CX_FRAME_PKT packets should be passed to the application's
1117
+ * muxer. Multiple compressed frames may be in the list.
1118
+ * #AOM_CODEC_STATS_PKT packets should be appended to a global buffer.
1119
+ *
1120
+ * The application \ref MUST silently ignore any packet kinds that it does
1121
+ * not recognize or support.
1122
+ *
1123
+ * The data buffers returned from this function are only guaranteed to be
1124
+ * valid until the application makes another call to any aom_codec_* function.
1125
+ *
1126
+ * \param[in] ctx Pointer to this instance's context
1127
+ * \param[in,out] iter Iterator storage, initialized to NULL
1128
+ *
1129
+ * \return Returns a pointer to an output data packet (compressed frame data,
1130
+ * two-pass statistics, etc.) or NULL to signal end-of-list.
1131
+ *
1132
+ */
1133
+ const aom_codec_cx_pkt_t *aom_codec_get_cx_data(aom_codec_ctx_t *ctx,
1134
+ aom_codec_iter_t *iter);
1135
+
1136
+ /*!\brief Get Preview Frame
1137
+ *
1138
+ * Returns an image that can be used as a preview. Shows the image as it would
1139
+ * exist at the decompressor. The application \ref MUST NOT write into this
1140
+ * image buffer.
1141
+ *
1142
+ * \param[in] ctx Pointer to this instance's context
1143
+ *
1144
+ * \return Returns a pointer to a preview image, or NULL if no image is
1145
+ * available.
1146
+ *
1147
+ */
1148
+ const aom_image_t *aom_codec_get_preview_frame(aom_codec_ctx_t *ctx);
1149
+
1150
+ /*!@} - end defgroup encoder*/
1151
+ #ifdef __cplusplus
1152
+ }
1153
+ #endif
1154
+ #endif // AOM_AOM_AOM_ENCODER_H_