1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/libtheora/lib/internal.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,116 @@ 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: internal.h 17578 2010-10-29 04:21:26Z tterribe $ 1.18 + 1.19 + ********************************************************************/ 1.20 +#if !defined(_internal_H) 1.21 +# define _internal_H (1) 1.22 +# include <stdlib.h> 1.23 +# include <limits.h> 1.24 +# if defined(HAVE_CONFIG_H) 1.25 +# include "config.h" 1.26 +# endif 1.27 +# include "theora/codec.h" 1.28 +# include "theora/theora.h" 1.29 +# include "ocintrin.h" 1.30 + 1.31 +# if !defined(__GNUC_PREREQ) 1.32 +# if defined(__GNUC__)&&defined(__GNUC_MINOR__) 1.33 +# define __GNUC_PREREQ(_maj,_min) \ 1.34 + ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min)) 1.35 +# else 1.36 +# define __GNUC_PREREQ(_maj,_min) 0 1.37 +# endif 1.38 +# endif 1.39 + 1.40 +# if defined(_MSC_VER) 1.41 +/*Disable missing EMMS warnings.*/ 1.42 +# pragma warning(disable:4799) 1.43 +/*Thank you Microsoft, I know the order of operations.*/ 1.44 +# pragma warning(disable:4554) 1.45 +# endif 1.46 +/*You, too, gcc.*/ 1.47 +# if __GNUC_PREREQ(4,2) 1.48 +# pragma GCC diagnostic ignored "-Wparentheses" 1.49 +# endif 1.50 + 1.51 +/*Some assembly constructs require aligned operands. 1.52 + The following macros are _only_ intended for structure member declarations. 1.53 + Although they will sometimes work on stack variables, gcc will often silently 1.54 + ignore them. 1.55 + A separate set of macros could be made for manual stack alignment, but we 1.56 + don't actually require it anywhere.*/ 1.57 +# if defined(OC_X86_ASM)||defined(OC_ARM_ASM) 1.58 +# if defined(__GNUC__) 1.59 +# define OC_ALIGN8(expr) expr __attribute__((aligned(8))) 1.60 +# define OC_ALIGN16(expr) expr __attribute__((aligned(16))) 1.61 +# elif defined(_MSC_VER) 1.62 +# define OC_ALIGN8(expr) __declspec (align(8)) expr 1.63 +# define OC_ALIGN16(expr) __declspec (align(16)) expr 1.64 +# else 1.65 +# error "Alignment macros required for this platform." 1.66 +# endif 1.67 +# endif 1.68 +# if !defined(OC_ALIGN8) 1.69 +# define OC_ALIGN8(expr) expr 1.70 +# endif 1.71 +# if !defined(OC_ALIGN16) 1.72 +# define OC_ALIGN16(expr) expr 1.73 +# endif 1.74 + 1.75 + 1.76 + 1.77 +/*This library's version.*/ 1.78 +# define OC_VENDOR_STRING "Xiph.Org libtheora 1.2.0alpha 20100924 (Ptalarbvorm)" 1.79 + 1.80 +/*Theora bitstream version.*/ 1.81 +# define TH_VERSION_MAJOR (3) 1.82 +# define TH_VERSION_MINOR (2) 1.83 +# define TH_VERSION_SUB (1) 1.84 +# define TH_VERSION_CHECK(_info,_maj,_min,_sub) \ 1.85 + ((_info)->version_major>(_maj)||(_info)->version_major==(_maj)&& \ 1.86 + ((_info)->version_minor>(_min)||(_info)->version_minor==(_min)&& \ 1.87 + (_info)->version_subminor>=(_sub))) 1.88 + 1.89 + 1.90 + 1.91 +/*A map from the index in the zig zag scan to the coefficient number in a 1.92 + block.*/ 1.93 +extern const unsigned char OC_FZIG_ZAG[128]; 1.94 +/*A map from the coefficient number in a block to its index in the zig zag 1.95 + scan.*/ 1.96 +extern const unsigned char OC_IZIG_ZAG[64]; 1.97 +/*A map from physical macro block ordering to bitstream macro block 1.98 + ordering within a super block.*/ 1.99 +extern const unsigned char OC_MB_MAP[2][2]; 1.100 +/*A list of the indices in the oc_mb_map array that can be valid for each of 1.101 + the various chroma decimation types.*/ 1.102 +extern const unsigned char OC_MB_MAP_IDXS[TH_PF_NFORMATS][12]; 1.103 +/*The number of indices in the oc_mb_map array that can be valid for each of 1.104 + the various chroma decimation types.*/ 1.105 +extern const unsigned char OC_MB_MAP_NIDXS[TH_PF_NFORMATS]; 1.106 + 1.107 + 1.108 + 1.109 +int oc_ilog(unsigned _v); 1.110 +void *oc_aligned_malloc(size_t _sz,size_t _align); 1.111 +void oc_aligned_free(void *_ptr); 1.112 +void **oc_malloc_2d(size_t _height,size_t _width,size_t _sz); 1.113 +void **oc_calloc_2d(size_t _height,size_t _width,size_t _sz); 1.114 +void oc_free_2d(void *_ptr); 1.115 + 1.116 +void oc_ycbcr_buffer_flip(th_ycbcr_buffer _dst, 1.117 + const th_ycbcr_buffer _src); 1.118 + 1.119 +#endif