32 |
* |
* |
33 |
* History |
* History |
34 |
* |
* |
35 |
|
* 10.07.2002 added BFRAMES_DEC_DEBUG support |
36 |
|
* MinChen <chenm001@163.com> |
37 |
* 20.06.2002 bframe patch |
* 20.06.2002 bframe patch |
38 |
* 08.05.2002 fix some problem in DEBUG mode; |
* 08.05.2002 fix some problem in DEBUG mode; |
39 |
* MinChen <chenm001@163.com> |
* MinChen <chenm001@163.com> |
40 |
* 14.04.2002 added FrameCodeB() |
* 14.04.2002 added FrameCodeB() |
41 |
* |
* |
42 |
* $Id: encoder.c,v 1.53 2002-07-10 19:16:32 chl Exp $ |
* $Id: encoder.c,v 1.54 2002-07-11 00:15:59 chenm001 Exp $ |
43 |
* |
* |
44 |
****************************************************************************/ |
****************************************************************************/ |
45 |
|
|
1742 |
IMAGE *f_ref = &pEnc->reference->image; |
IMAGE *f_ref = &pEnc->reference->image; |
1743 |
IMAGE *b_ref = &pEnc->current->image; |
IMAGE *b_ref = &pEnc->current->image; |
1744 |
|
|
1745 |
|
#ifdef BFRAMES_DEC_DEBUG |
1746 |
|
FILE *fp; |
1747 |
|
static char first=0; |
1748 |
|
#define BFRAME_DEBUG if (!first && fp){ \ |
1749 |
|
fprintf(fp,"Y=%3d X=%3d MB=%2d CBP=%02X\n",y,x,mb->mode,mb->cbp); \ |
1750 |
|
} |
1751 |
|
|
1752 |
|
if (!first){ |
1753 |
|
fp=fopen("C:\\XVIDDBGE.TXT","w"); |
1754 |
|
} |
1755 |
|
#endif |
1756 |
|
|
1757 |
// forward |
// forward |
1758 |
image_setedges(f_ref, pEnc->mbParam.edged_width, |
image_setedges(f_ref, pEnc->mbParam.edged_width, |
1759 |
pEnc->mbParam.edged_height, pEnc->mbParam.width, |
pEnc->mbParam.edged_height, pEnc->mbParam.width, |
1820 |
if (mb->mode == MODE_NOT_CODED) { |
if (mb->mode == MODE_NOT_CODED) { |
1821 |
mb->mvs[0].x = 0; |
mb->mvs[0].x = 0; |
1822 |
mb->mvs[0].y = 0; |
mb->mvs[0].y = 0; |
1823 |
|
|
1824 |
|
mb->cbp = 0; |
1825 |
|
#ifdef BFRAMES_DEC_DEBUG |
1826 |
|
BFRAME_DEBUG |
1827 |
|
#endif |
1828 |
continue; |
continue; |
1829 |
} |
} |
1830 |
|
|
1861 |
} |
} |
1862 |
// 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); |
1863 |
|
|
1864 |
|
#ifdef BFRAMES_DEC_DEBUG |
1865 |
|
BFRAME_DEBUG |
1866 |
|
#endif |
1867 |
start_timer(); |
start_timer(); |
1868 |
MBCodingBVOP(mb, qcoeff, frame->fcode, frame->bcode, bs, |
MBCodingBVOP(mb, qcoeff, frame->fcode, frame->bcode, bs, |
1869 |
&pEnc->sStat); |
&pEnc->sStat); |
1876 |
// TODO: dynamic fcode/bcode ??? |
// TODO: dynamic fcode/bcode ??? |
1877 |
|
|
1878 |
*pBits = BitstreamPos(bs) - *pBits; |
*pBits = BitstreamPos(bs) - *pBits; |
1879 |
|
|
1880 |
|
#ifdef BFRAMES_DEC_DEBUG |
1881 |
|
if (!first){ |
1882 |
|
first=1; |
1883 |
|
if (fp) |
1884 |
|
fclose(fp); |
1885 |
|
} |
1886 |
|
#endif |
1887 |
} |
} |
1888 |
#endif |
#endif |