tpeldsp.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * thirdpel DSP functions
  3. *
  4. * This file is part of FFmpeg.
  5. *
  6. * FFmpeg 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. * FFmpeg 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 FFmpeg; 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. * thirdpel DSP functions
  23. */
  24. #ifndef AVCODEC_TPELDSP_H
  25. #define AVCODEC_TPELDSP_H
  26. #include <stdint.h>
  27. /* add and put pixel (decoding) */
  28. // blocksizes for hpel_pixels_func are 8x4,8x8 16x8 16x16
  29. // h for hpel_pixels_func is limited to {width/2, width} but never larger
  30. // than 16 and never smaller than 4
  31. typedef void (*tpel_mc_func)(uint8_t *block /* align width (8 or 16) */,
  32. const uint8_t *pixels /* align 1 */,
  33. int line_size, int w, int h);
  34. /**
  35. * thirdpel DSP context
  36. */
  37. typedef struct TpelDSPContext {
  38. /**
  39. * Thirdpel motion compensation with rounding (a + b + 1) >> 1.
  40. * this is an array[12] of motion compensation functions for the
  41. * 9 thirdpel positions<br>
  42. * *pixels_tab[xthirdpel + 4 * ythirdpel]
  43. * @param block destination where the result is stored
  44. * @param pixels source
  45. * @param line_size number of bytes in a horizontal line of block
  46. * @param h height
  47. */
  48. tpel_mc_func put_tpel_pixels_tab[11]; // FIXME individual func ptr per width?
  49. tpel_mc_func avg_tpel_pixels_tab[11]; // FIXME individual func ptr per width?
  50. } TpelDSPContext;
  51. void ff_tpeldsp_init(TpelDSPContext *c);
  52. #endif /* AVCODEC_TPELDSP_H */