media/libtheora/lib/x86/x86int.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/media/libtheora/lib/x86/x86int.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,122 @@
     1.4 +/********************************************************************
     1.5 + *                                                                  *
     1.6 + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE.   *
     1.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
     1.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
     1.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
    1.10 + *                                                                  *
    1.11 + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009                *
    1.12 + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ *
    1.13 + *                                                                  *
    1.14 + ********************************************************************
    1.15 +
    1.16 +  function:
    1.17 +    last mod: $Id: x86int.h 17578 2010-10-29 04:21:26Z tterribe $
    1.18 +
    1.19 + ********************************************************************/
    1.20 +
    1.21 +#if !defined(_x86_x86int_H)
    1.22 +# define _x86_x86int_H (1)
    1.23 +# include "../internal.h"
    1.24 +
    1.25 +# if defined(OC_X86_ASM)
    1.26 +#  define oc_state_accel_init oc_state_accel_init_x86
    1.27 +#  if defined(OC_X86_64_ASM)
    1.28 +/*x86-64 guarantees SIMD support up through at least SSE2.
    1.29 +  If the best routine we have available only needs SSE2 (which at the moment
    1.30 +   covers all of them), then we can avoid runtime detection and the indirect
    1.31 +   call.*/
    1.32 +#   define oc_frag_copy(_state,_dst,_src,_ystride) \
    1.33 +  oc_frag_copy_mmx(_dst,_src,_ystride)
    1.34 +#   define oc_frag_copy_list(_state,_dst_frame,_src_frame,_ystride, \
    1.35 + _fragis,_nfragis,_frag_buf_offs) \
    1.36 +  oc_frag_copy_list_mmx(_dst_frame,_src_frame,_ystride, \
    1.37 +   _fragis,_nfragis,_frag_buf_offs)
    1.38 +#   define oc_frag_recon_intra(_state,_dst,_ystride,_residue) \
    1.39 +  oc_frag_recon_intra_mmx(_dst,_ystride,_residue)
    1.40 +#   define oc_frag_recon_inter(_state,_dst,_src,_ystride,_residue) \
    1.41 +  oc_frag_recon_inter_mmx(_dst,_src,_ystride,_residue)
    1.42 +#   define oc_frag_recon_inter2(_state,_dst,_src1,_src2,_ystride,_residue) \
    1.43 +  oc_frag_recon_inter2_mmx(_dst,_src1,_src2,_ystride,_residue)
    1.44 +#   define oc_idct8x8(_state,_y,_x,_last_zzi) \
    1.45 +  oc_idct8x8_sse2(_y,_x,_last_zzi)
    1.46 +#   define oc_state_frag_recon oc_state_frag_recon_mmx
    1.47 +#   define oc_loop_filter_init(_state,_bv,_flimit) \
    1.48 +  oc_loop_filter_init_mmxext(_bv,_flimit)
    1.49 +#   define oc_state_loop_filter_frag_rows oc_state_loop_filter_frag_rows_mmxext
    1.50 +#   define oc_restore_fpu(_state) \
    1.51 +  oc_restore_fpu_mmx()
    1.52 +#  else
    1.53 +#   define OC_STATE_USE_VTABLE (1)
    1.54 +#  endif
    1.55 +# endif
    1.56 +
    1.57 +# include "../state.h"
    1.58 +# include "x86cpu.h"
    1.59 +
    1.60 +/*Converts the expression in the argument to a string.*/
    1.61 +#define OC_M2STR(_s) #_s
    1.62 +
    1.63 +/*Memory operands do not always include an offset.
    1.64 +  To avoid warnings, we force an offset with %H (which adds 8).*/
    1.65 +# if __GNUC_PREREQ(4,0)
    1.66 +#  define OC_MEM_OFFS(_offs,_name) \
    1.67 +  OC_M2STR(_offs-8+%H[_name])
    1.68 +# endif
    1.69 +/*If your gcc version does't support %H, then you get to suffer the warnings.
    1.70 +  Note that Apple's gas breaks on things like _offs+(%esp): it throws away the
    1.71 +   whole offset, instead of substituting in 0 for the missing operand to +.*/
    1.72 +# if !defined(OC_MEM_OFFS)
    1.73 +#  define OC_MEM_OFFS(_offs,_name) \
    1.74 +  OC_M2STR(_offs+%[_name])
    1.75 +# endif
    1.76 +
    1.77 +/*Declare an array operand with an exact size.
    1.78 +  This tells gcc we're going to clobber this memory region, without having to
    1.79 +   clobber all of "memory" and lets us access local buffers directly using the
    1.80 +   stack pointer, without allocating a separate register to point to them.*/
    1.81 +#define OC_ARRAY_OPERAND(_type,_ptr,_size) \
    1.82 +  (*({ \
    1.83 +    struct{_type array_value__[(_size)];} *array_addr__=(void *)(_ptr); \
    1.84 +    array_addr__; \
    1.85 +  }))
    1.86 +
    1.87 +/*Declare an array operand with an exact size.
    1.88 +  This tells gcc we're going to clobber this memory region, without having to
    1.89 +   clobber all of "memory" and lets us access local buffers directly using the
    1.90 +   stack pointer, without allocating a separate register to point to them.*/
    1.91 +#define OC_CONST_ARRAY_OPERAND(_type,_ptr,_size) \
    1.92 +  (*({ \
    1.93 +    const struct{_type array_value__[(_size)];} *array_addr__= \
    1.94 +     (const void *)(_ptr); \
    1.95 +    array_addr__; \
    1.96 +  }))
    1.97 +
    1.98 +extern const unsigned short __attribute__((aligned(16))) OC_IDCT_CONSTS[64];
    1.99 +
   1.100 +void oc_state_accel_init_x86(oc_theora_state *_state);
   1.101 +
   1.102 +void oc_frag_copy_mmx(unsigned char *_dst,
   1.103 + const unsigned char *_src,int _ystride);
   1.104 +void oc_frag_copy_list_mmx(unsigned char *_dst_frame,
   1.105 + const unsigned char *_src_frame,int _ystride,
   1.106 + const ptrdiff_t *_fragis,ptrdiff_t _nfragis,const ptrdiff_t *_frag_buf_offs);
   1.107 +void oc_frag_recon_intra_mmx(unsigned char *_dst,int _ystride,
   1.108 + const ogg_int16_t *_residue);
   1.109 +void oc_frag_recon_inter_mmx(unsigned char *_dst,
   1.110 + const unsigned char *_src,int _ystride,const ogg_int16_t *_residue);
   1.111 +void oc_frag_recon_inter2_mmx(unsigned char *_dst,const unsigned char *_src1,
   1.112 + const unsigned char *_src2,int _ystride,const ogg_int16_t *_residue);
   1.113 +void oc_idct8x8_mmx(ogg_int16_t _y[64],ogg_int16_t _x[64],int _last_zzi);
   1.114 +void oc_idct8x8_sse2(ogg_int16_t _y[64],ogg_int16_t _x[64],int _last_zzi);
   1.115 +void oc_state_frag_recon_mmx(const oc_theora_state *_state,ptrdiff_t _fragi,
   1.116 + int _pli,ogg_int16_t _dct_coeffs[128],int _last_zzi,ogg_uint16_t _dc_quant);
   1.117 +void oc_loop_filter_init_mmx(signed char _bv[256],int _flimit);
   1.118 +void oc_loop_filter_init_mmxext(signed char _bv[256],int _flimit);
   1.119 +void oc_state_loop_filter_frag_rows_mmx(const oc_theora_state *_state,
   1.120 + signed char _bv[256],int _refi,int _pli,int _fragy0,int _fragy_end);
   1.121 +void oc_state_loop_filter_frag_rows_mmxext(const oc_theora_state *_state,
   1.122 + signed char _bv[256],int _refi,int _pli,int _fragy0,int _fragy_end);
   1.123 +void oc_restore_fpu_mmx(void);
   1.124 +
   1.125 +#endif

mercurial