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.

112 lines
5.2KB

  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[4][4])(int16_t *dst, ptrdiff_t dststride, uint8_t *src,
  50. ptrdiff_t srcstride, int width, int height,
  51. int16_t *mcbuffer);
  52. void (*put_hevc_epel[2][2])(int16_t *dst, ptrdiff_t dststride, uint8_t *src,
  53. ptrdiff_t srcstride, int width, int height,
  54. int mx, int my, int16_t *mcbuffer);
  55. void (*put_unweighted_pred)(uint8_t *dst, ptrdiff_t dststride, int16_t *src,
  56. ptrdiff_t srcstride, int width, int height);
  57. void (*put_weighted_pred_avg)(uint8_t *dst, ptrdiff_t dststride,
  58. int16_t *src1, int16_t *src2,
  59. ptrdiff_t srcstride, int width, int height);
  60. void (*weighted_pred)(uint8_t denom, int16_t wlxFlag, int16_t olxFlag,
  61. uint8_t *dst, ptrdiff_t dststride, int16_t *src,
  62. ptrdiff_t srcstride, int width, int height);
  63. void (*weighted_pred_avg)(uint8_t denom, int16_t wl0Flag, int16_t wl1Flag,
  64. int16_t ol0Flag, int16_t ol1Flag, uint8_t *dst,
  65. ptrdiff_t dststride, int16_t *src1, int16_t *src2,
  66. ptrdiff_t srcstride, int width, int height);
  67. void (*hevc_h_loop_filter_luma)(uint8_t *pix, ptrdiff_t stride,
  68. int beta, int *tc,
  69. uint8_t *no_p, uint8_t *no_q);
  70. void (*hevc_v_loop_filter_luma)(uint8_t *pix, ptrdiff_t stride,
  71. int beta, int *tc,
  72. uint8_t *no_p, uint8_t *no_q);
  73. void (*hevc_h_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride,
  74. int *tc, uint8_t *no_p, uint8_t *no_q);
  75. void (*hevc_v_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride,
  76. int *tc, uint8_t *no_p, uint8_t *no_q);
  77. void (*hevc_h_loop_filter_luma_c)(uint8_t *pix, ptrdiff_t stride,
  78. int beta, int *tc,
  79. uint8_t *no_p, uint8_t *no_q);
  80. void (*hevc_v_loop_filter_luma_c)(uint8_t *pix, ptrdiff_t stride,
  81. int beta, int *tc,
  82. uint8_t *no_p, uint8_t *no_q);
  83. void (*hevc_h_loop_filter_chroma_c)(uint8_t *pix, ptrdiff_t stride,
  84. int *tc, uint8_t *no_p,
  85. uint8_t *no_q);
  86. void (*hevc_v_loop_filter_chroma_c)(uint8_t *pix, ptrdiff_t stride,
  87. int *tc, uint8_t *no_p,
  88. uint8_t *no_q);
  89. } HEVCDSPContext;
  90. void ff_hevc_dsp_init(HEVCDSPContext *hpc, int bit_depth);
  91. void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth);
  92. extern const int8_t ff_hevc_epel_filters[7][16];
  93. #endif /* AVCODEC_HEVCDSP_H */