AOMedia AV1 Codec
aom_codec.h File Reference

Describes the codec algorithm interface to applications. More...

#include "aom/aom_image.h"
#include "aom/aom_integer.h"

Go to the source code of this file.

Data Structures

struct  aom_codec_ctx
 Codec context structure. More...
 

Macros

#define AOM_DEPRECATED
 Decorator indicating a function is deprecated.
 
#define AOM_DECLSPEC_DEPRECATED
 Decorator indicating a function is deprecated.
 
#define AOM_UNUSED
 Decorator indicating a function is potentially unused.
 
#define ATTRIBUTE_PACKED
 Decorator indicating that given struct/union/enum is packed.
 
#define AOM_CODEC_ABI_VERSION
 Current ABI version number.
 
#define AOM_CODEC_CAP_DECODER   0x1
 
#define AOM_CODEC_CAP_ENCODER   0x2
 
#define AOM_FRAME_IS_KEY   0x1u
 
#define AOM_FRAME_IS_DROPPABLE   0x2u
 frame can be dropped without affecting the stream (no future frame depends on this one)
 
#define AOM_FRAME_IS_INTRAONLY   0x10u
 this is an INTRA_ONLY frame
 
#define AOM_FRAME_IS_SWITCH   0x20u
 this is an S-frame
 
#define AOM_FRAME_IS_ERROR_RESILIENT   0x40u
 this is an error-resilient frame
 
#define AOM_FRAME_IS_DELAYED_RANDOM_ACCESS_POINT   0x80u
 this is a key-frame dependent recovery-point frame
 
#define aom_codec_version_major()
 Return the major version number.
 
#define aom_codec_version_minor()
 Return the minor version number.
 
#define aom_codec_version_patch()
 Return the patch version number.
 

Typedefs

typedef long aom_codec_caps_t
 Codec capabilities bitfield.
 
typedef long aom_codec_flags_t
 Initialization-time Feature Enabling.
 
typedef int64_t aom_codec_pts_t
 Time Stamp Type.
 
typedef const struct aom_codec_iface aom_codec_iface_t
 Codec interface structure.
 
typedef struct aom_codec_priv aom_codec_priv_t
 Codec private data structure.
 
typedef uint32_t aom_codec_frame_flags_t
 Compressed Frame Flags.
 
typedef const void * aom_codec_iter_t
 Iterator.
 
typedef struct aom_codec_ctx aom_codec_ctx_t
 Codec context structure.
 
typedef enum aom_bit_depth aom_bit_depth_t
 Bit depth for codec

  • This enumeration determines the bit depth of the codec.

 
typedef enum aom_superblock_size aom_superblock_size_t
 Superblock size selection.
 

Enumerations

enum  aom_codec_err_t {
  AOM_CODEC_OK , AOM_CODEC_ERROR , AOM_CODEC_MEM_ERROR , AOM_CODEC_ABI_MISMATCH ,
  AOM_CODEC_INCAPABLE , AOM_CODEC_UNSUP_BITSTREAM , AOM_CODEC_UNSUP_FEATURE , AOM_CODEC_CORRUPT_FRAME ,
  AOM_CODEC_INVALID_PARAM , AOM_CODEC_LIST_END
}
 Algorithm return codes. More...
 
enum  aom_bit_depth { AOM_BITS_8 = 8 , AOM_BITS_10 = 10 , AOM_BITS_12 = 12 }
 Bit depth for codec

  • This enumeration determines the bit depth of the codec.
More...
 
enum  aom_superblock_size { AOM_SUPERBLOCK_SIZE_64X64 , AOM_SUPERBLOCK_SIZE_128X128 , AOM_SUPERBLOCK_SIZE_DYNAMIC }
 Superblock size selection. More...
 
enum  OBU_TYPE {
  OBU_SEQUENCE_HEADER = 1 , OBU_TEMPORAL_DELIMITER = 2 , OBU_FRAME_HEADER = 3 , OBU_TILE_GROUP = 4 ,
  OBU_METADATA = 5 , OBU_FRAME = 6 , OBU_REDUNDANT_FRAME_HEADER = 7 , OBU_TILE_LIST = 8 ,
  OBU_PADDING = 15
}
 OBU types.
 
enum  OBU_METADATA_TYPE {
  OBU_METADATA_TYPE_AOM_RESERVED_0 = 0 , OBU_METADATA_TYPE_HDR_CLL = 1 , OBU_METADATA_TYPE_HDR_MDCV = 2 , OBU_METADATA_TYPE_SCALABILITY = 3 ,
  OBU_METADATA_TYPE_ITUT_T35 = 4 , OBU_METADATA_TYPE_TIMECODE = 5
}
 OBU metadata types.
 

Functions

int aom_codec_version (void)
 Return the version information (as an integer)
 
const char * aom_codec_version_str (void)
 Return the version information (as a string)
 
const char * aom_codec_version_extra_str (void)
 Return the version information (as a string)
 
const char * aom_codec_build_config (void)
 Return the build configuration.
 
const char * aom_codec_iface_name (aom_codec_iface_t *iface)
 Return the name for a given interface.
 
const char * aom_codec_err_to_string (aom_codec_err_t err)
 Convert error number to printable string.
 
const char * aom_codec_error (const aom_codec_ctx_t *ctx)
 Retrieve error synopsis for codec context.
 
const char * aom_codec_error_detail (const aom_codec_ctx_t *ctx)
 Retrieve detailed error information for codec context.
 
aom_codec_err_t aom_codec_destroy (aom_codec_ctx_t *ctx)
 Destroy a codec instance.
 
aom_codec_caps_t aom_codec_get_caps (aom_codec_iface_t *iface)
 Get the capabilities of an algorithm.
 
const char * aom_obu_type_to_string (OBU_TYPE type)
 Returns string representation of OBU_TYPE.
 

Codec Control

The aom_codec_control function exchanges algorithm specific data with the codec instance. Additionally, the macro AOM_CODEC_CONTROL_TYPECHECKED is provided, which will type-check the parameter against the control ID before calling aom_codec_control - note that this macro requires the control ID to be directly encoded in it, e.g., AOM_CODEC_CONTROL_TYPECHECKED(&ctx, AOME_SET_CPUUSED, 8).

The codec control IDs can be found in aom.h, aomcx.h, and aomdx.h (defined as aom_com_control_id, aome_enc_control_id, and aom_dec_control_id).

#define AOM_CODEC_CONTROL_TYPECHECKED(ctx, id, data)
 aom_codec_control wrapper macro (adds type-checking, less flexible)
 
#define AOM_CTRL_USE_TYPE(id, typ)
 Creates type checking mechanisms for aom_codec_control.
 
aom_codec_err_t aom_codec_control (aom_codec_ctx_t *ctx, int ctrl_id,...)
 Algorithm Control.
 
aom_codec_err_t aom_codec_set_option (aom_codec_ctx_t *ctx, const char *name, const char *value)
 Key & Value API.
 

Detailed Description

Describes the codec algorithm interface to applications.

This file describes the interface between an application and a video codec algorithm.

An application instantiates a specific codec instance by using aom_codec_dec_init() or aom_codec_enc_init() and a pointer to the algorithm's interface structure:

    my_app.c:
      extern aom_codec_iface_t my_codec;
      {
          aom_codec_ctx_t algo;
          int threads = 4;
          aom_codec_dec_cfg_t cfg = { threads, 0, 0, 1 };
          res = aom_codec_dec_init(&algo, &my_codec, &cfg, 0);
      }
    

Once initialized, the instance is managed using other functions from the aom_codec_* family.