errdo.c File Reference

Contains functions that implement the "decoders in the encoder" concept for the rate-distortion optimization with losses. More...

#include "global.h"
#include "memalloc.h"
#include "refbuf.h"
#include "image.h"
#include "errdo.h"
#include "errdo_mc_prediction.h"

Include dependency graph for errdo.c:

Go to the source code of this file.

Functions

static StorablePicture * find_nearest_ref_picture (int poc)
static void copy_conceal_mb (StorablePicture *enc_pic, ImageParameters *image, int decoder, int mb_error, Macroblock *currMB, StorablePicture *refPic)
static void get_predicted_mb (StorablePicture *enc_pic, ImageParameters *image, int decoder, Macroblock *currMB)
static void add_residue (StorablePicture *enc_pic, ImageParameters *image, int decoder, int pl, int block8x8, int x_size, int y_size)
static void Build_Status_Map (byte **s_map)
void DeblockFrame (ImageParameters *img, imgpel **, imgpel ***)
int allocate_errdo_mem (InputParameters *pparams)
void free_errdo_mem (void)
void decode_one_mb (ImageParameters *image, StorablePicture *enc_pic, int decoder, Macroblock *currMB)
void decode_one_b8block (ImageParameters *image, StorablePicture *enc_pic, Macroblock *currMB, int decoder, int block8x8, short mv_mode, int pred_dir)
void UpdateDecoders (InputParameters *params, ImageParameters *image, StorablePicture *enc_pic)
void init_error_conceal (int concealment_type)
static void get_predicted_concealment_mb (StorablePicture *enc_pic, ImageParameters *image, int decoder, Macroblock *currMB)
void copy_conceal_picture (ImageParameters *image, StorablePicture *enc_pic, int decoder)
void compute_residue_block (ImageParameters *image, imgpel **imgY, int **res_img, imgpel **mb_pred, int b8block, int block_size)
void errdo_store_best_block (imgpel ***mbY, imgpel ***dec_img, int block_i, int block_j, int img_i, int img_j, int block_size)
void errdo_get_best_block (ImageParameters *image, imgpel ***dec_img, imgpel ***mbY, int j0, int block_size)

Variables

Decoders * decs = NULL


Detailed Description

Contains functions that implement the "decoders in the encoder" concept for the rate-distortion optimization with losses.

Date:
October 22nd, 2001
Author:
Main contributors (see contributors.h for copyright, address and affiliation details)

Definition in file errdo.c.


Function Documentation

static void add_residue ( StorablePicture *  enc_pic,
ImageParameters *  image,
int  decoder,
int  pl,
int  block8x8,
int  x_size,
int  y_size 
) [static]

int allocate_errdo_mem ( InputParameters *  pparams  ) 

Allocate memory for error resilient RDO.

Definition at line 45 of file errdo.c.

References Decoders::dec_mb_pred, Decoders::dec_mb_pred_best8x8, Decoders::dec_mbY_best, Decoders::dec_mbY_best8x8, get_mem3Dint(), get_mem3Dpel(), get_mem4Dpel(), InputParameters::NoOfDecoders, and Decoders::res_img.

Referenced by init_global_buffers().

Here is the call graph for this function:

static void Build_Status_Map ( byte **  s_map  )  [static]

Builds a random status map showing whether each MB is received or lost, based on the packet loss rate and the slice structure.

Parameters:
s_map The status map to be filled

Packet OK

Definition at line 617 of file errdo.c.

References ImageParameters::height, InputParameters::LossRateA, InputParameters::LossRateB, InputParameters::LossRateC, ImageParameters::mb_data, InputParameters::partition_mode, InputParameters::slice_mode, macroblock::slice_nr, and ImageParameters::width.

Referenced by UpdateDecoders().

void compute_residue_block ( ImageParameters *  image,
imgpel **  imgY,
int **  res_img,
imgpel **  mb_pred,
int  b8block,
int  block_size 
)

Gives the prediction residue for a block.

Definition at line 551 of file errdo.c.

References ImageParameters::pix_x.

Referenced by RDCost_for_8x8blocks(), and RDCost_for_macroblocks().

void copy_conceal_picture ( ImageParameters *  image,
StorablePicture *  enc_pic,
int  decoder 
)

Performs copy error concealment for macroblocks with errors. Note: Currently assumes that the reference picture lists remain the same for all slices of a picture.

Definition at line 447 of file errdo.c.

References ImageParameters::block_x, ImageParameters::block_y, ImageParameters::mb_data, storable_picture::mb_error_map, ImageParameters::mb_x, ImageParameters::mb_y, ImageParameters::PicSizeInMbs, ImageParameters::pix_x, ImageParameters::pix_y, and storable_picture::poc.

Referenced by init_error_conceal().

void DeblockFrame ( ImageParameters *  img,
imgpel **  ,
imgpel ***   
)

Filter all macroblocks in order of increasing macroblock address.

Definition at line 90 of file loopFilter.c.

Referenced by code_a_plane(), and UpdateDecoders().

void decode_one_b8block ( ImageParameters *  image,
StorablePicture *  enc_pic,
Macroblock *  currMB,
int  decoder,
int  block8x8,
short  mv_mode,
int  pred_dir 
)

Decodes one 8x8 partition for error resilient RDO. Currently does not support: 1) B coded pictures 2) Chroma components 3) Potential error propagation due to intra prediction 4) Field coding.

Definition at line 239 of file errdo.c.

References add_residue(), macroblock::bipred_me, direct_ref_idx, storable_picture::motion, storable_picture::p_curr_img, storable_picture::p_dec_img, ImageParameters::pix_y, and pic_motion_params::ref_idx.

Referenced by RDCost_for_8x8blocks().

Here is the call graph for this function:

void decode_one_mb ( ImageParameters *  image,
StorablePicture *  enc_pic,
int  decoder,
Macroblock *  currMB 
)

Decodes one macroblock for error resilient RDO. Currently does not support: 1) B coded pictures 2) Chroma components 3) Potential error propagation due to intra prediction 4) Field coding.

Definition at line 109 of file errdo.c.

References add_residue(), Decoders::dec_mb_pred, get_predicted_mb(), ImageParameters::mb_size, macroblock::mb_type, storable_picture::p_curr_img, storable_picture::p_dec_img, ImageParameters::pix_x, ImageParameters::pix_y, and ImageParameters::type.

Referenced by RDCost_for_macroblocks().

Here is the call graph for this function:

void errdo_get_best_block ( ImageParameters *  image,
imgpel ***  dec_img,
imgpel ***  mbY,
int  j0,
int  block_size 
)

Restores the pel values from the current best mode.

Definition at line 593 of file errdo.c.

References InputParameters::NoOfDecoders, ImageParameters::pix_x, and ImageParameters::pix_y.

Referenced by set_stored_macroblock_parameters(), SetCoeffAndReconstruction8x8(), and submacroblock_mode_decision().

void errdo_store_best_block ( imgpel ***  mbY,
imgpel ***  dec_img,
int  block_i,
int  block_j,
int  img_i,
int  img_j,
int  block_size 
)

Stores the pel values for the current best mode.

Definition at line 572 of file errdo.c.

References InputParameters::NoOfDecoders.

Referenced by store_macroblock_parameters(), and submacroblock_mode_decision().

void free_errdo_mem ( void   ) 

free memory of error resilient RDO.

Definition at line 71 of file errdo.c.

References Decoders::dec_mb_pred, Decoders::dec_mb_pred_best8x8, Decoders::dec_mbY_best, Decoders::dec_mbY_best8x8, free_mem3Dint(), free_mem3Dpel(), free_mem4Dpel(), and Decoders::res_img.

Referenced by free_global_buffers().

Here is the call graph for this function:

static void get_predicted_concealment_mb ( StorablePicture *  enc_pic,
ImageParameters *  image,
int  decoder,
Macroblock *  currMB 
) [static]

Finds predicted macroblock values for error concealment.

Requires enc_pic->motion.mv and enc_pic->motion.ref_idx to be correct for current picture.

Definition at line 359 of file errdo.c.

References macroblock::b8mode, macroblock::b8pdir, macroblock::mb_type, storable_picture::motion, pic_motion_params::ref_idx, and ImageParameters::type.

static void get_predicted_mb ( StorablePicture *  enc_pic,
ImageParameters *  image,
int  decoder,
Macroblock *  currMB 
) [static]

Finds predicted macroblock values and copies them to img->mb_pred[0][][].

Definition at line 148 of file errdo.c.

References macroblock::b8mode, macroblock::b8pdir, macroblock::bipred_me, macroblock::mb_type, storable_picture::motion, pic_motion_params::ref_idx, and ImageParameters::type.

Referenced by decode_one_mb().

void init_error_conceal ( int  concealment_type  ) 

Initialize error concealment function (Currently only copy concealment is implemented. Can extend to other concealment types when available.).

Definition at line 345 of file errdo.c.

References copy_conceal_picture().

Referenced by init_encoder().

Here is the call graph for this function:

void UpdateDecoders ( InputParameters *  params,
ImageParameters *  image,
StorablePicture *  enc_pic 
)

Performs the simulation of the packet losses, calls the error concealment funcs and deblocks the error concealed pictures.

Definition at line 325 of file errdo.c.

References Build_Status_Map(), DeblockFrame(), storable_picture::mb_error_map, InputParameters::NoOfDecoders, and storable_picture::p_dec_img.

Referenced by encode_one_frame().

Here is the call graph for this function:


Documentation generated with DoxyGen