x86enc.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /********************************************************************
  2. * *
  3. * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. *
  4. * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
  5. * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
  6. * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
  7. * *
  8. * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 *
  9. * by the Xiph.Org Foundation and contributors http://www.xiph.org/ *
  10. * *
  11. ********************************************************************
  12. function:
  13. last mod: $Id: x86int.h 15675 2009-02-06 09:43:27Z tterribe $
  14. ********************************************************************/
  15. #if !defined(_x86_x86enc_H)
  16. # define _x86_x86enc_H (1)
  17. # include "x86int.h"
  18. # if defined(OC_X86_ASM)
  19. # define oc_enc_accel_init oc_enc_accel_init_x86
  20. # if defined(OC_X86_64_ASM)
  21. /*x86-64 guarantees SIMD support up through at least SSE2.
  22. If the best routine we have available only needs SSE2 (which at the moment
  23. covers all of them), then we can avoid runtime detection and the indirect
  24. call.*/
  25. # define oc_enc_frag_sub(_enc,_diff,_x,_y,_stride) \
  26. oc_enc_frag_sub_mmx(_diff,_x,_y,_stride)
  27. # define oc_enc_frag_sub_128(_enc,_diff,_x,_stride) \
  28. oc_enc_frag_sub_128_mmx(_diff,_x,_stride)
  29. # define oc_enc_frag_sad(_enc,_src,_ref,_ystride) \
  30. oc_enc_frag_sad_mmxext(_src,_ref,_ystride)
  31. # define oc_enc_frag_sad_thresh(_enc,_src,_ref,_ystride,_thresh) \
  32. oc_enc_frag_sad_thresh_mmxext(_src,_ref,_ystride,_thresh)
  33. # define oc_enc_frag_sad2_thresh(_enc,_src,_ref1,_ref2,_ystride,_thresh) \
  34. oc_enc_frag_sad2_thresh_mmxext(_src,_ref1,_ref2,_ystride,_thresh)
  35. # define oc_enc_frag_satd(_enc,_dc,_src,_ref,_ystride) \
  36. oc_enc_frag_satd_sse2(_dc,_src,_ref,_ystride)
  37. # define oc_enc_frag_satd2(_enc,_dc,_src,_ref1,_ref2,_ystride) \
  38. oc_enc_frag_satd2_sse2(_dc,_src,_ref1,_ref2,_ystride)
  39. # define oc_enc_frag_intra_satd(_enc,_dc,_src,_ystride) \
  40. oc_enc_frag_intra_satd_sse2(_dc,_src,_ystride)
  41. # define oc_enc_frag_ssd(_enc,_src,_ref,_ystride) \
  42. oc_enc_frag_ssd_sse2(_src,_ref,_ystride)
  43. # define oc_enc_frag_border_ssd(_enc,_src,_ref,_ystride,_mask) \
  44. oc_enc_frag_border_ssd_sse2(_src,_ref,_ystride,_mask)
  45. # define oc_enc_frag_copy2(_enc,_dst,_src1,_src2,_ystride) \
  46. oc_int_frag_copy2_mmxext(_dst,_ystride,_src1,_src2,_ystride)
  47. # define oc_enc_enquant_table_init(_enc,_enquant,_dequant) \
  48. oc_enc_enquant_table_init_x86(_enquant,_dequant)
  49. # define oc_enc_enquant_table_fixup(_enc,_enquant,_nqis) \
  50. oc_enc_enquant_table_fixup_x86(_enquant,_nqis)
  51. # define oc_enc_quantize(_enc,_qdct,_dct,_dequant,_enquant) \
  52. oc_enc_quantize_sse2(_qdct,_dct,_dequant,_enquant)
  53. # define oc_enc_frag_recon_intra(_enc,_dst,_ystride,_residue) \
  54. oc_frag_recon_intra_mmx(_dst,_ystride,_residue)
  55. # define oc_enc_frag_recon_inter(_enc,_dst,_src,_ystride,_residue) \
  56. oc_frag_recon_inter_mmx(_dst,_src,_ystride,_residue)
  57. # define oc_enc_fdct8x8(_enc,_y,_x) \
  58. oc_enc_fdct8x8_x86_64sse2(_y,_x)
  59. # else
  60. # define OC_ENC_USE_VTABLE (1)
  61. # endif
  62. # endif
  63. # include "../encint.h"
  64. void oc_enc_accel_init_x86(oc_enc_ctx *_enc);
  65. void oc_enc_frag_sub_mmx(ogg_int16_t _diff[64],
  66. const unsigned char *_x,const unsigned char *_y,int _stride);
  67. void oc_enc_frag_sub_128_mmx(ogg_int16_t _diff[64],
  68. const unsigned char *_x,int _stride);
  69. unsigned oc_enc_frag_sad_mmxext(const unsigned char *_src,
  70. const unsigned char *_ref,int _ystride);
  71. unsigned oc_enc_frag_sad_thresh_mmxext(const unsigned char *_src,
  72. const unsigned char *_ref,int _ystride,unsigned _thresh);
  73. unsigned oc_enc_frag_sad2_thresh_mmxext(const unsigned char *_src,
  74. const unsigned char *_ref1,const unsigned char *_ref2,int _ystride,
  75. unsigned _thresh);
  76. unsigned oc_enc_frag_satd_mmxext(int *_dc,const unsigned char *_src,
  77. const unsigned char *_ref,int _ystride);
  78. unsigned oc_enc_frag_satd_sse2(int *_dc,const unsigned char *_src,
  79. const unsigned char *_ref,int _ystride);
  80. unsigned oc_enc_frag_satd2_mmxext(int *_dc,const unsigned char *_src,
  81. const unsigned char *_ref1,const unsigned char *_ref2,int _ystride);
  82. unsigned oc_enc_frag_satd2_sse2(int *_dc,const unsigned char *_src,
  83. const unsigned char *_ref1,const unsigned char *_ref2,int _ystride);
  84. unsigned oc_enc_frag_intra_satd_mmxext(int *_dc,
  85. const unsigned char *_src,int _ystride);
  86. unsigned oc_enc_frag_intra_satd_sse2(int *_dc,
  87. const unsigned char *_src,int _ystride);
  88. unsigned oc_enc_frag_ssd_sse2(const unsigned char *_src,
  89. const unsigned char *_ref,int _ystride);
  90. unsigned oc_enc_frag_border_ssd_sse2(const unsigned char *_src,
  91. const unsigned char *_ref,int _ystride,ogg_int64_t _mask);
  92. void oc_int_frag_copy2_mmxext(unsigned char *_dst,int _dst_ystride,
  93. const unsigned char *_src1,const unsigned char *_src2,int _src_ystride);
  94. void oc_enc_frag_copy2_mmxext(unsigned char *_dst,
  95. const unsigned char *_src1,const unsigned char *_src2,int _ystride);
  96. void oc_enc_enquant_table_init_x86(void *_enquant,
  97. const ogg_uint16_t _dequant[64]);
  98. void oc_enc_enquant_table_fixup_x86(void *_enquant[3][3][2],int _nqis);
  99. int oc_enc_quantize_sse2(ogg_int16_t _qdct[64],const ogg_int16_t _dct[64],
  100. const ogg_uint16_t _dequant[64],const void *_enquant);
  101. void oc_enc_fdct8x8_mmxext(ogg_int16_t _y[64],const ogg_int16_t _x[64]);
  102. # if defined(OC_X86_64_ASM)
  103. void oc_enc_fdct8x8_x86_64sse2(ogg_int16_t _y[64],const ogg_int16_t _x[64]);
  104. # endif
  105. #endif