summaryrefslogtreecommitdiff
path: root/libavcodec/error_resilience.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-16 18:46:28 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-16 18:54:56 +0100
commit1fad547cefb4d2f3ed3d764b547ee16cf399e477 (patch)
treee0c261a8eb1823e1ab9235d1ff7c66a8058a247c /libavcodec/error_resilience.h
parent2bac1535db970e981e90306d64f2252be4c9fd63 (diff)
parent54974c62982ae827becdbdb9b620b7ba75d079a0 (diff)
Merge commit '54974c62982ae827becdbdb9b620b7ba75d079a0'
* commit '54974c62982ae827becdbdb9b620b7ba75d079a0': error_resilience: decouple ER from MpegEncContext Conflicts: libavcodec/error_resilience.c libavcodec/h263dec.c libavcodec/h264.c libavcodec/mpegvideo.c libavcodec/vc1dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/error_resilience.h')
-rw-r--r--libavcodec/error_resilience.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/libavcodec/error_resilience.h b/libavcodec/error_resilience.h
new file mode 100644
index 0000000000..b2318b79d2
--- /dev/null
+++ b/libavcodec/error_resilience.h
@@ -0,0 +1,74 @@
+/*
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_ERROR_RESILIENCE_H
+#define AVCODEC_ERROR_RESILIENCE_H
+
+///< current MB is the first after a resync marker
+#define VP_START 1
+#define ER_AC_ERROR 2
+#define ER_DC_ERROR 4
+#define ER_MV_ERROR 8
+#define ER_AC_END 16
+#define ER_DC_END 32
+#define ER_MV_END 64
+
+#define ER_MB_ERROR (ER_AC_ERROR|ER_DC_ERROR|ER_MV_ERROR)
+#define ER_MB_END (ER_AC_END|ER_DC_END|ER_MV_END)
+
+typedef struct ERContext {
+ AVCodecContext *avctx;
+ DSPContext *dsp;
+
+ int *mb_index2xy;
+ int mb_num;
+ int mb_width, mb_height;
+ int mb_stride;
+ int b8_stride;
+
+ int error_count, error_occurred;
+ uint8_t *error_status_table;
+ uint8_t *er_temp_buffer;
+ int16_t *dc_val[3];
+ uint8_t *mbskip_table;
+ uint8_t *mbintra_table;
+ int mv[2][4][2];
+
+ struct Picture *cur_pic;
+ struct Picture *last_pic;
+ struct Picture *next_pic;
+
+ uint16_t pp_time;
+ uint16_t pb_time;
+ int quarter_sample;
+ int partitioned_frame;
+ int ref_count;
+
+ void (*decode_mb)(void *opaque, int ref, int mv_dir, int mv_type,
+ int (*mv)[2][4][2],
+ int mb_x, int mb_y, int mb_intra, int mb_skipped);
+ void *opaque;
+} ERContext;
+
+void ff_er_frame_start(ERContext *s);
+void ff_er_frame_end(ERContext *s);
+void ff_er_add_slice(ERContext *s, int startx, int starty, int endx, int endy,
+ int status);
+
+#endif /* AVCODEC_ERROR_RESILIENCE_H */