[svn] / branches / dev-api-4 / xvidcore / src / plugins / plugin_2pass1.c Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/src/plugins/plugin_2pass1.c

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

revision 1290, Sat Dec 20 22:20:54 2003 UTC revision 1291, Sat Dec 20 22:22:26 2003 UTC
# Line 22  Line 22 
22   *  along with this program; if not, write to the Free Software   *  along with this program; if not, write to the Free Software
23   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24   *   *
25   * $Id: plugin_2pass1.c,v 1.1.2.13 2003-12-20 15:38:13 syskin Exp $   * $Id: plugin_2pass1.c,v 1.1.2.14 2003-12-20 22:22:26 edgomez Exp $
26   *   *
27   *****************************************************************************/   *****************************************************************************/
28    
# 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    
42    
# Line 128  Line 131 
131  {  {
132           if (data->quant <= 0) {           if (data->quant <= 0) {
133                  if (data->zone && data->zone->mode == XVID_ZONE_QUANT) {                  if (data->zone && data->zone->mode == XVID_ZONE_QUANT) {
134                            /* We disable no options in quant zones, as their implementation is
135                             * based on the fact we do first pass exactly the same way as the
136                             * second one to have exact zone size */
137                          rc->fq_error += (double)data->zone->increment / (double)data->zone->base;                          rc->fq_error += (double)data->zone->increment / (double)data->zone->base;
138                          data->quant = (int)rc->fq_error;                          data->quant = (int)rc->fq_error;
139                          rc->fq_error -= data->quant;                          rc->fq_error -= data->quant;
# Line 135  Line 141 
141                          data->quant = 2;                          data->quant = 2;
142    
143  #ifdef FAST1PASS  #ifdef FAST1PASS
144                            /* Given the fact our 2pass algorithm is based on very simple
145                          data->motion_flags &= ~(XVID_ME_CHROMA_PVOP + XVID_ME_CHROMA_BVOP + XVID_ME_USESQUARES16                           * rules, we can disable some options that are too CPU intensive
146                                                                          + XVID_ME_ADVANCEDDIAMOND16 + XVID_ME_EXTSEARCH16);                           * and do not provide the 2nd pass any benefit */
147    
148                          data->motion_flags |= XVID_ME_FAST_MODEINTERPOLATE + XVID_ME_SKIP_DELTASEARCH                          /* First disable some motion flags */
149                                                                          + XVID_ME_FASTREFINE16 + XVID_ME_BFRAME_EARLYSTOP;                          data->motion_flags &= ~XVID_ME_CHROMA_PVOP;
150                            data->motion_flags &= ~XVID_ME_CHROMA_BVOP;
151                          data->vop_flags &= ~(XVID_VOP_MODEDECISION_RD + XVID_VOP_FAST_MODEDECISION_RD                          data->motion_flags &= ~XVID_ME_USESQUARES16;
152                                                                  + XVID_VOP_TRELLISQUANT + XVID_VOP_INTER4V + XVID_VOP_HQACPRED);                          data->motion_flags &= ~XVID_ME_ADVANCEDDIAMOND16;
153                            data->motion_flags &= ~XVID_ME_EXTSEARCH16;
154    
155                            /* And enable fast replacements */
156                            data->motion_flags |= XVID_ME_FAST_MODEINTERPOLATE;
157                            data->motion_flags |= XVID_ME_SKIP_DELTASEARCH;
158                            data->motion_flags |= XVID_ME_FASTREFINE16;
159                            data->motion_flags |= XVID_ME_BFRAME_EARLYSTOP;
160    
161                            /* Now VOP flags (no fast replacements) */
162                            data->vop_flags &= ~XVID_VOP_MODEDECISION_RD;
163                            data->vop_flags &= ~XVID_VOP_FAST_MODEDECISION_RD;
164                            data->vop_flags &= ~XVID_VOP_TRELLISQUANT;
165                            data->vop_flags &= ~XVID_VOP_INTER4V;
166                            data->vop_flags &= ~XVID_VOP_HQACPRED;
167    
168                            /* Finnaly VOL flags
169                             *
170                             * NB: Qpel cannot be disable because this option really changes
171                             *     too much the texture data compressibility, and thus the
172                             *     second pass gets confused by too much impredictability
173                             *     of frame sizes, and actually hurts quality */
174                          data->vol_flags &= ~XVID_VOL_GMC;                          data->vol_flags &= ~XVID_VOL_GMC;
175  #endif  #endif
176                  }                  }

Legend:
Removed from v.1290  
changed lines
  Added in v.1291

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