media/libtheora/lib/internal.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /********************************************************************
michael@0 2 * *
michael@0 3 * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. *
michael@0 4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
michael@0 5 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
michael@0 6 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
michael@0 7 * *
michael@0 8 * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 *
michael@0 9 * by the Xiph.Org Foundation and contributors http://www.xiph.org/ *
michael@0 10 * *
michael@0 11 ********************************************************************
michael@0 12
michael@0 13 function:
michael@0 14 last mod: $Id: internal.h 17578 2010-10-29 04:21:26Z tterribe $
michael@0 15
michael@0 16 ********************************************************************/
michael@0 17 #if !defined(_internal_H)
michael@0 18 # define _internal_H (1)
michael@0 19 # include <stdlib.h>
michael@0 20 # include <limits.h>
michael@0 21 # if defined(HAVE_CONFIG_H)
michael@0 22 # include "config.h"
michael@0 23 # endif
michael@0 24 # include "theora/codec.h"
michael@0 25 # include "theora/theora.h"
michael@0 26 # include "ocintrin.h"
michael@0 27
michael@0 28 # if !defined(__GNUC_PREREQ)
michael@0 29 # if defined(__GNUC__)&&defined(__GNUC_MINOR__)
michael@0 30 # define __GNUC_PREREQ(_maj,_min) \
michael@0 31 ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min))
michael@0 32 # else
michael@0 33 # define __GNUC_PREREQ(_maj,_min) 0
michael@0 34 # endif
michael@0 35 # endif
michael@0 36
michael@0 37 # if defined(_MSC_VER)
michael@0 38 /*Disable missing EMMS warnings.*/
michael@0 39 # pragma warning(disable:4799)
michael@0 40 /*Thank you Microsoft, I know the order of operations.*/
michael@0 41 # pragma warning(disable:4554)
michael@0 42 # endif
michael@0 43 /*You, too, gcc.*/
michael@0 44 # if __GNUC_PREREQ(4,2)
michael@0 45 # pragma GCC diagnostic ignored "-Wparentheses"
michael@0 46 # endif
michael@0 47
michael@0 48 /*Some assembly constructs require aligned operands.
michael@0 49 The following macros are _only_ intended for structure member declarations.
michael@0 50 Although they will sometimes work on stack variables, gcc will often silently
michael@0 51 ignore them.
michael@0 52 A separate set of macros could be made for manual stack alignment, but we
michael@0 53 don't actually require it anywhere.*/
michael@0 54 # if defined(OC_X86_ASM)||defined(OC_ARM_ASM)
michael@0 55 # if defined(__GNUC__)
michael@0 56 # define OC_ALIGN8(expr) expr __attribute__((aligned(8)))
michael@0 57 # define OC_ALIGN16(expr) expr __attribute__((aligned(16)))
michael@0 58 # elif defined(_MSC_VER)
michael@0 59 # define OC_ALIGN8(expr) __declspec (align(8)) expr
michael@0 60 # define OC_ALIGN16(expr) __declspec (align(16)) expr
michael@0 61 # else
michael@0 62 # error "Alignment macros required for this platform."
michael@0 63 # endif
michael@0 64 # endif
michael@0 65 # if !defined(OC_ALIGN8)
michael@0 66 # define OC_ALIGN8(expr) expr
michael@0 67 # endif
michael@0 68 # if !defined(OC_ALIGN16)
michael@0 69 # define OC_ALIGN16(expr) expr
michael@0 70 # endif
michael@0 71
michael@0 72
michael@0 73
michael@0 74 /*This library's version.*/
michael@0 75 # define OC_VENDOR_STRING "Xiph.Org libtheora 1.2.0alpha 20100924 (Ptalarbvorm)"
michael@0 76
michael@0 77 /*Theora bitstream version.*/
michael@0 78 # define TH_VERSION_MAJOR (3)
michael@0 79 # define TH_VERSION_MINOR (2)
michael@0 80 # define TH_VERSION_SUB (1)
michael@0 81 # define TH_VERSION_CHECK(_info,_maj,_min,_sub) \
michael@0 82 ((_info)->version_major>(_maj)||(_info)->version_major==(_maj)&& \
michael@0 83 ((_info)->version_minor>(_min)||(_info)->version_minor==(_min)&& \
michael@0 84 (_info)->version_subminor>=(_sub)))
michael@0 85
michael@0 86
michael@0 87
michael@0 88 /*A map from the index in the zig zag scan to the coefficient number in a
michael@0 89 block.*/
michael@0 90 extern const unsigned char OC_FZIG_ZAG[128];
michael@0 91 /*A map from the coefficient number in a block to its index in the zig zag
michael@0 92 scan.*/
michael@0 93 extern const unsigned char OC_IZIG_ZAG[64];
michael@0 94 /*A map from physical macro block ordering to bitstream macro block
michael@0 95 ordering within a super block.*/
michael@0 96 extern const unsigned char OC_MB_MAP[2][2];
michael@0 97 /*A list of the indices in the oc_mb_map array that can be valid for each of
michael@0 98 the various chroma decimation types.*/
michael@0 99 extern const unsigned char OC_MB_MAP_IDXS[TH_PF_NFORMATS][12];
michael@0 100 /*The number of indices in the oc_mb_map array that can be valid for each of
michael@0 101 the various chroma decimation types.*/
michael@0 102 extern const unsigned char OC_MB_MAP_NIDXS[TH_PF_NFORMATS];
michael@0 103
michael@0 104
michael@0 105
michael@0 106 int oc_ilog(unsigned _v);
michael@0 107 void *oc_aligned_malloc(size_t _sz,size_t _align);
michael@0 108 void oc_aligned_free(void *_ptr);
michael@0 109 void **oc_malloc_2d(size_t _height,size_t _width,size_t _sz);
michael@0 110 void **oc_calloc_2d(size_t _height,size_t _width,size_t _sz);
michael@0 111 void oc_free_2d(void *_ptr);
michael@0 112
michael@0 113 void oc_ycbcr_buffer_flip(th_ycbcr_buffer _dst,
michael@0 114 const th_ycbcr_buffer _src);
michael@0 115
michael@0 116 #endif

mercurial