--- encoder.c 2010/12/31 10:20:22 1.135.2.3 +++ encoder.c 2010/12/28 19:19:43 1.136 @@ -21,7 +21,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: encoder.c,v 1.135.2.3 2010/12/31 10:20:22 Isibaar Exp $ + * $Id: encoder.c,v 1.136 2010/12/28 19:19:43 Isibaar Exp $ * ****************************************************************************/ @@ -1609,8 +1609,7 @@ memcpy((void *)((ptr_t)bs->start + pos), (void *)((ptr_t)pEnc->smpData[k].bs->start), len); - current->length += len; - pos += len; + current->length = pos += len; /* collect stats */ current->sStat.iTextBits += pEnc->smpData[k].sStat->iTextBits; @@ -2303,7 +2302,7 @@ image_setedges(f_ref, pEnc->mbParam.edged_width, pEnc->mbParam.edged_height, pEnc->mbParam.width, pEnc->mbParam.height, 0); - pEnc->reference->is_edged = 1; + pEnc->current->is_edged = 1; } if (pEnc->reference->is_interpolated != 0) { @@ -2334,8 +2333,8 @@ frame->coding_type = B_VOP; - if ((frame->vop_flags & XVID_VOP_RD_PSNRHVSM) && (frame->vop_flags & XVID_VOP_RD_BVOP)) { - image_block_variance(&frame->image, pEnc->mbParam.edged_width, frame->mbs, + if (pEnc->current->vop_flags & XVID_VOP_RD_PSNRHVSM) { + image_block_variance(&pEnc->current->image, pEnc->mbParam.edged_width, pEnc->current->mbs, pEnc->mbParam.mb_width, pEnc->mbParam.mb_height); }