19 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
20 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
* |
* |
22 |
* $Id: xvid_stat.c,v 1.15 2002-09-28 14:53:40 edgomez Exp $ |
* $Id: xvid_stat.c,v 1.16 2002-11-27 21:09:10 edgomez Exp $ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
25 |
|
|
112 |
****************************************************************************/ |
****************************************************************************/ |
113 |
|
|
114 |
static int const motion_presets[7] = { |
static int const motion_presets[7] = { |
115 |
0, // Q 0 |
0, /* Q 0 */ |
116 |
PMV_EARLYSTOP16, // Q 1 |
PMV_EARLYSTOP16, /* Q 1 */ |
117 |
PMV_EARLYSTOP16, // Q 2 |
PMV_EARLYSTOP16, /* Q 2 */ |
118 |
PMV_EARLYSTOP16 | PMV_HALFPELREFINE16, // Q 3 |
PMV_EARLYSTOP16 | PMV_HALFPELREFINE16, /* Q 3 */ |
119 |
PMV_EARLYSTOP16 | PMV_HALFPELREFINE16, // Q 4 |
PMV_EARLYSTOP16 | PMV_HALFPELREFINE16, /* Q 4 */ |
120 |
PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 | // Q 5 |
PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 | /* Q 5 */ |
121 |
PMV_HALFPELREFINE8, |
PMV_HALFPELREFINE8, |
122 |
PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EXTSEARCH16 | // Q 6 |
PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EXTSEARCH16 | /* Q 6 */ |
123 |
PMV_USESQUARES16 | PMV_EARLYSTOP8 | PMV_HALFPELREFINE8 |
PMV_USESQUARES16 | PMV_EARLYSTOP8 | PMV_HALFPELREFINE8 |
124 |
}; |
}; |
125 |
|
|
126 |
static int const general_presets[7] = { |
static int const general_presets[7] = { |
127 |
XVID_H263QUANT, // Q 0 |
XVID_H263QUANT, /* Q 0 */ |
128 |
XVID_MPEGQUANT, // Q 1 |
XVID_MPEGQUANT, /* Q 1 */ |
129 |
XVID_H263QUANT, // Q 2 |
XVID_H263QUANT, /* Q 2 */ |
130 |
XVID_H263QUANT | XVID_HALFPEL, // Q 3 |
XVID_H263QUANT | XVID_HALFPEL, /* Q 3 */ |
131 |
XVID_H263QUANT | XVID_HALFPEL | XVID_INTER4V, // Q 4 |
XVID_H263QUANT | XVID_HALFPEL | XVID_INTER4V, /* Q 4 */ |
132 |
XVID_H263QUANT | XVID_HALFPEL | XVID_INTER4V, // Q 5 |
XVID_H263QUANT | XVID_HALFPEL | XVID_INTER4V, /* Q 5 */ |
133 |
XVID_H263QUANT | XVID_HALFPEL | XVID_INTER4V // Q 6 |
XVID_H263QUANT | XVID_HALFPEL | XVID_INTER4V /* Q 6 */ |
134 |
}; |
}; |
135 |
|
|
136 |
|
|
362 |
do { |
do { |
363 |
|
|
364 |
if (ARG_INPUTTYPE) |
if (ARG_INPUTTYPE) |
365 |
status = read_pgmdata(in_file, in_buffer); // read PGM data (YUV-format) |
status = read_pgmdata(in_file, in_buffer); /* read PGM data (YUV-format) */ |
366 |
else |
else |
367 |
status = read_yuvdata(in_file, in_buffer); // read raw data (YUV-format) |
status = read_yuvdata(in_file, in_buffer); /* read raw data (YUV-format) */ |
368 |
|
|
369 |
if (status) |
if (status) |
370 |
{ |
{ |
825 |
XVID_ENC_STATS xstats; |
XVID_ENC_STATS xstats; |
826 |
|
|
827 |
xframe.bitstream = bitstream; |
xframe.bitstream = bitstream; |
828 |
xframe.length = -1; // this is written by the routine |
xframe.length = -1; /* this is written by the routine */ |
829 |
|
|
830 |
xframe.image = image; |
xframe.image = image; |
831 |
xframe.colorspace = XVID_CSP_YV12; // defined in <xvid.h> |
xframe.colorspace = XVID_CSP_YV12; /* defined in <xvid.h> */ |
832 |
|
|
833 |
xframe.intra = -1; // let the codec decide between I-frame (1) and P-frame (0) |
xframe.intra = -1; /* let the codec decide between I-frame (1) and P-frame (0) */ |
834 |
|
|
835 |
xframe.quant = ARG_QUANTI; // is quant != 0, use a fixed quant (and ignore bitrate) |
xframe.quant = ARG_QUANTI; /* is quant != 0, use a fixed quant (and ignore bitrate) */ |
836 |
|
|
837 |
xframe.motion = motion_presets[ARG_QUALITY]; |
xframe.motion = motion_presets[ARG_QUALITY]; |
838 |
xframe.general = general_presets[ARG_QUALITY]; |
xframe.general = general_presets[ARG_QUALITY]; |
894 |
xframe.length = m4v_size; |
xframe.length = m4v_size; |
895 |
xframe.image = out_buffer; |
xframe.image = out_buffer; |
896 |
xframe.stride = XDIM; |
xframe.stride = XDIM; |
897 |
xframe.colorspace = XVID_CSP_YV12; // XVID_CSP_USER is fastest (no memcopy involved) |
xframe.colorspace = XVID_CSP_YV12; /* XVID_CSP_USER is fastest (no memcopy involved) */ |
898 |
|
|
899 |
xerr = xvid_decore(dec_handle, XVID_DEC_DECODE, &xframe, NULL); |
xerr = xvid_decore(dec_handle, XVID_DEC_DECODE, &xframe, NULL); |
900 |
|
|