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.

95 lines
2.3KB

  1. /*
  2. * This file is part of FFmpeg.
  3. *
  4. * FFmpeg is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * FFmpeg is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with FFmpeg; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef AVCODEC_COPY_BLOCK_H
  19. #define AVCODEC_COPY_BLOCK_H
  20. #include <stdint.h>
  21. #include "libavutil/intreadwrite.h"
  22. static inline void copy_block2(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
  23. {
  24. int i;
  25. for(i=0; i<h; i++)
  26. {
  27. AV_COPY16U(dst, src);
  28. dst+=dstStride;
  29. src+=srcStride;
  30. }
  31. }
  32. static inline void copy_block4(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
  33. {
  34. int i;
  35. for(i=0; i<h; i++)
  36. {
  37. AV_COPY32U(dst, src);
  38. dst+=dstStride;
  39. src+=srcStride;
  40. }
  41. }
  42. static inline void copy_block8(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
  43. {
  44. int i;
  45. for(i=0; i<h; i++)
  46. {
  47. AV_COPY64U(dst, src);
  48. dst+=dstStride;
  49. src+=srcStride;
  50. }
  51. }
  52. static inline void copy_block16(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
  53. {
  54. int i;
  55. for(i=0; i<h; i++)
  56. {
  57. AV_COPY128U(dst, src);
  58. dst+=dstStride;
  59. src+=srcStride;
  60. }
  61. }
  62. static inline void copy_block9(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
  63. {
  64. int i;
  65. for(i=0; i<h; i++)
  66. {
  67. AV_COPY64U(dst, src);
  68. dst[8]= src[8];
  69. dst+=dstStride;
  70. src+=srcStride;
  71. }
  72. }
  73. static inline void copy_block17(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
  74. {
  75. int i;
  76. for(i=0; i<h; i++)
  77. {
  78. AV_COPY128U(dst, src);
  79. dst[16]= src[16];
  80. dst+=dstStride;
  81. src+=srcStride;
  82. }
  83. }
  84. #endif /* AVCODEC_COPY_BLOCK_H */