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

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

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

revision 1.4, Thu Apr 22 13:39:33 2004 UTC revision 1.12.2.1, Fri Dec 9 05:07:31 2005 UTC
# 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 41  Line 40 
40  #define MV16_INTER_BIAS 450  #define MV16_INTER_BIAS 450
41    
42  /* vector map (vlc delta size) smoother parameters ! float !*/  /* vector map (vlc delta size) smoother parameters ! float !*/
43  #define NEIGH_TEND_16X16                10.5  #define NEIGH_TEND_16X16                0.6
44  #define NEIGH_TEND_8X8                  40.0  #define NEIGH_TEND_8X8                  1.5
45    
46  #define NEIGH_8X8_BIAS                  40  #define NEIGH_8X8_BIAS                  40
47    
48  #define BITS_MULT                               16  #define BITS_MULT                               16
# Line 60  Line 60 
60  #define CHECK_CANDIDATE(X,Y,D) { \  #define CHECK_CANDIDATE(X,Y,D) { \
61          CheckCandidate((X),(Y), data, (D) ); }          CheckCandidate((X),(Y), data, (D) ); }
62    
 #define RRV_MV_SCALEDOWN(a)     ( (a)>=0 ? (a+1)/2 : (a-1)/2 )  
   
63  /* fast ((A)/2)*2 */  /* fast ((A)/2)*2 */
64  #define EVEN(A)         (((A)<0?(A)+1:(A)) & ~1)  #define EVEN(A)         (((A)<0?(A)+1:(A)) & ~1)
65    
# Line 71  Line 69 
69    
70  typedef struct  typedef struct
71  {  {
72            int max_dx, min_dx, max_dy, min_dy; /* maximum search range */
73    
74          /* data modified by CheckCandidates */          /* data modified by CheckCandidates */
75          int32_t iMinSAD[5];                     /* smallest SADs found so far */          int32_t iMinSAD[5];                     /* smallest SADs found so far */
76          VECTOR currentMV[5];            /* best vectors found so far */          VECTOR currentMV[5];            /* best vectors found so far */
# Line 80  Line 80 
80          int chromaX, chromaY, chromaSAD; /* info to make ChromaSAD faster */          int chromaX, chromaY, chromaSAD; /* info to make ChromaSAD faster */
81    
82          /* general fields */          /* general fields */
         int max_dx, min_dx, max_dy, min_dy; /* maximum range */  
83          uint32_t rounding;                      /* rounding type in use */          uint32_t rounding;                      /* rounding type in use */
84          VECTOR predMV;                          /* vector which predicts current vector */          VECTOR predMV;                          /* vector which predicts current vector */
85          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 95 
95          int qpel;                                       /* if we're coding in qpel mode */          int qpel;                                       /* if we're coding in qpel mode */
96          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) */
97          int chroma;                                     /* should we include chroma SAD? */          int chroma;                                     /* should we include chroma SAD? */
         int rrv;                                        /* are we using reduced resolution? */  
98    
99          /* fields for interpolate and direct modes */          /* fields for interpolate and direct modes */
100          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 */
101          VECTOR bpredMV;                         /* backward prediction - used interpolate mode only */          VECTOR bpredMV;                         /* backward prediction - used in Interpolate-mode search only */
102          uint32_t bFcode;                        /* backward fcode - used as above */          uint32_t bFcode;                        /* backward fcode - used in Interpolate-mode search only */
103          int b_chromaX, b_chromaY;          int b_chromaX, b_chromaY;
104    
105          /* fields for direct mode */          /* fields for direct mode */
106          VECTOR directmvF[4];            /* scaled reference vectors */          VECTOR directmvF[4];            /* scaled reference vectors */
107          VECTOR directmvB[4];            /* as above */          VECTOR directmvB[4];
108          const VECTOR * referencemv; /* pointer to not-scaled reference vectors */          const VECTOR * referencemv; /* pointer to not-scaled reference vectors */
109    
110          /* BITS/R-D stuff */          /* BITS/R-D stuff */
# Line 116  Line 114 
114          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 */
115          const uint16_t * scan_table; /* current scan table */          const uint16_t * scan_table; /* current scan table */
116          const uint16_t * mpeg_quant_matrices;                   /* current MPEG quantization matrices */          const uint16_t * mpeg_quant_matrices;                   /* current MPEG quantization matrices */
117            int lambda[6];                          /* R-D lambdas for all 6 blocks */
118            unsigned int quant_sq;          /* quant squared - saves many multiplications in VHQ */
119    
120  } SearchData;  } SearchData;
121    
# Line 139  Line 139 
139  int  int
140  xvid_me_SkipDecisionP(const IMAGE * current, const IMAGE * reference,  xvid_me_SkipDecisionP(const IMAGE * current, const IMAGE * reference,
141                                          const int x, const int y,                                          const int x, const int y,
142                                          const uint32_t stride, const uint32_t iQuant, int rrv);                                          const uint32_t stride, const uint32_t iQuant);
143    
144  #define iDiamondSize 2  #define iDiamondSize 2
145  typedef void  typedef void
# Line 149  Line 149 
149  MainSearchFunc xvid_me_DiamondSearch, xvid_me_AdvDiamondSearch, xvid_me_SquareSearch;  MainSearchFunc xvid_me_DiamondSearch, xvid_me_AdvDiamondSearch, xvid_me_SquareSearch;
150    
151  void  void
152  xvid_me_SubpelRefine(SearchData * const data, CheckFunc * const CheckCandidate, int dir);  xvid_me_SubpelRefine(VECTOR centerMV, SearchData * const data, CheckFunc * const CheckCandidate, int dir);
153    
154  void  void
155  FullRefine_Fast(SearchData * data, CheckFunc * CheckCandidate, int direction);  FullRefine_Fast(SearchData * data, CheckFunc * CheckCandidate, int direction);
# Line 182  Line 182 
182                  const IMAGE * const vGMC,                  const IMAGE * const vGMC,
183                  const int coding_type);                  const int coding_type);
184    
185    void
186    ModeDecision_BVOP_RD(SearchData * const Data_d,
187                                             SearchData * const Data_b,
188                                             SearchData * const Data_f,
189                                             SearchData * const Data_i,
190                                             MACROBLOCK * const pMB,
191                                             const MACROBLOCK * const b_mb,
192                                             VECTOR * f_predMV,
193                                             VECTOR * b_predMV,
194                                             const uint32_t MotionFlags,
195                                             const MBParam * const pParam,
196                                             int x, int y,
197                                             int best_sad);
198    
199    unsigned int
200    getMinFcode(const int MVmax);
201    
202  #endif                                                  /* _ESTIMATION_H_ */  #endif                                                  /* _ESTIMATION_H_ */

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.12.2.1

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