[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.2.5, Sun Mar 16 12:04:14 2003 UTC revision 1.27.4.1, Sat May 3 23:24:25 2003 UTC
# Line 52  Line 52 
52   * Constants   * Constants
53   ****************************************************************************/   ****************************************************************************/
54    
55    /* Quatization type */
56    #define H263_QUANT      0
57    #define MPEG4_QUANT     1
58    
59    /* Indicates no quantizer changes in INTRA_Q/INTER_Q modes */
60    #define NO_CHANGE 64
61    
62  /*****************************************************************************  /*****************************************************************************
63   * Types   * Types
64   ****************************************************************************/   ****************************************************************************/
65    
66  typedef int bool;  typedef int bool;
67    
68    typedef enum
69    {
70            I_VOP = 0,
71            P_VOP = 1,
72            B_VOP = 2,
73            S_VOP = 3
74    }
75    VOP_TYPE;
76    
77  /*****************************************************************************  /*****************************************************************************
78   * Structures   * Structures
79   ****************************************************************************/   ****************************************************************************/
80    
81  typedef struct  typedef struct
82  {  {
     /* --- constants --- */  
83          uint32_t width;          uint32_t width;
84          uint32_t height;          uint32_t height;
85    
# Line 73  Line 88 
88          uint32_t mb_width;          uint32_t mb_width;
89          uint32_t mb_height;          uint32_t mb_height;
90    
     int plugin_flags;  
   
91          /* frame rate increment & base */          /* frame rate increment & base */
92          uint32_t fincr;          uint32_t fincr;
93          uint32_t fbase;          uint32_t fbase;
94    
95          xvid_global_t global_flags;          /* constants */
96            int global;
97          int bquant_ratio;          int bquant_ratio;
98          int bquant_offset;          int bquant_offset;
99          int frame_drop_ratio;          int frame_drop_ratio;
100    
 #ifdef _SMP  
         int num_threads;  
 #endif  
   
   
101          int iMaxKeyInterval;          int iMaxKeyInterval;
102          int max_bframes;          int max_bframes;
103    
 /* --- inbetween vop stuff --- */  
104          /* rounding type; alternate 0-1 after each interframe */          /* rounding type; alternate 0-1 after each interframe */
105          /* 1 <= fixed_code <= 4          /* 1 <= fixed_code <= 4
106             automatically adjusted using motion vector statistics inside             automatically adjusted using motion vector statistics inside
107           */           */
108    
109          /* vars that not "quite" frame independant */          /* vars that not "quite" frame independant */
110            uint32_t m_quant_type;
111          uint32_t m_rounding_type;          uint32_t m_rounding_type;
112          uint32_t m_fcode;          uint32_t m_fcode;
113      xvid_vol_t vol_flags;          uint32_t m_quarterpel;
114            int m_reduced_resolution;       /* reduced_resolution_enable */
115    
116            HINTINFO *hint;
117    
118          int64_t m_stamp;          int64_t m_stamp;
119  }  }
# Line 117  Line 129 
129          int mblks;          int mblks;
130          int ublks;          int ublks;
131          int gblks;          int gblks;
132            int iblks;
133            int qblks;
134  }  }
135  Statistics;  Statistics;
136    
137    
 /* encoding queue */  
 typedef struct  
 {  
         xvid_enc_frame_t frame;  
         unsigned char quant_intra_matrix[64];  
         unsigned char quant_inter_matrix[64];  
         IMAGE image;  
 } QUEUEINFO;  
   
   
138  typedef struct  typedef struct
139  {  {
     int frame_num;  
     int fincr;  
         xvid_vol_t vol_flags;  
     xvid_vop_t vop_flags;  
         xvid_motion_t motion_flags;  
   
         int coding_type;  
140          uint32_t quant;          uint32_t quant;
141            uint32_t motion_flags;
142            uint32_t global_flags;
143    
144            VOP_TYPE coding_type;
145          uint32_t rounding_type;          uint32_t rounding_type;
146            uint32_t quarterpel;
147          uint32_t fcode;          uint32_t fcode;
148          uint32_t bcode;          uint32_t bcode;
149    
# Line 156  Line 158 
158          WARPPOINTS warp;                // as in bitstream          WARPPOINTS warp;                // as in bitstream
159          GMC_DATA gmc_data;              // common data for all MBs          GMC_DATA gmc_data;              // common data for all MBs
160    
     int length;         /* the encoded size of this frame */  
   
161          Statistics sStat;          Statistics sStat;
162  }  }
163  FRAMEINFO;  FRAMEINFO;
# Line 170  Line 170 
170          int iFrameNum;          int iFrameNum;
171          int bitrate;          int bitrate;
172    
     // plugins  
     unsigned int num_plugins;    /* note: we store plugin flags in MBPARAM */  
     xvid_enc_plugin_t * plugins;  
   
     // dquant  
   
     int * temp_dquants;  
   
173          // images          // images
174    
175          FRAMEINFO *current;          FRAMEINFO *current;
176          FRAMEINFO *reference;          FRAMEINFO *reference;
177    
178          IMAGE sOriginal;    /* original image copy for i/p frames */          IMAGE sOriginal;
     IMAGE sOriginal2;   /* original image copy for b-frames */  
179          IMAGE vInterH;          IMAGE vInterH;
180          IMAGE vInterV;          IMAGE vInterV;
181          IMAGE vInterVf;          IMAGE vInterVf;
# Line 197  Line 188 
188          int queue_head;          int queue_head;
189          int queue_tail;          int queue_tail;
190          int queue_size;          int queue_size;
191          QUEUEINFO *queue;          IMAGE *queue;
192    
193          /* bframe buffer */          /* bframe buffer */
194          int bframenum_head;          int bframenum_head;
# Line 208  Line 199 
199          IMAGE f_refh;          IMAGE f_refh;
200          IMAGE f_refv;          IMAGE f_refv;
201          IMAGE f_refhv;          IMAGE f_refhv;
202            int bframenum_dx50bvop;
     /* closed_gop fixup temporary storage */  
         int closed_bframenum; /* == -1 if there is no fixup intended */  
     QUEUEINFO closed_qframe;    /* qFrame, only valid when >= 0 */  
203    
204          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 */
205    
# Line 260  Line 248 
248    
249  void init_encoder(uint32_t cpu_flags);  void init_encoder(uint32_t cpu_flags);
250    
251  int enc_create(xvid_enc_create_t * create, xvid_enc_rc_t * rc);  int encoder_create(XVID_ENC_PARAM * pParam);
252  int enc_destroy(Encoder * pEnc);  int encoder_destroy(Encoder * pEnc);
253  int enc_encode(Encoder * pEnc,  int encoder_encode(Encoder * pEnc,
254                                     xvid_enc_frame_t * pFrame,                                     XVID_ENC_FRAME * pFrame,
255                                     xvid_enc_stats_t * stats);                                     XVID_ENC_STATS * pResult);
256    
257    int encoder_encode_bframes(Encoder * pEnc,
258                                       XVID_ENC_FRAME * pFrame,
259                                       XVID_ENC_STATS * pResult);
260    
261  #endif  #endif

Legend:
Removed from v.1.27.2.5  
changed lines
  Added in v.1.27.4.1

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