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.

130 lines
6.4KB

  1. /*
  2. * HEVC video decoder
  3. *
  4. * Copyright (C) 2012 - 2013 Guillaume Martres
  5. * Copyright (C) 2013 - 2014 Pierre-Edouard Lepere
  6. *
  7. *
  8. * This file is part of FFmpeg.
  9. *
  10. * FFmpeg is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation; either
  13. * version 2.1 of the License, or (at your option) any later version.
  14. *
  15. * FFmpeg is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with FFmpeg; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. */
  24. #ifndef AVCODEC_HEVCDSP_H
  25. #define AVCODEC_HEVCDSP_H
  26. #include "get_bits.h"
  27. #define MAX_PB_SIZE 64
  28. typedef struct SAOParams {
  29. int offset_abs[3][4]; ///< sao_offset_abs
  30. int offset_sign[3][4]; ///< sao_offset_sign
  31. uint8_t band_position[3]; ///< sao_band_position
  32. int eo_class[3]; ///< sao_eo_class
  33. int16_t offset_val[3][5]; ///<SaoOffsetVal
  34. uint8_t type_idx[3]; ///< sao_type_idx
  35. } SAOParams;
  36. typedef struct HEVCDSPContext {
  37. void (*put_pcm)(uint8_t *_dst, ptrdiff_t _stride, int width, int height,
  38. struct GetBitContext *gb, int pcm_bit_depth);
  39. void (*transform_add[4])(uint8_t *_dst, int16_t *coeffs, ptrdiff_t _stride);
  40. void (*transform_skip)(int16_t *coeffs, int16_t log2_size);
  41. void (*transform_rdpcm)(int16_t *coeffs, int16_t log2_size, int mode);
  42. void (*idct_4x4_luma)(int16_t *coeffs);
  43. void (*idct[4])(int16_t *coeffs, int col_limit);
  44. void (*idct_dc[4])(int16_t *coeffs);
  45. void (*sao_band_filter[5])(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src,
  46. int16_t *sao_offset_val, int sao_left_class, int width, int height);
  47. void (*sao_edge_filter[2])(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src,
  48. struct SAOParams *sao, int *borders, int _width,
  49. int _height, int c_idx, uint8_t *vert_edge,
  50. uint8_t *horiz_edge, uint8_t *diag_edge);
  51. void (*put_hevc_qpel[10][2][2])(int16_t *dst, uint8_t *src, ptrdiff_t srcstride,
  52. int height, intptr_t mx, intptr_t my, int width);
  53. void (*put_hevc_qpel_uni[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
  54. int height, intptr_t mx, intptr_t my, int width);
  55. void (*put_hevc_qpel_uni_w[10][2][2])(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
  56. int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
  57. void (*put_hevc_qpel_bi[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride,
  58. int16_t *src2,
  59. int height, intptr_t mx, intptr_t my, int width);
  60. void (*put_hevc_qpel_bi_w[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride,
  61. int16_t *src2,
  62. int height, int denom, int wx0, int wx1,
  63. int ox0, int ox1, intptr_t mx, intptr_t my, int width);
  64. void (*put_hevc_epel[10][2][2])(int16_t *dst, uint8_t *src, ptrdiff_t srcstride,
  65. int height, intptr_t mx, intptr_t my, int width);
  66. void (*put_hevc_epel_uni[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride,
  67. int height, intptr_t mx, intptr_t my, int width);
  68. void (*put_hevc_epel_uni_w[10][2][2])(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
  69. int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
  70. void (*put_hevc_epel_bi[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride,
  71. int16_t *src2,
  72. int height, intptr_t mx, intptr_t my, int width);
  73. void (*put_hevc_epel_bi_w[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride,
  74. int16_t *src2,
  75. int height, int denom, int wx0, int ox0, int wx1,
  76. int ox1, intptr_t mx, intptr_t my, int width);
  77. void (*hevc_h_loop_filter_luma)(uint8_t *pix, ptrdiff_t stride,
  78. int beta, int32_t *tc,
  79. uint8_t *no_p, uint8_t *no_q);
  80. void (*hevc_v_loop_filter_luma)(uint8_t *pix, ptrdiff_t stride,
  81. int beta, int32_t *tc,
  82. uint8_t *no_p, uint8_t *no_q);
  83. void (*hevc_h_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride,
  84. int32_t *tc, uint8_t *no_p, uint8_t *no_q);
  85. void (*hevc_v_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride,
  86. int32_t *tc, uint8_t *no_p, uint8_t *no_q);
  87. void (*hevc_h_loop_filter_luma_c)(uint8_t *pix, ptrdiff_t stride,
  88. int beta, int32_t *tc,
  89. uint8_t *no_p, uint8_t *no_q);
  90. void (*hevc_v_loop_filter_luma_c)(uint8_t *pix, ptrdiff_t stride,
  91. int beta, int32_t *tc,
  92. uint8_t *no_p, uint8_t *no_q);
  93. void (*hevc_h_loop_filter_chroma_c)(uint8_t *pix, ptrdiff_t stride,
  94. int32_t *tc, uint8_t *no_p,
  95. uint8_t *no_q);
  96. void (*hevc_v_loop_filter_chroma_c)(uint8_t *pix, ptrdiff_t stride,
  97. int32_t *tc, uint8_t *no_p,
  98. uint8_t *no_q);
  99. } HEVCDSPContext;
  100. void ff_hevc_dsp_init(HEVCDSPContext *hpc, int bit_depth);
  101. extern const int8_t ff_hevc_epel_filters[7][4];
  102. extern const int8_t ff_hevc_qpel_filters[3][16];
  103. void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth);
  104. #endif /* AVCODEC_HEVCDSP_H */