Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/thirdparty/libtheora/internal.h
9896 views
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 *
10
* https://www.xiph.org/ *
11
* *
12
********************************************************************
13
14
function:
15
16
********************************************************************/
17
#if !defined(_internal_H)
18
# define _internal_H (1)
19
# include <stdlib.h>
20
# include <limits.h>
21
# if defined(HAVE_CONFIG_H)
22
# include "config.h"
23
# endif
24
# include "theora/codec.h"
25
# include "theora/theora.h"
26
# include "ocintrin.h"
27
28
# if !defined(__GNUC_PREREQ)
29
# if defined(__GNUC__)&&defined(__GNUC_MINOR__)
30
# define __GNUC_PREREQ(_maj,_min) \
31
((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min))
32
# else
33
# define __GNUC_PREREQ(_maj,_min) 0
34
# endif
35
# endif
36
37
# if defined(_MSC_VER)
38
/*Disable missing EMMS warnings.*/
39
# pragma warning(disable:4799)
40
/*Thank you Microsoft, I know the order of operations.*/
41
# pragma warning(disable:4554)
42
# endif
43
/*You, too, gcc.*/
44
# if __GNUC_PREREQ(4,2)
45
# pragma GCC diagnostic ignored "-Wparentheses"
46
# endif
47
/*Et tu, clang.*/
48
# if defined(__clang__)
49
# pragma clang diagnostic ignored "-Wparentheses"
50
# endif
51
52
/*Some assembly constructs require aligned operands.
53
The following macros are _only_ intended for structure member declarations.
54
Although they will sometimes work on stack variables, gcc will often silently
55
ignore them.
56
A separate set of macros could be made for manual stack alignment, but we
57
don't actually require it anywhere.*/
58
# if defined(OC_X86_ASM)||defined(OC_ARM_ASM)
59
# if defined(__GNUC__)
60
# define OC_ALIGN8(expr) expr __attribute__((aligned(8)))
61
# define OC_ALIGN16(expr) expr __attribute__((aligned(16)))
62
# elif defined(_MSC_VER)
63
# define OC_ALIGN8(expr) __declspec (align(8)) expr
64
# define OC_ALIGN16(expr) __declspec (align(16)) expr
65
# else
66
# error "Alignment macros required for this platform."
67
# endif
68
# endif
69
# if !defined(OC_ALIGN8)
70
# define OC_ALIGN8(expr) expr
71
# endif
72
# if !defined(OC_ALIGN16)
73
# define OC_ALIGN16(expr) expr
74
# endif
75
76
77
78
/*This library's version.*/
79
# define OC_VENDOR_STRING "Xiph.Org libtheora 1.2.0 20250329 (Ptalarbvorm)"
80
81
/*Theora bitstream version.*/
82
# define TH_VERSION_MAJOR (3)
83
# define TH_VERSION_MINOR (2)
84
# define TH_VERSION_SUB (1)
85
# define TH_VERSION_CHECK(_info,_maj,_min,_sub) \
86
((_info)->version_major>(_maj)||(_info)->version_major==(_maj)&& \
87
((_info)->version_minor>(_min)||(_info)->version_minor==(_min)&& \
88
(_info)->version_subminor>=(_sub)))
89
90
91
92
/*A map from the index in the zig zag scan to the coefficient number in a
93
block.*/
94
extern const unsigned char OC_FZIG_ZAG[128];
95
/*A map from the coefficient number in a block to its index in the zig zag
96
scan.*/
97
extern const unsigned char OC_IZIG_ZAG[64];
98
/*A map from physical macro block ordering to bitstream macro block
99
ordering within a super block.*/
100
extern const unsigned char OC_MB_MAP[2][2];
101
/*A list of the indices in the oc_mb_map array that can be valid for each of
102
the various chroma decimation types.*/
103
extern const unsigned char OC_MB_MAP_IDXS[TH_PF_NFORMATS][12];
104
/*The number of indices in the oc_mb_map array that can be valid for each of
105
the various chroma decimation types.*/
106
extern const unsigned char OC_MB_MAP_NIDXS[TH_PF_NFORMATS];
107
108
109
110
int oc_ilog(unsigned _v);
111
void *oc_aligned_malloc(size_t _sz,size_t _align);
112
void oc_aligned_free(void *_ptr);
113
void **oc_malloc_2d(size_t _height,size_t _width,size_t _sz);
114
void **oc_calloc_2d(size_t _height,size_t _width,size_t _sz);
115
void oc_free_2d(void *_ptr);
116
117
void oc_ycbcr_buffer_flip(th_ycbcr_buffer _dst,
118
const th_ycbcr_buffer _src);
119
120
#endif
121
122