1 |
|
/***************************************************************************** |
2 |
|
* |
3 |
|
* XVID MPEG-4 VIDEO CODEC |
4 |
|
* - Decoder header - |
5 |
|
* |
6 |
|
* This file is part of XviD, a free MPEG-4 video encoder/decoder |
7 |
|
* |
8 |
|
* XviD is free software; you can redistribute it and/or modify it |
9 |
|
* under the terms of the GNU General Public License as published by |
10 |
|
* the Free Software Foundation; either version 2 of the License, or |
11 |
|
* (at your option) any later version. |
12 |
|
* |
13 |
|
* This program is distributed in the hope that it will be useful, |
14 |
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 |
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 |
|
* GNU General Public License for more details. |
17 |
|
* |
18 |
|
* You should have received a copy of the GNU General Public License |
19 |
|
* along with this program; if not, write to the Free Software |
20 |
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
|
* |
22 |
|
* Under section 8 of the GNU General Public License, the copyright |
23 |
|
* holders of XVID explicitly forbid distribution in the following |
24 |
|
* countries: |
25 |
|
* |
26 |
|
* - Japan |
27 |
|
* - United States of America |
28 |
|
* |
29 |
|
* Linking XviD statically or dynamically with other modules is making a |
30 |
|
* combined work based on XviD. Thus, the terms and conditions of the |
31 |
|
* GNU General Public License cover the whole combination. |
32 |
|
* |
33 |
|
* As a special exception, the copyright holders of XviD give you |
34 |
|
* permission to link XviD with independent modules that communicate with |
35 |
|
* XviD solely through the VFW1.1 and DShow interfaces, regardless of the |
36 |
|
* license terms of these independent modules, and to copy and distribute |
37 |
|
* the resulting combined work under terms of your choice, provided that |
38 |
|
* every copy of the combined work is accompanied by a complete copy of |
39 |
|
* the source code of XviD (the version of XviD used to produce the |
40 |
|
* combined work), being distributed under the terms of the GNU General |
41 |
|
* Public License plus this exception. An independent module is a module |
42 |
|
* which is not derived from or based on XviD. |
43 |
|
* |
44 |
|
* Note that people who make modified versions of XviD are not obligated |
45 |
|
* to grant this special exception for their modified versions; it is |
46 |
|
* their choice whether to do so. The GNU General Public License gives |
47 |
|
* permission to release a modified version without this exception; this |
48 |
|
* exception also makes it possible to release a modified version which |
49 |
|
* carries forward this exception. |
50 |
|
* |
51 |
|
* $Id: decoder.h,v 1.12 2002-11-26 23:44:09 edgomez Exp $ |
52 |
|
* |
53 |
|
****************************************************************************/ |
54 |
|
|
55 |
#ifndef _DECODER_H_ |
#ifndef _DECODER_H_ |
56 |
#define _DECODER_H_ |
#define _DECODER_H_ |
57 |
|
|
58 |
#include "xvid.h" |
#include "xvid.h" |
|
|
|
59 |
#include "portab.h" |
#include "portab.h" |
60 |
#include "global.h" |
#include "global.h" |
61 |
#include "image/image.h" |
#include "image/image.h" |
62 |
|
|
63 |
|
/***************************************************************************** |
64 |
|
* Structures |
65 |
|
****************************************************************************/ |
66 |
|
|
67 |
typedef struct |
typedef struct |
68 |
{ |
{ |
69 |
// bitstream |
/* bitstream */ |
70 |
|
|
71 |
uint32_t shape; |
uint32_t shape; |
72 |
uint32_t time_inc_bits; |
uint32_t time_inc_bits; |
74 |
uint32_t quant_type; |
uint32_t quant_type; |
75 |
uint32_t quarterpel; |
uint32_t quarterpel; |
76 |
|
|
77 |
// image |
uint32_t interlacing; |
78 |
|
uint32_t top_field_first; |
79 |
|
uint32_t alternate_vertical_scan; |
80 |
|
|
81 |
|
/* image */ |
82 |
|
|
83 |
uint32_t width; |
uint32_t width; |
84 |
uint32_t height; |
uint32_t height; |
86 |
uint32_t edged_height; |
uint32_t edged_height; |
87 |
|
|
88 |
IMAGE cur; |
IMAGE cur; |
89 |
IMAGE refn; |
IMAGE refn[3]; /* 0 -- last I or P VOP */ |
90 |
|
/* 1 -- first I or P */ |
91 |
|
/* 2 -- for interpolate mode B-frame */ |
92 |
IMAGE refh; |
IMAGE refh; |
93 |
IMAGE refv; |
IMAGE refv; |
94 |
IMAGE refhv; |
IMAGE refhv; |
95 |
|
|
96 |
// macroblock |
/* macroblock */ |
97 |
|
|
98 |
uint32_t mb_width; |
uint32_t mb_width; |
99 |
uint32_t mb_height; |
uint32_t mb_height; |
100 |
MACROBLOCK * mbs; |
MACROBLOCK * mbs; |
101 |
|
|
102 |
|
/* for B-frame */ |
103 |
} DECODER; |
int32_t frames; /* total frame number */ |
104 |
|
int8_t scalability; |
105 |
|
VECTOR p_fmv, p_bmv; /* pred forward & backward motion vector */ |
106 |
|
MACROBLOCK *last_mbs; /* last MB */ |
107 |
|
int64_t time; /* for record time */ |
108 |
|
int64_t time_base; |
109 |
|
int64_t last_time_base; |
110 |
|
int64_t last_non_b_time; |
111 |
|
uint32_t time_pp; |
112 |
|
uint32_t time_bp; |
113 |
|
uint8_t low_delay; /* low_delay flage (1 means no B_VOP) */ |
114 |
|
|
115 |
|
XVID_DEC_PICTURE* out_frm; /* This is used for slice rendering */ |
116 |
|
} |
117 |
|
DECODER; |
118 |
|
|
119 |
|
/***************************************************************************** |
120 |
|
* Decoder prototypes |
121 |
|
****************************************************************************/ |
122 |
|
|
123 |
void init_decoder(uint32_t cpu_flags); |
void init_decoder(uint32_t cpu_flags); |
124 |
|
|
125 |
int decoder_create(XVID_DEC_PARAM * param); |
int decoder_create(XVID_DEC_PARAM * param); |
126 |
int decoder_destroy(DECODER * dec); |
int decoder_destroy(DECODER * dec); |
127 |
int decoder_decode(DECODER * dec, XVID_DEC_FRAME * frame); |
int decoder_decode(DECODER * dec, |
128 |
|
XVID_DEC_FRAME * frame); |
129 |
|
|
130 |
|
|
131 |
#endif /* _DECODER_H_ */ |
#endif |