--- branches/dev-api-4/xvidcore/src/motion/motion_est.h 2003/05/14 13:21:47 1021 +++ branches/dev-api-4/xvidcore/src/motion/motion_est.h 2003/05/14 18:46:39 1022 @@ -26,7 +26,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: motion_est.h,v 1.3.2.5 2003-04-08 15:35:52 edgomez Exp $ + * $Id: motion_est.h,v 1.3.2.6 2003-05-14 18:46:39 edgomez Exp $ * ***************************************************************************/ @@ -137,6 +137,8 @@ const VECTOR * referencemv; // _BITS stuff int16_t * dctSpace; + uint32_t iQuant; + uint32_t quant_type; } SearchData; @@ -217,16 +219,14 @@ const int x, const int y, const uint32_t MotionFlags, - const uint32_t GlobalFlags, - const uint32_t iQuant, + const uint32_t VopFlags, + const uint32_t VolFlags, SearchData * const Data, const MBParam * const pParam, const MACROBLOCK * const pMBs, const MACROBLOCK * const prevMBs, - int inter4v, MACROBLOCK * const pMB); - static WARPPOINTS GlobalMotionEst(const MACROBLOCK * const pMBs, const MBParam * const pParam, @@ -281,6 +281,7 @@ #include "../quant/quant_mpeg4.h" #include "../quant/quant_h263.h" #include "../bitstream/vlc_codes.h" +#include "../dct/fdct.h" static int CountMBBitsInter(SearchData * const Data, @@ -300,5 +301,29 @@ int CodeCoeffIntra_CalcBits(const int16_t qcoeff[64], const uint16_t * zigzag); int CodeCoeffInter_CalcBits(const int16_t qcoeff[64], const uint16_t * zigzag); +/* +static int +CountDistortionSkip(const SearchData * const Data); +*/ +static __inline unsigned int +Block_CalcBits(uint16_t * const coeff, + uint16_t * const data, + const uint32_t quant, const int quant_type, + uint32_t * cbp, + const int block, + const int RD) +{ + int sum; + + fdct(data); + + if (quant_type == 0) sum = quant_inter(coeff, data, quant); + else sum = quant4_inter(coeff, data, quant); + + if (sum > 0) { + *cbp |= 1 << (5 - block); + return CodeCoeffInter_CalcBits(coeff, scan_tables[0]); + } else return 0; +} #endif /* _MOTION_EST_H_ */