rectangle.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*****************************************************************************
  2. * rectangle.c: rectangle filling
  3. *****************************************************************************
  4. * Copyright (C) 2010-2018 x264 project
  5. *
  6. * Authors: Fiona Glaser <fiona@x264.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
  21. *
  22. * This program is also available under a commercial proprietary license.
  23. * For more information, contact us at licensing@x264.com.
  24. *****************************************************************************/
  25. #include "common.h"
  26. #define CACHE_FUNC(name,size,width,height)\
  27. static void macroblock_cache_##name##_##width##_##height( void *target, uint32_t val )\
  28. {\
  29. x264_macroblock_cache_rect( target, width*size, height, size, val );\
  30. }
  31. #define CACHE_FUNCS(name,size)\
  32. CACHE_FUNC(name,size,4,4)\
  33. CACHE_FUNC(name,size,2,4)\
  34. CACHE_FUNC(name,size,4,2)\
  35. CACHE_FUNC(name,size,2,2)\
  36. CACHE_FUNC(name,size,2,1)\
  37. CACHE_FUNC(name,size,1,2)\
  38. CACHE_FUNC(name,size,1,1)\
  39. void (*x264_cache_##name##_func_table[10])(void *, uint32_t) =\
  40. {\
  41. macroblock_cache_##name##_1_1,\
  42. macroblock_cache_##name##_2_1,\
  43. macroblock_cache_##name##_1_2,\
  44. macroblock_cache_##name##_2_2,\
  45. NULL,\
  46. macroblock_cache_##name##_4_2,\
  47. NULL,\
  48. macroblock_cache_##name##_2_4,\
  49. NULL,\
  50. macroblock_cache_##name##_4_4\
  51. };\
  52. CACHE_FUNCS(mv, 4)
  53. CACHE_FUNCS(mvd, 2)
  54. CACHE_FUNCS(ref, 1)