3 * This file is part of FFmpeg.
5 * FFmpeg is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * FFmpeg is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with FFmpeg; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef AVCODEC_ERROR_RESILIENCE_H
21 #define AVCODEC_ERROR_RESILIENCE_H
29 ///< current MB is the first after a resync marker
38 #define ER_MB_ERROR (ER_AC_ERROR|ER_DC_ERROR|ER_MV_ERROR)
39 #define ER_MB_END (ER_AC_END|ER_DC_END|ER_MV_END)
41 typedef struct ERPicture
{
45 // it's the caller's responsibility to allocate these buffers
46 int16_t (*motion_val
[2])[2];
53 typedef struct ERContext
{
54 AVCodecContext
*avctx
;
59 int mb_width
, mb_height
;
63 int error_count
, error_occurred
;
64 uint8_t *error_status_table
;
65 uint8_t *er_temp_buffer
;
67 uint8_t *mbskip_table
;
68 uint8_t *mbintra_table
;
75 AVBufferRef
*ref_index_buf
[2];
76 AVBufferRef
*motion_val_buf
[2];
81 int partitioned_frame
;
84 void (*decode_mb
)(void *opaque
, int ref
, int mv_dir
, int mv_type
,
86 int mb_x
, int mb_y
, int mb_intra
, int mb_skipped
);
90 void ff_er_frame_start(ERContext
*s
);
91 void ff_er_frame_end(ERContext
*s
);
92 void ff_er_add_slice(ERContext
*s
, int startx
, int starty
, int endx
, int endy
,
95 #endif /* AVCODEC_ERROR_RESILIENCE_H */