aomdx.h
Go to the documentation of this file.
/*
* Copyright (c) 2016, Alliance for Open Media. All rights reserved.
*
* This source code is subject to the terms of the BSD 2 Clause License and
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
* Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
#ifndef AOM_AOM_AOMDX_H_
#define AOM_AOM_AOMDX_H_
#ifdef __cplusplus
extern "C" {
#endif
/* Include controls common to both the encoder and decoder */
#include "aom/aom.h"
extern aom_codec_iface_t aom_codec_av1_dx_algo;
extern aom_codec_iface_t *aom_codec_av1_dx(void);
typedef struct Accounting Accounting;
#ifndef AOM_INSPECTION_H_
typedef void (*aom_inspect_cb)(void *decoder, void *ctx);
#endif
typedef struct aom_inspect_init {
aom_inspect_cb inspect_cb;
void *inspect_ctx;
} aom_inspect_init;
typedef struct {
const unsigned char *buf;
int idx;
int show_existing;
} Av1DecodeReturn;
typedef struct aom_tile_data {
size_t coded_tile_data_size;
const void *coded_tile_data;
size_t extra_size;
} aom_tile_data;
#define AOM_MAX_TILE_COLS 64
#define AOM_MAX_TILE_ROWS 64
typedef struct aom_tile_info {
int tile_columns;
int tile_rows;
int tile_widths[AOM_MAX_TILE_COLS];
int tile_heights[AOM_MAX_TILE_ROWS];
int num_tile_groups;
} aom_tile_info;
typedef struct aom_still_picture_info {
int is_still_picture;
int is_reduced_still_picture_hdr;
} aom_still_picture_info;
typedef struct aom_s_frame_info {
int is_s_frame;
int is_s_frame_at_altref;
} aom_s_frame_info;
typedef struct aom_screen_content_tools_info {
int allow_screen_content_tools;
int allow_intrabc;
int force_integer_mv;
} aom_screen_content_tools_info;
typedef struct av1_ext_ref_frame {
aom_image_t *img;
int num;
} av1_ext_ref_frame_t;
enum aom_dec_control_id {
AOMD_GET_LAST_REF_UPDATES = AOM_DECODER_CTRL_ID_START,
AOMD_GET_FRAME_CORRUPTED,
AOMD_GET_LAST_REF_USED,
AV1D_GET_FRAME_SIZE,
AV1D_GET_DISPLAY_SIZE,
AV1D_GET_BIT_DEPTH,
AV1D_GET_IMG_FORMAT,
AV1D_GET_TILE_SIZE,
AV1D_GET_TILE_COUNT,
AV1_SET_BYTE_ALIGNMENT,
AV1_INVERT_TILE_DECODE_ORDER,
AV1_SET_SKIP_LOOP_FILTER,
AV1_GET_ACCOUNTING,
AOMD_GET_LAST_QUANTIZER,
AV1_SET_DECODE_TILE_ROW,
AV1_SET_DECODE_TILE_COL,
AV1_SET_TILE_MODE,
AV1D_GET_FRAME_HEADER_INFO,
AV1D_GET_TILE_DATA,
AV1D_SET_EXT_REF_PTR,
AV1D_EXT_TILE_DEBUG,
AV1D_SET_ROW_MT,
AV1D_SET_IS_ANNEXB,
AV1D_SET_OPERATING_POINT,
AV1D_SET_OUTPUT_ALL_LAYERS,
AV1_SET_INSPECTION_CALLBACK,
AV1D_SET_SKIP_FILM_GRAIN,
AOMD_GET_FWD_KF_PRESENT,
AOMD_GET_FRAME_FLAGS,
AOMD_GET_ALTREF_PRESENT,
AOMD_GET_TILE_INFO,
AOMD_GET_SCREEN_CONTENT_TOOLS_INFO,
AOMD_GET_STILL_PICTURE,
AOMD_GET_SB_SIZE,
AOMD_GET_SHOW_EXISTING_FRAME_FLAG,
AOMD_GET_S_FRAME_INFO,
AOMD_GET_SHOW_FRAME_FLAG,
AOMD_GET_BASE_Q_IDX,
AOMD_GET_ORDER_HINT,
AV1D_GET_MI_INFO,
AOMD_SET_FRAME_SIZE_LIMIT,
};
AOM_CTRL_USE_TYPE(AOMD_GET_LAST_REF_UPDATES, int *)
#define AOM_CTRL_AOMD_GET_LAST_REF_UPDATES
AOM_CTRL_USE_TYPE(AOMD_GET_FRAME_CORRUPTED, int *)
#define AOM_CTRL_AOMD_GET_FRAME_CORRUPTED
AOM_CTRL_USE_TYPE(AOMD_GET_LAST_REF_USED, int *)
#define AOM_CTRL_AOMD_GET_LAST_REF_USED
AOM_CTRL_USE_TYPE(AV1D_GET_FRAME_SIZE, int *)
#define AOM_CTRL_AV1D_GET_FRAME_SIZE
AOM_CTRL_USE_TYPE(AV1D_GET_DISPLAY_SIZE, int *)
#define AOM_CTRL_AV1D_GET_DISPLAY_SIZE
AOM_CTRL_USE_TYPE(AV1D_GET_BIT_DEPTH, unsigned int *)
#define AOM_CTRL_AV1D_GET_BIT_DEPTH
AOM_CTRL_USE_TYPE(AV1D_GET_IMG_FORMAT, aom_img_fmt_t *)
#define AOM_CTRL_AV1D_GET_IMG_FORMAT
AOM_CTRL_USE_TYPE(AV1D_GET_TILE_SIZE, unsigned int *)
#define AOM_CTRL_AV1D_GET_TILE_SIZE
AOM_CTRL_USE_TYPE(AV1D_GET_TILE_COUNT, unsigned int *)
#define AOM_CTRL_AV1D_GET_TILE_COUNT
AOM_CTRL_USE_TYPE(AV1_INVERT_TILE_DECODE_ORDER, int)
#define AOM_CTRL_AV1_INVERT_TILE_DECODE_ORDER
AOM_CTRL_USE_TYPE(AV1_SET_SKIP_LOOP_FILTER, int)
#define AOM_CTRL_AV1_SET_SKIP_LOOP_FILTER
AOM_CTRL_USE_TYPE(AV1_GET_ACCOUNTING, Accounting **)
#define AOM_CTRL_AV1_GET_ACCOUNTING
AOM_CTRL_USE_TYPE(AOMD_GET_LAST_QUANTIZER, int *)
#define AOM_CTRL_AOMD_GET_LAST_QUANTIZER
AOM_CTRL_USE_TYPE(AV1_SET_DECODE_TILE_ROW, int)
#define AOM_CTRL_AV1_SET_DECODE_TILE_ROW
AOM_CTRL_USE_TYPE(AV1_SET_DECODE_TILE_COL, int)
#define AOM_CTRL_AV1_SET_DECODE_TILE_COL
AOM_CTRL_USE_TYPE(AV1_SET_TILE_MODE, unsigned int)
#define AOM_CTRL_AV1_SET_TILE_MODE
AOM_CTRL_USE_TYPE(AV1D_GET_FRAME_HEADER_INFO, aom_tile_data *)
#define AOM_CTRL_AV1D_GET_FRAME_HEADER_INFO
AOM_CTRL_USE_TYPE(AV1D_GET_TILE_DATA, aom_tile_data *)
#define AOM_CTRL_AV1D_GET_TILE_DATA
AOM_CTRL_USE_TYPE(AV1D_SET_EXT_REF_PTR, av1_ext_ref_frame_t *)
#define AOM_CTRL_AV1D_SET_EXT_REF_PTR
AOM_CTRL_USE_TYPE(AV1D_EXT_TILE_DEBUG, unsigned int)
#define AOM_CTRL_AV1D_EXT_TILE_DEBUG
AOM_CTRL_USE_TYPE(AV1D_SET_ROW_MT, unsigned int)
#define AOM_CTRL_AV1D_SET_ROW_MT
AOM_CTRL_USE_TYPE(AV1D_SET_IS_ANNEXB, unsigned int)
#define AOM_CTRL_AV1D_SET_IS_ANNEXB
AOM_CTRL_USE_TYPE(AV1D_SET_OPERATING_POINT, int)
#define AOM_CTRL_AV1D_SET_OPERATING_POINT
AOM_CTRL_USE_TYPE(AV1D_SET_OUTPUT_ALL_LAYERS, int)
#define AOM_CTRL_AV1D_SET_OUTPUT_ALL_LAYERS
AOM_CTRL_USE_TYPE(AV1_SET_INSPECTION_CALLBACK, aom_inspect_init *)
#define AOM_CTRL_AV1_SET_INSPECTION_CALLBACK
AOM_CTRL_USE_TYPE(AV1D_SET_SKIP_FILM_GRAIN, int)
#define AOM_CTRL_AV1D_SET_SKIP_FILM_GRAIN
AOM_CTRL_USE_TYPE(AOMD_GET_FWD_KF_PRESENT, int *)
#define AOM_CTRL_AOMD_GET_FWD_KF_PRESENT
AOM_CTRL_USE_TYPE(AOMD_GET_FRAME_FLAGS, int *)
#define AOM_CTRL_AOMD_GET_FRAME_FLAGS
AOM_CTRL_USE_TYPE(AOMD_GET_ALTREF_PRESENT, int *)
#define AOM_CTRL_AOMD_GET_ALTREF_PRESENT
AOM_CTRL_USE_TYPE(AOMD_GET_TILE_INFO, aom_tile_info *)
#define AOM_CTRL_AOMD_GET_TILE_INFO
AOM_CTRL_USE_TYPE(AOMD_GET_SCREEN_CONTENT_TOOLS_INFO,
aom_screen_content_tools_info *)
#define AOM_CTRL_AOMD_GET_SCREEN_CONTENT_TOOLS_INFO
AOM_CTRL_USE_TYPE(AOMD_GET_STILL_PICTURE, aom_still_picture_info *)
#define AOM_CTRL_AOMD_GET_STILL_PICTURE
AOM_CTRL_USE_TYPE(AOMD_GET_SB_SIZE, aom_superblock_size_t *)
#define AOMD_CTRL_AOMD_GET_SB_SIZE
AOM_CTRL_USE_TYPE(AOMD_GET_SHOW_EXISTING_FRAME_FLAG, int *)
#define AOMD_CTRL_AOMD_GET_SHOW_EXISTING_FRAME_FLAG
AOM_CTRL_USE_TYPE(AOMD_GET_S_FRAME_INFO, aom_s_frame_info *)
#define AOMD_CTRL_AOMD_GET_S_FRAME_INFO
AOM_CTRL_USE_TYPE(AOMD_GET_SHOW_FRAME_FLAG, int *)
#define AOM_CTRL_AOMD_GET_SHOW_FRAME_FLAG
AOM_CTRL_USE_TYPE(AOMD_GET_BASE_Q_IDX, int *)
#define AOM_CTRL_AOMD_GET_BASE_Q_IDX
AOM_CTRL_USE_TYPE(AOMD_GET_ORDER_HINT, unsigned int *)
#define AOM_CTRL_AOMD_GET_ORDER_HINT
// The AOM_CTRL_USE_TYPE macro can't be used with AV1D_GET_MI_INFO because
// AV1D_GET_MI_INFO takes more than one parameter.
#define AOM_CTRL_AV1D_GET_MI_INFO
AOM_CTRL_USE_TYPE(AOMD_SET_FRAME_SIZE_LIMIT, unsigned int)
#define AOM_CTRL_AOMD_SET_FRAME_SIZE_LIMIT
#ifdef __cplusplus
} // extern "C"
#endif
#endif // AOM_AOM_AOMDX_H_
aom.h
Provides controls common to both the AOM encoder and decoder.
aom_img_fmt_t
enum aom_img_fmt aom_img_fmt_t
List of supported image formats.
aom_image_t
struct aom_image aom_image_t
Image Descriptor.
aom_inspect_cb
void(* aom_inspect_cb)(void *decoder, void *ctx)
Definition aomdx.h:55
aom_codec_av1_dx_algo
aom_codec_iface_t aom_codec_av1_dx_algo
A single instance of the AV1 decoder.
aom_dec_control_id
aom_dec_control_id
AOM decoder control functions.
Definition aomdx.h:195
Accounting
struct Accounting Accounting
Definition aomdx.h:50
aom_codec_av1_dx
aom_codec_iface_t * aom_codec_av1_dx(void)
The interface to the AV1 decoder.
AOM_MAX_TILE_ROWS
#define AOM_MAX_TILE_ROWS
Max number of tile rows.
Definition aomdx.h:115
AOM_MAX_TILE_COLS
#define AOM_MAX_TILE_COLS
Max number of tile columns.
Definition aomdx.h:107
av1_ext_ref_frame_t
struct av1_ext_ref_frame av1_ext_ref_frame_t
Structure to hold the external reference frame pointer.
AOMD_GET_LAST_REF_USED
@ AOMD_GET_LAST_REF_USED
Codec control function to get info on which reference frames were used by the last decode,...
Definition aomdx.h:209
AV1_SET_TILE_MODE
@ AV1_SET_TILE_MODE
Codec control function to set the tile coding mode, unsigned int parameter.
Definition aomdx.h:316
AOMD_GET_FRAME_CORRUPTED
@ AOMD_GET_FRAME_CORRUPTED
Codec control function to check if the indicated frame is corrupted, int* parameter.
Definition aomdx.h:204
AV1D_GET_FRAME_SIZE
@ AV1D_GET_FRAME_SIZE
Codec control function to get the dimensions that the current frame is decoded at,...
Definition aomdx.h:217
AV1D_SET_SKIP_FILM_GRAIN
@ AV1D_SET_SKIP_FILM_GRAIN
Codec control function to set the skip film grain flag, int parameter.
Definition aomdx.h:390
AOMD_GET_TILE_INFO
@ AOMD_GET_TILE_INFO
Codec control function to get tile information of the previous frame decoded, aom_tile_info* paramete...
Definition aomdx.h:414
AV1D_SET_IS_ANNEXB
@ AV1D_SET_IS_ANNEXB
Codec control function to indicate whether bitstream is in Annex-B format, unsigned int parameter.
Definition aomdx.h:352
AV1D_GET_TILE_COUNT
@ AV1D_GET_TILE_COUNT
Codec control function to get the tile count in a tile list, unsigned int* parameter.
Definition aomdx.h:248
AOMD_GET_BASE_Q_IDX
@ AOMD_GET_BASE_Q_IDX
Codec control function to get the base q index of a frame, int* parameter.
Definition aomdx.h:455
AOMD_GET_SB_SIZE
@ AOMD_GET_SB_SIZE
Codec control function to get superblock size, aom_superblock_size_t* parameter.
Definition aomdx.h:436
AOMD_GET_SHOW_EXISTING_FRAME_FLAG
@ AOMD_GET_SHOW_EXISTING_FRAME_FLAG
Codec control function to check if the previous frame decoded has show existing frame flag set,...
Definition aomdx.h:441
AOMD_GET_ORDER_HINT
@ AOMD_GET_ORDER_HINT
Codec control function to get the order hint of a frame, unsigned int* parameter.
Definition aomdx.h:460
AOMD_GET_ALTREF_PRESENT
@ AOMD_GET_ALTREF_PRESENT
Codec control function to check the presence of altref frames, int* parameter.
Definition aomdx.h:407
AOMD_GET_SHOW_FRAME_FLAG
@ AOMD_GET_SHOW_FRAME_FLAG
Codec control function to get the show frame flag, int* parameter.
Definition aomdx.h:450
AV1_SET_SKIP_LOOP_FILTER
@ AV1_SET_SKIP_LOOP_FILTER
Codec control function to set the skip loop filter flag, int parameter.
Definition aomdx.h:278
AV1D_SET_ROW_MT
@ AV1D_SET_ROW_MT
Codec control function to enable the row based multi-threading of decoding, unsigned int parameter.
Definition aomdx.h:347
AV1D_GET_TILE_SIZE
@ AV1D_GET_TILE_SIZE
Codec control function to get the width and height (in pixels) of the tiles in a tile list,...
Definition aomdx.h:243
AV1D_GET_DISPLAY_SIZE
@ AV1D_GET_DISPLAY_SIZE
Codec control function to get the current frame's intended display dimensions (as specified in the wr...
Definition aomdx.h:225
AV1D_SET_OUTPUT_ALL_LAYERS
@ AV1D_SET_OUTPUT_ALL_LAYERS
Codec control function to indicate whether to output one frame per temporal unit (the default),...
Definition aomdx.h:374
AOMD_GET_SCREEN_CONTENT_TOOLS_INFO
@ AOMD_GET_SCREEN_CONTENT_TOOLS_INFO
Codec control function to get screen content tools information, aom_screen_content_tools_info* parame...
Definition aomdx.h:423
AV1D_SET_OPERATING_POINT
@ AV1D_SET_OPERATING_POINT
Codec control function to indicate which operating point to use, int parameter.
Definition aomdx.h:362
AOMD_GET_LAST_QUANTIZER
@ AOMD_GET_LAST_QUANTIZER
Codec control function to get last decoded frame quantizer, int* parameter.
Definition aomdx.h:297
AV1D_GET_MI_INFO
@ AV1D_GET_MI_INFO
Codec control function to get the info of a 4x4 block. Parameters: int mi_row, int mi_col,...
Definition aomdx.h:468
AOMD_GET_FRAME_FLAGS
@ AOMD_GET_FRAME_FLAGS
Codec control function to get the frame flags of the previous frame decoded, int* parameter.
Definition aomdx.h:402
AV1_GET_ACCOUNTING
@ AV1_GET_ACCOUNTING
Codec control function to retrieve a pointer to the Accounting struct, takes Accounting** as paramete...
Definition aomdx.h:290
AOMD_SET_FRAME_SIZE_LIMIT
@ AOMD_SET_FRAME_SIZE_LIMIT
Codec control function to set the maximum frame size, unsigned int parameter.
Definition aomdx.h:477
AOMD_GET_LAST_REF_UPDATES
@ AOMD_GET_LAST_REF_UPDATES
Codec control function to get info on which reference frames were updated by the last decode,...
Definition aomdx.h:199
AV1_SET_BYTE_ALIGNMENT
@ AV1_SET_BYTE_ALIGNMENT
Codec control function to set the byte alignment of the planes in the reference buffers,...
Definition aomdx.h:257
AV1_SET_DECODE_TILE_ROW
@ AV1_SET_DECODE_TILE_ROW
Codec control function to set the range of tile decoding, int parameter.
Definition aomdx.h:307
AV1_INVERT_TILE_DECODE_ORDER
@ AV1_INVERT_TILE_DECODE_ORDER
Codec control function to invert the decoding order to from right to left, int parameter.
Definition aomdx.h:269
AOMD_GET_STILL_PICTURE
@ AOMD_GET_STILL_PICTURE
Codec control function to get the still picture coding information, aom_still_picture_info* parameter...
Definition aomdx.h:428
AV1D_GET_IMG_FORMAT
@ AV1D_GET_IMG_FORMAT
Codec control function to get the image format of the stream, aom_img_fmt_t* parameter.
Definition aomdx.h:235
AV1D_GET_BIT_DEPTH
@ AV1D_GET_BIT_DEPTH
Codec control function to get the bit depth of the stream, unsigned int* parameter.
Definition aomdx.h:230
AOMD_GET_FWD_KF_PRESENT
@ AOMD_GET_FWD_KF_PRESENT
Codec control function to check the presence of forward key frames, int* parameter.
Definition aomdx.h:395
AOMD_GET_S_FRAME_INFO
@ AOMD_GET_S_FRAME_INFO
Codec control function to get the S_FRAME coding information, aom_s_frame_info* parameter.
Definition aomdx.h:446
AV1D_GET_TILE_DATA
@ AV1D_GET_TILE_DATA
Codec control function to get the start address and size of a tile in the coded bitstream,...
Definition aomdx.h:326
AV1D_SET_EXT_REF_PTR
@ AV1D_SET_EXT_REF_PTR
Codec control function to set the external references' pointers in the decoder, av1_ext_ref_frame_t* ...
Definition aomdx.h:334
AV1_SET_INSPECTION_CALLBACK
@ AV1_SET_INSPECTION_CALLBACK
Codec control function to set an aom_inspect_cb callback that is invoked each time a frame is decoded...
Definition aomdx.h:382
AV1D_GET_FRAME_HEADER_INFO
@ AV1D_GET_FRAME_HEADER_INFO
Codec control function to get the frame header information of an encoded frame, aom_tile_data* parame...
Definition aomdx.h:321
AV1D_EXT_TILE_DEBUG
@ AV1D_EXT_TILE_DEBUG
Codec control function to enable the ext-tile software debug and testing code in the decoder,...
Definition aomdx.h:339
AOM_DECODER_CTRL_ID_START
@ AOM_DECODER_CTRL_ID_START
Start point of control IDs for aom_dec_control_id. Any new common control IDs should be added above.
Definition aom.h:81
AOM_CTRL_USE_TYPE
#define AOM_CTRL_USE_TYPE(id, typ)
Creates type checking mechanisms for aom_codec_control.
Definition aom_codec.h:551
aom_codec_iface_t
const struct aom_codec_iface aom_codec_iface_t
Codec interface structure.
Definition aom_codec.h:271
aom_superblock_size_t
enum aom_superblock_size aom_superblock_size_t
Superblock size selection.
Av1DecodeReturn
Structure to collect a buffer index when inspecting.
Definition aomdx.h:78
Av1DecodeReturn::buf
const unsigned char * buf
Definition aomdx.h:80
Av1DecodeReturn::show_existing
int show_existing
Definition aomdx.h:84
Av1DecodeReturn::idx
int idx
Definition aomdx.h:82
aom_inspect_init
Structure to hold inspection callback and context.
Definition aomdx.h:64
aom_inspect_init::inspect_ctx
void * inspect_ctx
Definition aomdx.h:69
aom_inspect_init::inspect_cb
aom_inspect_cb inspect_cb
Definition aomdx.h:66
aom_s_frame_info
Structure to hold information about S_FRAME.
Definition aomdx.h:153
aom_s_frame_info::is_s_frame_at_altref
int is_s_frame_at_altref
Definition aomdx.h:157
aom_s_frame_info::is_s_frame
int is_s_frame
Definition aomdx.h:155
aom_screen_content_tools_info
Structure to hold information about screen content tools.
Definition aomdx.h:166
aom_screen_content_tools_info::force_integer_mv
int force_integer_mv
Definition aomdx.h:172
aom_screen_content_tools_info::allow_intrabc
int allow_intrabc
Definition aomdx.h:170
aom_screen_content_tools_info::allow_screen_content_tools
int allow_screen_content_tools
Definition aomdx.h:168
aom_still_picture_info
Structure to hold information about still image coding.
Definition aomdx.h:141
aom_still_picture_info::is_reduced_still_picture_hdr
int is_reduced_still_picture_hdr
Definition aomdx.h:145
aom_still_picture_info::is_still_picture
int is_still_picture
Definition aomdx.h:143
aom_tile_data
Structure to hold a tile's start address and size in the bitstream.
Definition aomdx.h:91
aom_tile_data::coded_tile_data
const void * coded_tile_data
Definition aomdx.h:95
aom_tile_data::coded_tile_data_size
size_t coded_tile_data_size
Definition aomdx.h:93
aom_tile_data::extra_size
size_t extra_size
Definition aomdx.h:97
aom_tile_info
Structure to hold information about tiles in a frame.
Definition aomdx.h:123
aom_tile_info::tile_heights
int tile_heights[64]
Definition aomdx.h:131
aom_tile_info::tile_rows
int tile_rows
Definition aomdx.h:127
aom_tile_info::tile_columns
int tile_columns
Definition aomdx.h:125
aom_tile_info::num_tile_groups
int num_tile_groups
Definition aomdx.h:133
aom_tile_info::tile_widths
int tile_widths[64]
Definition aomdx.h:129
av1_ext_ref_frame
Structure to hold the external reference frame pointer.
Definition aomdx.h:179
av1_ext_ref_frame::num
int num
Definition aomdx.h:183
av1_ext_ref_frame::img
aom_image_t * img
Definition aomdx.h:181