#include "global.h"
#include "memalloc.h"
#include "refbuf.h"
#include "image.h"
#include "errdo.h"
#include "errdo_mc_prediction.h"
#include "md_common.h"
Go to the source code of this file.
Functions | |
static StorablePicture * | find_nearest_ref_picture (DecodedPictureBuffer *p_Dpb, int poc) |
static void | copy_conceal_mb (Macroblock *currMB, StorablePicture *enc_pic, int decoder, int mb_error, StorablePicture *refPic) |
static void | get_predicted_mb (Macroblock *currMB, StorablePicture *enc_pic, int decoder) |
static void | add_residue (Macroblock *currMB, StorablePicture *enc_pic, int decoder, int pl, int block8x8, int x_size, int y_size) |
static void | Build_Status_Map (ImageParameters *p_Img, InputParameters *p_Inp, byte **s_map) |
void | DeblockFrame (ImageParameters *p_Img, imgpel **, imgpel ***) |
int | allocate_errdo_mem (ImageParameters *p_Img, InputParameters *p_Inp) |
void | free_errdo_mem (ImageParameters *p_Img) |
void | decode_one_mb (Macroblock *currMB, StorablePicture *enc_pic, int decoder) |
void | decode_one_b8block (Macroblock *currMB, StorablePicture *enc_pic, int decoder, int block8x8, short mv_mode, int pred_dir) |
void | UpdateDecoders (ImageParameters *p_Img, InputParameters *p_Inp, StorablePicture *enc_pic) |
void | init_error_conceal (ImageParameters *p_Img, int concealment_type) |
static void | get_predicted_concealment_mb (Macroblock *currMB, StorablePicture *enc_pic, int decoder) |
void | copy_conceal_picture (ImageParameters *p_Img, StorablePicture *enc_pic, int decoder) |
void | compute_residue_block (Macroblock *currMB, imgpel **imgY, int **res_img, imgpel **mb_pred, int b8block, int block_size) |
void | errdo_store_best_block (InputParameters *p_Inp, 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 (Macroblock *currMB, imgpel ***dec_img, imgpel ***mbY, int j0, int block_size) |
Definition in file errdo.c.
static void add_residue | ( | Macroblock * | currMB, | |
StorablePicture * | enc_pic, | |||
int | decoder, | |||
int | pl, | |||
int | block8x8, | |||
int | x_size, | |||
int | y_size | |||
) | [static] |
Add residual to motion predicted block.
Definition at line 299 of file errdo.c.
References decoders::dec_mb_pred, img_par::max_pel_value_comp, storable_picture::p_dec_img, macroblock::p_Img, macroblock::pix_x, macroblock::pix_y, and decoders::res_img.
Referenced by decode_one_b8block(), and decode_one_mb().
int allocate_errdo_mem | ( | ImageParameters * | p_Img, | |
InputParameters * | p_Inp | |||
) |
Allocate memory for error resilient RDO.
Definition at line 44 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(), and decoders::res_img.
Referenced by init_global_buffers().
static void Build_Status_Map | ( | ImageParameters * | p_Img, | |
InputParameters * | p_Inp, | |||
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.
p_Img | ImageParameters structure for encoding | |
p_Inp | InputParameters for configurations | |
s_map | The status map to be filled |
Packet OK
Definition at line 628 of file errdo.c.
References img_par::height, inp_par_enc::LossRateA, inp_par_enc::LossRateB, inp_par_enc::LossRateC, img_par::mb_data, inp_par_enc::partition_mode, inp_par_enc::slice_mode, macroblock::slice_nr, and img_par::width.
Referenced by UpdateDecoders().
void compute_residue_block | ( | Macroblock * | currMB, | |
imgpel ** | imgY, | |||
int ** | res_img, | |||
imgpel ** | mb_pred, | |||
int | b8block, | |||
int | block_size | |||
) |
Gives the prediction residue for a block.
Definition at line 558 of file errdo.c.
References macroblock::pix_x.
Referenced by RDCost_for_8x8blocks(), and RDCost_for_macroblocks().
void copy_conceal_picture | ( | ImageParameters * | p_Img, | |
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 452 of file errdo.c.
References macroblock::block_x, macroblock::block_y, img_par::mb_data, storable_picture::mb_error_map, macroblock::mb_x, macroblock::mb_y, macroblock::pix_x, and macroblock::pix_y.
Referenced by init_error_conceal().
void DeblockFrame | ( | ImageParameters * | p_Img, | |
imgpel ** | , | |||
imgpel *** | ||||
) |
Filter all macroblocks in order of increasing macroblock address.
Definition at line 81 of file loopFilter.c.
Referenced by code_a_plane(), and UpdateDecoders().
void decode_one_b8block | ( | Macroblock * | currMB, | |
StorablePicture * | enc_pic, | |||
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(), slice::direct_ref_idx, storable_picture::motion, storable_picture::p_curr_img, storable_picture::p_dec_img, macroblock::p_slice, perform_mc(), macroblock::pix_y, and pic_motion_params::ref_idx.
Referenced by RDCost_for_8x8blocks().
void decode_one_mb | ( | Macroblock * | currMB, | |
StorablePicture * | enc_pic, | |||
int | decoder | |||
) |
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 108 of file errdo.c.
References add_residue(), copy_image_data_16x16(), decoders::dec_mb_pred, get_predicted_mb(), macroblock::mb_type, storable_picture::p_curr_img, storable_picture::p_dec_img, macroblock::p_Img, macroblock::p_slice, macroblock::pix_x, macroblock::pix_y, and slice::slice_type.
Referenced by RDCost_for_macroblocks().
void errdo_get_best_block | ( | Macroblock * | currMB, | |
imgpel *** | dec_img, | |||
imgpel *** | mbY, | |||
int | j0, | |||
int | block_size | |||
) |
Restores the pel values from the current best mode.
Definition at line 600 of file errdo.c.
References macroblock::pix_x, and macroblock::pix_y.
Referenced by set_stored_macroblock_parameters(), set_stored_macroblock_parameters_mpass(), set_stored_macroblock_parameters_sp(), SetCoeffAndReconstruction8x8(), and submacroblock_mode_decision().
void errdo_store_best_block | ( | InputParameters * | p_Inp, | |
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 579 of file errdo.c.
Referenced by store_macroblock_parameters(), and submacroblock_mode_decision().
void free_errdo_mem | ( | ImageParameters * | p_Img | ) |
free memory of error resilient RDO.
Definition at line 70 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().
static void get_predicted_concealment_mb | ( | Macroblock * | currMB, | |
StorablePicture * | enc_pic, | |||
int | decoder | |||
) | [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 362 of file errdo.c.
References macroblock::mb_type, storable_picture::motion, macroblock::p_slice, perform_mc_concealment(), pic_motion_params::ref_idx, and slice::slice_type.
static void get_predicted_mb | ( | Macroblock * | currMB, | |
StorablePicture * | enc_pic, | |||
int | decoder | |||
) | [static] |
Finds predicted macroblock values and copies them to currSlice->mb_pred[0][][].
Definition at line 147 of file errdo.c.
References macroblock::mb_type, storable_picture::motion, macroblock::p_slice, perform_mc(), pic_motion_params::ref_idx, and slice::slice_type.
Referenced by decode_one_mb().
void init_error_conceal | ( | ImageParameters * | p_Img, | |
int | concealment_type | |||
) |
Initialize error concealment function (Currently only copy concealment is implemented. Can extend to other concealment types when available.).
Definition at line 348 of file errdo.c.
References copy_conceal_picture(), and img_par::error_conceal_picture.
Referenced by init_encoder().
void UpdateDecoders | ( | ImageParameters * | p_Img, | |
InputParameters * | p_Inp, | |||
StorablePicture * | enc_pic | |||
) |
Performs the simulation of the packet losses, calls the error concealment funcs and deblocks the error concealed pictures.
Definition at line 328 of file errdo.c.
References Build_Status_Map(), DeblockFrame(), img_par::error_conceal_picture, storable_picture::mb_error_map, and storable_picture::p_dec_img.
Referenced by encode_one_frame().