[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 1105, Tue Jul 29 23:02:34 2003 UTC revision 1278, Thu Dec 18 17:43:32 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.6 2003-07-29 23:02:34 edgomez Exp $   * $Id: plugin_2pass1.c,v 1.1.2.11 2003-12-18 17:43:32 edgomez Exp $
26   *   *
27   *****************************************************************************/   *****************************************************************************/
28    
# Line 60  Line 60 
60      rc->stat_file = NULL;      rc->stat_file = NULL;
61    
62          /* Open the 1st pass file */          /* Open the 1st pass file */
63          if((rc->stat_file = fopen(param->filename, "w+")) == NULL)          if((rc->stat_file = fopen(param->filename, "w+b")) == NULL)
64                  return(XVID_ERR_FAIL);                  return(XVID_ERR_FAIL);
65    
66          /*          /*
67           * The File Header           * The File Header
68           */           */
69  #if 0          fprintf(rc->stat_file, "# XviD 2pass stat file (core version %d.%d.%d)\n",
70          fprintf(rc->stat_file, "# XviD 2pass stat file\n");                          XVID_VERSION_MAJOR(XVID_VERSION),
71      fprintf(rc->stat_file, "version %i.%i.%i\n",XVID_MAJOR(XVID_VERSION), XVID_MINOR(XVID_VERSION), XVID_PATCH(XVID_VERSION));                          XVID_VERSION_MINOR(XVID_VERSION),
72          fprintf(rc->stat_file, "start\n");                          XVID_VERSION_PATCH(XVID_VERSION));
73      fprintf(rc->stat_file, "type quantizer length kblocks mblocks ublocks\n");          fprintf(rc->stat_file, "# Please do not modify this file\n\n");
 #endif  
74    
75      rc->fq_error = 0;      rc->fq_error = 0;
76    
# Line 83  Line 82 
82  static int rc_2pass1_destroy(rc_2pass1_t * rc, xvid_plg_destroy_t * destroy)  static int rc_2pass1_destroy(rc_2pass1_t * rc, xvid_plg_destroy_t * destroy)
83  {  {
84          fclose(rc->stat_file);          fclose(rc->stat_file);
   
85          free(rc);          free(rc);
86          return(0);          return(0);
87  }  }
# Line 96  Line 94 
94              rc->fq_error += (double)data->zone->increment / (double)data->zone->base;              rc->fq_error += (double)data->zone->increment / (double)data->zone->base;
95              data->quant = (int)rc->fq_error;              data->quant = (int)rc->fq_error;
96              rc->fq_error -= data->quant;              rc->fq_error -= data->quant;
   
97          }else {          }else {
98              data->quant = 2;              data->quant = 2;
99          }          }
100      }      }
101      return 0;           return(0);
102  }  }
103    
104    
105  static int rc_2pass1_after(rc_2pass1_t * rc, xvid_plg_data_t * data)  static int rc_2pass1_after(rc_2pass1_t * rc, xvid_plg_data_t * data)
106  {  {
107          char type;          char type;
108            xvid_enc_stats_t *stats = &data->stats;
109    
110          /* Frame type in ascii I/P/B */          /* Frame type in ascii I/P/B */
111          switch(data->type) {          switch(stats->type) {
112          case XVID_TYPE_IVOP:          case XVID_TYPE_IVOP:
113                  type = 'i';                  type = 'i';
114                  break;                  break;
# Line 129  Line 127 
127    
128          /* write the resulting statistics */          /* write the resulting statistics */
129    
130          fprintf(rc->stat_file, "%c %d %d %d %d %d\n",          fprintf(rc->stat_file, "%c %d %d %d %d %d %d\n",
131          type,          type,
132                  data->quant,                          stats->quant,
133                  data->kblks,                          stats->kblks,
134          data->mblks,                          stats->mblks,
135          data->ublks,                          stats->ublks,
136          data->length);                          stats->length,
137                            stats->hlength);
138    
139          return(0);          return(0);
140  }  }
# Line 147  Line 146 
146      switch(opt)      switch(opt)
147      {      {
148      case XVID_PLG_INFO :      case XVID_PLG_INFO :
149            case XVID_PLG_FRAME :
150          return 0;          return 0;
151    
152      case XVID_PLG_CREATE :      case XVID_PLG_CREATE :

Legend:
Removed from v.1105  
changed lines
  Added in v.1278

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