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.

89 lines
2.1KB

  1. /*
  2. * AV1 video decoder
  3. * *
  4. * This file is part of FFmpeg.
  5. *
  6. * FFmpeg is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * FFmpeg is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with FFmpeg; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #ifndef AVCODEC_AV1DEC_H
  21. #define AVCODEC_AV1DEC_H
  22. #include <stdint.h>
  23. #include "libavutil/buffer.h"
  24. #include "libavutil/pixfmt.h"
  25. #include "avcodec.h"
  26. #include "cbs.h"
  27. #include "cbs_av1.h"
  28. #include "thread.h"
  29. typedef struct AV1Frame {
  30. ThreadFrame tf;
  31. AVBufferRef *hwaccel_priv_buf;
  32. void *hwaccel_picture_private;
  33. AVBufferRef *header_ref;
  34. AV1RawFrameHeader *raw_frame_header;
  35. int temporal_id;
  36. int spatial_id;
  37. uint8_t gm_type[AV1_NUM_REF_FRAMES];
  38. int32_t gm_params[AV1_NUM_REF_FRAMES][6];
  39. uint8_t skip_mode_frame_idx[2];
  40. AV1RawFilmGrainParams film_grain;
  41. uint8_t coded_lossless;
  42. } AV1Frame;
  43. typedef struct TileGroupInfo {
  44. uint32_t tile_offset;
  45. uint32_t tile_size;
  46. uint16_t tile_row;
  47. uint16_t tile_column;
  48. } TileGroupInfo;
  49. typedef struct AV1DecContext {
  50. const AVClass *class;
  51. AVCodecContext *avctx;
  52. enum AVPixelFormat pix_fmt;
  53. CodedBitstreamContext *cbc;
  54. CodedBitstreamFragment current_obu;
  55. AVBufferRef *seq_ref;
  56. AV1RawSequenceHeader *raw_seq;
  57. AVBufferRef *header_ref;
  58. AV1RawFrameHeader *raw_frame_header;
  59. TileGroupInfo *tile_group_info;
  60. uint16_t tile_num;
  61. uint16_t tg_start;
  62. uint16_t tg_end;
  63. int operating_point_idc;
  64. AV1Frame ref[AV1_NUM_REF_FRAMES];
  65. AV1Frame cur_frame;
  66. // AVOptions
  67. int operating_point;
  68. } AV1DecContext;
  69. #endif /* AVCODEC_AV1DEC_H */