michael@0: /******************************************************************** michael@0: * * michael@0: * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * michael@0: * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * michael@0: * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * michael@0: * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * michael@0: * * michael@0: * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * michael@0: * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * michael@0: * * michael@0: ******************************************************************** michael@0: michael@0: function: michael@0: last mod: $Id: internal.h 17578 2010-10-29 04:21:26Z tterribe $ michael@0: michael@0: ********************************************************************/ michael@0: #if !defined(_internal_H) michael@0: # define _internal_H (1) michael@0: # include michael@0: # include michael@0: # if defined(HAVE_CONFIG_H) michael@0: # include "config.h" michael@0: # endif michael@0: # include "theora/codec.h" michael@0: # include "theora/theora.h" michael@0: # include "ocintrin.h" michael@0: michael@0: # if !defined(__GNUC_PREREQ) michael@0: # if defined(__GNUC__)&&defined(__GNUC_MINOR__) michael@0: # define __GNUC_PREREQ(_maj,_min) \ michael@0: ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min)) michael@0: # else michael@0: # define __GNUC_PREREQ(_maj,_min) 0 michael@0: # endif michael@0: # endif michael@0: michael@0: # if defined(_MSC_VER) michael@0: /*Disable missing EMMS warnings.*/ michael@0: # pragma warning(disable:4799) michael@0: /*Thank you Microsoft, I know the order of operations.*/ michael@0: # pragma warning(disable:4554) michael@0: # endif michael@0: /*You, too, gcc.*/ michael@0: # if __GNUC_PREREQ(4,2) michael@0: # pragma GCC diagnostic ignored "-Wparentheses" michael@0: # endif michael@0: michael@0: /*Some assembly constructs require aligned operands. michael@0: The following macros are _only_ intended for structure member declarations. michael@0: Although they will sometimes work on stack variables, gcc will often silently michael@0: ignore them. michael@0: A separate set of macros could be made for manual stack alignment, but we michael@0: don't actually require it anywhere.*/ michael@0: # if defined(OC_X86_ASM)||defined(OC_ARM_ASM) michael@0: # if defined(__GNUC__) michael@0: # define OC_ALIGN8(expr) expr __attribute__((aligned(8))) michael@0: # define OC_ALIGN16(expr) expr __attribute__((aligned(16))) michael@0: # elif defined(_MSC_VER) michael@0: # define OC_ALIGN8(expr) __declspec (align(8)) expr michael@0: # define OC_ALIGN16(expr) __declspec (align(16)) expr michael@0: # else michael@0: # error "Alignment macros required for this platform." michael@0: # endif michael@0: # endif michael@0: # if !defined(OC_ALIGN8) michael@0: # define OC_ALIGN8(expr) expr michael@0: # endif michael@0: # if !defined(OC_ALIGN16) michael@0: # define OC_ALIGN16(expr) expr michael@0: # endif michael@0: michael@0: michael@0: michael@0: /*This library's version.*/ michael@0: # define OC_VENDOR_STRING "Xiph.Org libtheora 1.2.0alpha 20100924 (Ptalarbvorm)" michael@0: michael@0: /*Theora bitstream version.*/ michael@0: # define TH_VERSION_MAJOR (3) michael@0: # define TH_VERSION_MINOR (2) michael@0: # define TH_VERSION_SUB (1) michael@0: # define TH_VERSION_CHECK(_info,_maj,_min,_sub) \ michael@0: ((_info)->version_major>(_maj)||(_info)->version_major==(_maj)&& \ michael@0: ((_info)->version_minor>(_min)||(_info)->version_minor==(_min)&& \ michael@0: (_info)->version_subminor>=(_sub))) michael@0: michael@0: michael@0: michael@0: /*A map from the index in the zig zag scan to the coefficient number in a michael@0: block.*/ michael@0: extern const unsigned char OC_FZIG_ZAG[128]; michael@0: /*A map from the coefficient number in a block to its index in the zig zag michael@0: scan.*/ michael@0: extern const unsigned char OC_IZIG_ZAG[64]; michael@0: /*A map from physical macro block ordering to bitstream macro block michael@0: ordering within a super block.*/ michael@0: extern const unsigned char OC_MB_MAP[2][2]; michael@0: /*A list of the indices in the oc_mb_map array that can be valid for each of michael@0: the various chroma decimation types.*/ michael@0: extern const unsigned char OC_MB_MAP_IDXS[TH_PF_NFORMATS][12]; michael@0: /*The number of indices in the oc_mb_map array that can be valid for each of michael@0: the various chroma decimation types.*/ michael@0: extern const unsigned char OC_MB_MAP_NIDXS[TH_PF_NFORMATS]; michael@0: michael@0: michael@0: michael@0: int oc_ilog(unsigned _v); michael@0: void *oc_aligned_malloc(size_t _sz,size_t _align); michael@0: void oc_aligned_free(void *_ptr); michael@0: void **oc_malloc_2d(size_t _height,size_t _width,size_t _sz); michael@0: void **oc_calloc_2d(size_t _height,size_t _width,size_t _sz); michael@0: void oc_free_2d(void *_ptr); michael@0: michael@0: void oc_ycbcr_buffer_flip(th_ycbcr_buffer _dst, michael@0: const th_ycbcr_buffer _src); michael@0: michael@0: #endif