FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
error_resilience.c File Reference

Error resilience / concealment. More...

#include <limits.h>
#include "libavutil/atomic.h"
#include "libavutil/internal.h"
#include "avcodec.h"
#include "error_resilience.h"
#include "me_cmp.h"
#include "mpegutils.h"
#include "mpegvideo.h"
#include "rectangle.h"
#include "thread.h"
#include "version.h"

Go to the source code of this file.

Macros

#define MV_FROZEN   3
 
#define MV_CHANGED   2
 
#define MV_UNCHANGED   1
 

Functions

static void set_mv_strides (ERContext *s, int *mv_step, int *stride)
 
static void put_dc (ERContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int mb_x, int mb_y)
 Replace the current MB with a flat dc-only version. More...
 
static void filter181 (int16_t *data, int width, int height, int stride)
 
static void guess_dc (ERContext *s, int16_t *dc, int w, int h, int stride, int is_luma)
 guess the dc of blocks which do not have an undamaged dc More...
 
static void h_block_filter (ERContext *s, uint8_t *dst, int w, int h, int stride, int is_luma)
 simple horizontal deblocking filter used for error resilience More...
 
static void v_block_filter (ERContext *s, uint8_t *dst, int w, int h, int stride, int is_luma)
 simple vertical deblocking filter used for error resilience More...
 
static void guess_mv (ERContext *s)
 
static int is_intra_more_likely (ERContext *s)
 
void ff_er_frame_start (ERContext *s)
 
static int er_supported (ERContext *s)
 
void ff_er_add_slice (ERContext *s, int startx, int starty, int endx, int endy, int status)
 Add a slice. More...
 
void ff_er_frame_end (ERContext *s)
 

Detailed Description

Error resilience / concealment.

Definition in file error_resilience.c.

Macro Definition Documentation

#define MV_FROZEN   3

Referenced by guess_mv().

#define MV_CHANGED   2

Referenced by guess_mv().

#define MV_UNCHANGED   1

Referenced by guess_mv().

Function Documentation

static void set_mv_strides ( ERContext s,
int *  mv_step,
int *  stride 
)
static
Parameters
stridethe number of MVs to get to the next row
mv_stepthe number of MVs per row or column in a macroblock

Definition at line 45 of file error_resilience.c.

Referenced by guess_mv(), h_block_filter(), and v_block_filter().

static void put_dc ( ERContext s,
uint8_t dest_y,
uint8_t dest_cb,
uint8_t dest_cr,
int  mb_x,
int  mb_y 
)
static

Replace the current MB with a flat dc-only version.

Definition at line 60 of file error_resilience.c.

Referenced by ff_er_frame_end().

static void filter181 ( int16_t *  data,
int  width,
int  height,
int  stride 
)
static

Definition at line 98 of file error_resilience.c.

Referenced by ff_er_frame_end().

static void guess_dc ( ERContext s,
int16_t *  dc,
int  w,
int  h,
int  stride,
int  is_luma 
)
static

guess the dc of blocks which do not have an undamaged dc

Parameters
wwidth in 8 pixel blocks
hheight in 8 pixel blocks

Definition at line 139 of file error_resilience.c.

Referenced by ff_er_frame_end().

static void h_block_filter ( ERContext s,
uint8_t dst,
int  w,
int  h,
int  stride,
int  is_luma 
)
static

simple horizontal deblocking filter used for error resilience

Parameters
wwidth in 8 pixel blocks
hheight in 8 pixel blocks

Definition at line 242 of file error_resilience.c.

Referenced by ff_er_frame_end().

static void v_block_filter ( ERContext s,
uint8_t dst,
int  w,
int  h,
int  stride,
int  is_luma 
)
static

simple vertical deblocking filter used for error resilience

Parameters
wwidth in 8 pixel blocks
hheight in 8 pixel blocks

Definition at line 310 of file error_resilience.c.

Referenced by ff_er_frame_end().

static void guess_mv ( ERContext s)
static

Definition at line 376 of file error_resilience.c.

Referenced by ff_er_frame_end().

static int is_intra_more_likely ( ERContext s)
static

Definition at line 691 of file error_resilience.c.

Referenced by ff_er_frame_end().

void ff_er_frame_start ( ERContext s)

Definition at line 766 of file error_resilience.c.

Referenced by ff_mpeg_er_frame_start(), and h264_frame_start().

static int er_supported ( ERContext s)
static

Definition at line 782 of file error_resilience.c.

Referenced by ff_er_add_slice(), and ff_er_frame_end().

void ff_er_add_slice ( ERContext s,
int  startx,
int  starty,
int  endx,
int  endy,
int  status 
)

Add a slice.

Parameters
endxx component of the last macroblock, can be -1 for the last of the previous line
statusthe status at the end (ER_MV_END, ER_AC_ERROR, ...), it is assumed that no earlier end or error of the same type occurred

Definition at line 802 of file error_resilience.c.

Referenced by decode_chunks(), decode_slice(), er_add_slice(), ff_intrax8_decode_picture(), ff_mpeg4_decode_partitions(), rv10_decode_packet(), rv34_decode_slice(), slice_decode_thread(), vc1_decode_b_blocks(), vc1_decode_i_blocks(), vc1_decode_i_blocks_adv(), vc1_decode_p_blocks(), and vc1_decode_skip_blocks().

void ff_er_frame_end ( ERContext s)