yading@10: /* yading@10: * yading@10: * This file is part of FFmpeg. yading@10: * yading@10: * FFmpeg is free software; you can redistribute it and/or yading@10: * modify it under the terms of the GNU Lesser General Public yading@10: * License as published by the Free Software Foundation; either yading@10: * version 2.1 of the License, or (at your option) any later version. yading@10: * yading@10: * FFmpeg is distributed in the hope that it will be useful, yading@10: * but WITHOUT ANY WARRANTY; without even the implied warranty of yading@10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU yading@10: * Lesser General Public License for more details. yading@10: * yading@10: * You should have received a copy of the GNU Lesser General Public yading@10: * License along with FFmpeg; if not, write to the Free Software yading@10: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA yading@10: */ yading@10: yading@10: #ifndef AVCODEC_ERROR_RESILIENCE_H yading@10: #define AVCODEC_ERROR_RESILIENCE_H yading@10: yading@10: #include yading@10: yading@10: #include "avcodec.h" yading@10: #include "dsputil.h" yading@10: yading@10: ///< current MB is the first after a resync marker yading@10: #define VP_START 1 yading@10: #define ER_AC_ERROR 2 yading@10: #define ER_DC_ERROR 4 yading@10: #define ER_MV_ERROR 8 yading@10: #define ER_AC_END 16 yading@10: #define ER_DC_END 32 yading@10: #define ER_MV_END 64 yading@10: yading@10: #define ER_MB_ERROR (ER_AC_ERROR|ER_DC_ERROR|ER_MV_ERROR) yading@10: #define ER_MB_END (ER_AC_END|ER_DC_END|ER_MV_END) yading@10: yading@10: typedef struct ERContext { yading@10: AVCodecContext *avctx; yading@10: DSPContext *dsp; yading@10: yading@10: int *mb_index2xy; yading@10: int mb_num; yading@10: int mb_width, mb_height; yading@10: int mb_stride; yading@10: int b8_stride; yading@10: yading@10: int error_count, error_occurred; yading@10: uint8_t *error_status_table; yading@10: uint8_t *er_temp_buffer; yading@10: int16_t *dc_val[3]; yading@10: uint8_t *mbskip_table; yading@10: uint8_t *mbintra_table; yading@10: int mv[2][4][2]; yading@10: yading@10: struct Picture *cur_pic; yading@10: struct Picture *last_pic; yading@10: struct Picture *next_pic; yading@10: yading@10: uint16_t pp_time; yading@10: uint16_t pb_time; yading@10: int quarter_sample; yading@10: int partitioned_frame; yading@10: int ref_count; yading@10: yading@10: void (*decode_mb)(void *opaque, int ref, int mv_dir, int mv_type, yading@10: int (*mv)[2][4][2], yading@10: int mb_x, int mb_y, int mb_intra, int mb_skipped); yading@10: void *opaque; yading@10: } ERContext; yading@10: yading@10: void ff_er_frame_start(ERContext *s); yading@10: void ff_er_frame_end(ERContext *s); yading@10: void ff_er_add_slice(ERContext *s, int startx, int starty, int endx, int endy, yading@10: int status); yading@10: yading@10: #endif /* AVCODEC_ERROR_RESILIENCE_H */