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.

127 lines
6.3KB

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