[cvs] / xvidcore / src / plugins / plugin_2pass1.c Repository:
ViewVC logotype

Diff of /xvidcore/src/plugins/plugin_2pass1.c

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

revision 1.1.2.12, Sat Dec 20 15:30:03 2003 UTC revision 1.3, Sun Jul 18 12:46:44 2004 UTC
# Line 34  Line 34 
34  #include "../image/image.h"  #include "../image/image.h"
35    
36    
37    /* This preprocessor constant controls wheteher or not, first pass is done
38     * using fast ME routines to speed up the 2pass process at the expense of
39     * less precise first pass stats */
40    #define FAST1PASS
41    #define FAST1PASS_QPEL_TOO
42    
43    
44  /* context struct */  /* context struct */
45  typedef struct  typedef struct
46  {  {
# Line 125  Line 132 
132  {  {
133           if (data->quant <= 0) {           if (data->quant <= 0) {
134                  if (data->zone && data->zone->mode == XVID_ZONE_QUANT) {                  if (data->zone && data->zone->mode == XVID_ZONE_QUANT) {
135                            /* We disable no options in quant zones, as their implementation is
136                             * based on the fact we do first pass exactly the same way as the
137                             * second one to have exact zone size */
138                          rc->fq_error += (double)data->zone->increment / (double)data->zone->base;                          rc->fq_error += (double)data->zone->increment / (double)data->zone->base;
139                          data->quant = (int)rc->fq_error;                          data->quant = (int)rc->fq_error;
140                          rc->fq_error -= data->quant;                          rc->fq_error -= data->quant;
141                  } else {                  } else {
142                          data->quant = 2;                          data->quant = 2;
143    
144    #ifdef FAST1PASS
145                            /* Given the fact our 2pass algorithm is based on very simple
146                             * rules, we can disable some options that are too CPU intensive
147                             * and do not provide the 2nd pass any benefit */
148    
149                            /* First disable some motion flags */
150                            data->motion_flags &= ~XVID_ME_CHROMA_PVOP;
151                            data->motion_flags &= ~XVID_ME_CHROMA_BVOP;
152                            data->motion_flags &= ~XVID_ME_USESQUARES16;
153                            data->motion_flags &= ~XVID_ME_ADVANCEDDIAMOND16;
154                            data->motion_flags &= ~XVID_ME_EXTSEARCH16;
155    
156                            /* And enable fast replacements */
157                            data->motion_flags |= XVID_ME_FAST_MODEINTERPOLATE;
158                            data->motion_flags |= XVID_ME_SKIP_DELTASEARCH;
159                            data->motion_flags |= XVID_ME_FASTREFINE16;
160                            data->motion_flags |= XVID_ME_BFRAME_EARLYSTOP;
161    
162                            /* Now VOP flags (no fast replacements) */
163                            data->vop_flags &= ~XVID_VOP_MODEDECISION_RD;
164                            data->vop_flags &= ~XVID_VOP_RD_BVOP;
165                            data->vop_flags &= ~XVID_VOP_FAST_MODEDECISION_RD;
166                            data->vop_flags &= ~XVID_VOP_TRELLISQUANT;
167                            data->vop_flags &= ~XVID_VOP_INTER4V;
168                            data->vop_flags &= ~XVID_VOP_HQACPRED;
169    
170                            /* Finnaly VOL flags
171                             *
172                             * NB: Qpel cannot be disable because this option really changes
173                             *     too much the texture data compressibility, and thus the
174                             *     second pass gets confused by too much impredictability
175                             *     of frame sizes, and actually hurts quality */
176    #ifdef FAST1PASS_QPEL_TOO
177                            /* or maybe we can disable it after all? */
178                            data->vol_flags &= ~XVID_VOL_QUARTERPEL;
179    #endif
180                            data->vol_flags &= ~XVID_VOL_GMC;
181    #endif
182                  }                  }
183          }          }
184           return(0);           return(0);

Legend:
Removed from v.1.1.2.12  
changed lines
  Added in v.1.3

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