00001 /* mpg2enc.h, defines and types */ 00002 00003 /* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */ 00004 00005 /* 00006 * Disclaimer of Warranty 00007 * 00008 * These software programs are available to the user without any license fee or 00009 * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims 00010 * any and all warranties, whether express, implied, or statuary, including any 00011 * implied warranties or merchantability or of fitness for a particular 00012 * purpose. In no event shall the copyright-holder be liable for any 00013 * incidental, punitive, or consequential damages of any kind whatsoever 00014 * arising from the use of these programs. 00015 * 00016 * This disclaimer of warranty extends to the user of these programs and user's 00017 * customers, employees, agents, transferees, successors, and assigns. 00018 * 00019 * The MPEG Software Simulation Group does not represent or warrant that the 00020 * programs furnished hereunder are free of infringement of any third-party 00021 * patents. 00022 * 00023 * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware, 00024 * are subject to royalty fees to patent holders. Many of these patents are 00025 * general enough such that they are unavoidable regardless of implementation 00026 * design. 00027 * 00028 */ 00029 00030 #ifndef MPEG2ENC_H 00031 #define MPEG2ENC_H 00032 00033 #define PICTURE_START_CODE 0x100L 00034 #define SLICE_MIN_START 0x101L 00035 #define SLICE_MAX_START 0x1AFL 00036 #define USER_START_CODE 0x1B2L 00037 #define SEQ_START_CODE 0x1B3L 00038 #define EXT_START_CODE 0x1B5L 00039 #define SEQ_END_CODE 0x1B7L 00040 #define GOP_START_CODE 0x1B8L 00041 #define ISO_END_CODE 0x1B9L 00042 #define PACK_START_CODE 0x1BAL 00043 #define SYSTEM_START_CODE 0x1BBL 00044 00045 /* picture coding type */ 00046 #define I_TYPE 1 00047 #define P_TYPE 2 00048 #define B_TYPE 3 00049 #define D_TYPE 4 00050 00051 /* picture structure */ 00052 #define TOP_FIELD 1 00053 #define BOTTOM_FIELD 2 00054 #define FRAME_PICTURE 3 00055 00056 /* macroblock type */ 00057 #define MB_INTRA 1 00058 #define MB_PATTERN 2 00059 #define MB_BACKWARD 4 00060 #define MB_FORWARD 8 00061 #define MB_QUANT 16 00062 00063 /* motion_type */ 00064 #define MC_FIELD 1 00065 #define MC_FRAME 2 00066 #define MC_16X8 2 00067 #define MC_DMV 3 00068 00069 /* mv_format */ 00070 #define MV_FIELD 0 00071 #define MV_FRAME 1 00072 00073 /* chroma_format */ 00074 #define CHROMA420 1 00075 #define CHROMA422 2 00076 #define CHROMA444 3 00077 00078 /* extension start code IDs */ 00079 00080 #define SEQ_ID 1 00081 #define DISP_ID 2 00082 #define QUANT_ID 3 00083 #define SEQSCAL_ID 5 00084 #define PANSCAN_ID 7 00085 #define CODING_ID 8 00086 #define SPATSCAL_ID 9 00087 #define TEMPSCAL_ID 10 00088 00089 /* inputtype */ 00090 #define T_Y_U_V 0 00091 #define T_YUV 1 00092 #define T_PPM 2 00093 #define T_QUICKTIME 3 00094 #define T_MPEG 4 00095 #define T_STDIN 5 00096 #define T_BUFFERS 6 00097 00098 #define BUFFER_ALIGN 16 00099 00100 /* macroblock information */ 00101 struct mbinfo { 00102 int mb_type; /* intra/forward/backward/interpolated */ 00103 int motion_type; /* frame/field/16x8/dual_prime */ 00104 int dct_type; /* field/frame DCT */ 00105 int mquant; /* quantization parameter */ 00106 int cbp; /* coded block pattern */ 00107 int skipped; /* skipped macroblock */ 00108 int MV[2][2][2]; /* motion vectors */ 00109 int mv_field_sel[2][2]; /* motion vertical field select */ 00110 int dmvector[2]; /* dual prime vectors */ 00111 double act; /* activity measure */ 00112 int i_act; /* Activity measure if intra coded (I/P-frame) */ 00113 int p_act; /* Activity measure for *forward* prediction (P-frame) */ 00114 int b_act; /* Activity measure if bi-directionally coded (B-frame) */ 00115 int var; /* Macroblock luminance variance (measure of activity) */ 00116 short (*dctblocks)[64]; 00117 }; 00118 00119 /* motion data */ 00120 struct motion_data { 00121 int forw_hor_f_code,forw_vert_f_code; /* vector range */ 00122 int sxf,syf; /* search range */ 00123 int back_hor_f_code,back_vert_f_code; 00124 int sxb,syb; 00125 }; 00126 00127 00128 00129 00130 #endif
1.5.5