2 // This is the header file describing
3 // the entrance function of the encoder core
10 typedef struct _ENC_PARAM_
{
11 int x_dim
; // the x dimension of the frames to be encoded
12 int y_dim
; // the y dimension of the frames to be encoded
13 float framerate
;// the frame rate of the sequence to be encoded
14 long bitrate
; // the bitrate of the target encoded stream
15 long rc_period
; // the intended rate control averaging period
16 long rc_reaction_period
; // the reation period for rate control
17 long rc_reaction_ratio
; // the ratio for down/up rate control
18 long max_key_interval
; // the maximum interval between key frames
19 int max_quantizer
; // the upper limit of the quantizer
20 int min_quantizer
; // the lower limit of the quantizer
21 int search_range
; // the forward search range for motion estimation
24 typedef struct _ENC_FRAME_
{
25 void *image
; // the image frame to be encoded
26 void *bitstream
;// the buffer for encoded bitstream
27 long length
; // the length of the encoded bitstream
31 typedef struct _ENC_RESULT_
{
32 int isKeyFrame
; // the current frame is encoded as a key frame
35 // the prototype of the encore() - main encode engine entrance
37 unsigned long handle
, // handle - the handle of the calling entity, must be unique
38 unsigned long enc_opt
, // enc_opt - the option for encoding, see below
39 void *param1
, // param1 - the parameter 1 (its actually meaning depends on enc_opt
40 void *param2
); // param2 - the parameter 2 (its actually meaning depends on enc_opt
42 // encore options (the enc_opt parameter of encore())
43 #define ENC_OPT_WRITE 1024 // write the reconstruct image to files (for debuging)
44 #define ENC_OPT_INIT 32768 // initialize the encoder for an handle
45 #define ENC_OPT_RELEASE 65536 // release all the resource associated with the handle
47 // return code of encore()
50 #define ENC_BAD_FORMAT 2
53 // Set global variables for an encoding session
54 void encore_set_global(ENC_PARAM
*param
);