Common Algorithm Interface

This abstraction allows applications to easily support multiple video formats with minimal code duplication. More...

Modules

 Decoder Algorithm Interface
 This abstraction allows applications using this decoder to easily support multiple video formats with minimal code duplication.
 
 Encoder Algorithm Interface
 This abstraction allows applications using this encoder to easily support multiple video formats with minimal code duplication.
 

Files

file  vpx_codec.h
 Describes the codec algorithm interface to applications.
 
file  vpx_codec.h
 Describes the codec algorithm interface to applications.
 

Classes

struct  vpx_codec_ctx
 Codec context structure. More...
 

Typedefs

typedef long vpx_codec_caps_t
 Codec capabilities bitfield. More...
 
typedef long vpx_codec_flags_t
 Initialization-time Feature Enabling. More...
 
typedef const struct vpx_codec_iface vpx_codec_iface_t
 Codec interface structure. More...
 
typedef struct vpx_codec_priv vpx_codec_priv_t
 Codec private data structure. More...
 
typedef const void * vpx_codec_iter_t
 Iterator. More...
 
typedef struct vpx_codec_ctx vpx_codec_ctx_t
 Codec context structure. More...
 
typedef enum vpx_bit_depth vpx_bit_depth_t
 Bit depth for codec

  • This enumeration determines the bit depth of the codec.
More...
 
typedef long vpx_codec_caps_t
 Codec capabilities bitfield. More...
 
typedef long vpx_codec_flags_t
 Initialization-time Feature Enabling. More...
 
typedef const struct vpx_codec_iface vpx_codec_iface_t
 Codec interface structure. More...
 
typedef struct vpx_codec_priv vpx_codec_priv_t
 Codec private data structure. More...
 
typedef const void * vpx_codec_iter_t
 Iterator. More...
 
typedef struct vpx_codec_ctx vpx_codec_ctx_t
 Codec context structure. More...
 
typedef enum vpx_bit_depth vpx_bit_depth_t
 Bit depth for codec

  • This enumeration determines the bit depth of the codec.
More...
 

Enumerations

enum  vpx_codec_err_t {
  VPX_CODEC_OK , VPX_CODEC_ERROR , VPX_CODEC_MEM_ERROR , VPX_CODEC_ABI_MISMATCH ,
  VPX_CODEC_INCAPABLE , VPX_CODEC_UNSUP_BITSTREAM , VPX_CODEC_UNSUP_FEATURE , VPX_CODEC_CORRUPT_FRAME ,
  VPX_CODEC_INVALID_PARAM , VPX_CODEC_LIST_END , VPX_CODEC_OK , VPX_CODEC_ERROR ,
  VPX_CODEC_MEM_ERROR , VPX_CODEC_ABI_MISMATCH , VPX_CODEC_INCAPABLE , VPX_CODEC_UNSUP_BITSTREAM ,
  VPX_CODEC_UNSUP_FEATURE , VPX_CODEC_CORRUPT_FRAME , VPX_CODEC_INVALID_PARAM , VPX_CODEC_LIST_END
}
 Algorithm return codes. More...
 
enum  vpx_bit_depth {
  VPX_BITS_8 = 8 , VPX_BITS_10 = 10 , VPX_BITS_12 = 12 , VPX_BITS_8 = 8 ,
  VPX_BITS_10 = 10 , VPX_BITS_12 = 12
}
 Bit depth for codec

  • This enumeration determines the bit depth of the codec.
More...
 
enum  vpx_codec_err_t {
  VPX_CODEC_OK , VPX_CODEC_ERROR , VPX_CODEC_MEM_ERROR , VPX_CODEC_ABI_MISMATCH ,
  VPX_CODEC_INCAPABLE , VPX_CODEC_UNSUP_BITSTREAM , VPX_CODEC_UNSUP_FEATURE , VPX_CODEC_CORRUPT_FRAME ,
  VPX_CODEC_INVALID_PARAM , VPX_CODEC_LIST_END , VPX_CODEC_OK , VPX_CODEC_ERROR ,
  VPX_CODEC_MEM_ERROR , VPX_CODEC_ABI_MISMATCH , VPX_CODEC_INCAPABLE , VPX_CODEC_UNSUP_BITSTREAM ,
  VPX_CODEC_UNSUP_FEATURE , VPX_CODEC_CORRUPT_FRAME , VPX_CODEC_INVALID_PARAM , VPX_CODEC_LIST_END
}
 Algorithm return codes. More...
 
enum  vpx_bit_depth {
  VPX_BITS_8 = 8 , VPX_BITS_10 = 10 , VPX_BITS_12 = 12 , VPX_BITS_8 = 8 ,
  VPX_BITS_10 = 10 , VPX_BITS_12 = 12
}
 Bit depth for codec

  • This enumeration determines the bit depth of the codec.
More...
 

Functions

int vpx_codec_version (void)
 Return the version information (as an integer) More...
 
const char * vpx_codec_version_str (void)
 Return the version information (as a string) More...
 
const char * vpx_codec_version_extra_str (void)
 Return the version information (as a string) More...
 
const char * vpx_codec_build_config (void)
 Return the build configuration. More...
 
const char * vpx_codec_iface_name (vpx_codec_iface_t *iface)
 Return the name for a given interface. More...
 
const char * vpx_codec_err_to_string (vpx_codec_err_t err)
 Convert error number to printable string. More...
 
const char * vpx_codec_error (vpx_codec_ctx_t *ctx)
 Retrieve error synopsis for codec context. More...
 
const char * vpx_codec_error_detail (vpx_codec_ctx_t *ctx)
 Retrieve detailed error information for codec context. More...
 
vpx_codec_err_t vpx_codec_destroy (vpx_codec_ctx_t *ctx)
 Destroy a codec instance. More...
 
vpx_codec_caps_t vpx_codec_get_caps (vpx_codec_iface_t *iface)
 Get the capabilities of an algorithm. More...
 
vpx_codec_err_t vpx_codec_control_ (vpx_codec_ctx_t *ctx, int ctrl_id,...)
 Control algorithm. More...
 

Detailed Description

This abstraction allows applications to easily support multiple video formats with minimal code duplication.

This section describes the interface common to all codecs (both encoders and decoders).

Typedef Documentation

◆ vpx_bit_depth_t [1/2]

Bit depth for codec

  • This enumeration determines the bit depth of the codec.

◆ vpx_bit_depth_t [2/2]

Bit depth for codec

  • This enumeration determines the bit depth of the codec.

◆ vpx_codec_caps_t [1/2]

typedef long vpx_codec_caps_t

Codec capabilities bitfield.

Each codec advertises the capabilities it supports as part of its vpx_codec_iface_t interface structure. Capabilities are extra interfaces or functionality, and are not required to be supported.

The available flags are specified by VPX_CODEC_CAP_* defines.

◆ vpx_codec_caps_t [2/2]

typedef long vpx_codec_caps_t

Codec capabilities bitfield.

Each codec advertises the capabilities it supports as part of its vpx_codec_iface_t interface structure. Capabilities are extra interfaces or functionality, and are not required to be supported.

The available flags are specified by VPX_CODEC_CAP_* defines.

◆ vpx_codec_ctx_t [1/2]

Codec context structure.

All codecs MUST support this context structure fully. In general, this data should be considered private to the codec algorithm, and not be manipulated or examined by the calling application. Applications may reference the 'name' member to get a printable description of the algorithm.

◆ vpx_codec_ctx_t [2/2]

Codec context structure.

All codecs MUST support this context structure fully. In general, this data should be considered private to the codec algorithm, and not be manipulated or examined by the calling application. Applications may reference the 'name' member to get a printable description of the algorithm.

◆ vpx_codec_flags_t [1/2]

typedef long vpx_codec_flags_t

Initialization-time Feature Enabling.

Certain codec features must be known at initialization time, to allow for proper memory allocation.

The available flags are specified by VPX_CODEC_USE_* defines.

◆ vpx_codec_flags_t [2/2]

typedef long vpx_codec_flags_t

Initialization-time Feature Enabling.

Certain codec features must be known at initialization time, to allow for proper memory allocation.

The available flags are specified by VPX_CODEC_USE_* defines.

◆ vpx_codec_iface_t [1/2]

typedef const struct vpx_codec_iface vpx_codec_iface_t

Codec interface structure.

Contains function pointers and other data private to the codec implementation. This structure is opaque to the application.

◆ vpx_codec_iface_t [2/2]

typedef const struct vpx_codec_iface vpx_codec_iface_t

Codec interface structure.

Contains function pointers and other data private to the codec implementation. This structure is opaque to the application.

◆ vpx_codec_iter_t [1/2]

typedef const void* vpx_codec_iter_t

Iterator.

Opaque storage used for iterating over lists.

◆ vpx_codec_iter_t [2/2]

typedef const void* vpx_codec_iter_t

Iterator.

Opaque storage used for iterating over lists.

◆ vpx_codec_priv_t [1/2]

typedef struct vpx_codec_priv vpx_codec_priv_t

Codec private data structure.

Contains data private to the codec implementation. This structure is opaque to the application.

◆ vpx_codec_priv_t [2/2]

typedef struct vpx_codec_priv vpx_codec_priv_t

Codec private data structure.

Contains data private to the codec implementation. This structure is opaque to the application.

Enumeration Type Documentation

◆ vpx_bit_depth [1/2]

Bit depth for codec

  • This enumeration determines the bit depth of the codec.

Enumerator
VPX_BITS_8 

8 bits

VPX_BITS_10 

10 bits

VPX_BITS_12 

12 bits

VPX_BITS_8 

8 bits

VPX_BITS_10 

10 bits

VPX_BITS_12 

12 bits

◆ vpx_bit_depth [2/2]

Bit depth for codec

  • This enumeration determines the bit depth of the codec.

Enumerator
VPX_BITS_8 

8 bits

VPX_BITS_10 

10 bits

VPX_BITS_12 

12 bits

VPX_BITS_8 

8 bits

VPX_BITS_10 

10 bits

VPX_BITS_12 

12 bits

◆ vpx_codec_err_t [1/2]

Algorithm return codes.

Enumerator
VPX_CODEC_OK 

Operation completed without error.

VPX_CODEC_ERROR 

Unspecified error.

VPX_CODEC_MEM_ERROR 

Memory operation failed.

VPX_CODEC_ABI_MISMATCH 

ABI version mismatch.

VPX_CODEC_INCAPABLE 

Algorithm does not have required capability.

VPX_CODEC_UNSUP_BITSTREAM 

The given bitstream is not supported.

The bitstream was unable to be parsed at the highest level. The decoder is unable to proceed. This error SHOULD be treated as fatal to the stream.

VPX_CODEC_UNSUP_FEATURE 

Encoded bitstream uses an unsupported feature.

The decoder does not implement a feature required by the encoder. This return code should only be used for features that prevent future pictures from being properly decoded. This error MAY be treated as fatal to the stream or MAY be treated as fatal to the current GOP.

VPX_CODEC_CORRUPT_FRAME 

The coded data for this stream is corrupt or incomplete.

There was a problem decoding the current frame. This return code should only be used for failures that prevent future pictures from being properly decoded. This error MAY be treated as fatal to the stream or MAY be treated as fatal to the current GOP. If decoding is continued for the current GOP, artifacts may be present.

VPX_CODEC_INVALID_PARAM 

An application-supplied parameter is not valid.

VPX_CODEC_LIST_END 

An iterator reached the end of list.

VPX_CODEC_OK 

Operation completed without error.

VPX_CODEC_ERROR 

Unspecified error.

VPX_CODEC_MEM_ERROR 

Memory operation failed.

VPX_CODEC_ABI_MISMATCH 

ABI version mismatch.

VPX_CODEC_INCAPABLE 

Algorithm does not have required capability.

VPX_CODEC_UNSUP_BITSTREAM 

The given bitstream is not supported.

The bitstream was unable to be parsed at the highest level. The decoder
is unable to proceed. This error \ref SHOULD be treated as fatal to the
stream. 
VPX_CODEC_UNSUP_FEATURE 

Encoded bitstream uses an unsupported feature.

The decoder does not implement a feature required by the encoder. This
return code should only be used for features that prevent future
pictures from being properly decoded. This error \ref MAY be treated as
fatal to the stream or \ref MAY be treated as fatal to the current GOP.
VPX_CODEC_CORRUPT_FRAME 

The coded data for this stream is corrupt or incomplete.

There was a problem decoding the current frame.  This return code
should only be used for failures that prevent future pictures from
being properly decoded. This error \ref MAY be treated as fatal to the
stream or \ref MAY be treated as fatal to the current GOP. If decoding
is continued for the current GOP, artifacts may be present.
VPX_CODEC_INVALID_PARAM 

An application-supplied parameter is not valid.

VPX_CODEC_LIST_END 

An iterator reached the end of list.

◆ vpx_codec_err_t [2/2]

Algorithm return codes.

Enumerator
VPX_CODEC_OK 

Operation completed without error.

VPX_CODEC_ERROR 

Unspecified error.

VPX_CODEC_MEM_ERROR 

Memory operation failed.

VPX_CODEC_ABI_MISMATCH 

ABI version mismatch.

VPX_CODEC_INCAPABLE 

Algorithm does not have required capability.

VPX_CODEC_UNSUP_BITSTREAM 

The given bitstream is not supported.

The bitstream was unable to be parsed at the highest level. The decoder is unable to proceed. This error SHOULD be treated as fatal to the stream.

VPX_CODEC_UNSUP_FEATURE 

Encoded bitstream uses an unsupported feature.

The decoder does not implement a feature required by the encoder. This return code should only be used for features that prevent future pictures from being properly decoded. This error MAY be treated as fatal to the stream or MAY be treated as fatal to the current GOP.

VPX_CODEC_CORRUPT_FRAME 

The coded data for this stream is corrupt or incomplete.

There was a problem decoding the current frame. This return code should only be used for failures that prevent future pictures from being properly decoded. This error MAY be treated as fatal to the stream or MAY be treated as fatal to the current GOP. If decoding is continued for the current GOP, artifacts may be present.

VPX_CODEC_INVALID_PARAM 

An application-supplied parameter is not valid.

VPX_CODEC_LIST_END 

An iterator reached the end of list.

VPX_CODEC_OK 

Operation completed without error.

VPX_CODEC_ERROR 

Unspecified error.

VPX_CODEC_MEM_ERROR 

Memory operation failed.

VPX_CODEC_ABI_MISMATCH 

ABI version mismatch.

VPX_CODEC_INCAPABLE 

Algorithm does not have required capability.

VPX_CODEC_UNSUP_BITSTREAM 

The given bitstream is not supported.

The bitstream was unable to be parsed at the highest level. The decoder
is unable to proceed. This error \ref SHOULD be treated as fatal to the
stream. 
VPX_CODEC_UNSUP_FEATURE 

Encoded bitstream uses an unsupported feature.

The decoder does not implement a feature required by the encoder. This
return code should only be used for features that prevent future
pictures from being properly decoded. This error \ref MAY be treated as
fatal to the stream or \ref MAY be treated as fatal to the current GOP.
VPX_CODEC_CORRUPT_FRAME 

The coded data for this stream is corrupt or incomplete.

There was a problem decoding the current frame.  This return code
should only be used for failures that prevent future pictures from
being properly decoded. This error \ref MAY be treated as fatal to the
stream or \ref MAY be treated as fatal to the current GOP. If decoding
is continued for the current GOP, artifacts may be present.
VPX_CODEC_INVALID_PARAM 

An application-supplied parameter is not valid.

VPX_CODEC_LIST_END 

An iterator reached the end of list.

Function Documentation

◆ vpx_codec_build_config()

const char * vpx_codec_build_config ( void  )

Return the build configuration.

Returns a printable string containing an encoded version of the build configuration. This may be useful to vpx support.

◆ vpx_codec_control_()

vpx_codec_err_t vpx_codec_control_ ( vpx_codec_ctx_t ctx,
int  ctrl_id,
  ... 
)

Control algorithm.

This function is used to exchange algorithm specific data with the codec instance. This can be used to implement features specific to a particular algorithm.

This wrapper function dispatches the request to the helper function associated with the given ctrl_id. It tries to call this function transparently, but will return VPX_CODEC_ERROR if the request could not be dispatched.

Note that this function should not be used directly. Call the #vpx_codec_control wrapper macro instead.

Parameters
[in]ctxPointer to this instance's context
[in]ctrl_idAlgorithm specific control identifier
Return values
VPX_CODEC_OKThe control request was processed.
VPX_CODEC_ERRORThe control request was not processed.
VPX_CODEC_INVALID_PARAMThe data was not valid.

◆ vpx_codec_destroy()

vpx_codec_err_t vpx_codec_destroy ( vpx_codec_ctx_t ctx)

Destroy a codec instance.

Destroys a codec context, freeing any associated memory buffers.

Parameters
[in]ctxPointer to this instance's context
Return values
VPX_CODEC_OKThe codec algorithm initialized.
VPX_CODEC_MEM_ERRORMemory allocation failed.

◆ vpx_codec_err_to_string()

const char * vpx_codec_err_to_string ( vpx_codec_err_t  err)

Convert error number to printable string.

Returns a human readable string for the last error returned by the algorithm. The returned error will be one line and will not contain any newline characters.

Parameters
[in]errError number.

◆ vpx_codec_error()

const char * vpx_codec_error ( vpx_codec_ctx_t ctx)

Retrieve error synopsis for codec context.

Returns a human readable string for the last error returned by the algorithm. The returned error will be one line and will not contain any newline characters.

Parameters
[in]ctxPointer to this instance's context.

◆ vpx_codec_error_detail()

const char * vpx_codec_error_detail ( vpx_codec_ctx_t ctx)

Retrieve detailed error information for codec context.

Returns a human readable string providing detailed information about the last error.

Parameters
[in]ctxPointer to this instance's context.
Return values
NULLNo detailed information is available.

◆ vpx_codec_get_caps()

vpx_codec_caps_t vpx_codec_get_caps ( vpx_codec_iface_t iface)

Get the capabilities of an algorithm.

Retrieves the capabilities bitfield from the algorithm's interface.

Parameters
[in]ifacePointer to the algorithm interface

◆ vpx_codec_iface_name()

const char * vpx_codec_iface_name ( vpx_codec_iface_t iface)

Return the name for a given interface.

Returns a human readable string for name of the given codec interface.

Parameters
[in]ifaceInterface pointer

◆ vpx_codec_version()

int vpx_codec_version ( void  )

Return the version information (as an integer)

Returns a packed encoding of the library version number. This will only include the major.minor.patch component of the version number. Note that this encoded value should be accessed through the macros provided, as the encoding may change in the future.

◆ vpx_codec_version_extra_str()

const char * vpx_codec_version_extra_str ( void  )

Return the version information (as a string)

Returns a printable "extra string". This is the component of the string returned by vpx_codec_version_str() following the three digit version number.

◆ vpx_codec_version_str()

const char * vpx_codec_version_str ( void  )

Return the version information (as a string)

Returns a printable string containing the full library version number. This may contain additional text following the three digit version number, as to indicate release candidates, prerelease versions, etc.