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.

69 lines
2.1KB

  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. #include "hevcdec.h"
  23. #define BIT_DEPTH 8
  24. #include "hevcpred_template.c"
  25. #undef BIT_DEPTH
  26. #define BIT_DEPTH 9
  27. #include "hevcpred_template.c"
  28. #undef BIT_DEPTH
  29. #define BIT_DEPTH 10
  30. #include "hevcpred_template.c"
  31. #undef BIT_DEPTH
  32. void ff_hevc_pred_init(HEVCPredContext *hpc, int bit_depth)
  33. {
  34. #undef FUNC
  35. #define FUNC(a, depth) a ## _ ## depth
  36. #define HEVC_PRED(depth) \
  37. hpc->intra_pred[0] = FUNC(intra_pred_2, depth); \
  38. hpc->intra_pred[1] = FUNC(intra_pred_3, depth); \
  39. hpc->intra_pred[2] = FUNC(intra_pred_4, depth); \
  40. hpc->intra_pred[3] = FUNC(intra_pred_5, depth); \
  41. hpc->pred_planar[0] = FUNC(pred_planar_0, depth); \
  42. hpc->pred_planar[1] = FUNC(pred_planar_1, depth); \
  43. hpc->pred_planar[2] = FUNC(pred_planar_2, depth); \
  44. hpc->pred_planar[3] = FUNC(pred_planar_3, depth); \
  45. hpc->pred_dc = FUNC(pred_dc, depth); \
  46. hpc->pred_angular[0] = FUNC(pred_angular_0, depth); \
  47. hpc->pred_angular[1] = FUNC(pred_angular_1, depth); \
  48. hpc->pred_angular[2] = FUNC(pred_angular_2, depth); \
  49. hpc->pred_angular[3] = FUNC(pred_angular_3, depth);
  50. switch (bit_depth) {
  51. case 9:
  52. HEVC_PRED(9);
  53. break;
  54. case 10:
  55. HEVC_PRED(10);
  56. break;
  57. default:
  58. HEVC_PRED(8);
  59. break;
  60. }
  61. }