20 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
21 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 |
* |
* |
23 |
* $Id: plugin_single.c,v 1.1.2.7 2003-11-28 14:20:13 syskin Exp $ |
* $Id: plugin_single.c,v 1.1.2.8 2003-12-05 14:23:02 syskin Exp $ |
24 |
* |
* |
25 |
****************************************************************************/ |
****************************************************************************/ |
26 |
|
|
153 |
data->quant = (int)rc->fq_error; |
data->quant = (int)rc->fq_error; |
154 |
rc->fq_error -= data->quant; |
rc->fq_error -= data->quant; |
155 |
}else { |
}else { |
156 |
data->quant = rc->rtn_quant; |
int q = rc->rtn_quant; |
157 |
|
/* limit to min/max range |
158 |
|
we don't know frame type of the next frame, so we just use |
159 |
|
P-VOP's range... */ |
160 |
|
if (q > data->max_quant[XVID_TYPE_PVOP-1]) |
161 |
|
q = data->max_quant[XVID_TYPE_PVOP-1]; |
162 |
|
else if (q < data->min_quant[XVID_TYPE_PVOP-1]) |
163 |
|
q = data->min_quant[XVID_TYPE_PVOP-1]; |
164 |
|
|
165 |
|
data->quant = q; |
166 |
} |
} |
167 |
} |
} |
168 |
return 0; |
return 0; |
254 |
else if (rtn_quant < data->quant - 1) |
else if (rtn_quant < data->quant - 1) |
255 |
rtn_quant = data->quant - 1; |
rtn_quant = data->quant - 1; |
256 |
|
|
|
/* limit to min/max range |
|
|
we don't know frame type of the next frame, so we just use |
|
|
P-VOP's range... */ |
|
|
if (rtn_quant > data->max_quant[XVID_TYPE_PVOP-1]) |
|
|
rtn_quant = data->max_quant[XVID_TYPE_PVOP-1]; |
|
|
else if (rtn_quant < data->min_quant[XVID_TYPE_PVOP-1]) |
|
|
rtn_quant = data->min_quant[XVID_TYPE_PVOP-1]; |
|
|
|
|
257 |
rc->rtn_quant = rtn_quant; |
rc->rtn_quant = rtn_quant; |
258 |
|
|
259 |
return (0); |
return (0); |