[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 977, Tue Apr 8 14:01:35 2003 UTC revision 1032, Sat May 17 13:37:49 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.2 2003-04-08 14:01:09 suxen_drol Exp $   * $Id: plugin_2pass1.c,v 1.1.2.4 2003-05-17 13:36:38 suxen_drol Exp $
26   *   *
27   *****************************************************************************/   *****************************************************************************/
28    
# Line 36  Line 36 
36  typedef struct  typedef struct
37  {  {
38          FILE * stat_file;          FILE * stat_file;
39    
40        double fq_error;
41  } rc_2pass1_t;  } rc_2pass1_t;
42    
43    
# Line 68  Line 70 
70          fprintf(rc->stat_file, "start\n");          fprintf(rc->stat_file, "start\n");
71      fprintf(rc->stat_file, "type quantizer length kblocks mblocks ublocks\n");  */      fprintf(rc->stat_file, "type quantizer length kblocks mblocks ublocks\n");  */
72    
73        rc->fq_error = 0;
74    
75      *handle = rc;      *handle = rc;
76          return(0);          return(0);
77  }  }
# Line 75  Line 79 
79    
80  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)
81  {  {
     //fprintf(rc->stat_file, "stop\n");  
82          fclose(rc->stat_file);          fclose(rc->stat_file);
83    
84          free(rc);          free(rc);
# Line 85  Line 88 
88    
89  static int rc_2pass1_before(rc_2pass1_t * rc, xvid_plg_data_t * data)  static int rc_2pass1_before(rc_2pass1_t * rc, xvid_plg_data_t * data)
90  {  {
91         if (data->quant <= 0) {
92            if (data->zone && data->zone->mode == XVID_ZONE_QUANT) {
93                rc->fq_error += (double)data->zone->increment / (double)data->zone->base;
94                data->quant = (int)rc->fq_error;
95                rc->fq_error -= data->quant;
96    
97            }else {
98      data->quant = 2;      data->quant = 2;
99      data->type = XVID_TYPE_AUTO;          }
100        }
101      return 0;      return 0;
102  }  }
103    

Legend:
Removed from v.977  
changed lines
  Added in v.1032

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