ac3dec: simplify zero-bit mantissa dithering by calculating it
[FFMpeg-mirror/lagarith.git] / libavcodec / libdirac_libschro.h
blob72b73814b0aed4bcef93be1ad356c9eb3bb8134f
1 /*
2 * Copyright (c) 2008 BBC, Anuradha Suraparaju <asuraparaju at gmail dot com >
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 /**
22 * @file libavcodec/libdirac_libschro.h
23 * data structures common to libdirac and libschroedinger
26 #ifndef AVCODEC_LIBDIRAC_LIBSCHRO_H
27 #define AVCODEC_LIBDIRAC_LIBSCHRO_H
29 #include "avcodec.h"
31 typedef struct
33 uint16_t width;
34 uint16_t height;
35 uint16_t frame_rate_num;
36 uint16_t frame_rate_denom;
37 } FfmpegDiracSchroVideoFormatInfo;
39 /**
40 * Returns the index into the Dirac Schro common video format info table
42 unsigned int ff_dirac_schro_get_video_format_idx (AVCodecContext *avccontext);
44 /**
45 * contains a single encoded frame returned from Dirac or Schroedinger
47 typedef struct FfmpegDiracSchroEncodedFrame
49 /** encoded frame data */
50 uint8_t *p_encbuf;
52 /** encoded frame size */
53 uint32_t size;
55 /** encoded frame number. Will be used as pts */
56 uint32_t frame_num;
58 /** key frame flag. 1 : is key frame , 0 : in not key frame */
59 uint16_t key_frame;
60 } FfmpegDiracSchroEncodedFrame;
62 /**
63 * queue element
65 typedef struct FfmpegDiracSchroQueueElement
67 /** Data to be stored in queue*/
68 void *data;
69 /** Pointer to next element queue */
70 struct FfmpegDiracSchroQueueElement *next;
71 } FfmpegDiracSchroQueueElement;
74 /**
75 * A simple queue implementation used in libdirac and libschroedinger
77 typedef struct FfmpegDiracSchroQueue
79 /** Pointer to head of queue */
80 FfmpegDiracSchroQueueElement *p_head;
81 /** Pointer to tail of queue */
82 FfmpegDiracSchroQueueElement *p_tail;
83 /** Queue size*/
84 int size;
85 } FfmpegDiracSchroQueue;
87 /**
88 * Initialise the queue
90 void ff_dirac_schro_queue_init(FfmpegDiracSchroQueue *queue);
92 /**
93 * Add an element to the end of the queue
95 int ff_dirac_schro_queue_push_back (FfmpegDiracSchroQueue *queue, void *p_data);
97 /**
98 * Return the first element in the queue
100 void *ff_dirac_schro_queue_pop (FfmpegDiracSchroQueue *queue);
103 * Free the queue resources. free_func is a function supplied by the caller to
104 * free any resources allocated by the caller. The data field of the queue
105 * element is passed to it.
107 void ff_dirac_schro_queue_free(FfmpegDiracSchroQueue *queue,
108 void (*free_func)(void *));
109 #endif /* AVCODEC_LIBDIRAC_LIBSCHRO_H */