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.

49 lines
1.7KB

  1. /*
  2. * Copyright (c) Alexandra Hajkova
  3. *
  4. * This file is part of Libav.
  5. *
  6. * Libav is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * Libav is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with Libav; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. static void FUNC(ff_hevc_idct_4x4, BIT_DEPTH)(int16_t *coeffs, int col_limit)
  21. {
  22. const int shift = 7;
  23. const int shift2 = 20 - BIT_DEPTH;
  24. vec_s16 src_01, src_23;
  25. vec_s32 res[4];
  26. vec_s16 res_packed[2];
  27. src_01 = vec_ld(0, coeffs);
  28. src_23 = vec_ld(16, coeffs);
  29. transform4x4(src_01, src_23, res, shift, coeffs);
  30. src_01 = vec_packs(res[0], res[1]);
  31. src_23 = vec_packs(res[2], res[3]);
  32. scale(res, res_packed, shift);
  33. // transpose
  34. src_01 = vec_perm(res_packed[0], res_packed[1], mask[0]);
  35. src_23 = vec_perm(res_packed[0], res_packed[1], mask[1]);
  36. transform4x4(src_01, src_23, res, shift2, coeffs);
  37. scale(res, res_packed, shift2);
  38. // transpose
  39. src_01 = vec_perm(res_packed[0], res_packed[1], mask[0]);
  40. src_23 = vec_perm(res_packed[0], res_packed[1], mask[1]);
  41. vec_st(src_01, 0, coeffs);
  42. vec_st(src_23, 16, coeffs);
  43. }