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

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

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

revision 1443, Thu Apr 22 13:39:33 2004 UTC revision 1569, Thu Dec 9 04:58:12 2004 UTC
# Line 21  Line 21 
21   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
22   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
23   *   *
24   * $Id: estimation.h,v 1.4 2004-04-22 13:39:33 syskin Exp $   * $Id: estimation.h,v 1.10 2004-12-09 04:58:12 syskin Exp $
25   *   *
26   ****************************************************************************/   ****************************************************************************/
27    
# Line 30  Line 30 
30    
31  #include "../portab.h"  #include "../portab.h"
32  #include "../global.h"  #include "../global.h"
 #include "../image/reduced.h"  
33    
34  /* hard coded motion search parameters */  /* hard coded motion search parameters */
35    
# Line 60  Line 59 
59  #define CHECK_CANDIDATE(X,Y,D) { \  #define CHECK_CANDIDATE(X,Y,D) { \
60          CheckCandidate((X),(Y), data, (D) ); }          CheckCandidate((X),(Y), data, (D) ); }
61    
 #define RRV_MV_SCALEDOWN(a)     ( (a)>=0 ? (a+1)/2 : (a-1)/2 )  
   
62  /* fast ((A)/2)*2 */  /* fast ((A)/2)*2 */
63  #define EVEN(A)         (((A)<0?(A)+1:(A)) & ~1)  #define EVEN(A)         (((A)<0?(A)+1:(A)) & ~1)
64    
# Line 71  Line 68 
68    
69  typedef struct  typedef struct
70  {  {
71            int max_dx, min_dx, max_dy, min_dy; /* maximum search range */
72    
73          /* data modified by CheckCandidates */          /* data modified by CheckCandidates */
74          int32_t iMinSAD[5];                     /* smallest SADs found so far */          int32_t iMinSAD[5];                     /* smallest SADs found so far */
75          VECTOR currentMV[5];            /* best vectors found so far */          VECTOR currentMV[5];            /* best vectors found so far */
# Line 80  Line 79 
79          int chromaX, chromaY, chromaSAD; /* info to make ChromaSAD faster */          int chromaX, chromaY, chromaSAD; /* info to make ChromaSAD faster */
80    
81          /* general fields */          /* general fields */
         int max_dx, min_dx, max_dy, min_dy; /* maximum range */  
82          uint32_t rounding;                      /* rounding type in use */          uint32_t rounding;                      /* rounding type in use */
83          VECTOR predMV;                          /* vector which predicts current vector */          VECTOR predMV;                          /* vector which predicts current vector */
84          const uint8_t * RefP[6];        /* reference pictures - N, V, H, HV, cU, cV */          const uint8_t * RefP[6];        /* reference pictures - N, V, H, HV, cU, cV */
# Line 96  Line 94 
94          int qpel;                                       /* if we're coding in qpel mode */          int qpel;                                       /* if we're coding in qpel mode */
95          int qpel_precision;                     /* if X and Y are in qpel precision (refinement probably) */          int qpel_precision;                     /* if X and Y are in qpel precision (refinement probably) */
96          int chroma;                                     /* should we include chroma SAD? */          int chroma;                                     /* should we include chroma SAD? */
         int rrv;                                        /* are we using reduced resolution? */  
97    
98          /* fields for interpolate and direct modes */          /* fields for interpolate and direct modes */
99          const uint8_t * b_RefP[6];      /* backward reference pictures - N, V, H, HV, cU, cV */          const uint8_t * b_RefP[6];      /* backward reference pictures - N, V, H, HV, cU, cV */
100          VECTOR bpredMV;                         /* backward prediction - used interpolate mode only */          VECTOR bpredMV;                         /* backward prediction - used in Interpolate-mode search only */
101          uint32_t bFcode;                        /* backward fcode - used as above */          uint32_t bFcode;                        /* backward fcode - used in Interpolate-mode search only */
102          int b_chromaX, b_chromaY;          int b_chromaX, b_chromaY;
103    
104          /* fields for direct mode */          /* fields for direct mode */
105          VECTOR directmvF[4];            /* scaled reference vectors */          VECTOR directmvF[4];            /* scaled reference vectors */
106          VECTOR directmvB[4];            /* as above */          VECTOR directmvB[4];
107          const VECTOR * referencemv; /* pointer to not-scaled reference vectors */          const VECTOR * referencemv; /* pointer to not-scaled reference vectors */
108    
109          /* BITS/R-D stuff */          /* BITS/R-D stuff */
# Line 116  Line 113 
113          unsigned int cbp[2];                                    /* CBP of the best vector found so far + cbp for inter4v search */          unsigned int cbp[2];                                    /* CBP of the best vector found so far + cbp for inter4v search */
114          const uint16_t * scan_table; /* current scan table */          const uint16_t * scan_table; /* current scan table */
115          const uint16_t * mpeg_quant_matrices;                   /* current MPEG quantization matrices */          const uint16_t * mpeg_quant_matrices;                   /* current MPEG quantization matrices */
116            int lambda[6];                          /* R-D lambdas for all 6 blocks */
117            unsigned int quant_sq;          /* quant squared - saves many multiplications in VHQ */
118    
119  } SearchData;  } SearchData;
120    
# Line 139  Line 138 
138  int  int
139  xvid_me_SkipDecisionP(const IMAGE * current, const IMAGE * reference,  xvid_me_SkipDecisionP(const IMAGE * current, const IMAGE * reference,
140                                          const int x, const int y,                                          const int x, const int y,
141                                          const uint32_t stride, const uint32_t iQuant, int rrv);                                          const uint32_t stride, const uint32_t iQuant);
142    
143  #define iDiamondSize 2  #define iDiamondSize 2
144  typedef void  typedef void
# Line 149  Line 148 
148  MainSearchFunc xvid_me_DiamondSearch, xvid_me_AdvDiamondSearch, xvid_me_SquareSearch;  MainSearchFunc xvid_me_DiamondSearch, xvid_me_AdvDiamondSearch, xvid_me_SquareSearch;
149    
150  void  void
151  xvid_me_SubpelRefine(SearchData * const data, CheckFunc * const CheckCandidate, int dir);  xvid_me_SubpelRefine(VECTOR centerMV, SearchData * const data, CheckFunc * const CheckCandidate, int dir);
152    
153  void  void
154  FullRefine_Fast(SearchData * data, CheckFunc * CheckCandidate, int direction);  FullRefine_Fast(SearchData * data, CheckFunc * CheckCandidate, int direction);
# Line 182  Line 181 
181                  const IMAGE * const vGMC,                  const IMAGE * const vGMC,
182                  const int coding_type);                  const int coding_type);
183    
184    void
185    ModeDecision_BVOP_RD(SearchData * const Data_d,
186                                             SearchData * const Data_b,
187                                             SearchData * const Data_f,
188                                             SearchData * const Data_i,
189                                             MACROBLOCK * const pMB,
190                                             const MACROBLOCK * const b_mb,
191                                             VECTOR * f_predMV,
192                                             VECTOR * b_predMV,
193                                             const uint32_t MotionFlags,
194                                             const MBParam * const pParam,
195                                             int x, int y);
196    
197    unsigned int
198    getMinFcode(const int MVmax);
199    
200  #endif                                                  /* _ESTIMATION_H_ */  #endif                                                  /* _ESTIMATION_H_ */

Legend:
Removed from v.1443  
changed lines
  Added in v.1569

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