Dirac - A Video Codec

Created by the British Broadcasting Corporation.


dirac_encoder.h
Go to the documentation of this file.
1 /* ***** BEGIN LICENSE BLOCK *****
2 *
3 * $Id: dirac_encoder.h,v 1.28 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 * Thomas Davies
26 * Myo Tun (Brunel University, myo.tun@brunel.ac.uk)
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU General Public License Version 2 (the "GPL"), or the GNU Lesser
30 * Public License Version 2.1 (the "LGPL"), in which case the provisions of
31 * the GPL or the LGPL are applicable instead of those above. If you wish to
32 * allow use of your version of this file only under the terms of the either
33 * the GPL or LGPL and not to allow others to use your version of this file
34 * under the MPL, indicate your decision by deleting the provisions above
35 * and replace them with the notice and other provisions required by the GPL
36 * or LGPL. If you do not delete the provisions above, a recipient may use
37 * your version of this file under the terms of any one of the MPL, the GPL
38 * or the LGPL.
39 * ***** END LICENSE BLOCK ***** */
40 
41 #ifndef DIRAC_ENCODER_H
42 #define DIRAC_ENCODER_H
43 
46 
151 #ifdef __cplusplus
152 extern "C" {
153 #endif
154 
156 typedef enum
157 {
163 
167 
171 
176 typedef struct
177 {
179  int lossless;
181  float qf;
191  int L1_sep;
195  int num_L1;
197  float cpd;
199  int xblen;
201  int yblen;
203  int xbsep;
205  int ybsep;
213  unsigned int wlt_depth;
215  unsigned int spatial_partition;
217  dirac_prefilter_t prefilter;
219  unsigned int prefilter_strength;
221  unsigned int multi_quants;
223  dirac_mvprecision_t mv_precision;
225  int trate;
227  unsigned int picture_coding_mode;
229  int using_ac;
231 
233 typedef struct
234 {
245 
258 extern DllExport void dirac_encoder_context_init (dirac_encoder_context_t *enc_ctx, dirac_encoder_presets_t preset);
259 
260 
262 typedef struct
263 {
265  unsigned char *buffer;
267  int size;
269 
271 typedef struct
272 {
274  unsigned int mv_bits;
276  unsigned int ycomp_bits;
278  unsigned int ucomp_bits;
280  unsigned int vcomp_bits;
282  unsigned int pic_bits;
284 
286 typedef struct
287 {
289  int64_t mv_bits;
291  int64_t seq_bits;
293  int64_t ycomp_bits;
295  int64_t ucomp_bits;
297  int64_t vcomp_bits;
299  int64_t bit_rate;
301 
303 typedef struct
304 {
306  int x;
308  int y;
309 } dirac_mv_t;
310 
312 typedef struct
313 {
315  float SAD;
317  float mvcost;
319 
321 typedef struct
322 {
328  int pnum;
330  int num_refs;
332  int refs[2];
334  int xbsep;
336  int ybsep;
338  int sb_xlen;
340  int sb_ylen;
342  int mv_xlen;
344  int mv_ylen;
348  float *sb_costs;
350  int *pred_mode;
352  float *intra_costs;
356  short *dc_ycomp;
358  short *dc_ucomp;
360  short *dc_vcomp;
362  dirac_mv_t *mv[2];
364  dirac_mv_cost_t *pred_costs[2];
365 } dirac_instr_t;
366 
368 typedef struct
369 {
372 
375 
381 
384 
387 
390 
393 
394  /* locally decoded frame (NB: not picture) available flag.
395  1 - locally decoded frame available in dec_buf.
396  0 - locally decoded frame not available.
397  */
399 
405 
408 
413 
419 
421  const void *compressor;
423 
430 extern DllExport dirac_encoder_t *dirac_encoder_init (const dirac_encoder_context_t *enc_ctx, int verbose);
431 
432 #if DIRAC_RESEARCH_VERSION_ATLEAST(1,0,2)
433 
440 extern DllExport int dirac_encoder_pts_offset (const dirac_encoder_t *encoder);
441 #endif
442 
452 extern DllExport int dirac_encoder_load (dirac_encoder_t *encoder, unsigned char *uncdata, int uncdata_size);
453 
465 
471 
476 extern DllExport void dirac_encoder_close (dirac_encoder_t *encoder);
477 
478 #endif
479 #ifdef __cplusplus
480 }
481 #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.