21 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
22 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 |
* |
* |
24 |
* $Id: encoder.c,v 1.95.2.45 2003-10-07 13:02:35 edgomez Exp $ |
* $Id: encoder.c,v 1.95.2.46 2003-10-27 00:50:05 edgomez Exp $ |
25 |
* |
* |
26 |
****************************************************************************/ |
****************************************************************************/ |
27 |
|
|
994 |
SWAP(FRAMEINFO*, pEnc->current, pEnc->bframes[pEnc->bframenum_tail]); |
SWAP(FRAMEINFO*, pEnc->current, pEnc->bframes[pEnc->bframenum_tail]); |
995 |
|
|
996 |
/* convert B-VOP to P-VOP */ |
/* convert B-VOP to P-VOP */ |
997 |
pEnc->current->quant = ((pEnc->current->quant*100) - pEnc->mbParam.bquant_offset) / pEnc->mbParam.bquant_ratio; |
pEnc->current->quant = 100*pEnc->current->quant - pEnc->mbParam.bquant_offset; |
998 |
|
pEnc->current->quant += pEnc->mbParam.bquant_ratio - 1; /* to avoid rouding issues */ |
999 |
|
pEnc->current->quant /= pEnc->mbParam.bquant_ratio; |
1000 |
|
|
1001 |
if ((pEnc->mbParam.plugin_flags & XVID_REQORIGINAL)) { |
if ((pEnc->mbParam.plugin_flags & XVID_REQORIGINAL)) { |
1002 |
image_copy(&pEnc->sOriginal, &pEnc->current->image, |
image_copy(&pEnc->sOriginal, &pEnc->current->image, |
1163 |
} |
} |
1164 |
|
|
1165 |
/* convert B-VOP quant to P-VOP */ |
/* convert B-VOP quant to P-VOP */ |
1166 |
pEnc->current->quant = ((pEnc->current->quant*100) - pEnc->mbParam.bquant_offset) / pEnc->mbParam.bquant_ratio; |
pEnc->current->quant = 100*pEnc->current->quant - pEnc->mbParam.bquant_offset; |
1167 |
|
pEnc->current->quant += pEnc->mbParam.bquant_ratio - 1; /* to avoid rouding issues */ |
1168 |
|
pEnc->current->quant /= pEnc->mbParam.bquant_ratio; |
1169 |
type = P_VOP; |
type = P_VOP; |
1170 |
} |
} |
1171 |
|
|