25 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
26 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
27 |
* |
* |
28 |
* $Id: plugin_2pass2.c,v 1.1.2.24 2003-11-09 20:49:21 edgomez Exp $ |
* $Id: plugin_2pass2.c,v 1.1.2.27 2003-11-19 15:59:41 edgomez Exp $ |
29 |
* |
* |
30 |
*****************************************************************************/ |
*****************************************************************************/ |
31 |
|
|
220 |
{ |
{ |
221 |
switch(opt) { |
switch(opt) { |
222 |
case XVID_PLG_INFO : |
case XVID_PLG_INFO : |
223 |
|
case XVID_PLG_FRAME : |
224 |
return 0; |
return 0; |
225 |
|
|
226 |
case XVID_PLG_CREATE : |
case XVID_PLG_CREATE : |
617 |
b_ref--; |
b_ref--; |
618 |
|
|
619 |
/* Compute the original quant */ |
/* Compute the original quant */ |
620 |
s->quant = 100*s->quant - data->bquant_offset; |
s->quant = 2*(100*s->quant - data->bquant_offset); |
621 |
s->quant += data->bquant_ratio - 1; /* to avoid rouding issues */ |
s->quant += data->bquant_ratio - 1; /* to avoid rouding issues */ |
622 |
s->quant = s->quant/data->bquant_ratio - b_ref->quant; |
s->quant = s->quant/data->bquant_ratio - b_ref->quant; |
623 |
} |
} |
824 |
|
|
825 |
char *ptr; |
char *ptr; |
826 |
char type; |
char type; |
827 |
int fields, nouse; |
int fields; |
828 |
|
|
829 |
lines++; |
lines++; |
830 |
|
|
831 |
/* We skip spaces */ |
/* We skip spaces */ |
832 |
ptr = skipspaces(line); |
ptr = skipspaces(line); |
833 |
|
|
834 |
/* Skip coment lines */ |
/* Skip coment lines or empty lines */ |
835 |
if(iscomment(ptr)) { |
if(iscomment(ptr) || *ptr == '\0') { |
836 |
free(line); |
free(line); |
837 |
continue; |
continue; |
838 |
} |
} |
839 |
|
|
840 |
/* Read the stat line from buffer */ |
/* Read the stat line from buffer */ |
841 |
fields = sscanf(ptr, |
fields = sscanf(ptr, "%c", &type); |
|
"%c %d %d %d %d %d", |
|
|
&type, &nouse, &nouse, &nouse, &nouse, &nouse); |
|
842 |
|
|
843 |
/* Valid stats files have at least 6 fields */ |
/* Valid stats files have at least 6 fields */ |
844 |
if (fields == 6) { |
if (fields == 1) { |
845 |
switch(type) { |
switch(type) { |
846 |
case 'i': |
case 'i': |
847 |
case 'I': |
case 'I': |
900 |
/* We skip spaces */ |
/* We skip spaces */ |
901 |
ptr = skipspaces(line); |
ptr = skipspaces(line); |
902 |
|
|
903 |
/* Skip comment lines */ |
/* Skip comment lines or empty lines */ |
904 |
if(iscomment(ptr)) { |
if(iscomment(ptr) || *ptr == '\0') { |
905 |
free(line); |
free(line); |
906 |
continue; |
continue; |
907 |
} |
} |
1277 |
} else { |
} else { |
1278 |
rc->avg_length[i] = rc->tot_scaled_length[i]; |
rc->avg_length[i] = rc->tot_scaled_length[i]; |
1279 |
|
|
1280 |
if (i == XVID_TYPE_IVOP) { |
if (i == (XVID_TYPE_IVOP-1)) { |
1281 |
/* I Frames total has to be added the boost total */ |
/* I Frames total has to be added the boost total */ |
1282 |
rc->avg_length[i] += ivop_boost_total; |
rc->avg_length[i] += ivop_boost_total; |
1283 |
} else { |
} else { |