AOMedia AV1 Codec
Scalable Video Coding

Data Structures

struct  LAYER_CONTEXT
 The stucture of quantities related to each spatial and temporal layer. More...
 
struct  SVC
 The stucture of SVC. More...
 

Typedefs

typedef struct SVC SVC
 The stucture of SVC.
 

Functions

void av1_init_layer_context (struct AV1_COMP *const cpi)
 Initialize layer context data from init_config().
 
bool av1_alloc_layer_context (struct AV1_COMP *cpi, int num_layers)
 Allocate layer context data.
 
void av1_update_layer_context_change_config (struct AV1_COMP *const cpi, const int64_t target_bandwidth)
 Update the layer context from a change_config() call.
 
void av1_update_temporal_layer_framerate (struct AV1_COMP *const cpi)
 Prior to encoding the frame, update framerate-related quantities for the current temporal layer.
 
bool av1_check_ref_is_low_spatial_res_super_frame (struct AV1_COMP *const cpi, int ref_frame)
 Prior to check if reference is lower spatial layer at the same timestamp/superframe.
 
void av1_restore_layer_context (struct AV1_COMP *const cpi)
 Prior to encoding the frame, set the layer context, for the current layer to be encoded, to the cpi struct.
 
void av1_save_layer_context (struct AV1_COMP *const cpi)
 Save the layer context after encoding the frame.
 
void av1_free_svc_cyclic_refresh (struct AV1_COMP *const cpi)
 Free the memory used for cyclic refresh in layer context.
 
void av1_svc_reset_temporal_layers (struct AV1_COMP *const cpi, int is_key)
 Reset on key frame: reset counters, references and buffer updates.
 
void av1_one_pass_cbr_svc_start_layer (struct AV1_COMP *const cpi)
 Before encoding, set resolutions and allocate compressor data.
 
int av1_svc_primary_ref_frame (const struct AV1_COMP *const cpi)
 Get primary reference frame for current layer.
 
void av1_get_layer_resolution (const int width_org, const int height_org, const int num, const int den, int *width_out, int *height_out)
 Get resolution for current layer.
 

Detailed Description

This module describes scalable video coding algorithm in AV1. More details will be added.

Function Documentation

◆ av1_init_layer_context()

◆ av1_alloc_layer_context()

bool av1_alloc_layer_context ( struct AV1_COMP * cpi,
int num_layers )

Allocate layer context data.

Parameters
[in]cpiTop level encoder structure
[in]num_layersNumber of layers to be allocated
Remarks
Allocates memory for cpi->svc.layer_context.
Returns
True on success, false on allocation failure.

References layer_context, num_allocated_layers, and AV1_COMP::svc.

◆ av1_update_layer_context_change_config()

◆ av1_update_temporal_layer_framerate()

void av1_update_temporal_layer_framerate ( struct AV1_COMP *const cpi)

Prior to encoding the frame, update framerate-related quantities for the current temporal layer.

Parameters
[in]cpiTop level encoder structure
Remarks
Nothing returned. Frame related quantities for current temporal layer are updated.

References AV1_COMP::framerate, get_layer_context(), layer_context, AV1_COMP::rc, and AV1_COMP::svc.

Referenced by av1_svc_reset_temporal_layers().

◆ av1_check_ref_is_low_spatial_res_super_frame()

bool av1_check_ref_is_low_spatial_res_super_frame ( struct AV1_COMP *const cpi,
int ref_frame )

Prior to check if reference is lower spatial layer at the same timestamp/superframe.

Parameters
[in]cpiTop level encoder structure
[in]ref_frameReference frame
Returns
True if the ref_frame if lower spatial layer, otherwise false.

References AV1_COMP::ppi, AV1_PRIMARY::rtc_ref, and AV1_COMP::svc.

Referenced by av1_restore_layer_context().

◆ av1_restore_layer_context()

◆ av1_save_layer_context()

◆ av1_free_svc_cyclic_refresh()

void av1_free_svc_cyclic_refresh ( struct AV1_COMP *const cpi)

Free the memory used for cyclic refresh in layer context.

Parameters
[in]cpiTop level encoder structure

References layer_context, LAYER_CONTEXT::map, and AV1_COMP::svc.

◆ av1_svc_reset_temporal_layers()

void av1_svc_reset_temporal_layers ( struct AV1_COMP *const cpi,
int is_key )

Reset on key frame: reset counters, references and buffer updates.

Parameters
[in]cpiTop level encoder structure
[in]is_keyWhether current layer is key frame

References av1_restore_layer_context(), av1_update_temporal_layer_framerate(), layer_context, and AV1_COMP::svc.

◆ av1_one_pass_cbr_svc_start_layer()

void av1_one_pass_cbr_svc_start_layer ( struct AV1_COMP *const cpi)

◆ av1_svc_primary_ref_frame()

int av1_svc_primary_ref_frame ( const struct AV1_COMP *const cpi)

Get primary reference frame for current layer.

Parameters
[in]cpiTop level encoder structure
Returns
The primary reference frame for current layer.

◆ av1_get_layer_resolution()

void av1_get_layer_resolution ( const int width_org,
const int height_org,
const int num,
const int den,
int * width_out,
int * height_out )

Get resolution for current layer.

Parameters
[in]width_orgOriginal width, unscaled
[in]height_orgOriginal height, unscaled
[in]numNumerator for the scale ratio
[in]denDenominator for the scale ratio
[in]width_outOutput width, scaled for current layer
[in]height_outOutput height, scaled for current layer
Remarks
Nothing is returned. Instead the scaled width and height are set.

Referenced by av1_one_pass_cbr_svc_start_layer().