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.

73 lines
1.9KB

  1. /*
  2. * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
  3. * Copyright (c) 2003-2011 Michael Niedermayer <michaelni@gmx.at>
  4. *
  5. * This file is part of Libav.
  6. *
  7. * Libav is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * Libav is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with Libav; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. /**
  22. * @file
  23. * H.264 / AVC / MPEG-4 part10 DSP functions.
  24. * @author Michael Niedermayer <michaelni@gmx.at>
  25. */
  26. #include "bit_depth_template.c"
  27. static void FUNCC(ff_h264_add_pixels4)(uint8_t *_dst, int16_t *_src, int stride)
  28. {
  29. int i;
  30. pixel *dst = (pixel *) _dst;
  31. dctcoef *src = (dctcoef *) _src;
  32. stride /= sizeof(pixel);
  33. for (i = 0; i < 4; i++) {
  34. dst[0] += src[0];
  35. dst[1] += src[1];
  36. dst[2] += src[2];
  37. dst[3] += src[3];
  38. dst += stride;
  39. src += 4;
  40. }
  41. memset(_src, 0, sizeof(dctcoef) * 16);
  42. }
  43. static void FUNCC(ff_h264_add_pixels8)(uint8_t *_dst, int16_t *_src, int stride)
  44. {
  45. int i;
  46. pixel *dst = (pixel *) _dst;
  47. dctcoef *src = (dctcoef *) _src;
  48. stride /= sizeof(pixel);
  49. for (i = 0; i < 8; i++) {
  50. dst[0] += src[0];
  51. dst[1] += src[1];
  52. dst[2] += src[2];
  53. dst[3] += src[3];
  54. dst[4] += src[4];
  55. dst[5] += src[5];
  56. dst[6] += src[6];
  57. dst[7] += src[7];
  58. dst += stride;
  59. src += 8;
  60. }
  61. memset(_src, 0, sizeof(dctcoef) * 64);
  62. }