--- encoder.h 2002/05/06 10:07:19 1.7 +++ encoder.h 2010/09/13 07:38:09 1.33 @@ -1,195 +1,268 @@ -/************************************************************************** +/***************************************************************************** * - * Modifications: + * XVID MPEG-4 VIDEO CODEC + * - Encoder related header - * - * 22.08.2001 added support for EXT_MODE encoding mode - * support for EXTENDED API - * 22.08.2001 fixed bug in iDQtab + * Copyright(C) 2002-2003 Michael Militzer + * 2002-2003 Peter Ross * - * Michael Militzer + * This program is free software ; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation ; either version 2 of the License, or + * (at your option) any later version. * - **************************************************************************/ + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY ; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program ; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id: encoder.h,v 1.33 2010/09/13 07:38:09 Isibaar Exp $ + * + ****************************************************************************/ #ifndef _ENCODER_H_ #define _ENCODER_H_ - #include "xvid.h" - #include "portab.h" #include "global.h" -#include "image/image.h" - - -#define H263_QUANT 0 -#define MPEG4_QUANT 1 - -typedef uint32_t bool; - - -typedef enum -{ - I_VOP = 0, - P_VOP = 1, - B_VOP = 2 -} -VOP_TYPE; - -/*********************************** - - Encoding Parameters - -************************************/ +/***************************************************************************** + * Constants + ****************************************************************************/ + +/* lambda base exponential. 1<= 0 */ + + /* multithreaded stuff */ + int num_threads; /* number of additional threads */ + SMPmotionData * motionData; /* data structures used to pass all thread-specific data */ + + int m_framenum; /* debug frame num counter; unlike iFrameNum, does not reset at ivop */ + + float fMvPrevSigma; +} Encoder; + +/***************************************************************************** + * Inline functions + ****************************************************************************/ -void init_encoder(uint32_t cpu_flags); - -int encoder_create(XVID_ENC_PARAM * pParam); -int encoder_destroy(Encoder * pEnc); -int encoder_encode(Encoder * pEnc, XVID_ENC_FRAME * pFrame, XVID_ENC_STATS * pResult); - -static __inline uint8_t get_fcode(uint16_t sr) +static __inline uint8_t +get_fcode(uint16_t sr) { - if (sr <= 16) + if (sr <= 16) return 1; - else if (sr <= 32) + else if (sr <= 32) return 2; - else if (sr <= 64) + else if (sr <= 64) return 3; - else if (sr <= 128) + else if (sr <= 128) return 4; - else if (sr <= 256) + else if (sr <= 256) return 5; - else if (sr <= 512) + else if (sr <= 512) return 6; - else if (sr <= 1024) + else if (sr <= 1024) return 7; - else + else return 0; } -#endif /* _ENCODER_H_ */ +/***************************************************************************** + * Prototypes + ****************************************************************************/ + +void init_encoder(uint32_t cpu_flags); + +int enc_create(xvid_enc_create_t * create); +int enc_destroy(Encoder * pEnc); +int enc_encode(Encoder * pEnc, + xvid_enc_frame_t * pFrame, + xvid_enc_stats_t * stats); + +#endif