[svn] / trunk / xvidcore / src / motion / motion_est.h Repository:
ViewVC logotype

Diff of /trunk/xvidcore/src/motion/motion_est.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1015, Tue May 13 00:13:09 2003 UTC revision 1016, Tue May 13 12:48:20 2003 UTC
# Line 26  Line 26 
26   *  along with this program; if not, write to the Free Software   *  along with this program; if not, write to the Free Software
27   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
28   *   *
29   *  $Id: motion_est.h,v 1.6 2003-04-08 11:12:07 syskin Exp $   *  $Id: motion_est.h,v 1.7 2003-05-13 12:48:20 syskin Exp $
30   *   *
31   ***************************************************************************/   ***************************************************************************/
32    
# Line 137  Line 137 
137          const VECTOR * referencemv;          const VECTOR * referencemv;
138  // _BITS stuff  // _BITS stuff
139          int16_t * dctSpace;          int16_t * dctSpace;
140            uint32_t iQuant;
141            uint32_t quant_type;
142    
143  } SearchData;  } SearchData;
144    
# Line 218  Line 220 
220                  const int y,                  const int y,
221                  const uint32_t MotionFlags,                  const uint32_t MotionFlags,
222                  const uint32_t GlobalFlags,                  const uint32_t GlobalFlags,
                 const uint32_t iQuant,  
223                  SearchData * const Data,                  SearchData * const Data,
224                  const MBParam * const pParam,                  const MBParam * const pParam,
225                  const MACROBLOCK * const pMBs,                  const MACROBLOCK * const pMBs,
226                  const MACROBLOCK * const prevMBs,                  const MACROBLOCK * const prevMBs,
                 int inter4v,  
227                  MACROBLOCK * const pMB);                  MACROBLOCK * const pMB);
228    
229    
# Line 281  Line 281 
281  #include "../quant/quant_mpeg4.h"  #include "../quant/quant_mpeg4.h"
282  #include "../quant/quant_h263.h"  #include "../quant/quant_h263.h"
283  #include "../bitstream/vlc_codes.h"  #include "../bitstream/vlc_codes.h"
284    #include "../dct/fdct.h"
285    
286  static int  static int
287  CountMBBitsInter(SearchData * const Data,  CountMBBitsInter(SearchData * const Data,
# Line 300  Line 301 
301    
302  int CodeCoeffIntra_CalcBits(const int16_t qcoeff[64], const uint16_t * zigzag);  int CodeCoeffIntra_CalcBits(const int16_t qcoeff[64], const uint16_t * zigzag);
303  int CodeCoeffInter_CalcBits(const int16_t qcoeff[64], const uint16_t * zigzag);  int CodeCoeffInter_CalcBits(const int16_t qcoeff[64], const uint16_t * zigzag);
304    /*
305    static int
306    CountDistortionSkip(const SearchData * const Data);
307    */
308    static __inline unsigned int
309    Block_CalcBits(uint16_t * const coeff,
310                                            uint16_t * const data,
311                                            const uint32_t quant, const int quant_type,
312                                            uint32_t * cbp,
313                                            const int block,
314                                            const int RD)
315    {
316            int sum;
317    
318            fdct(data);
319    
320            if (quant_type == 0) sum = quant_inter(coeff, data, quant);
321            else sum = quant4_inter(coeff, data, quant);
322    
323            if (sum > 0) {
324                    *cbp |= 1 << (5 - block);
325                    return CodeCoeffInter_CalcBits(coeff, scan_tables[0]);
326            } else return 0;
327    }
328    
329    /* RD experiment. ignore.
330    static __inline unsigned int
331    Block_CalcBits( int16_t * const coeff,
332                                    int16_t * const data,
333                                    const uint32_t quant, const int quant_type,
334                                    uint32_t * cbp,
335                                    const int block,
336                                    const int RD)
337    {
338            int sum;
339            int bits;
340            const int lambda = quant*quant/2;
341            int distortion = 0;
342    
343            fdct(data);
344    
345            if (quant_type == 0) sum = quant_inter(coeff, data, quant);
346            else sum = quant4_inter(coeff, data, quant);
347    
348            if (sum > 0) {
349                    *cbp |= 1 << (5 - block);
350                    bits = CodeCoeffInter_CalcBits(coeff, scan_tables[0]);
351            } else bits = 0;
352    
353            if (RD) {
354                    int i;
355                    if (quant_type == 0) dequant_inter_c(coeff, coeff, quant);
356                    else dequant4_inter_c(coeff, coeff, quant);
357    
358                    for (i = 0; i < 64; i++) {
359                            distortion += (data[i] - coeff[i])*(data[i] - coeff[i]);
360                    }
361            }
362    
363            bits += distortion/lambda;
364    
365            return bits;
366    }
367    */
368    
369  #endif                                                  /* _MOTION_EST_H_ */  #endif                                                  /* _MOTION_EST_H_ */

Legend:
Removed from v.1015  
changed lines
  Added in v.1016

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4