[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 1382, Mon Mar 22 22:36:25 2004 UTC revision 1566, Sun Dec 5 13:56:13 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.2 2004-03-22 22:36:24 edgomez Exp $   * $Id: estimation.h,v 1.8 2004-12-05 13:56:13 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 47  Line 46 
46    
47  #define BITS_MULT                               16  #define BITS_MULT                               16
48    
49  #define INITIAL_SKIP_THRESH             10  #define INITIAL_SKIP_THRESH             6
50  #define FINAL_SKIP_THRESH               50  #define FINAL_SKIP_THRESH               50
51  #define MAX_SAD00_FOR_SKIP              20  #define MAX_SAD00_FOR_SKIP              20
52  #define MAX_CHROMA_SAD_FOR_SKIP 22  #define MAX_CHROMA_SAD_FOR_SKIP 22
# 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 78  Line 75 
75          int temp[4];                            /* temporary space */          int temp[4];                            /* temporary space */
76          unsigned int dir;                       /* 'direction', set when better vector is found */          unsigned int dir;                       /* 'direction', set when better vector is found */
77          int chromaX, chromaY, chromaSAD; /* info to make ChromaSAD faster */          int chromaX, chromaY, chromaSAD; /* info to make ChromaSAD faster */
         VECTOR currentQMV2;                     /* extra vector for SubpelRefine_fast */  
         int32_t iMinSAD2;                       /* extra SAD value for SubpelRefine_fast */  
78    
79          /* general fields */          /* general fields */
80          int max_dx, min_dx, max_dy, min_dy; /* maximum range */          int max_dx, min_dx, max_dy, min_dy; /* maximum range */
# Line 98  Line 93 
93          int qpel;                                       /* if we're coding in qpel mode */          int qpel;                                       /* if we're coding in qpel mode */
94          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) */
95          int chroma;                                     /* should we include chroma SAD? */          int chroma;                                     /* should we include chroma SAD? */
         int rrv;                                        /* are we using reduced resolution? */  
96    
97          /* fields for interpolate and direct modes */          /* fields for interpolate and direct modes */
98          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 */
99          VECTOR bpredMV;                         /* backward prediction - used interpolate mode only */          VECTOR bpredMV;                         /* backward prediction - used in Interpolate-mode search only */
100          uint32_t bFcode;                        /* backward fcode - used as above */          uint32_t bFcode;                        /* backward fcode - used in Interpolate-mode search only */
101            int b_chromaX, b_chromaY;
102    
103          /* fields for direct mode */          /* fields for direct mode */
104          VECTOR directmvF[4];            /* scaled reference vectors */          VECTOR directmvF[4];            /* scaled reference vectors */
105          VECTOR directmvB[4];            /* as above */          VECTOR directmvB[4];
106          const VECTOR * referencemv; /* pointer to not-scaled reference vectors */          const VECTOR * referencemv; /* pointer to not-scaled reference vectors */
107    
108          /* BITS/R-D stuff */          /* BITS/R-D stuff */
# Line 117  Line 112 
112          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 */
113          const uint16_t * scan_table; /* current scan table */          const uint16_t * scan_table; /* current scan table */
114          const uint16_t * mpeg_quant_matrices;                   /* current MPEG quantization matrices */          const uint16_t * mpeg_quant_matrices;                   /* current MPEG quantization matrices */
115            int lambda[6];                          /* R-D lambdas for all 6 blocks */
116    
117  } SearchData;  } SearchData;
118    
# Line 140  Line 136 
136  int  int
137  xvid_me_SkipDecisionP(const IMAGE * current, const IMAGE * reference,  xvid_me_SkipDecisionP(const IMAGE * current, const IMAGE * reference,
138                                          const int x, const int y,                                          const int x, const int y,
139                                          const uint32_t stride, const uint32_t iQuant, int rrv);                                          const uint32_t stride, const uint32_t iQuant);
140    
141  #define iDiamondSize 2  #define iDiamondSize 2
142  typedef void  typedef void
# Line 150  Line 146 
146  MainSearchFunc xvid_me_DiamondSearch, xvid_me_AdvDiamondSearch, xvid_me_SquareSearch;  MainSearchFunc xvid_me_DiamondSearch, xvid_me_AdvDiamondSearch, xvid_me_SquareSearch;
147    
148  void  void
149  xvid_me_SubpelRefine(SearchData * const data, CheckFunc * const CheckCandidate);  xvid_me_SubpelRefine(VECTOR centerMV, SearchData * const data, CheckFunc * const CheckCandidate, int dir);
150    
151  void  void
152  SubpelRefine_Fast(SearchData * data, CheckFunc * CheckCandidate);  FullRefine_Fast(SearchData * data, CheckFunc * CheckCandidate, int direction);
153    
154  void  void
155  xvid_me_ModeDecision_RD(SearchData * const Data,  xvid_me_ModeDecision_RD(SearchData * const Data,
# Line 183  Line 179 
179                  const IMAGE * const vGMC,                  const IMAGE * const vGMC,
180                  const int coding_type);                  const int coding_type);
181    
182    void
183    ModeDecision_BVOP_RD(SearchData * const Data_d,
184                                             SearchData * const Data_b,
185                                             SearchData * const Data_f,
186                                             SearchData * const Data_i,
187                                             MACROBLOCK * const pMB,
188                                             const MACROBLOCK * const b_mb,
189                                             VECTOR * f_predMV,
190                                             VECTOR * b_predMV,
191                                             const uint32_t MotionFlags,
192                                             const MBParam * const pParam,
193                                             int x, int y);
194    
195    
196  #endif                                                  /* _ESTIMATION_H_ */  #endif                                                  /* _ESTIMATION_H_ */

Legend:
Removed from v.1382  
changed lines
  Added in v.1566

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