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.

81 lines
2.3KB

  1. /*
  2. * HEVC video Decoder
  3. *
  4. * Copyright (C) 2012 - 2013 Guillaume Martres
  5. *
  6. * This file is part of FFmpeg.
  7. *
  8. * FFmpeg 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. * FFmpeg 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 FFmpeg; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. #include "hevc.h"
  23. #include "hevcpred.h"
  24. #define BIT_DEPTH 8
  25. #include "hevcpred_template.c"
  26. #undef BIT_DEPTH
  27. #define BIT_DEPTH 9
  28. #include "hevcpred_template.c"
  29. #undef BIT_DEPTH
  30. #define BIT_DEPTH 10
  31. #include "hevcpred_template.c"
  32. #undef BIT_DEPTH
  33. #define BIT_DEPTH 12
  34. #include "hevcpred_template.c"
  35. #undef BIT_DEPTH
  36. void ff_hevc_pred_init(HEVCPredContext *hpc, int bit_depth)
  37. {
  38. #undef FUNC
  39. #define FUNC(a, depth) a ## _ ## depth
  40. #define HEVC_PRED(depth) \
  41. hpc->intra_pred[0] = FUNC(intra_pred_2, depth); \
  42. hpc->intra_pred[1] = FUNC(intra_pred_3, depth); \
  43. hpc->intra_pred[2] = FUNC(intra_pred_4, depth); \
  44. hpc->intra_pred[3] = FUNC(intra_pred_5, depth); \
  45. hpc->pred_planar[0] = FUNC(pred_planar_0, depth); \
  46. hpc->pred_planar[1] = FUNC(pred_planar_1, depth); \
  47. hpc->pred_planar[2] = FUNC(pred_planar_2, depth); \
  48. hpc->pred_planar[3] = FUNC(pred_planar_3, depth); \
  49. hpc->pred_dc = FUNC(pred_dc, depth); \
  50. hpc->pred_angular[0] = FUNC(pred_angular_0, depth); \
  51. hpc->pred_angular[1] = FUNC(pred_angular_1, depth); \
  52. hpc->pred_angular[2] = FUNC(pred_angular_2, depth); \
  53. hpc->pred_angular[3] = FUNC(pred_angular_3, depth);
  54. switch (bit_depth) {
  55. case 9:
  56. HEVC_PRED(9);
  57. break;
  58. case 10:
  59. HEVC_PRED(10);
  60. break;
  61. case 12:
  62. HEVC_PRED(12);
  63. break;
  64. default:
  65. HEVC_PRED(8);
  66. break;
  67. }
  68. if (ARCH_MIPS)
  69. ff_hevc_pred_init_mips(hpc, bit_depth);
  70. }