3 |
* XVID MPEG-4 VIDEO CODEC |
* XVID MPEG-4 VIDEO CODEC |
4 |
* - Encoder main module - |
* - Encoder main module - |
5 |
* |
* |
6 |
|
* Copyright(C) 2002 Michael Militzer |
7 |
|
* |
8 |
* This program is an implementation of a part of one or more MPEG-4 |
* This program is an implementation of a part of one or more MPEG-4 |
9 |
* Video tools as specified in ISO/IEC 14496-2 standard. Those intending |
* Video tools as specified in ISO/IEC 14496-2 standard. Those intending |
10 |
* to use this software module in hardware or software products are |
* to use this software module in hardware or software products are |
30 |
* |
* |
31 |
****************************************************************************/ |
****************************************************************************/ |
32 |
|
|
|
/***************************************************************************** |
|
|
* |
|
|
* History |
|
|
* |
|
|
* 10.07.2002 added BFRAMES_DEC_DEBUG support |
|
|
* MinChen <chenm001@163.com> |
|
|
* 20.06.2002 bframe patch |
|
|
* 08.05.2002 fix some problem in DEBUG mode; |
|
|
* MinChen <chenm001@163.com> |
|
|
* 14.04.2002 added FrameCodeB() |
|
|
* |
|
|
* $Id: encoder.c,v 1.54 2002-07-11 00:15:59 chenm001 Exp $ |
|
|
* |
|
|
****************************************************************************/ |
|
|
|
|
33 |
#include <stdlib.h> |
#include <stdlib.h> |
34 |
#include <stdio.h> |
#include <stdio.h> |
35 |
#include <math.h> |
#include <math.h> |
42 |
#include "image/image.h" |
#include "image/image.h" |
43 |
#ifdef BFRAMES |
#ifdef BFRAMES |
44 |
#include "image/font.h" |
#include "image/font.h" |
45 |
|
#include "motion/sad.h" |
46 |
#endif |
#endif |
47 |
#include "motion/motion.h" |
#include "motion/motion.h" |
48 |
#include "bitstream/cbp.h" |
#include "bitstream/cbp.h" |
197 |
|
|
198 |
/* 1 keyframe each 10 seconds */ |
/* 1 keyframe each 10 seconds */ |
199 |
|
|
200 |
if (pParam->max_key_interval == 0) |
if (pParam->max_key_interval <= 0) |
201 |
pParam->max_key_interval = 10 * pParam->fincr / pParam->fbase; |
pParam->max_key_interval = 10 * pParam->fincr / pParam->fbase; |
202 |
|
|
|
|
|
203 |
pEnc = (Encoder *) xvid_malloc(sizeof(Encoder), CACHE_LINE); |
pEnc = (Encoder *) xvid_malloc(sizeof(Encoder), CACHE_LINE); |
204 |
if (pEnc == NULL) |
if (pEnc == NULL) |
205 |
return XVID_ERR_MEMORY; |
return XVID_ERR_MEMORY; |
224 |
|
|
225 |
pEnc->mbParam.m_quant_type = H263_QUANT; |
pEnc->mbParam.m_quant_type = H263_QUANT; |
226 |
|
|
227 |
|
#ifdef _SMP |
228 |
|
pEnc->mbParam.num_threads = MIN(pParam->num_threads, MAXNUMTHREADS); |
229 |
|
#endif |
230 |
|
|
231 |
pEnc->sStat.fMvPrevSigma = -1; |
pEnc->sStat.fMvPrevSigma = -1; |
232 |
|
|
233 |
/* Fill rate control parameters */ |
/* Fill rate control parameters */ |
332 |
pEnc->global = pParam->global; |
pEnc->global = pParam->global; |
333 |
pEnc->mbParam.max_bframes = pParam->max_bframes; |
pEnc->mbParam.max_bframes = pParam->max_bframes; |
334 |
pEnc->bquant_ratio = pParam->bquant_ratio; |
pEnc->bquant_ratio = pParam->bquant_ratio; |
335 |
|
pEnc->frame_drop_ratio = pParam->frame_drop_ratio; |
336 |
pEnc->bframes = NULL; |
pEnc->bframes = NULL; |
337 |
|
|
338 |
if (pEnc->mbParam.max_bframes > 0) { |
if (pEnc->mbParam.max_bframes > 0) { |
410 |
pEnc->mbParam.m_seconds = 0; |
pEnc->mbParam.m_seconds = 0; |
411 |
pEnc->mbParam.m_ticks = 0; |
pEnc->mbParam.m_ticks = 0; |
412 |
pEnc->m_framenum = 0; |
pEnc->m_framenum = 0; |
413 |
|
pEnc->last_pframe = 0; |
414 |
|
pEnc->last_sync = 0; |
415 |
#endif |
#endif |
416 |
|
|
417 |
pParam->handle = (void *) pEnc; |
pParam->handle = (void *) pEnc; |
607 |
} |
} |
608 |
|
|
609 |
|
|
|
#ifdef BFRAMES |
|
610 |
void inc_frame_num(Encoder * pEnc) |
void inc_frame_num(Encoder * pEnc) |
611 |
{ |
{ |
|
pEnc->iFrameNum++; |
|
612 |
pEnc->mbParam.m_ticks += pEnc->mbParam.fincr; |
pEnc->mbParam.m_ticks += pEnc->mbParam.fincr; |
613 |
|
|
614 |
|
#ifdef BFRAMES |
615 |
|
pEnc->mbParam.m_ticks = pEnc->mbParam.m_ticks % pEnc->mbParam.fbase; |
616 |
|
if (pEnc->mbParam.m_ticks < pEnc->last_sync) |
617 |
|
pEnc->mbParam.m_seconds = 1; // more than 1 second since last I or P is not supported. |
618 |
|
else |
619 |
|
pEnc->mbParam.m_seconds = 0; |
620 |
|
|
621 |
|
if (pEnc->current->coding_type != B_VOP) |
622 |
|
pEnc->last_sync = pEnc->mbParam.m_ticks; |
623 |
|
#else |
624 |
|
|
625 |
pEnc->mbParam.m_seconds = pEnc->mbParam.m_ticks / pEnc->mbParam.fbase; |
pEnc->mbParam.m_seconds = pEnc->mbParam.m_ticks / pEnc->mbParam.fbase; |
626 |
pEnc->mbParam.m_ticks = pEnc->mbParam.m_ticks % pEnc->mbParam.fbase; |
pEnc->mbParam.m_ticks = pEnc->mbParam.m_ticks % pEnc->mbParam.fbase; |
627 |
} |
|
628 |
#endif |
#endif |
629 |
|
|
630 |
|
} |
631 |
|
|
632 |
|
|
633 |
#ifdef BFRAMES |
#ifdef BFRAMES |
634 |
void queue_image(Encoder * pEnc, XVID_ENC_FRAME * pFrame) |
void queue_image(Encoder * pEnc, XVID_ENC_FRAME * pFrame) |
824 |
|
|
825 |
pFrame->intra = 0; |
pFrame->intra = 0; |
826 |
|
|
827 |
BitstreamPutBits(&bs, 0x7f, 8); |
BitstreamWriteVopHeader(&bs, &pEnc->mbParam, pEnc->current, 0); // write N_VOP |
828 |
BitstreamPad(&bs); |
BitstreamPad(&bs); |
829 |
pFrame->length = BitstreamLength(&bs); |
pFrame->length = BitstreamLength(&bs); |
830 |
|
|
853 |
else |
else |
854 |
pEnc->current->quant = pFrame->quant; |
pEnc->current->quant = pFrame->quant; |
855 |
|
|
856 |
if (pEnc->current->quant < 1) |
/* if (pEnc->current->quant < 1) |
857 |
pEnc->current->quant = 1; |
pEnc->current->quant = 1; |
858 |
|
|
859 |
if (pEnc->current->quant > 31) |
if (pEnc->current->quant > 31) |
860 |
pEnc->current->quant = 31; |
pEnc->current->quant = 31; |
861 |
|
*/ |
862 |
pEnc->current->global_flags = pFrame->general; |
pEnc->current->global_flags = pFrame->general; |
863 |
pEnc->current->motion_flags = pFrame->motion; |
pEnc->current->motion_flags = pFrame->motion; |
864 |
|
|
1005 |
* This will be coded as a Bidirectional Frame |
* This will be coded as a Bidirectional Frame |
1006 |
*/ |
*/ |
1007 |
|
|
|
DPRINTF(DPRINTF_DEBUG,"*** BFRAME (store) bf: head=%i tail=%i queue: head=%i tail=%i size=%i", |
|
|
pEnc->bframenum_head, pEnc->bframenum_tail, |
|
|
pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size); |
|
|
|
|
1008 |
if ((pEnc->global & XVID_GLOBAL_DEBUG)) { |
if ((pEnc->global & XVID_GLOBAL_DEBUG)) { |
1009 |
image_printf(&pEnc->current->image, pEnc->mbParam.edged_width, pEnc->mbParam.height, 5, 200, "BVOP"); |
image_printf(&pEnc->current->image, pEnc->mbParam.edged_width, pEnc->mbParam.height, 5, 200, "BVOP"); |
1010 |
} |
} |
1016 |
} else { |
} else { |
1017 |
pEnc->current->quant = pFrame->bquant; |
pEnc->current->quant = pFrame->bquant; |
1018 |
} |
} |
1019 |
|
if (pEnc->current->quant < 1) |
1020 |
|
pEnc->current->quant = 1; |
1021 |
|
|
1022 |
|
if (pEnc->current->quant > 31) |
1023 |
|
pEnc->current->quant = 31; |
1024 |
|
|
1025 |
|
|
1026 |
|
DPRINTF(DPRINTF_DEBUG,"*** BFRAME (store) bf: head=%i tail=%i queue: head=%i tail=%i size=%i quant=%i\n", |
1027 |
|
pEnc->bframenum_head, pEnc->bframenum_tail, |
1028 |
|
pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size,pEnc->current->quant); |
1029 |
|
|
1030 |
|
|
1031 |
|
|
1032 |
/* store frame into bframe buffer & swap ref back to current */ |
/* store frame into bframe buffer & swap ref back to current */ |
1033 |
SWAP(pEnc->current, pEnc->bframes[pEnc->bframenum_tail]); |
SWAP(pEnc->current, pEnc->bframes[pEnc->bframenum_tail]); |
1042 |
goto bvop_loop; |
goto bvop_loop; |
1043 |
} |
} |
1044 |
|
|
1045 |
|
pEnc->iFrameNum++; |
1046 |
|
|
1047 |
BitstreamPad(&bs); |
BitstreamPad(&bs); |
1048 |
pFrame->length = BitstreamLength(&bs); |
pFrame->length = BitstreamLength(&bs); |
1049 |
|
|
1118 |
|
|
1119 |
pEnc->current->global_flags = pFrame->general; |
pEnc->current->global_flags = pFrame->general; |
1120 |
pEnc->current->motion_flags = pFrame->motion; |
pEnc->current->motion_flags = pFrame->motion; |
|
#ifdef BFRAMES |
|
1121 |
pEnc->current->seconds = pEnc->mbParam.m_seconds; |
pEnc->current->seconds = pEnc->mbParam.m_seconds; |
1122 |
pEnc->current->ticks = pEnc->mbParam.m_ticks; |
pEnc->current->ticks = pEnc->mbParam.m_ticks; |
|
#endif |
|
1123 |
pEnc->mbParam.hint = &pFrame->hint; |
pEnc->mbParam.hint = &pFrame->hint; |
1124 |
|
|
1125 |
start_timer(); |
start_timer(); |
1249 |
DEBUG(temp); |
DEBUG(temp); |
1250 |
#endif |
#endif |
1251 |
|
|
|
#ifdef BFRAMES |
|
1252 |
inc_frame_num(pEnc); |
inc_frame_num(pEnc); |
|
#else |
|
1253 |
pEnc->iFrameNum++; |
pEnc->iFrameNum++; |
|
#endif |
|
|
|
|
1254 |
|
|
1255 |
stop_global_timer(); |
stop_global_timer(); |
1256 |
write_timer(); |
write_timer(); |
1530 |
stop_prediction_timer(); |
stop_prediction_timer(); |
1531 |
|
|
1532 |
start_timer(); |
start_timer(); |
1533 |
|
if (pEnc->current->global_flags & XVID_GREYSCALE) |
1534 |
|
{ pMB->cbp &= 0x3C; /* keep only bits 5-2 */ |
1535 |
|
qcoeff[4*64+0]=0; /* zero, because for INTRA MBs DC value is saved */ |
1536 |
|
qcoeff[5*64+0]=0; |
1537 |
|
} |
1538 |
MBCoding(pEnc->current, pMB, qcoeff, bs, &pEnc->sStat); |
MBCoding(pEnc->current, pMB, qcoeff, bs, &pEnc->sStat); |
1539 |
stop_coding_timer(); |
stop_coding_timer(); |
1540 |
} |
} |
1556 |
|
|
1557 |
|
|
1558 |
#define INTRA_THRESHOLD 0.5 |
#define INTRA_THRESHOLD 0.5 |
1559 |
|
#define BFRAME_SKIP_THRESHHOLD 16 |
1560 |
|
|
1561 |
static int |
static int |
1562 |
FrameCodeP(Encoder * pEnc, |
FrameCodeP(Encoder * pEnc, |
1571 |
DECLARE_ALIGNED_MATRIX(qcoeff, 6, 64, int16_t, CACHE_LINE); |
DECLARE_ALIGNED_MATRIX(qcoeff, 6, 64, int16_t, CACHE_LINE); |
1572 |
|
|
1573 |
int iLimit; |
int iLimit; |
1574 |
uint32_t x, y; |
int x, y, k; |
1575 |
int iSearchRange; |
int iSearchRange; |
1576 |
int bIntra; |
int bIntra; |
1577 |
|
|
1610 |
} else { |
} else { |
1611 |
|
|
1612 |
#ifdef _SMP |
#ifdef _SMP |
1613 |
if (NUMTHREADS > 1) |
if (pEnc->mbParam.num_threads > 1) |
1614 |
bIntra = |
bIntra = |
1615 |
SMP_MotionEstimation(&pEnc->mbParam, pEnc->current, pEnc->reference, |
SMP_MotionEstimation(&pEnc->mbParam, pEnc->current, pEnc->reference, |
1616 |
&pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV, |
&pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV, |
1617 |
iLimit); |
iLimit); |
1618 |
else |
else |
1619 |
#endif |
#endif |
|
|
|
1620 |
bIntra = |
bIntra = |
1621 |
MotionEstimation(&pEnc->mbParam, pEnc->current, pEnc->reference, |
MotionEstimation(&pEnc->mbParam, pEnc->current, pEnc->reference, |
1622 |
&pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV, |
&pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV, |
1623 |
iLimit); |
iLimit); |
1624 |
|
|
|
|
|
1625 |
} |
} |
1626 |
stop_motion_timer(); |
stop_motion_timer(); |
1627 |
|
|
1699 |
} |
} |
1700 |
|
|
1701 |
start_timer(); |
start_timer(); |
1702 |
|
|
1703 |
|
/* Finished processing the MB, now check if to CODE or SKIP */ |
1704 |
|
|
1705 |
|
if (pMB->cbp == 0 && pMB->mode == MODE_INTER && pMB->mvs[0].x == 0 && |
1706 |
|
pMB->mvs[0].y == 0) { |
1707 |
|
|
1708 |
|
/* This is a candidate for SKIPping, but check intermediate B-frames first */ |
1709 |
|
|
1710 |
|
#ifdef BFRAMES |
1711 |
|
int iSAD=BFRAME_SKIP_THRESHHOLD; |
1712 |
|
int bSkip=1; |
1713 |
|
|
1714 |
|
for (k=pEnc->bframenum_head; k< pEnc->bframenum_tail; k++) |
1715 |
|
{ |
1716 |
|
iSAD = sad16(pEnc->reference->image.y + 16*y*pEnc->mbParam.edged_width + 16*x, |
1717 |
|
pEnc->bframes[k]->image.y + 16*y*pEnc->mbParam.edged_width + 16*x, |
1718 |
|
pEnc->mbParam.edged_width,BFRAME_SKIP_THRESHHOLD); |
1719 |
|
if (iSAD >= BFRAME_SKIP_THRESHHOLD) |
1720 |
|
{ bSkip = 0; |
1721 |
|
break; |
1722 |
|
} |
1723 |
|
} |
1724 |
|
if (!bSkip) |
1725 |
|
{ |
1726 |
|
if (pEnc->current->global_flags & XVID_GREYSCALE) |
1727 |
|
{ pMB->cbp &= 0x3C; /* keep only bits 5-2 */ |
1728 |
|
qcoeff[4*64+0]=0; /* zero, because DC for INTRA MBs DC value is saved */ |
1729 |
|
qcoeff[5*64+0]=0; |
1730 |
|
} |
1731 |
|
MBCoding(pEnc->current, pMB, qcoeff, bs, &pEnc->sStat); |
1732 |
|
pMB->cbp = 0x80; /* trick! so cbp!=0, but still nothing is written to bs */ |
1733 |
|
} |
1734 |
|
else |
1735 |
|
MBSkip(bs); |
1736 |
|
|
1737 |
|
#else |
1738 |
|
MBSkip(bs); /* without B-frames, no precautions are needed */ |
1739 |
|
|
1740 |
|
#endif |
1741 |
|
|
1742 |
|
} else { |
1743 |
|
if (pEnc->current->global_flags & XVID_GREYSCALE) |
1744 |
|
{ pMB->cbp &= 0x3C; /* keep only bits 5-2 */ |
1745 |
|
qcoeff[4*64+0]=0; /* zero, because DC for INTRA MBs DC value is saved */ |
1746 |
|
qcoeff[5*64+0]=0; |
1747 |
|
} |
1748 |
MBCoding(pEnc->current, pMB, qcoeff, bs, &pEnc->sStat); |
MBCoding(pEnc->current, pMB, qcoeff, bs, &pEnc->sStat); |
1749 |
|
} |
1750 |
|
|
1751 |
stop_coding_timer(); |
stop_coding_timer(); |
1752 |
} |
} |
1753 |
} |
} |
1781 |
|
|
1782 |
pEnc->sStat.fMvPrevSigma = fSigma; |
pEnc->sStat.fMvPrevSigma = fSigma; |
1783 |
|
|
1784 |
|
#ifdef BFRAMES |
1785 |
|
/* frame drop code */ |
1786 |
|
// DPRINTF(DPRINTF_DEBUG, "kmu %i %i %i", pEnc->sStat.kblks, pEnc->sStat.mblks, pEnc->sStat.ublks); |
1787 |
|
if (pEnc->sStat.kblks + pEnc->sStat.mblks < |
1788 |
|
(pEnc->frame_drop_ratio * pEnc->mbParam.mb_width * pEnc->mbParam.mb_height) / 100) |
1789 |
|
{ |
1790 |
|
pEnc->sStat.kblks = pEnc->sStat.mblks = 0; |
1791 |
|
pEnc->sStat.ublks = pEnc->mbParam.mb_width * pEnc->mbParam.mb_height; |
1792 |
|
|
1793 |
|
BitstreamReset(bs); |
1794 |
|
BitstreamWriteVopHeader(bs, &pEnc->mbParam, pEnc->current, 0); |
1795 |
|
|
1796 |
|
// copy reference frame details into the current frame |
1797 |
|
pEnc->current->quant = pEnc->reference->quant; |
1798 |
|
pEnc->current->motion_flags = pEnc->reference->motion_flags; |
1799 |
|
pEnc->current->rounding_type = pEnc->reference->rounding_type; |
1800 |
|
pEnc->current->fcode = pEnc->reference->fcode; |
1801 |
|
pEnc->current->bcode = pEnc->reference->bcode; |
1802 |
|
image_copy(&pEnc->current->image, &pEnc->reference->image, pEnc->mbParam.edged_width, pEnc->mbParam.height); |
1803 |
|
memcpy(pEnc->current->mbs, pEnc->reference->mbs, sizeof(MACROBLOCK) * pEnc->mbParam.mb_width * pEnc->mbParam.mb_height); |
1804 |
|
|
1805 |
|
} |
1806 |
|
#endif |
1807 |
|
|
1808 |
*pBits = BitstreamPos(bs) - *pBits; |
*pBits = BitstreamPos(bs) - *pBits; |
1809 |
|
|
1810 |
|
#ifdef BFRAMES |
1811 |
|
pEnc->time_pp = ((int32_t)pEnc->mbParam.fbase - (int32_t)pEnc->last_pframe + (int32_t)pEnc->current->ticks) % |
1812 |
|
(int32_t)pEnc->mbParam.fbase; |
1813 |
|
pEnc->last_pframe = pEnc->current->ticks; |
1814 |
|
#endif |
1815 |
|
|
1816 |
return 0; // inter |
return 0; // inter |
1817 |
} |
} |
1818 |
|
|
1868 |
stop_inter_timer(); |
stop_inter_timer(); |
1869 |
|
|
1870 |
start_timer(); |
start_timer(); |
1871 |
MotionEstimationBVOP(&pEnc->mbParam, frame, pEnc->reference->mbs, f_ref, |
MotionEstimationBVOP(&pEnc->mbParam, frame, |
1872 |
|
((int32_t)pEnc->mbParam.fbase + pEnc->last_pframe - frame->ticks) % pEnc->mbParam.fbase, |
1873 |
|
pEnc->time_pp, |
1874 |
|
pEnc->reference->mbs, f_ref, |
1875 |
&pEnc->f_refh, &pEnc->f_refv, &pEnc->f_refhv, |
&pEnc->f_refh, &pEnc->f_refv, &pEnc->f_refhv, |
1876 |
pEnc->current->mbs, b_ref, &pEnc->vInterH, |
pEnc->current->mbs, b_ref, &pEnc->vInterH, |
1877 |
&pEnc->vInterV, &pEnc->vInterHV); |
&pEnc->vInterV, &pEnc->vInterHV); |
1930 |
|
|
1931 |
mb->quant = frame->quant; |
mb->quant = frame->quant; |
1932 |
mb->cbp = |
mb->cbp = |
1933 |
MBTransQuantInter(&pEnc->mbParam, frame, mb, x, y, dct_codes, |
MBTransQuantInterBVOP(&pEnc->mbParam, frame, mb, dct_codes, qcoeff); |
|
qcoeff); |
|
1934 |
//mb->cbp = MBTransQuantBVOP(&pEnc->mbParam, x, y, dct_codes, qcoeff, &frame->image, frame->quant); |
//mb->cbp = MBTransQuantBVOP(&pEnc->mbParam, x, y, dct_codes, qcoeff, &frame->image, frame->quant); |
1935 |
|
|
1936 |
|
if ( (mb->mode == MODE_DIRECT) && (mb->cbp == 0) |
1937 |
if ((mb->mode == MODE_INTERPOLATE || mb->mode == MODE_DIRECT) |
&& (mb->deltamv.x == 0) && (mb->deltamv.y == 0) ) { |
1938 |
&& mb->cbp == 0 && mb->mvs[0].x == 0 && mb->mvs[0].y == 0) { |
mb->mode = MODE_DIRECT_NONE_MV; // skipped |
|
mb->mode = 5; // skipped |
|
1939 |
} |
} |
1940 |
|
|
1941 |
|
/* update predictors for forward and backward vectors */ |
1942 |
if (mb->mode == MODE_INTERPOLATE || mb->mode == MODE_FORWARD) { |
if (mb->mode == MODE_INTERPOLATE || mb->mode == MODE_FORWARD) { |
1943 |
mb->pmvs[0].x = mb->mvs[0].x - forward.x; |
mb->pmvs[0].x = mb->mvs[0].x - forward.x; |
1944 |
mb->pmvs[0].y = mb->mvs[0].y - forward.y; |
mb->pmvs[0].y = mb->mvs[0].y - forward.y; |
1952 |
backward.x = mb->b_mvs[0].x; |
backward.x = mb->b_mvs[0].x; |
1953 |
backward.y = mb->b_mvs[0].y; |
backward.y = mb->b_mvs[0].y; |
1954 |
} |
} |
1955 |
|
|
1956 |
// DPRINTF("%05i : [%i %i] M=%i CBP=%i MVS=%i,%i forward=%i,%i", pEnc->m_framenum, x, y, mb->mode, mb->cbp, mb->mvs[0].x, mb->mvs[0].y, forward.x, forward.y); |
// DPRINTF("%05i : [%i %i] M=%i CBP=%i MVS=%i,%i forward=%i,%i", pEnc->m_framenum, x, y, mb->mode, mb->cbp, mb->mvs[0].x, mb->mvs[0].y, forward.x, forward.y); |
1957 |
|
|
1958 |
#ifdef BFRAMES_DEC_DEBUG |
#ifdef BFRAMES_DEC_DEBUG |
1980 |
#endif |
#endif |
1981 |
} |
} |
1982 |
#endif |
#endif |
1983 |
|
|
1984 |
|
|
1985 |
|
/* in case internal output is needed somewhere... */ |
1986 |
|
/* { |
1987 |
|
FILE *filehandle; |
1988 |
|
filehandle=fopen("last-b.pgm","wb"); |
1989 |
|
if (filehandle) |
1990 |
|
{ |
1991 |
|
fprintf(filehandle,"P5\n\n"); // |
1992 |
|
fprintf(filehandle,"%d %d 255\n",pEnc->mbParam.edged_width,pEnc->mbParam.edged_height); |
1993 |
|
fwrite(frame->image.y,pEnc->mbParam.edged_width,pEnc->mbParam.edged_height,filehandle); |
1994 |
|
fclose(filehandle); |
1995 |
|
} |
1996 |
|
} |
1997 |
|
*/ |