annotate libdirac_libschro.h @ 9346:ee59f4f22dce libavcodec

Make sure the last bits of huffyuv frames are zeroed. Fixes issue946
author michael
date Sun, 05 Apr 2009 13:02:47 +0000
parents e9d9d946f213
children 965220ebc611
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6662
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
1 /*
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
2 * Copyright (c) 2008 BBC, Anuradha Suraparaju <asuraparaju at gmail dot com >
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
3 *
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
4 * This file is part of FFmpeg.
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
5 *
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
10 *
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
14 * Lesser General Public License for more details.
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
15 *
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
19 */
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
20
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
21 /**
8718
e9d9d946f213 Use full internal pathname in doxygen @file directives.
diego
parents: 7760
diff changeset
22 * @file libavcodec/libdirac_libschro.h
6662
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
23 * data structures common to libdirac and libschroedinger
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
24 */
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
25
7760
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 7233
diff changeset
26 #ifndef AVCODEC_LIBDIRAC_LIBSCHRO_H
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 7233
diff changeset
27 #define AVCODEC_LIBDIRAC_LIBSCHRO_H
6662
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
28
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
29 #include "avcodec.h"
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
30
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
31 typedef struct
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
32 {
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
33 uint16_t width;
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
34 uint16_t height;
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
35 uint16_t frame_rate_num;
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
36 uint16_t frame_rate_denom;
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
37 } FfmpegDiracSchroVideoFormatInfo;
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
38
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
39 /**
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
40 * Returns the index into the Dirac Schro common video format info table
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
41 */
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
42 unsigned int ff_dirac_schro_get_video_format_idx (AVCodecContext *avccontext);
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
43
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
44 /**
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
45 * contains a single encoded frame returned from Dirac or Schroedinger
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
46 */
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
47 typedef struct FfmpegDiracSchroEncodedFrame
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
48 {
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
49 /** encoded frame data */
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
50 uint8_t *p_encbuf;
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
51
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
52 /** encoded frame size */
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
53 uint32_t size;
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
54
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
55 /** encoded frame number. Will be used as pts */
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
56 uint32_t frame_num;
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
57
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
58 /** key frame flag. 1 : is key frame , 0 : in not key frame */
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
59 uint16_t key_frame;
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
60 } FfmpegDiracSchroEncodedFrame;
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
61
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
62 /**
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
63 * queue element
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
64 */
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
65 typedef struct FfmpegDiracSchroQueueElement
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
66 {
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
67 /** Data to be stored in queue*/
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
68 void *data;
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
69 /** Pointer to next element queue */
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
70 struct FfmpegDiracSchroQueueElement *next;
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
71 } FfmpegDiracSchroQueueElement;
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
72
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
73
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
74 /**
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
75 * A simple queue implementation used in libdirac and libschroedinger
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
76 */
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
77 typedef struct FfmpegDiracSchroQueue
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
78 {
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
79 /** Pointer to head of queue */
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
80 FfmpegDiracSchroQueueElement *p_head;
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
81 /** Pointer to tail of queue */
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
82 FfmpegDiracSchroQueueElement *p_tail;
7233
238a3511f183 Add a parameter for queue size.
benoit
parents: 6663
diff changeset
83 /** Queue size*/
238a3511f183 Add a parameter for queue size.
benoit
parents: 6663
diff changeset
84 int size;
6662
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
85 } FfmpegDiracSchroQueue;
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
86
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
87 /**
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
88 * Initialise the queue
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
89 */
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
90 void ff_dirac_schro_queue_init(FfmpegDiracSchroQueue *queue);
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
91
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
92 /**
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
93 * Add an element to the end of the queue
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
94 */
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
95 int ff_dirac_schro_queue_push_back (FfmpegDiracSchroQueue *queue, void *p_data);
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
96
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
97 /**
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
98 * Return the first element in the queue
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
99 */
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
100 void *ff_dirac_schro_queue_pop (FfmpegDiracSchroQueue *queue);
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
101
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
102 /**
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
103 * Free the queue resources. free_func is a function supplied by the caller to
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
104 * free any resources allocated by the caller. The data field of the queue
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
105 * element is passed to it.
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
106 */
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
107 void ff_dirac_schro_queue_free(FfmpegDiracSchroQueue *queue,
c5432b7e7bc1 libdirac and libschro common code, patch from Anuradha Suraparaju anuradhaAtrdDoTbbcDoTcoDotuk
lu_zero
parents:
diff changeset
108 void (*free_func)(void *));
7760
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 7233
diff changeset
109 #endif /* AVCODEC_LIBDIRAC_LIBSCHRO_H */