Diffstat (limited to 'core/multimedia/opieplayer/libmpeg3/video/mpeg3video.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/libmpeg3/video/mpeg3video.h | 180 |
1 files changed, 180 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/libmpeg3/video/mpeg3video.h b/core/multimedia/opieplayer/libmpeg3/video/mpeg3video.h new file mode 100644 index 0000000..2db62b0 --- a/dev/null +++ b/core/multimedia/opieplayer/libmpeg3/video/mpeg3video.h | |||
@@ -0,0 +1,180 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #ifndef MPEGVIDEO_H | ||
21 | #define MPEGVIDEO_H | ||
22 | |||
23 | #include "../bitstream.h" | ||
24 | #include "../mpeg3private.inc" | ||
25 | #include "idct.h" | ||
26 | #include "slice.h" | ||
27 | #include "../timecode.h" | ||
28 | |||
29 | /* zig-zag scan */ | ||
30 | extern unsigned char mpeg3_zig_zag_scan_nommx[64]; | ||
31 | extern unsigned char mpeg3_zig_zag_scan_mmx[64]; | ||
32 | |||
33 | /* alternate scan */ | ||
34 | extern unsigned char mpeg3_alternate_scan_nommx[64]; | ||
35 | extern unsigned char mpeg3_alternate_scan_mmx[64]; | ||
36 | |||
37 | /* default intra quantization matrix */ | ||
38 | extern unsigned char mpeg3_default_intra_quantizer_matrix[64]; | ||
39 | |||
40 | /* Frame rate table must agree with the one in the encoder */ | ||
41 | extern double mpeg3_frame_rate_table[16]; | ||
42 | |||
43 | /* non-linear quantization coefficient table */ | ||
44 | extern unsigned char mpeg3_non_linear_mquant_table[32]; | ||
45 | |||
46 | #define CHROMA420 1 /* chroma_format */ | ||
47 | #define CHROMA422 2 | ||
48 | #define CHROMA444 3 | ||
49 | |||
50 | #define TOP_FIELD 1 /* picture structure */ | ||
51 | #define BOTTOM_FIELD 2 | ||
52 | #define FRAME_PICTURE 3 | ||
53 | |||
54 | #define SEQ_ID 1 /* extension start code IDs */ | ||
55 | #define DISP_ID 2 | ||
56 | #define QUANT_ID 3 | ||
57 | #define SEQSCAL_ID 5 | ||
58 | #define PANSCAN_ID 7 | ||
59 | #define CODING_ID 8 | ||
60 | #define SPATSCAL_ID 9 | ||
61 | #define TEMPSCAL_ID 10 | ||
62 | |||
63 | #define ERROR (-1) | ||
64 | |||
65 | #define SC_NONE 0 /* scalable_mode */ | ||
66 | #define SC_DP 1 | ||
67 | #define SC_SPAT 2 | ||
68 | #define SC_SNR 3 | ||
69 | #define SC_TEMP 4 | ||
70 | |||
71 | #define I_TYPE 1 /* picture coding type */ | ||
72 | #define P_TYPE 2 | ||
73 | #define B_TYPE 3 | ||
74 | #define D_TYPE 4 | ||
75 | |||
76 | #define MB_INTRA 1 /* macroblock type */ | ||
77 | #define MB_PATTERN 2 | ||
78 | #define MB_BACKWARD 4 | ||
79 | #define MB_FORWARD 8 | ||
80 | #define MB_QUANT 16 | ||
81 | #define MB_WEIGHT 32 | ||
82 | #define MB_CLASS4 64 | ||
83 | |||
84 | #define MC_FIELD 1 /* motion_type */ | ||
85 | #define MC_FRAME 2 | ||
86 | #define MC_16X8 2 | ||
87 | #define MC_DMV 3 | ||
88 | |||
89 | #define MV_FIELD 0 /* mv_format */ | ||
90 | #define MV_FRAME 1 | ||
91 | |||
92 | #define CLIP(x) ((x) >= 0 ? ((x) < 255 ? (x) : 255) : 0) | ||
93 | |||
94 | /* Statically allocate as little as possible so a fake video struct */ | ||
95 | /* can be used for reading the GOP headers. */ | ||
96 | |||
97 | struct mpeg3video_rec | ||
98 | { | ||
99 | struct mpeg3_rec* file; | ||
100 | struct mpeg3_vtrack_rec* track; | ||
101 | |||
102 | /* ================================= Seeking variables ========================= */ | ||
103 | mpeg3_bits_t *vstream; | ||
104 | int decoder_initted; | ||
105 | unsigned char **output_rows; /* Output frame buffer supplied by user */ | ||
106 | int in_x, in_y, in_w, in_h, out_w, out_h; /* Output dimensions */ | ||
107 | int *x_table, *y_table; /* Location of every output pixel in the input */ | ||
108 | int color_model; | ||
109 | int want_yvu; /* Want to return a YUV frame */ | ||
110 | char *y_output, *u_output, *v_output; /* Output pointers for a YUV frame */ | ||
111 | |||
112 | mpeg3_slice_t slice_decoders[MPEG3_MAX_CPUS]; /* One slice decoder for every CPU */ | ||
113 | int total_slice_decoders; /* Total slice decoders in use */ | ||
114 | mpeg3_slice_buffer_t slice_buffers[MPEG3_MAX_CPUS]; /* Buffers for holding the slice data */ | ||
115 | int total_slice_buffers; /* Total buffers in the array to be decompressed */ | ||
116 | int slice_buffers_initialized; /* Total buffers initialized in the array */ | ||
117 | pthread_mutex_t slice_lock; /* Lock slice array while getting the next buffer */ | ||
118 | pthread_mutex_t test_lock; | ||
119 | |||
120 | int blockreadsize; | ||
121 | long maxframe; /* Max value of frame num to read */ | ||
122 | double percentage_seek; /* Perform a percentage seek before the next frame is read */ | ||
123 | int frame_seek; /* Perform a frame seek before the next frame is read */ | ||
124 | long framenum; /* Number of the next frame to be decoded */ | ||
125 | long last_number; /* Last framenum rendered */ | ||
126 | int found_seqhdr; | ||
127 | long bitrate; | ||
128 | mpeg3_timecode_t gop_timecode; /* Timecode for the last GOP header read. */ | ||
129 | |||
130 | /* These are only available from elementary streams. */ | ||
131 | long frames_per_gop; /* Frames per GOP after the first GOP. */ | ||
132 | long first_gop_frames; /* Frames in the first GOP. */ | ||
133 | long first_frame; /* Number of first frame stored in timecode */ | ||
134 | long last_frame; /* Last frame in file */ | ||
135 | |||
136 | /* ================================= Compression variables ===================== */ | ||
137 | /* Malloced frame buffers. 2 refframes are swapped in and out. */ | ||
138 | /* while only 1 auxframe is used. */ | ||
139 | unsigned char *yuv_buffer[5]; /* Make YVU buffers contiguous for all frames */ | ||
140 | unsigned char *oldrefframe[3], *refframe[3], *auxframe[3]; | ||
141 | unsigned char *llframe0[3], *llframe1[3]; | ||
142 | unsigned char *mpeg3_zigzag_scan_table; | ||
143 | unsigned char *mpeg3_alternate_scan_table; | ||
144 | // Source for the next frame presentation | ||
145 | unsigned char **output_src; | ||
146 | /* Pointers to frame buffers. */ | ||
147 | unsigned char *newframe[3]; | ||
148 | int horizontal_size, vertical_size, mb_width, mb_height; | ||
149 | int coded_picture_width, coded_picture_height; | ||
150 | int chroma_format, chrom_width, chrom_height, blk_cnt; | ||
151 | int pict_type; | ||
152 | int forw_r_size, back_r_size, full_forw, full_back; | ||
153 | int prog_seq, prog_frame; | ||
154 | int h_forw_r_size, v_forw_r_size, h_back_r_size, v_back_r_size; | ||
155 | int dc_prec, pict_struct, topfirst, frame_pred_dct, conceal_mv; | ||
156 | int intravlc; | ||
157 | int repeatfirst; | ||
158 | int repeat_count; /* Number of times to repeat the current frame * 100 since floating point is impossible in MMX */ | ||
159 | int current_repeat; /* Number of times the current frame has been repeated * 100 */ | ||
160 | int secondfield; | ||
161 | int skip_bframes; | ||
162 | int stwc_table_index, llw, llh, hm, hn, vm, vn; | ||
163 | int lltempref, llx0, lly0, llprog_frame, llfieldsel; | ||
164 | int matrix_coefficients; | ||
165 | int framerate_code; | ||
166 | float frame_rate; | ||
167 | long *cr_to_r, *cr_to_g, *cb_to_g, *cb_to_b; | ||
168 | long *cr_to_r_ptr, *cr_to_g_ptr, *cb_to_g_ptr, *cb_to_b_ptr; | ||
169 | int have_mmx; | ||
170 | int intra_quantizer_matrix[64], non_intra_quantizer_matrix[64]; | ||
171 | int chroma_intra_quantizer_matrix[64], chroma_non_intra_quantizer_matrix[64]; | ||
172 | int mpeg2; | ||
173 | int qscale_type, altscan; /* picture coding extension */ | ||
174 | int pict_scal; /* picture spatial scalable extension */ | ||
175 | int scalable_mode; /* sequence scalable extension */ | ||
176 | }; | ||
177 | |||
178 | typedef struct mpeg3video_rec mpeg3video_t; | ||
179 | |||
180 | #endif | ||