comparison libmpcodecs/ve_xvid4.c @ 16602:4626c4d13e2a

make xvid encoding use the filename from -passlogfile to store and retreive pass information. Patch by Olivier Rolland < billl AH users POIS sf POIS net> Original thread: Date: Sep 25, 2005 9:41 PM Subject: [MPlayer-dev-eng] [PATCH] XviD and -passlogfile
author gpoirier
date Mon, 26 Sep 2005 10:43:34 +0000
parents 1218c5859ce8
children aede77b9e276
comparison
equal deleted inserted replaced
16601:d0239352b380 16602:4626c4d13e2a
55 #include <limits.h> 55 #include <limits.h>
56 #include <assert.h> 56 #include <assert.h>
57 57
58 #include "m_option.h" 58 #include "m_option.h"
59 59
60 #define XVID_FIRST_PASS_FILENAME "xvid-twopass.stats"
61 #define FINE (!0) 60 #define FINE (!0)
62 #define BAD (!FINE) 61 #define BAD (!FINE)
63 62
64 #define MAX_ZONES 64 63 #define MAX_ZONES 64
65 64
227 } 226 }
228 227
229 /***************************************************************************** 228 /*****************************************************************************
230 * Configuration options 229 * Configuration options
231 ****************************************************************************/ 230 ****************************************************************************/
231
232 extern char* passtmpfile;
232 233
233 static int xvidenc_bitrate = 0; 234 static int xvidenc_bitrate = 0;
234 static int xvidenc_pass = 0; 235 static int xvidenc_pass = 0;
235 static float xvidenc_quantizer = 0; 236 static float xvidenc_quantizer = 0;
236 237
1188 if(pass == MODE_2PASS1) { 1189 if(pass == MODE_2PASS1) {
1189 xvid_plugin_2pass1_t *pass1 = &mod->pass1; 1190 xvid_plugin_2pass1_t *pass1 = &mod->pass1;
1190 1191
1191 /* There is not much to initialize for this plugin */ 1192 /* There is not much to initialize for this plugin */
1192 pass1->version = XVID_VERSION; 1193 pass1->version = XVID_VERSION;
1193 pass1->filename = XVID_FIRST_PASS_FILENAME; 1194 pass1->filename = passtmpfile;
1194 1195
1195 create->plugins[create->num_plugins].func = xvid_plugin_2pass1; 1196 create->plugins[create->num_plugins].func = xvid_plugin_2pass1;
1196 create->plugins[create->num_plugins].param = pass1; 1197 create->plugins[create->num_plugins].param = pass1;
1197 create->num_plugins++; 1198 create->num_plugins++;
1198 1199
1204 if(pass == MODE_2PASS2) { 1205 if(pass == MODE_2PASS2) {
1205 xvid_plugin_2pass2_t *pass2 = &mod->pass2; 1206 xvid_plugin_2pass2_t *pass2 = &mod->pass2;
1206 1207
1207 /* There is not much left to initialize after dispatch settings */ 1208 /* There is not much left to initialize after dispatch settings */
1208 pass2->version = XVID_VERSION; 1209 pass2->version = XVID_VERSION;
1209 pass2->filename = XVID_FIRST_PASS_FILENAME; 1210 pass2->filename = passtmpfile;
1210 1211
1211 /* Positive bitrate values are bitrates as usual but if the 1212 /* Positive bitrate values are bitrates as usual but if the
1212 * value is negative it is considered as being a total size 1213 * value is negative it is considered as being a total size
1213 * to reach (in kilobytes) */ 1214 * to reach (in kilobytes) */
1214 if(xvidenc_bitrate > 0) { 1215 if(xvidenc_bitrate > 0) {