# Dirac - A Video Codec

Created by the British Broadcasting Corporation.

dirac_types.h
Go to the documentation of this file.
1 /* ***** BEGIN LICENSE BLOCK *****
2 *
3 * $Id: dirac_types.h,v 1.12 2008/11/18 23:25:54 asuraparaju Exp $ $Name: Dirac_1_0_2 $
4 *
5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 *
7 * The contents of this file are subject to the Mozilla Public License
8 * Version 1.1 (the "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 * http://www.mozilla.org/MPL/
11 *
12 * Software distributed under the License is distributed on an "AS IS" basis,
13 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
14 * the specific language governing rights and limitations under the License.
15 *
16 * The Original Code is BBC Research and Development code.
17 *
18 * The Initial Developer of the Original Code is the British Broadcasting
19 * Corporation.
20 * Portions created by the Initial Developer are Copyright (C) 2004.
21 * All Rights Reserved.
22 *
23 * Contributor(s): Anuradha Suraparaju (Original Author)
24 * Andrew Kennedy
25 *
26 * Alternatively, the contents of this file may be used under the terms of
27 * the GNU General Public License Version 2 (the "GPL"), or the GNU Lesser
28 * Public License Version 2.1 (the "LGPL"), in which case the provisions of
29 * the GPL or the LGPL are applicable instead of those above. If you wish to
30 * allow use of your version of this file only under the terms of the either
31 * the GPL or LGPL and not to allow others to use your version of this file
32 * under the MPL, indicate your decision by deleting the provisions above
33 * and replace them with the notice and other provisions required by the GPL
34 * or LGPL. If you do not delete the provisions above, a recipient may use
35 * your version of this file under the terms of any one of the MPL, the GPL
36 * or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
38
39 #ifndef _DIRAC_TYPES_H
40 #define _DIRAC_TYPES_H
41
42 #include <libdirac_common/common_types.h>
43
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51
52 #if defined(WIN32) && defined(_WINDLL)
53 #define DllExport __declspec( dllexport )
54 #else
55 #define DllExport
56 #endif
57
58 /*
59 * Major version corresponds to major version of the software.
60 * Minor version corresponds to minor version of the software. Bump
61 * this up by one whenever there are major feature changes to the software.
62 * Patch version corresponds to changes in the API. It should be
63 * bumped up by 1 for every committed change to the API
64 */
65 #define DIRAC_RESEARCH_MAJOR_VERSION 1 /* 0..255 */
66 #define DIRAC_RESEARCH_MINOR_VERSION 0 /* 0..255 */
67 #define DIRAC_RESEARCH_PATCH_VERSION 2 /* 0..255 */
68
69 #define DIRAC_RESEARCH_VERSION(X, Y, Z) \
70 (((X)<<16) + ((Y)<<8) + (Z))
71
72 #define DIRAC_RESEARCH_CURVERSION \
73 DIRAC_RESEARCH_VERSION(DIRAC_RESEARCH_MAJOR_VERSION, \
74 DIRAC_RESEARCH_MINOR_VERSION, \
75 DIRAC_RESEARCH_PATCH_VERSION)
76
77 #define DIRAC_RESEARCH_VERSION_ATLEAST(X, Y, Z) \
78 (DIRAC_RESEARCH_CURVERSION >= DIRAC_RESEARCH_VERSION(X, Y, Z))
79
80 /*
81 * Some basic enumeration types used by end user encoder and decoder ...//
82 */
83 typedef ChromaFormat dirac_chroma_t;
84 typedef PictureType dirac_picture_type_t;
85 typedef ReferenceType dirac_reference_type_t;
86 typedef WltFilter dirac_wlt_filter_t;
87
88 typedef struct
89 {
90 int numerator;
91 int denominator;
92 } dirac_rational_t;
93
94 typedef dirac_rational_t dirac_frame_rate_t;
95 typedef dirac_rational_t dirac_pix_asr_t;
96
98 typedef struct
99 {
101 unsigned int major_ver;
103 unsigned int minor_ver;
105 unsigned int profile;
107 unsigned int level;
108 } dirac_parseparams_t;
109
110 typedef struct
111 {
112 unsigned int width;
113 unsigned int height;
114 unsigned int left_offset;
115 unsigned int top_offset;
116 } dirac_clean_area_t;
117
118 typedef struct
119 {
120 unsigned int luma_offset;
121 unsigned int luma_excursion;
122 unsigned int chroma_offset;
123 unsigned int chroma_excursion;
124 } dirac_signal_range_t;
125
126 typedef struct
127 {
128 float kr;
129 float kb;
130 } dirac_col_matrix_t;
131
132 typedef ColourPrimaries dirac_col_primaries_t;
133 typedef TransferFunction dirac_transfer_func_t;
134
135 typedef struct
136 {
137 dirac_col_primaries_t col_primary;
138 dirac_col_matrix_t col_matrix;
139 dirac_transfer_func_t trans_func;
140 } dirac_colour_spec_t;
141
143 typedef struct
144 {
146 unsigned int width;
148 unsigned int height;
150 dirac_chroma_t chroma;
152 unsigned int chroma_width;
154 unsigned int chroma_height;
156 unsigned int source_sampling;
158 int topfieldfirst;
160 dirac_frame_rate_t frame_rate;
162 dirac_pix_asr_t pix_asr;
163 /* clean area*/
164 dirac_clean_area_t clean_area;
165 /* signal range*/
166 dirac_signal_range_t signal_range;
167 /* colour specification*/
168 dirac_colour_spec_t colour_spec;
169
170 } dirac_sourceparams_t;
171
173 typedef struct
174 {
176 dirac_picture_type_t ptype;
178 dirac_reference_type_t rtype;
180 int pnum;
181 } dirac_picparams_t;
182
183
186 typedef struct
187 {
189 unsigned char *buf[3];
191 void *id;
192 } dirac_framebuf_t;
193
194 #ifdef __cplusplus
195 }
196 #endif
197
198 #endif

© 2004 British Broadcasting Corporation. Dirac code licensed under the Mozilla Public License (MPL) Version 1.1.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.