[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.13, Sat Dec 20 15:38:13 2003 UTC revision 1.1.2.15, Wed Jan 21 07:14:29 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  #define FAST1PASS
41    #define FAST1PASS_QPEL_TOO
42    
43    
44  /* context struct */  /* context struct */
# Line 128  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;
# Line 135  Line 142 
142                          data->quant = 2;                          data->quant = 2;
143    
144  #ifdef FAST1PASS  #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_FAST_MODEDECISION_RD;
165                            data->vop_flags &= ~XVID_VOP_TRELLISQUANT;
166                            data->vop_flags &= ~XVID_VOP_INTER4V;
167                            data->vop_flags &= ~XVID_VOP_HQACPRED;
168    
169                          data->motion_flags &= ~(XVID_ME_CHROMA_PVOP + XVID_ME_CHROMA_BVOP + XVID_ME_USESQUARES16                          /* Finnaly VOL flags
170                                                                          + XVID_ME_ADVANCEDDIAMOND16 + XVID_ME_EXTSEARCH16);                           *
171                             * NB: Qpel cannot be disable because this option really changes
172                          data->motion_flags |= XVID_ME_FAST_MODEINTERPOLATE + XVID_ME_SKIP_DELTASEARCH                           *     too much the texture data compressibility, and thus the
173                                                                          + XVID_ME_FASTREFINE16 + XVID_ME_BFRAME_EARLYSTOP;                           *     second pass gets confused by too much impredictability
174                             *     of frame sizes, and actually hurts quality */
175                          data->vop_flags &= ~(XVID_VOP_MODEDECISION_RD + XVID_VOP_FAST_MODEDECISION_RD  #ifdef FAST1PASS_QPEL_TOO
176                                                                  + XVID_VOP_TRELLISQUANT + XVID_VOP_INTER4V + XVID_VOP_HQACPRED);                          /* or maybe we can disable it after all? */
177                            data->vol_flags &= ~XVID_VOL_QUARTERPEL;
178    #endif
179                          data->vol_flags &= ~XVID_VOL_GMC;                          data->vol_flags &= ~XVID_VOL_GMC;
180  #endif  #endif
181                  }                  }

Legend:
Removed from v.1.1.2.13  
changed lines
  Added in v.1.1.2.15

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