AOMedia AV1 Codec
Loop Restoration

Functions

void av1_loop_restoration_filter_unit (const RestorationTileLimits *limits, const RestorationUnitInfo *rui, const RestorationStripeBoundaries *rsb, RestorationLineBuffers *rlbs, int plane_w, int plane_h, int ss_x, int ss_y, int highbd, int bit_depth, uint8_t *data8, int stride, uint8_t *dst8, int dst_stride, int32_t *tmpbuf, int optimized_lr, struct aom_internal_error_info *error_info)
 Function for applying loop restoration filter to a single unit.
 
void av1_loop_restoration_filter_frame (YV12_BUFFER_CONFIG *frame, struct AV1Common *cm, int optimized_lr, void *lr_ctxt)
 Function for applying loop restoration filter to a frame.
 
void av1_pick_filter_restoration (const YV12_BUFFER_CONFIG *sd, AV1_COMP *cpi)
 Algorithm for AV1 loop restoration search and estimation.
 

Detailed Description

This module describes the loop restoration search and estimation algorithm in AV1. More details will be added.

Function Documentation

◆ av1_loop_restoration_filter_unit()

void av1_loop_restoration_filter_unit ( const RestorationTileLimits * limits,
const RestorationUnitInfo * rui,
const RestorationStripeBoundaries * rsb,
RestorationLineBuffers * rlbs,
int plane_w,
int plane_h,
int ss_x,
int ss_y,
int highbd,
int bit_depth,
uint8_t * data8,
int stride,
uint8_t * dst8,
int dst_stride,
int32_t * tmpbuf,
int optimized_lr,
struct aom_internal_error_info * error_info )

Function for applying loop restoration filter to a single unit.

This function applies the loop restoration filter to a single loop restoration unit.

Parameters
[in]limitsLimits of the unit
[in]ruiThe parameters to use for this unit and its coefficients
[in]rsbDeblocked pixels to use for stripe boundaries
[in]rlbsSpace to use as a scratch buffer
[in]ss_xHorizontal subsampling for plane
[in]ss_yVertical subsampling for plane
[in]plane_wWidth of the current plane
[in]plane_hHeight of the current plane
[in]highbdWhether high bitdepth pipeline is used
[in]bit_depthBit-depth of the video
[in]data8Frame data (pointing at the top-left corner of the frame, not the restoration unit).
[in]strideStride of data8
[out]dst8Buffer where the results will be written. Like data8, dst8 should point at the top-left corner of the frame
[in]dst_strideStride of dst8
[in]tmpbufScratch buffer used by the sgrproj filter which should be at least SGRPROJ_TMPBUF_SIZE big.
[in]optimized_lrWhether to use fast optimized Loop Restoration
[in,out]error_infoError info for reporting errors
Remarks
Nothing is returned. Instead, the filtered unit is output in dst8 at the proper restoration unit offset.

◆ av1_loop_restoration_filter_frame()

void av1_loop_restoration_filter_frame ( YV12_BUFFER_CONFIG * frame,
struct AV1Common * cm,
int optimized_lr,
void * lr_ctxt )

Function for applying loop restoration filter to a frame.

This function applies the loop restoration filter to a frame.

Parameters
[in,out]frameCompressed frame buffer
[in,out]cmPointer to top level common structure
[in]optimized_lrWhether to use fast optimized Loop Restoration
[in]lr_ctxtLoop restoration context
Remarks
Nothing is returned. Instead, the filtered frame is output in frame.

Referenced by cdef_restoration_frame().

◆ av1_pick_filter_restoration()

void av1_pick_filter_restoration ( const YV12_BUFFER_CONFIG * sd,
AV1_COMP * cpi )

Algorithm for AV1 loop restoration search and estimation.

This function determines proper restoration filter types and associated parameters for each restoration unit in a frame.

Parameters
[in]sdSource frame buffer
[in,out]cpiTop-level encoder structure
Remarks
Nothing is returned. Instead, chosen restoration filter types and parameters are stored per plane in the rst_info structure of type RestorationInfo inside cpi->common:
  • rst_info[ 0 ]: Chosen parameters for Y plane
  • rst_info[ 1 ]: Chosen parameters for U plane if it exists
  • rst_info[ 2 ]: Chosen parameters for V plane if it exists
The following fields in each rst_info[ p], p = 0, 1, 2 are populated:
  • rst_info[ p ].frame_restoration_type
  • rst_info[ p ].unit_info[ u ], for each u in 0, 1, ..., n( p ) - 1, where n( p ) is the number of restoration units in plane p.
The following fields in each rst_info[ p ].unit_info[ u ], p = 0, 1, 2 and u = 0, 1, ..., n( p ) - 1, of type RestorationUnitInfo are populated:
  • rst_info[ p ].unit_info[ u ].restoration_type
  • rst_info[ p ].unit_info[ u ].wiener_info OR rst_info[ p ].unit_info[ u ].sgrproj_info OR neither, depending on rst_info[ p ].unit_info[ u ].restoration_type

Referenced by cdef_restoration_frame().