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.

77 lines
2.8KB

  1. /*
  2. * Copyright (C) 2012 Ronald S. Bultje
  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. /**
  21. * @file
  22. * Core video DSP helper functions
  23. */
  24. #ifndef AVCODEC_VIDEODSP_H
  25. #define AVCODEC_VIDEODSP_H
  26. #include <stddef.h>
  27. #include <stdint.h>
  28. typedef struct VideoDSPContext {
  29. /**
  30. * Copy a rectangular area of samples to a temporary buffer and replicate
  31. * the border samples.
  32. *
  33. * @param buf destination buffer
  34. * @param src source buffer
  35. * @param buf_linesize number of bytes between 2 vertically adjacent
  36. * samples in the destination buffer
  37. * @param src_linesize number of bytes between 2 vertically adjacent
  38. * samples in both the source buffer
  39. * @param block_w width of block
  40. * @param block_h height of block
  41. * @param src_x x coordinate of the top left sample of the block in the
  42. * source buffer
  43. * @param src_y y coordinate of the top left sample of the block in the
  44. * source buffer
  45. * @param w width of the source buffer
  46. * @param h height of the source buffer
  47. */
  48. void (*emulated_edge_mc)(uint8_t *buf, const uint8_t *src,
  49. ptrdiff_t buf_linesize,
  50. ptrdiff_t src_linesize,
  51. int block_w, int block_h,
  52. int src_x, int src_y, int w, int h);
  53. /**
  54. * Prefetch memory into cache (if supported by hardware).
  55. *
  56. * @param buf pointer to buffer to prefetch memory from
  57. * @param stride distance between two lines of buf (in bytes)
  58. * @param h number of lines to prefetch
  59. */
  60. void (*prefetch)(uint8_t *buf, ptrdiff_t stride, int h);
  61. } VideoDSPContext;
  62. void ff_videodsp_init(VideoDSPContext *ctx, int bpc);
  63. /* for internal use only (i.e. called by ff_videodsp_init() */
  64. void ff_videodsp_init_aarch64(VideoDSPContext *ctx, int bpc);
  65. void ff_videodsp_init_arm(VideoDSPContext *ctx, int bpc);
  66. void ff_videodsp_init_ppc(VideoDSPContext *ctx, int bpc);
  67. void ff_videodsp_init_x86(VideoDSPContext *ctx, int bpc);
  68. #endif /* AVCODEC_VIDEODSP_H */