AOMedia Codec SDK
Data Structures | Macros | Typedefs | Enumerations | Functions
aom_image.h File Reference

Describes the aom image descriptor and associated operations. More...

#include "aom/aom_integer.h"

Go to the source code of this file.

Data Structures

struct  aom_image
 Image Descriptor. More...
 
struct  aom_image_rect
 Representation of a rectangle on a surface. More...
 

Macros

#define AOM_IMAGE_ABI_VERSION
 Current ABI version number.
 
#define AOM_IMG_FMT_PLANAR   0x100
 
#define AOM_IMG_FMT_UV_FLIP   0x200
 
#define AOM_IMG_FMT_HAS_ALPHA   0x400
 
#define AOM_IMG_FMT_HIGHBITDEPTH   0x800
 
#define AOM_PLANE_PACKED   0
 
#define AOM_PLANE_Y   0
 
#define AOM_PLANE_U   1
 
#define AOM_PLANE_V   2
 
#define AOM_PLANE_ALPHA   3
 

Typedefs

typedef enum aom_img_fmt aom_img_fmt_t
 List of supported image formats. More...
 
typedef enum aom_color_primaries aom_color_primaries_t
 List of supported color primaries. More...
 
typedef enum
aom_transfer_characteristics 
aom_transfer_characteristics_t
 List of supported transfer functions. More...
 
typedef enum
aom_matrix_coefficients 
aom_matrix_coefficients_t
 List of supported matrix coefficients.
 
typedef enum aom_color_range aom_color_range_t
 List of supported color range. More...
 
typedef enum
aom_chroma_sample_position 
aom_chroma_sample_position_t
 List of chroma sample positions. More...
 
typedef struct aom_image aom_image_t
 Image Descriptor. More...
 
typedef struct aom_image_rect aom_image_rect_t
 Representation of a rectangle on a surface. More...
 

Enumerations

enum  aom_img_fmt {
  AOM_IMG_FMT_NONE, AOM_IMG_FMT_YV12, AOM_IMG_FMT_I420 = 0x100 | 2, AOM_IMG_FMT_AOMYV12,
  AOM_IMG_FMT_AOMI420 = 0x100 | 4, AOM_IMG_FMT_I422 = 0x100 | 5, AOM_IMG_FMT_I444 = 0x100 | 6, AOM_IMG_FMT_444A = 0x100 | 0x400 | 6,
  AOM_IMG_FMT_I42016 = AOM_IMG_FMT_I420 | 0x800, AOM_IMG_FMT_I42216 = AOM_IMG_FMT_I422 | 0x800, AOM_IMG_FMT_I44416 = AOM_IMG_FMT_I444 | 0x800
}
 List of supported image formats. More...
 
enum  aom_color_primaries {
  AOM_CICP_CP_RESERVED_0 = 0, AOM_CICP_CP_BT_709 = 1, AOM_CICP_CP_UNSPECIFIED = 2, AOM_CICP_CP_RESERVED_3 = 3,
  AOM_CICP_CP_BT_470_M = 4, AOM_CICP_CP_BT_470_B_G = 5, AOM_CICP_CP_BT_601 = 6, AOM_CICP_CP_SMPTE_240 = 7,
  AOM_CICP_CP_GENERIC_FILM, AOM_CICP_CP_BT_2020 = 9, AOM_CICP_CP_XYZ = 10, AOM_CICP_CP_SMPTE_431 = 11,
  AOM_CICP_CP_SMPTE_432 = 12, AOM_CICP_CP_RESERVED_13 = 13, AOM_CICP_CP_EBU_3213 = 22, AOM_CICP_CP_RESERVED_23 = 23
}
 List of supported color primaries. More...
 
enum  aom_transfer_characteristics {
  AOM_CICP_TC_RESERVED_0 = 0, AOM_CICP_TC_BT_709 = 1, AOM_CICP_TC_UNSPECIFIED = 2, AOM_CICP_TC_RESERVED_3 = 3,
  AOM_CICP_TC_BT_470_M = 4, AOM_CICP_TC_BT_470_B_G = 5, AOM_CICP_TC_BT_601 = 6, AOM_CICP_TC_SMPTE_240 = 7,
  AOM_CICP_TC_LINEAR = 8, AOM_CICP_TC_LOG_100 = 9, AOM_CICP_TC_LOG_100_SQRT10, AOM_CICP_TC_IEC_61966 = 11,
  AOM_CICP_TC_BT_1361 = 12, AOM_CICP_TC_SRGB = 13, AOM_CICP_TC_BT_2020_10_BIT = 14, AOM_CICP_TC_BT_2020_12_BIT = 15,
  AOM_CICP_TC_SMPTE_2084 = 16, AOM_CICP_TC_SMPTE_428 = 17, AOM_CICP_TC_HLG = 18, AOM_CICP_TC_RESERVED_19 = 19
}
 List of supported transfer functions. More...
 
enum  aom_matrix_coefficients {
  AOM_CICP_MC_IDENTITY = 0, AOM_CICP_MC_BT_709 = 1, AOM_CICP_MC_UNSPECIFIED = 2, AOM_CICP_MC_RESERVED_3 = 3,
  AOM_CICP_MC_FCC = 4, AOM_CICP_MC_BT_470_B_G = 5, AOM_CICP_MC_BT_601 = 6, AOM_CICP_MC_SMPTE_240 = 7,
  AOM_CICP_MC_SMPTE_YCGCO = 8, AOM_CICP_MC_BT_2020_NCL, AOM_CICP_MC_BT_2020_CL = 10, AOM_CICP_MC_SMPTE_2085 = 11,
  AOM_CICP_MC_CHROMAT_NCL, AOM_CICP_MC_CHROMAT_CL = 13, AOM_CICP_MC_ICTCP = 14, AOM_CICP_MC_RESERVED_15 = 15
}
 List of supported matrix coefficients. More...
 
enum  aom_color_range { AOM_CR_STUDIO_RANGE = 0, AOM_CR_FULL_RANGE = 1 }
 List of supported color range. More...
 
enum  aom_chroma_sample_position { AOM_CSP_UNKNOWN = 0, AOM_CSP_VERTICAL = 1, AOM_CSP_COLOCATED = 2, AOM_CSP_RESERVED = 3 }
 List of chroma sample positions. More...
 

Functions

aom_image_taom_img_alloc (aom_image_t *img, aom_img_fmt_t fmt, unsigned int d_w, unsigned int d_h, unsigned int align)
 Open a descriptor, allocating storage for the underlying image. More...
 
aom_image_taom_img_wrap (aom_image_t *img, aom_img_fmt_t fmt, unsigned int d_w, unsigned int d_h, unsigned int align, unsigned char *img_data)
 Open a descriptor, using existing storage for the underlying image. More...
 
aom_image_taom_img_alloc_with_border (aom_image_t *img, aom_img_fmt_t fmt, unsigned int d_w, unsigned int d_h, unsigned int align, unsigned int size_align, unsigned int border)
 Open a descriptor, allocating storage for the underlying image with a border. More...
 
int aom_img_set_rect (aom_image_t *img, unsigned int x, unsigned int y, unsigned int w, unsigned int h, unsigned int border)
 Set the rectangle identifying the displayed portion of the image. More...
 
void aom_img_flip (aom_image_t *img)
 Flip the image vertically (top for bottom) More...
 
void aom_img_free (aom_image_t *img)
 Close an image descriptor. More...
 
int aom_img_plane_width (const aom_image_t *img, int plane)
 Get the width of a plane. More...
 
int aom_img_plane_height (const aom_image_t *img, int plane)
 Get the height of a plane. More...
 

Detailed Description

Describes the aom image descriptor and associated operations.

Macro Definition Documentation

#define AOM_IMG_FMT_PLANAR   0x100

Image is a planar format.

#define AOM_IMG_FMT_UV_FLIP   0x200

V plane precedes U in memory.

#define AOM_IMG_FMT_HAS_ALPHA   0x400

Image has an alpha channel.

#define AOM_IMG_FMT_HIGHBITDEPTH   0x800

Image uses 16bit framebuffer.

#define AOM_PLANE_PACKED   0

To be used for all packed formats

#define AOM_PLANE_Y   0

Y (Luminance) plane

#define AOM_PLANE_U   1

U (Chroma) plane

#define AOM_PLANE_V   2

V (Chroma) plane

#define AOM_PLANE_ALPHA   3

A (Transparency) plane

Typedef Documentation

typedef enum aom_img_fmt aom_img_fmt_t

List of supported image formats.

alias for enum aom_img_fmt

List of supported color primaries.

alias for enum aom_color_primaries

List of supported transfer functions.

alias for enum aom_transfer_function

List of supported color range.

alias for enum aom_color_range

List of chroma sample positions.

alias for enum aom_transfer_function

typedef struct aom_image aom_image_t

Image Descriptor.

alias for struct aom_image

Representation of a rectangle on a surface.

alias for struct aom_image_rect

Enumeration Type Documentation

List of supported image formats.

Enumerator
AOM_IMG_FMT_YV12 

Image is a planar format. V plane precedes U in memory. planar YVU

AOM_IMG_FMT_I420 

Image is a planar format.

AOM_IMG_FMT_AOMYV12 

Image is a planar format. V plane precedes U in memory.

AOM_IMG_FMT_AOMI420 

< planar 4:2:0 format with aom color space Image is a planar format.

AOM_IMG_FMT_I422 

Image is a planar format.

AOM_IMG_FMT_I444 

Image is a planar format.

AOM_IMG_FMT_444A 

Image is a planar format. Image has an alpha channel.

AOM_IMG_FMT_I42016 

Image uses 16bit framebuffer.

AOM_IMG_FMT_I42216 

Image uses 16bit framebuffer.

AOM_IMG_FMT_I44416 

Image uses 16bit framebuffer.

List of supported color primaries.

Enumerator
AOM_CICP_CP_RESERVED_0 

For future use

AOM_CICP_CP_BT_709 

BT.709

AOM_CICP_CP_UNSPECIFIED 

Unspecified

AOM_CICP_CP_RESERVED_3 

For future use

AOM_CICP_CP_BT_470_M 

BT.470 System M (historical)

AOM_CICP_CP_BT_470_B_G 

BT.470 System B, G (historical)

AOM_CICP_CP_BT_601 

BT.601

AOM_CICP_CP_SMPTE_240 

SMPTE 240

AOM_CICP_CP_GENERIC_FILM 

Generic film (color filters using illuminant C)

AOM_CICP_CP_BT_2020 

BT.2020, BT.2100

AOM_CICP_CP_XYZ 

SMPTE 428 (CIE 1921 XYZ)

AOM_CICP_CP_SMPTE_431 

SMPTE RP 431-2

AOM_CICP_CP_SMPTE_432 

SMPTE EG 432-1

AOM_CICP_CP_RESERVED_13 

For future use (values 13 - 21)

AOM_CICP_CP_EBU_3213 

EBU Tech. 3213-E

AOM_CICP_CP_RESERVED_23 

For future use (values 23 - 255)

List of supported transfer functions.

Enumerator
AOM_CICP_TC_RESERVED_0 

For future use

AOM_CICP_TC_BT_709 

BT.709

AOM_CICP_TC_UNSPECIFIED 

Unspecified

AOM_CICP_TC_RESERVED_3 

For future use

AOM_CICP_TC_BT_470_M 

BT.470 System M (historical)

AOM_CICP_TC_BT_470_B_G 

BT.470 System B, G (historical)

AOM_CICP_TC_BT_601 

BT.601

AOM_CICP_TC_SMPTE_240 

SMPTE 240 M

AOM_CICP_TC_LINEAR 

Linear

AOM_CICP_TC_LOG_100 

Logarithmic (100 : 1 range)

AOM_CICP_TC_LOG_100_SQRT10 

Logarithmic (100 * Sqrt(10) : 1 range)

AOM_CICP_TC_IEC_61966 

IEC 61966-2-4

AOM_CICP_TC_BT_1361 

BT.1361

AOM_CICP_TC_SRGB 

sRGB or sYCC

AOM_CICP_TC_BT_2020_10_BIT 

BT.2020 10-bit systems

AOM_CICP_TC_BT_2020_12_BIT 

BT.2020 12-bit systems

AOM_CICP_TC_SMPTE_2084 

SMPTE ST 2084, ITU BT.2100 PQ

AOM_CICP_TC_SMPTE_428 

SMPTE ST 428

AOM_CICP_TC_HLG 

BT.2100 HLG, ARIB STD-B67

AOM_CICP_TC_RESERVED_19 

For future use (values 19-255)

List of supported matrix coefficients.

Enumerator
AOM_CICP_MC_IDENTITY 

Identity matrix

AOM_CICP_MC_BT_709 

BT.709

AOM_CICP_MC_UNSPECIFIED 

Unspecified

AOM_CICP_MC_RESERVED_3 

For future use

AOM_CICP_MC_FCC 

US FCC 73.628

AOM_CICP_MC_BT_470_B_G 

BT.470 System B, G (historical)

AOM_CICP_MC_BT_601 

BT.601

AOM_CICP_MC_SMPTE_240 

SMPTE 240 M

AOM_CICP_MC_SMPTE_YCGCO 

YCgCo

AOM_CICP_MC_BT_2020_NCL 

BT.2020 non-constant luminance, BT.2100 YCbCr

AOM_CICP_MC_BT_2020_CL 

BT.2020 constant luminance

AOM_CICP_MC_SMPTE_2085 

SMPTE ST 2085 YDzDx

AOM_CICP_MC_CHROMAT_NCL 

Chromaticity-derived non-constant luminance

AOM_CICP_MC_CHROMAT_CL 

Chromaticity-derived constant luminance

AOM_CICP_MC_ICTCP 

BT.2100 ICtCp

AOM_CICP_MC_RESERVED_15 

For future use (values 15-255)

List of supported color range.

Enumerator
AOM_CR_STUDIO_RANGE 

Y [16..235], UV [16..240]

AOM_CR_FULL_RANGE 

YUV/RGB [0..255]

List of chroma sample positions.

Enumerator
AOM_CSP_UNKNOWN 

Unknown

AOM_CSP_VERTICAL 

Horizontally co-located with luma(0, 0) sample, between two vertical samples

AOM_CSP_COLOCATED 

Co-located with luma(0, 0) sample

AOM_CSP_RESERVED 

Reserved value

Function Documentation

aom_image_t* aom_img_alloc ( aom_image_t img,
aom_img_fmt_t  fmt,
unsigned int  d_w,
unsigned int  d_h,
unsigned int  align 
)

Open a descriptor, allocating storage for the underlying image.

Returns a descriptor for storing an image of the given format. The storage for the descriptor is allocated on the heap.

Parameters
[in]imgPointer to storage for descriptor. If this parameter is NULL, the storage for the descriptor will be allocated on the heap.
[in]fmtFormat for the image
[in]d_wWidth of the image
[in]d_hHeight of the image
[in]alignAlignment, in bytes, of the image buffer and each row in the image(stride).
Returns
Returns a pointer to the initialized image descriptor. If the img parameter is non-null, the value of the img parameter will be returned.
aom_image_t* aom_img_wrap ( aom_image_t img,
aom_img_fmt_t  fmt,
unsigned int  d_w,
unsigned int  d_h,
unsigned int  align,
unsigned char *  img_data 
)

Open a descriptor, using existing storage for the underlying image.

Returns a descriptor for storing an image of the given format. The storage for descriptor has been allocated elsewhere, and a descriptor is desired to "wrap" that storage.

Parameters
[in]imgPointer to storage for descriptor. If this parameter is NULL, the storage for the descriptor will be allocated on the heap.
[in]fmtFormat for the image
[in]d_wWidth of the image
[in]d_hHeight of the image
[in]alignAlignment, in bytes, of each row in the image.
[in]img_dataStorage to use for the image
Returns
Returns a pointer to the initialized image descriptor. If the img parameter is non-null, the value of the img parameter will be returned.
aom_image_t* aom_img_alloc_with_border ( aom_image_t img,
aom_img_fmt_t  fmt,
unsigned int  d_w,
unsigned int  d_h,
unsigned int  align,
unsigned int  size_align,
unsigned int  border 
)

Open a descriptor, allocating storage for the underlying image with a border.

Returns a descriptor for storing an image of the given format and its borders. The storage for the descriptor is allocated on the heap.

Parameters
[in]imgPointer to storage for descriptor. If this parameter is NULL, the storage for the descriptor will be allocated on the heap.
[in]fmtFormat for the image
[in]d_wWidth of the image
[in]d_hHeight of the image
[in]alignAlignment, in bytes, of the image buffer and each row in the image(stride).
[in]size_alignAlignment, in bytes, of the image width and height.
[in]borderA border that is padded on four sides of the image.
Returns
Returns a pointer to the initialized image descriptor. If the img parameter is non-null, the value of the img parameter will be returned.
int aom_img_set_rect ( aom_image_t img,
unsigned int  x,
unsigned int  y,
unsigned int  w,
unsigned int  h,
unsigned int  border 
)

Set the rectangle identifying the displayed portion of the image.

Updates the displayed rectangle (aka viewport) on the image surface to match the specified coordinates and size.

Parameters
[in]imgImage descriptor
[in]xleftmost column
[in]ytopmost row
[in]wwidth
[in]hheight
[in]borderA border that is padded on four sides of the image.
Returns
0 if the requested rectangle is valid, nonzero otherwise.
void aom_img_flip ( aom_image_t img)

Flip the image vertically (top for bottom)

Adjusts the image descriptor's pointers and strides to make the image be referenced upside-down.

Parameters
[in]imgImage descriptor
void aom_img_free ( aom_image_t img)

Close an image descriptor.

Frees all allocated storage associated with an image descriptor.

Parameters
[in]imgImage descriptor
int aom_img_plane_width ( const aom_image_t img,
int  plane 
)

Get the width of a plane.

Get the width of a plane of an image

Parameters
[in]imgImage descriptor
[in]planePlane index
int aom_img_plane_height ( const aom_image_t img,
int  plane 
)

Get the height of a plane.

Get the height of a plane of an image

Parameters
[in]imgImage descriptor
[in]planePlane index