1384 |
|
|
1385 |
if ( FrameCodeP(pEnc, &bs) == 0 ) { |
if ( FrameCodeP(pEnc, &bs) == 0 ) { |
1386 |
/* N-VOP, we mustn't code b-frames yet */ |
/* N-VOP, we mustn't code b-frames yet */ |
1387 |
|
if ((pEnc->mbParam.global_flags & XVID_GLOBAL_PACKED) || |
1388 |
|
pEnc->mbParam.max_bframes == 0) |
1389 |
call_plugins(pEnc, pEnc->current, &pEnc->sOriginal, XVID_PLG_AFTER, NULL, NULL, stats); |
call_plugins(pEnc, pEnc->current, &pEnc->sOriginal, XVID_PLG_AFTER, NULL, NULL, stats); |
1390 |
goto done; |
goto done; |
1391 |
} |
} |
1496 |
BitstreamWriteVopHeader(bs, &pEnc->mbParam, pEnc->current, 1, pEnc->current->mbs[0].quant); |
BitstreamWriteVopHeader(bs, &pEnc->mbParam, pEnc->current, 1, pEnc->current->mbs[0].quant); |
1497 |
|
|
1498 |
pEnc->current->sStat.iTextBits = 0; |
pEnc->current->sStat.iTextBits = 0; |
1499 |
|
pEnc->current->sStat.iMVBits = 0; |
1500 |
pEnc->current->sStat.kblks = mb_width * mb_height; |
pEnc->current->sStat.kblks = mb_width * mb_height; |
1501 |
pEnc->current->sStat.mblks = pEnc->current->sStat.ublks = 0; |
pEnc->current->sStat.mblks = pEnc->current->sStat.ublks = 0; |
1502 |
|
|
1595 |
if ((current->vop_flags & XVID_VOP_HALFPEL)) { |
if ((current->vop_flags & XVID_VOP_HALFPEL)) { |
1596 |
if (reference->is_interpolated != current->rounding_type) { |
if (reference->is_interpolated != current->rounding_type) { |
1597 |
start_timer(); |
start_timer(); |
1598 |
image_interpolate(pRef, &pEnc->vInterH, &pEnc->vInterV, |
image_interpolate(pRef->y, pEnc->vInterH.y, pEnc->vInterV.y, |
1599 |
&pEnc->vInterHV, pParam->edged_width, |
pEnc->vInterHV.y, pParam->edged_width, |
1600 |
pParam->edged_height, |
pParam->edged_height, |
1601 |
(pParam->vol_flags & XVID_VOL_QUARTERPEL), |
(pParam->vol_flags & XVID_VOL_QUARTERPEL), |
1602 |
current->rounding_type); |
current->rounding_type); |
1606 |
} |
} |
1607 |
|
|
1608 |
current->sStat.iTextBits = current->sStat.iMvSum = current->sStat.iMvCount = |
current->sStat.iTextBits = current->sStat.iMvSum = current->sStat.iMvCount = |
1609 |
current->sStat.kblks = current->sStat.mblks = current->sStat.ublks = 0; |
current->sStat.kblks = current->sStat.mblks = current->sStat.ublks = |
1610 |
|
current->sStat.iMVBits = 0; |
1611 |
|
|
1612 |
current->coding_type = P_VOP; |
current->coding_type = P_VOP; |
1613 |
|
|
1799 |
(pParam->frame_drop_ratio * mb_width * mb_height) / 100 && |
(pParam->frame_drop_ratio * mb_width * mb_height) / 100 && |
1800 |
( (pEnc->bframenum_head >= pEnc->bframenum_tail) || !(pEnc->mbParam.global_flags & XVID_GLOBAL_CLOSED_GOP)) ) |
( (pEnc->bframenum_head >= pEnc->bframenum_tail) || !(pEnc->mbParam.global_flags & XVID_GLOBAL_CLOSED_GOP)) ) |
1801 |
{ |
{ |
1802 |
current->sStat.kblks = current->sStat.mblks = 0; |
current->sStat.kblks = current->sStat.mblks = current->sStat.iTextBits = 0; |
1803 |
current->sStat.ublks = mb_width * mb_height; |
current->sStat.ublks = mb_width * mb_height; |
1804 |
|
|
1805 |
BitstreamReset(bs); |
BitstreamReset(bs); |
1889 |
|
|
1890 |
if (pEnc->reference->is_interpolated != 0) { |
if (pEnc->reference->is_interpolated != 0) { |
1891 |
start_timer(); |
start_timer(); |
1892 |
image_interpolate(f_ref, &pEnc->f_refh, &pEnc->f_refv, &pEnc->f_refhv, |
image_interpolate(f_ref->y, pEnc->f_refh.y, pEnc->f_refv.y, pEnc->f_refhv.y, |
1893 |
pEnc->mbParam.edged_width, pEnc->mbParam.edged_height, |
pEnc->mbParam.edged_width, pEnc->mbParam.edged_height, |
1894 |
(pEnc->mbParam.vol_flags & XVID_VOL_QUARTERPEL), 0); |
(pEnc->mbParam.vol_flags & XVID_VOL_QUARTERPEL), 0); |
1895 |
stop_inter_timer(); |
stop_inter_timer(); |
1906 |
|
|
1907 |
if (pEnc->current->is_interpolated != 0) { |
if (pEnc->current->is_interpolated != 0) { |
1908 |
start_timer(); |
start_timer(); |
1909 |
image_interpolate(b_ref, &pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV, |
image_interpolate(b_ref->y, pEnc->vInterH.y, pEnc->vInterV.y, pEnc->vInterHV.y, |
1910 |
pEnc->mbParam.edged_width, pEnc->mbParam.edged_height, |
pEnc->mbParam.edged_width, pEnc->mbParam.edged_height, |
1911 |
(pEnc->mbParam.vol_flags & XVID_VOL_QUARTERPEL), 0); |
(pEnc->mbParam.vol_flags & XVID_VOL_QUARTERPEL), 0); |
1912 |
stop_inter_timer(); |
stop_inter_timer(); |
1930 |
BitstreamWriteVopHeader(bs, &pEnc->mbParam, frame, 1, frame->quant); |
BitstreamWriteVopHeader(bs, &pEnc->mbParam, frame, 1, frame->quant); |
1931 |
|
|
1932 |
frame->sStat.iTextBits = 0; |
frame->sStat.iTextBits = 0; |
1933 |
|
frame->sStat.iMVBits = 0; |
1934 |
frame->sStat.iMvSum = 0; |
frame->sStat.iMvSum = 0; |
1935 |
frame->sStat.iMvCount = 0; |
frame->sStat.iMvCount = 0; |
1936 |
frame->sStat.kblks = frame->sStat.mblks = frame->sStat.ublks = 0; |
frame->sStat.kblks = frame->sStat.mblks = frame->sStat.ublks = 0; |