/***************************************************************************** * * XVID MPEG-4 VIDEO CODEC * - Encoder related header - * * Copyright(C) 2002-2003 Michael Militzer * 2002-2003 Peter Ross * * 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.31 2006-02-24 08:46:22 syskin Exp $ * ****************************************************************************/ #ifndef _ENCODER_H_ #define _ENCODER_H_ #include "xvid.h" #include "portab.h" #include "global.h" /***************************************************************************** * 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 ****************************************************************************/ static __inline uint8_t get_fcode(uint16_t sr) { if (sr <= 16) return 1; else if (sr <= 32) return 2; else if (sr <= 64) return 3; else if (sr <= 128) return 4; else if (sr <= 256) return 5; else if (sr <= 512) return 6; else if (sr <= 1024) return 7; else return 0; } /***************************************************************************** * 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