[cvs] / xvidcore / src / encoder.h Repository:
ViewVC logotype

Diff of /xvidcore/src/encoder.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.27, Sat Feb 15 15:22:17 2003 UTC revision 1.27.2.7, Mon May 12 12:28:31 2003 UTC
# Line 52  Line 52 
52   * Constants   * Constants
53   ****************************************************************************/   ****************************************************************************/
54    
 /* Quatization type */  
 #define H263_QUANT      0  
 #define MPEG4_QUANT     1  
   
 /* Indicates no quantizer changes in INTRA_Q/INTER_Q modes */  
 #define NO_CHANGE 64  
   
55  /*****************************************************************************  /*****************************************************************************
56   * Types   * Types
57   ****************************************************************************/   ****************************************************************************/
58    
59  typedef int bool;  typedef int bool;
60    
 typedef enum  
 {  
         I_VOP = 0,  
         P_VOP = 1,  
         B_VOP = 2,  
         S_VOP = 3  
 }  
 VOP_TYPE;  
   
61  /*****************************************************************************  /*****************************************************************************
62   * Structures   * Structures
63   ****************************************************************************/   ****************************************************************************/
64    
65  typedef struct  typedef struct
66  {  {
67        /* --- constants --- */
68          uint32_t width;          uint32_t width;
69          uint32_t height;          uint32_t height;
70    
# Line 88  Line 73 
73          uint32_t mb_width;          uint32_t mb_width;
74          uint32_t mb_height;          uint32_t mb_height;
75    
76        int plugin_flags;
77    
78          /* frame rate increment & base */          /* frame rate increment & base */
79          uint32_t fincr;          uint32_t fincr;
80          uint32_t fbase;          uint32_t fbase;
81    
82          /* constants */      int profile;
83          int global;  
84            xvid_global_t global_flags;
85          int bquant_ratio;          int bquant_ratio;
86          int bquant_offset;          int bquant_offset;
87          int frame_drop_ratio;          int frame_drop_ratio;
88    
89        int min_quant[3];
90        int max_quant[3];
91    
92    #ifdef _SMP
93            int num_threads;
94    #endif
95    
96    
97          int iMaxKeyInterval;          int iMaxKeyInterval;
98          int max_bframes;          int max_bframes;
99    
100    /* --- inbetween vop stuff --- */
101          /* rounding type; alternate 0-1 after each interframe */          /* rounding type; alternate 0-1 after each interframe */
102          /* 1 <= fixed_code <= 4          /* 1 <= fixed_code <= 4
103             automatically adjusted using motion vector statistics inside             automatically adjusted using motion vector statistics inside
104           */           */
105    
106          /* vars that not "quite" frame independant */          /* vars that not "quite" frame independant */
         uint32_t m_quant_type;  
107          uint32_t m_rounding_type;          uint32_t m_rounding_type;
108          uint32_t m_fcode;          uint32_t m_fcode;
109          uint32_t m_quarterpel;      xvid_vol_t vol_flags;
         int m_reduced_resolution;       /* reduced_resolution_enable */  
   
         HINTINFO *hint;  
110    
111          int64_t m_stamp;          int64_t m_stamp;
112  }  }
# Line 133  Line 126 
126  Statistics;  Statistics;
127    
128    
129    /* encoding queue */
130  typedef struct  typedef struct
131  {  {
132          uint32_t quant;          xvid_enc_frame_t frame;
133          uint32_t motion_flags;          unsigned char quant_intra_matrix[64];
134          uint32_t global_flags;          unsigned char quant_inter_matrix[64];
135            IMAGE image;
136    } QUEUEINFO;
137    
138    
139    typedef struct
140    {
141        int frame_num;
142        int fincr;
143            xvid_vol_t vol_flags;
144        xvid_vop_t vop_flags;
145            xvid_motion_t motion_flags;
146    
147          VOP_TYPE coding_type;          int coding_type;
148            uint32_t quant;
149          uint32_t rounding_type;          uint32_t rounding_type;
         uint32_t quarterpel;  
150          uint32_t fcode;          uint32_t fcode;
151          uint32_t bcode;          uint32_t bcode;
152    
# Line 156  Line 161 
161          WARPPOINTS warp;                // as in bitstream          WARPPOINTS warp;                // as in bitstream
162          GMC_DATA gmc_data;              // common data for all MBs          GMC_DATA gmc_data;              // common data for all MBs
163    
164        int length;         /* the encoded size of this frame */
165    
166          Statistics sStat;          Statistics sStat;
167  }  }
168  FRAMEINFO;  FRAMEINFO;
# Line 168  Line 175 
175          int iFrameNum;          int iFrameNum;
176          int bitrate;          int bitrate;
177    
178        // zones
179        unsigned int num_zones;
180        xvid_enc_zone_t * zones;
181    
182        // plugins
183        unsigned int num_plugins;    /* note: we store plugin flags in MBPARAM */
184        xvid_enc_plugin_t * plugins;
185    
186        // dquant
187    
188        int * temp_dquants;
189    
190          // images          // images
191    
192          FRAMEINFO *current;          FRAMEINFO *current;
193          FRAMEINFO *reference;          FRAMEINFO *reference;
194    
195          IMAGE sOriginal;          IMAGE sOriginal;    /* original image copy for i/p frames */
196        IMAGE sOriginal2;   /* original image copy for b-frames */
197          IMAGE vInterH;          IMAGE vInterH;
198          IMAGE vInterV;          IMAGE vInterV;
199          IMAGE vInterVf;          IMAGE vInterVf;
# Line 186  Line 206 
206          int queue_head;          int queue_head;
207          int queue_tail;          int queue_tail;
208          int queue_size;          int queue_size;
209          IMAGE *queue;          QUEUEINFO *queue;
210    
211          /* bframe buffer */          /* bframe buffer */
212          int bframenum_head;          int bframenum_head;
# Line 197  Line 217 
217          IMAGE f_refh;          IMAGE f_refh;
218          IMAGE f_refv;          IMAGE f_refv;
219          IMAGE f_refhv;          IMAGE f_refhv;
220          int bframenum_dx50bvop;  
221        /* closed_gop fixup temporary storage */
222            int closed_bframenum; /* == -1 if there is no fixup intended */
223        QUEUEINFO closed_qframe;    /* qFrame, only valid when >= 0 */
224    
225          int m_framenum; /* debug frame num counter; unlike iFrameNum, does not reset at ivop */          int m_framenum; /* debug frame num counter; unlike iFrameNum, does not reset at ivop */
226    
# Line 246  Line 269 
269    
270  void init_encoder(uint32_t cpu_flags);  void init_encoder(uint32_t cpu_flags);
271    
272  int encoder_create(XVID_ENC_PARAM * pParam);  int enc_create(xvid_enc_create_t * create);
273  int encoder_destroy(Encoder * pEnc);  int enc_destroy(Encoder * pEnc);
274  int encoder_encode(Encoder * pEnc,  int enc_encode(Encoder * pEnc,
275                                     XVID_ENC_FRAME * pFrame,                                     xvid_enc_frame_t * pFrame,
276                                     XVID_ENC_STATS * pResult);                                     xvid_enc_stats_t * stats);
   
 int encoder_encode_bframes(Encoder * pEnc,  
                                    XVID_ENC_FRAME * pFrame,  
                                    XVID_ENC_STATS * pResult);  
277    
278  #endif  #endif

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.27.2.7

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4