[cvs] / xvidcore / src / utils / mbfunctions.h Repository:
ViewVC logotype

Diff of /xvidcore/src/utils/mbfunctions.h

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

revision 1.15, Sun Nov 17 00:51:10 2002 UTC revision 1.18, Sat Mar 22 14:04:48 2003 UTC
# Line 1  Line 1 
1  /*****************************************************************************  /**************************************************************************
2   *   *
3   *  XVID MPEG-4 VIDEO CODEC   *  Modifications:
  *  - Motion estimation fuctions header file -  
4   *   *
5   *  Copyright(C) 2002 Michael Militzer <isibaar@xvid.org>   *  29.03.2002 removed MBFieldToFrame - no longer used (transfers instead)
6     *  26.03.2002 interlacing support
7     *  02.12.2001 motion estimation/compensation split
8     *  16.11.2001 const/uint32_t changes to MBMotionEstComp()
9     *  26.08.2001 added inter4v_mode parameter to MBMotionEstComp()
10   *   *
11   *  This file is part of XviD, a free MPEG-4 video encoder/decoder   *  Michael Militzer <isibaar@videocoding.de>
12   *   *
13   *  XviD 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  
  *  
  *  Under section 8 of the GNU General Public License, the copyright  
  *  holders of XVID explicitly forbid distribution in the following  
  *  countries:  
  *  
  *    - Japan  
  *    - United States of America  
  *  
  *  Linking XviD statically or dynamically with other modules is making a  
  *  combined work based on XviD.  Thus, the terms and conditions of the  
  *  GNU General Public License cover the whole combination.  
  *  
  *  As a special exception, the copyright holders of XviD give you  
  *  permission to link XviD with independent modules that communicate with  
  *  XviD solely through the VFW1.1 and DShow interfaces, regardless of the  
  *  license terms of these independent modules, and to copy and distribute  
  *  the resulting combined work under terms of your choice, provided that  
  *  every copy of the combined work is accompanied by a complete copy of  
  *  the source code of XviD (the version of XviD used to produce the  
  *  combined work), being distributed under the terms of the GNU General  
  *  Public License plus this exception.  An independent module is a module  
  *  which is not derived from or based on XviD.  
  *  
  *  Note that people who make modified versions of XviD are not obligated  
  *  to grant this special exception for their modified versions; it is  
  *  their choice whether to do so.  The GNU General Public License gives  
  *  permission to release a modified version without this exception; this  
  *  exception also makes it possible to release a modified version which  
  *  carries forward this exception.  
  *  
  * $Id$  
  *  
  ****************************************************************************/  
14    
15  #ifndef _MBFUNCTIONS_H  #ifndef _ENCORE_BLOCK_H
16  #define _MBFUNCTIONS_H  #define _ENCORE_BLOCK_H
17    
18  #include "../encoder.h"  #include "../encoder.h"
19  #include "../bitstream/bitstream.h"  #include "../bitstream/bitstream.h"
20    
21  /*****************************************************************************  /** MotionEstimation **/
  * Prototypes  
  ****************************************************************************/  
   
   
 /* MotionEstimation */  
22    
23  bool MotionEstimation(MBParam * const pParam,  bool MotionEstimation(MBParam * const pParam,
24                                            FRAMEINFO * const current,                                            FRAMEINFO * const current,
# Line 75  Line 28 
28                                            const IMAGE * const pRefHV,                                            const IMAGE * const pRefHV,
29                                            const uint32_t iLimit);                                            const uint32_t iLimit);
30    
31    /** MBMotionCompensation **/
32    
33  bool SMP_MotionEstimation(MBParam * const pParam,  void
34                                                    FRAMEINFO * const current,  MBMotionCompensation(MACROBLOCK * const mb,
                                                   FRAMEINFO * const reference,  
                                                   const IMAGE * const pRefH,  
                                                   const IMAGE * const pRefV,  
                                                   const IMAGE * const pRefHV,  
                                                   const uint32_t iLimit);  
   
   
   
 /* MBMotionCompensation */  
   
 void MBMotionCompensation(MACROBLOCK * const pMB,  
                                                   const uint32_t j,  
35                                                    const uint32_t i,                                                    const uint32_t i,
36                                                    const IMAGE * const pRef,                                          const uint32_t j,
37                                                    const IMAGE * const pRefH,                                          const IMAGE * const ref,
38                                                    const IMAGE * const pRefV,                                          const IMAGE * const refh,
39                                                    const IMAGE * const pRefHV,                                          const IMAGE * const refv,
40                                                    IMAGE * const pCurrent,                                          const IMAGE * const refhv,
41                                                    int16_t dct_codes[6 * 64],                                          const IMAGE * const refGMC,
42                                            IMAGE * const cur,
43                                            int16_t * dct_codes,
44                                                    const uint32_t width,                                                    const uint32_t width,
45                                                    const uint32_t height,                                                    const uint32_t height,
46                                                    const uint32_t edged_width,                                                    const uint32_t edged_width,
47                                                    const uint32_t rounding);                                          const int32_t quarterpel,
48                                            const int reduced_resolution,
49                                            const int32_t rounding);
 /* MBTransQuant.c */  
   
 void MBTransQuantIntra(const MBParam * pParam,  
                                            FRAMEINFO * frame,  
                                            MACROBLOCK * pMB,  
                                            const uint32_t x_pos,    /* <-- The x position of the MB to be searched */  
                                            const uint32_t y_pos,    /* <-- The y position of the MB to be searched */  
                                            int16_t data[6 * 64],    /* <-> the data of the MB to be coded */  
                                            int16_t qcoeff[6 * 64]); /* <-> the quantized DCT coefficients */  
50    
51    /** MBTransQuant.c **/
52    
53    
54  void MBTransQuantIntra2(const MBParam * pParam,  void MBTransQuantIntra(const MBParam * const pParam,
55                                                  FRAMEINFO * frame,                                          FRAMEINFO * const frame,
56                                                  MACROBLOCK * pMB,                                          MACROBLOCK * const pMB,
57                                                  const uint32_t x_pos,    /* <-- The x position of the MB to be searched */                                                  const uint32_t x_pos,    /* <-- The x position of the MB to be searched */
58                                                  const uint32_t y_pos,    /* <-- The y position of the MB to be searched */                                                  const uint32_t y_pos,    /* <-- The y position of the MB to be searched */
59                                                  int16_t data[6 * 64],    /* <-> the data of the MB to be coded */                                                  int16_t data[6 * 64],    /* <-> the data of the MB to be coded */
60                                                  int16_t qcoeff[6 * 64]); /* <-> the quantized DCT coefficients */                                                  int16_t qcoeff[6 * 64]); /* <-> the quantized DCT coefficients */
61    
62    uint8_t MBTransQuantInter(const MBParam * const pParam,
63                                                    FRAMEINFO * const frame,
64  uint8_t MBTransQuantInter(const MBParam * pParam,                                                  MACROBLOCK * const pMB,
                                                   FRAMEINFO * frame,  
                                                   MACROBLOCK * pMB,  
                                                   const uint32_t x_pos,  
                                                   const uint32_t y_pos,  
                                                   int16_t data[6 * 64],  
                                                   int16_t qcoeff[6 * 64]);  
   
   
 uint8_t MBTransQuantInter2(const MBParam * pParam,  
                                                    FRAMEINFO * frame,  
                                                    MACROBLOCK * pMB,  
65                                                     const uint32_t x_pos,                                                     const uint32_t x_pos,
66                                                     const uint32_t y_pos,                                                     const uint32_t y_pos,
67                                                     int16_t data[6 * 64],                                                     int16_t data[6 * 64],
# Line 148  Line 73 
73                                                            int16_t data[6 * 64],                                                            int16_t data[6 * 64],
74                                                            int16_t qcoeff[6 * 64]);                                                            int16_t qcoeff[6 * 64]);
75    
76  void MBTrans(const MBParam * pParam,  /** interlacing **/
                          FRAMEINFO * frame,  
                          MACROBLOCK * pMB,  
                          const uint32_t x_pos,  
                          const uint32_t y_pos,  
                          int16_t data[6 * 64]);  
   
 void MBfDCT(const MBParam * pParam,  
                         FRAMEINFO * frame,  
                         MACROBLOCK * pMB,  
                         int16_t data[6 * 64]);  
   
 uint8_t MBQuantInter(const MBParam * pParam,  
                                          const int iQuant,  
                                          int16_t data[6 * 64],  
                                          int16_t qcoeff[6 * 64]);  
   
 void MBQuantDeQuantIntra(const MBParam * pParam,  
                                                  FRAMEINFO * frame,  
                                                  MACROBLOCK *pMB,  
                                                  int16_t qcoeff[6 * 64],  
                                                  int16_t data[6*64]);  
   
 void MBQuantIntra(const MBParam * pParam,  
                                   FRAMEINFO * frame,  
                                   MACROBLOCK *pMB,  
                                   int16_t data[6*64],  
                                   int16_t qcoeff[6 * 64]);  
   
 void MBDeQuantIntra(const MBParam * pParam,  
                                         const int iQuant,  
                                         int16_t qcoeff[6 * 64],  
                                         int16_t data[6*64]);  
   
 void MBDeQuantInter(const MBParam * pParam,  
                                         const int iQuant,  
                                         int16_t data[6 * 64],  
                                         int16_t qcoeff[6 * 64],  
                                         const uint8_t cbp);  
   
77    
78  void MBiDCT(int16_t data[6 * 64],  uint32_t MBDecideFieldDCT(int16_t data[6 * 64]);        /* <- decide whether to use field-based DCT
79                          const uint8_t cbp);                                                                                                                  for interlacing */
80    
81    typedef uint32_t (MBFIELDTEST) (int16_t data[6 * 64]);  /* function pointer for field test */
82    typedef MBFIELDTEST *MBFIELDTEST_PTR;
83    
84  void MBTransAdd(const MBParam * pParam,  /* global field test pointer for xvid.c */
85                                  FRAMEINFO * frame,  extern MBFIELDTEST_PTR MBFieldTest;
                                 MACROBLOCK * pMB,  
                                 const uint32_t x_pos,  
                                 const uint32_t y_pos,  
                                 int16_t data[6 * 64],  
                                 const uint8_t cbp);  
86    
87    /* field test implementations */
88    MBFIELDTEST MBFieldTest_c;
89  /* interlacing */  MBFIELDTEST MBFieldTest_mmx;
   
 uint32_t MBDecideFieldDCT(int16_t data[6 * 64]); /* <- decide whether to use field-based DCT for interlacing */  
90    
91  void MBFrameToField(int16_t data[6 * 64]);       /* de-interlace vertical Y blocks */  void MBFrameToField(int16_t data[6 * 64]);       /* de-interlace vertical Y blocks */
92    
93    
94  /* MBCoding.c */  /** MBCoding.c **/
   
 void MBSkip(Bitstream * bs); /* just the bitstream. Since MB is skipped, no info is needed */  
   
95    
96  void MBCoding(const FRAMEINFO * frame, /* <-- the parameter for coding of the bitstream */  void MBCoding(const FRAMEINFO * const frame,    /* <-- the parameter for coding of the bitstream */
97                            MACROBLOCK * pMB,        /* <-- Info of the MB to be coded */                            MACROBLOCK * pMB,        /* <-- Info of the MB to be coded */
98                            int16_t qcoeff[6 * 64],  /* <-- the quantized DCT coefficients */                            int16_t qcoeff[6 * 64],  /* <-- the quantized DCT coefficients */
99                            Bitstream * bs,          /* <-> the bitstream */                            Bitstream * bs,          /* <-> the bitstream */

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.18

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