The following sections are common to all codecs:
Fore more information on decoder and encoder specific usage, see the following pages:
Most operations require an initialized codec context. Codec context instances are codec specific. That is, the codec to be used for the encoded video must be known at initialization time. See vpx_codec_ctx_t for further information.
Each supported codec will expose an interface structure to the application as an extern
reference to a structure of the incomplete type vpx_codec_iface_t.
Currently defined features available in both encoders and decoders include:
Currently defined decoder features include:
To prevent cases of confusion where the ABI of the library changes, the ABI is versioned. The ABI version number must be passed at initialization time to ensure the application is using a header file that matches the library. The current ABI version number is stored in the prepropcessor macros VPX_CODEC_ABI_VERSION, VPX_ENCODER_ABI_VERSION, and VPX_DECODER_ABI_VERSION. For convenience, each initialization function has a wrapper macro that inserts the correct version number. These macros are named like the initialization methods, but without the _ver suffix.
The available initialization methods are:
err
member of the decoder context as well. Finally, more detailed error information may be able to be obtained by using the vpx_codec_error_detail() method. Not all errors produce detailed error information.In addition to error information, the codec library's build configuration is available at runtime on some platforms. This information can be returned by calling vpx_codec_build_config(), and is formatted as a base64 coded string (comprised of characters in the set [a-z_a-Z0-9+/]). This information is not useful to an application at runtime, but may be of use to vpx for support.
deadline
parameter. This parameter indicates the amount of time, in microseconds (us), that the application wants the codec to spend processing before returning. This is a soft deadline -- that is, the semantics of the requested operation take precedence over meeting the deadline. If, for example, an application sets a deadline
of 1000us, and the frame takes 2000us to decode, the call to vpx_codec_decode() will return after 2000us. In this case the deadline is not met, but the semantics of the function are preserved. If, for the same frame, an application instead sets a deadline
of 5000us, the decoder will see that it has 3000us remaining in its time slice when decoding completes. It could then choose to run a set of Postprocessing filters, and perhaps would return after 4000us (instead of the allocated 5000us). In this case the deadline is met, and the semantics of the call are preserved, as before.
The special value 0
is reserved to represent an infinite deadline. In this case, the codec will perform as much processing as possible to yeild the highest quality frame.
By convention, the value 1
is used to mean "return as fast as possible."