1 2 /* 3 * xa_xmpg.c 4 * 5 * Copyright (C) 1995-1998,1999 by Mark Podlipec. 6 * All rights reserved. 7 * 8 * This software may be freely used, copied and redistributed without 9 * fee for non-commerical purposes provided that this copyright 10 * notice is preserved intact on all copies. 11 * 12 * There is no warranty or other guarantee of fitness of this software. 13 * It is provided solely "as is". The author disclaims all 14 * responsibility and liability with respect to this software's usage 15 * or its effect upon hardware or computer systems. 16 * 17 */ 18 19 20 21 #define MPG_TYPE_I 1 22 #define MPG_TYPE_P 2 23 #define MPG_TYPE_B 3 24 25 #define MPG_PIC_START 0x00 26 #define MPG_MIN_SLICE 0x01 27 #define MPG_MAX_SLICE 0xaf 28 #define MPG_USR_START 0xb2 29 #define MPG_SEQ_START 0xb3 30 #define MPG_EXT_START 0xb5 31 #define MPG_SEQ_END 0xb7 32 #define MPG_GOP_START 0xb8 33 34 #define MPG_ISO_END 0xb9 35 36 #define MPG_PACK_START 0xba 37 #define MPG_SYS_START 0xbb 38 39 #define MPG_UNK_BC 0xbc 40 #define MPG_UNK_BE 0xbe 41 #define MPG_UNK_C0 0xc0 42 #define MPG_UNK_E0 0xe0 43 44 45 typedef struct STRUCT_SEQ_HDR 46 { 47 xaULONG width; 48 xaULONG height; 49 xaULONG aspect; 50 xaULONG pic_rate; 51 xaULONG bit_rate; 52 xaULONG vbv_buff_size; 53 xaULONG constrained; 54 xaULONG intra_flag; 55 xaULONG non_intra_flag; 56 xaUBYTE intra_qtab[64]; 57 xaUBYTE non_intra_qtab[64]; 58 } MPG_SEQ_HDR; 59 60 typedef struct STRUCT_SLICE_HDR 61 { 62 xaULONG vert_pos; 63 xaULONG fpos; 64 xaULONG fsize; 65 XA_ACTION *act; 66 struct STRUCT_SLICE_HDR *next; 67 } MPG_SLICE_HDR; 68 69 typedef struct STRUCT_PIC_HDR 70 { 71 xaULONG type; 72 xaULONG time; 73 xaULONG vbv_delay; /* not used */ 74 xaULONG full_forw_flag; 75 xaULONG forw_r_size; 76 xaULONG forw_f; 77 xaULONG full_back_flag; 78 xaULONG back_r_size; 79 xaULONG back_f; 80 xaULONG vert_pos; 81 xaULONG q_scale; 82 MPG_SEQ_HDR *seq_hdr; 83 xaULONG slice_cnt; 84 MPG_SLICE_HDR *slice_1st; 85 MPG_SLICE_HDR *slice_last; 86 MPG_SLICE_HDR slices[2]; /* must be last */ 87 } MPG_PIC_HDR; 88 89 90