You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.3KB

  1. /*
  2. *
  3. * This file is part of Libav.
  4. *
  5. * Libav 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.
  9. *
  10. * Libav 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.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with Libav; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  18. */
  19. #ifndef AVCODEC_ERROR_RESILIENCE_H
  20. #define AVCODEC_ERROR_RESILIENCE_H
  21. #include <stdint.h>
  22. #include "avcodec.h"
  23. #include "dsputil.h"
  24. ///< current MB is the first after a resync marker
  25. #define VP_START 1
  26. #define ER_AC_ERROR 2
  27. #define ER_DC_ERROR 4
  28. #define ER_MV_ERROR 8
  29. #define ER_AC_END 16
  30. #define ER_DC_END 32
  31. #define ER_MV_END 64
  32. #define ER_MB_ERROR (ER_AC_ERROR|ER_DC_ERROR|ER_MV_ERROR)
  33. #define ER_MB_END (ER_AC_END|ER_DC_END|ER_MV_END)
  34. typedef struct ERContext {
  35. AVCodecContext *avctx;
  36. DSPContext *dsp;
  37. int *mb_index2xy;
  38. int mb_num;
  39. int mb_width, mb_height;
  40. int mb_stride;
  41. int b8_stride;
  42. int error_count, error_occurred;
  43. uint8_t *error_status_table;
  44. uint8_t *er_temp_buffer;
  45. int16_t *dc_val[3];
  46. uint8_t *mbskip_table;
  47. uint8_t *mbintra_table;
  48. int mv[2][4][2];
  49. struct Picture *cur_pic;
  50. struct Picture *last_pic;
  51. struct Picture *next_pic;
  52. uint16_t pp_time;
  53. uint16_t pb_time;
  54. int quarter_sample;
  55. int partitioned_frame;
  56. int ref_count;
  57. void (*decode_mb)(void *opaque, int ref, int mv_dir, int mv_type,
  58. int (*mv)[2][4][2],
  59. int mb_x, int mb_y, int mb_intra, int mb_skipped);
  60. void *opaque;
  61. } ERContext;
  62. void ff_er_frame_start(ERContext *s);
  63. void ff_er_frame_end(ERContext *s);
  64. void ff_er_add_slice(ERContext *s, int startx, int starty, int endx, int endy,
  65. int status);
  66. #endif /* AVCODEC_ERROR_RESILIENCE_H */