summaryrefslogtreecommitdiff
path: root/apps/plugins/mpegplayer/mpeg2_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/mpegplayer/mpeg2_internal.h')
-rw-r--r--apps/plugins/mpegplayer/mpeg2_internal.h78
1 files changed, 43 insertions, 35 deletions
diff --git a/apps/plugins/mpegplayer/mpeg2_internal.h b/apps/plugins/mpegplayer/mpeg2_internal.h
index 1ec85c60f1..ba46b85ac4 100644
--- a/apps/plugins/mpegplayer/mpeg2_internal.h
+++ b/apps/plugins/mpegplayer/mpeg2_internal.h
@@ -20,26 +20,28 @@
20 * along with this program; if not, write to the Free Software 20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */ 22 */
23 23#ifndef MPEG2_INTERNAL_H
24#define MPEG2_INTERNAL_H
25
24#include "config.h" /* for Rockbox CPU_ #defines */ 26#include "config.h" /* for Rockbox CPU_ #defines */
25 27
26/* macroblock modes */ 28/* macroblock modes */
27#define MACROBLOCK_INTRA 1 29#define MACROBLOCK_INTRA 1
28#define MACROBLOCK_PATTERN 2 30#define MACROBLOCK_PATTERN 2
29#define MACROBLOCK_MOTION_BACKWARD 4 31#define MACROBLOCK_MOTION_BACKWARD 4
30#define MACROBLOCK_MOTION_FORWARD 8 32#define MACROBLOCK_MOTION_FORWARD 8
31#define MACROBLOCK_QUANT 16 33#define MACROBLOCK_QUANT 16
32#define DCT_TYPE_INTERLACED 32 34#define DCT_TYPE_INTERLACED 32
33/* motion_type */ 35/* motion_type */
34#define MOTION_TYPE_SHIFT 6 36#define MOTION_TYPE_SHIFT 6
35#define MC_FIELD 1 37#define MC_FIELD 1
36#define MC_FRAME 2 38#define MC_FRAME 2
37#define MC_16X8 2 39#define MC_16X8 2
38#define MC_DMV 3 40#define MC_DMV 3
39 41
40/* picture structure */ 42/* picture structure */
41#define TOP_FIELD 1 43#define TOP_FIELD 1
42#define BOTTOM_FIELD 2 44#define BOTTOM_FIELD 2
43#define FRAME_PICTURE 3 45#define FRAME_PICTURE 3
44 46
45/* picture coding type */ 47/* picture coding type */
@@ -50,18 +52,20 @@
50 52
51typedef void mpeg2_mc_fct (uint8_t *, const uint8_t *, int, int); 53typedef void mpeg2_mc_fct (uint8_t *, const uint8_t *, int, int);
52 54
53typedef struct { 55typedef struct
56{
54 uint8_t * ref[2][3]; 57 uint8_t * ref[2][3];
55 uint8_t ** ref2[2]; 58 uint8_t ** ref2[2];
56 int pmv[2][2]; 59 int pmv[2][2];
57 int f_code[2]; 60 int f_code[2];
58} motion_t; 61} motion_t;
59 62
60typedef void motion_parser_t (mpeg2_decoder_t * decoder, 63typedef void motion_parser_t(mpeg2_decoder_t * decoder,
61 motion_t * motion, 64 motion_t * motion,
62 mpeg2_mc_fct * const * table); 65 mpeg2_mc_fct * const * table);
63 66
64struct mpeg2_decoder_s { 67struct mpeg2_decoder_s
68{
65 /* first, state that carries information from one macroblock to the */ 69 /* first, state that carries information from one macroblock to the */
66 /* next inside a slice, and is never used outside of mpeg2_slice() */ 70 /* next inside a slice, and is never used outside of mpeg2_slice() */
67 71
@@ -102,7 +106,7 @@ struct mpeg2_decoder_s {
102 106
103 uint8_t * picture_dest[3]; 107 uint8_t * picture_dest[3];
104 void (* convert) (void * convert_id, uint8_t * const * src, 108 void (* convert) (void * convert_id, uint8_t * const * src,
105 unsigned int v_offset); 109 unsigned int v_offset);
106 void * convert_id; 110 void * convert_id;
107 111
108 int dmv_offset; 112 int dmv_offset;
@@ -152,11 +156,13 @@ struct mpeg2_decoder_s {
152 int mpeg1; 156 int mpeg1;
153}; 157};
154 158
155typedef struct { 159typedef struct
160{
156 mpeg2_fbuf_t fbuf; 161 mpeg2_fbuf_t fbuf;
157} fbuf_alloc_t; 162} fbuf_alloc_t;
158 163
159struct mpeg2dec_s { 164struct mpeg2dec_s
165{
160 mpeg2_decoder_t decoder; 166 mpeg2_decoder_t decoder;
161 167
162 mpeg2_info_t info; 168 mpeg2_info_t info;
@@ -208,8 +214,8 @@ struct mpeg2dec_s {
208 unsigned int convert_id_size; 214 unsigned int convert_id_size;
209 int convert_stride; 215 int convert_stride;
210 void (* convert_start) (void * id, const mpeg2_fbuf_t * fbuf, 216 void (* convert_start) (void * id, const mpeg2_fbuf_t * fbuf,
211 const mpeg2_picture_t * picture, 217 const mpeg2_picture_t * picture,
212 const mpeg2_gop_t * gop); 218 const mpeg2_gop_t * gop);
213 219
214 uint8_t * buf_start; 220 uint8_t * buf_start;
215 uint8_t * buf_end; 221 uint8_t * buf_end;
@@ -222,19 +228,6 @@ struct mpeg2dec_s {
222 uint8_t new_quantizer_matrix[4][64]; 228 uint8_t new_quantizer_matrix[4][64];
223}; 229};
224 230
225typedef struct {
226#ifdef ARCH_PPC
227 uint8_t regv[12*16];
228#endif
229 int dummy;
230} cpu_state_t;
231
232/* cpu_accel.c */
233uint32_t mpeg2_detect_accel (void);
234
235/* cpu_state.c */
236void mpeg2_cpu_state_init (uint32_t accel);
237
238/* decode.c */ 231/* decode.c */
239mpeg2_state_t mpeg2_seek_header (mpeg2dec_t * mpeg2dec); 232mpeg2_state_t mpeg2_seek_header (mpeg2dec_t * mpeg2dec);
240mpeg2_state_t mpeg2_parse_header (mpeg2dec_t * mpeg2dec); 233mpeg2_state_t mpeg2_parse_header (mpeg2dec_t * mpeg2dec);
@@ -257,11 +250,26 @@ void mpeg2_set_fbuf (mpeg2dec_t * mpeg2dec, int b_type);
257 250
258/* idct.c */ 251/* idct.c */
259void mpeg2_idct_init (void); 252void mpeg2_idct_init (void);
253void mpeg2_idct_copy(int16_t * block, uint8_t * dest,
254 const int stride);
255void mpeg2_idct_add(const int last, int16_t * block,
256 uint8_t * dest, const int stride);
257
258extern const uint8_t default_mpeg2_scan_norm[64];
259extern const uint8_t default_mpeg2_scan_alt[64];
260extern uint8_t mpeg2_scan_norm[64];
261extern uint8_t mpeg2_scan_alt[64];
260 262
261/* motion_comp.c */ 263/* motion_comp.c */
262void mpeg2_mc_init (void); 264void mpeg2_mc_init (void);
263 265
264typedef struct { 266typedef struct
267{
265 mpeg2_mc_fct * put [8]; 268 mpeg2_mc_fct * put [8];
266 mpeg2_mc_fct * avg [8]; 269 mpeg2_mc_fct * avg [8];
267} mpeg2_mc_t; 270} mpeg2_mc_t;
271
272extern const mpeg2_mc_t mpeg2_mc;
273
274#endif /* MPEG2_INTERNAL_H */
275