00001 00002 // This is the header file describing 00003 // the entrance function of the encoder core 00004 // or the encore ... 00005 00006 #ifdef __cplusplus 00007 extern "C" { 00008 #endif 00009 00010 typedef struct _ENC_PARAM_ { 00011 int x_dim; // the x dimension of the frames to be encoded 00012 int y_dim; // the y dimension of the frames to be encoded 00013 float framerate;// the frame rate of the sequence to be encoded 00014 long bitrate; // the bitrate of the target encoded stream 00015 long rc_period; // the intended rate control averaging period 00016 long rc_reaction_period; // the reation period for rate control 00017 long rc_reaction_ratio; // the ratio for down/up rate control 00018 long max_key_interval; // the maximum interval between key frames 00019 int max_quantizer; // the upper limit of the quantizer 00020 int min_quantizer; // the lower limit of the quantizer 00021 int search_range; // the forward search range for motion estimation 00022 } ENC_PARAM; 00023 00024 typedef struct _ENC_FRAME_ { 00025 void *image; // the image frame to be encoded 00026 void *bitstream;// the buffer for encoded bitstream 00027 long length; // the length of the encoded bitstream 00028 int quant; 00029 } ENC_FRAME; 00030 00031 typedef struct _ENC_RESULT_ { 00032 int isKeyFrame; // the current frame is encoded as a key frame 00033 } ENC_RESULT; 00034 00035 // the prototype of the encore() - main encode engine entrance 00036 int encore( 00037 unsigned long handle, // handle - the handle of the calling entity, must be unique 00038 unsigned long enc_opt, // enc_opt - the option for encoding, see below 00039 void *param1, // param1 - the parameter 1 (its actually meaning depends on enc_opt 00040 void *param2); // param2 - the parameter 2 (its actually meaning depends on enc_opt 00041 00042 // encore options (the enc_opt parameter of encore()) 00043 #define ENC_OPT_WRITE 1024 // write the reconstruct image to files (for debuging) 00044 #define ENC_OPT_INIT 32768 // initialize the encoder for an handle 00045 #define ENC_OPT_RELEASE 65536 // release all the resource associated with the handle 00046 00047 // return code of encore() 00048 #define ENC_OK 0 00049 #define ENC_MEMORY 1 00050 #define ENC_BAD_FORMAT 2 00051 00052 00053 // Set global variables for an encoding session 00054 void encore_set_global(ENC_PARAM *param); 00055 00056 #ifdef __cplusplus 00057 } 00058 #endif 00059 00060 00061 00062 00063
1.5.5