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.

101 lines
2.5KB

  1. #ifndef DSPUTIL_H
  2. #define DSPUTIL_H
  3. #include "common.h"
  4. #include <inttypes.h>
  5. /* dct code */
  6. typedef short DCTELEM;
  7. void jpeg_fdct_ifast (DCTELEM *data);
  8. void j_rev_dct (DCTELEM *data);
  9. void fdct_mmx(DCTELEM *block);
  10. void (*av_fdct)(DCTELEM *block);
  11. /* pixel operations */
  12. #define MAX_NEG_CROP 384
  13. /* temporary */
  14. extern UINT32 squareTbl[512];
  15. void dsputil_init(void);
  16. /* pixel ops : interface with DCT */
  17. extern void (*ff_idct)(DCTELEM *block);
  18. extern void (*get_pixels)(DCTELEM *block, const UINT8 *pixels, int line_size);
  19. extern void (*put_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size);
  20. extern void (*add_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size);
  21. void get_pixels_c(DCTELEM *block, const UINT8 *pixels, int line_size);
  22. void put_pixels_clamped_c(const DCTELEM *block, UINT8 *pixels, int line_size);
  23. void add_pixels_clamped_c(const DCTELEM *block, UINT8 *pixels, int line_size);
  24. /* add and put pixel (decoding) */
  25. typedef void (*op_pixels_func)(UINT8 *block, const UINT8 *pixels, int line_size, int h);
  26. extern op_pixels_func put_pixels_tab[4];
  27. extern op_pixels_func avg_pixels_tab[4];
  28. extern op_pixels_func put_no_rnd_pixels_tab[4];
  29. extern op_pixels_func avg_no_rnd_pixels_tab[4];
  30. /* sub pixel (encoding) */
  31. extern void (*sub_pixels_tab[4])(DCTELEM *block, const UINT8 *pixels, int line_size, int h);
  32. #define sub_pixels_2(block, pixels, line_size, dxy) \
  33. sub_pixels_tab[dxy](block, pixels, line_size, 8)
  34. /* motion estimation */
  35. typedef int (*op_pixels_abs_func)(UINT8 *blk1, UINT8 *blk2, int line_size, int h);
  36. extern op_pixels_abs_func pix_abs16x16;
  37. extern op_pixels_abs_func pix_abs16x16_x2;
  38. extern op_pixels_abs_func pix_abs16x16_y2;
  39. extern op_pixels_abs_func pix_abs16x16_xy2;
  40. int pix_abs16x16_c(UINT8 *blk1, UINT8 *blk2, int lx, int h);
  41. int pix_abs16x16_x2_c(UINT8 *blk1, UINT8 *blk2, int lx, int h);
  42. int pix_abs16x16_y2_c(UINT8 *blk1, UINT8 *blk2, int lx, int h);
  43. int pix_abs16x16_xy2_c(UINT8 *blk1, UINT8 *blk2, int lx, int h);
  44. #ifdef HAVE_MMX
  45. #define MM_MMX 0x0001 /* standard MMX */
  46. #define MM_3DNOW 0x0004 /* AMD 3DNOW */
  47. #define MM_MMXEXT 0x0002 /* SSE integer functions or AMD MMX ext */
  48. #define MM_SSE 0x0008 /* SSE functions */
  49. #define MM_SSE2 0x0010 /* PIV SSE2 functions */
  50. extern int mm_flags;
  51. int mm_support(void);
  52. static inline void emms(void)
  53. {
  54. __asm __volatile ("emms;":::"memory");
  55. }
  56. #define emms_c() \
  57. {\
  58. if (mm_flags & MM_MMX)\
  59. emms();\
  60. }
  61. #define __align8 __attribute__ ((aligned (8)))
  62. void dsputil_init_mmx(void);
  63. #else
  64. #define emms_c()
  65. #define __align8
  66. #endif
  67. #endif