41 |
* * |
* * |
42 |
* Revision history: * |
* Revision history: * |
43 |
* * |
* * |
44 |
* 01.05.2002 added BVOP support to BitstreamWriteVopHeader |
* 06.05.2002 fixed fincr/fbase error * |
45 |
|
* 01.05.2002 added BVOP support to BitstreamWriteVopHeader * |
46 |
* 15.04.2002 rewrite log2bin use asm386 By MinChen <chenm001@163.com> * |
* 15.04.2002 rewrite log2bin use asm386 By MinChen <chenm001@163.com> * |
47 |
* 26.03.2002 interlacing support * |
* 26.03.2002 interlacing support * |
48 |
* 03.03.2002 qmatrix writing * |
* 03.03.2002 qmatrix writing * |
59 |
#include "../quant/quant_matrix.h" |
#include "../quant/quant_matrix.h" |
60 |
|
|
61 |
|
|
62 |
static int __inline log2bin(int value) |
static uint32_t __inline log2bin(uint32_t value) |
63 |
{ |
{ |
64 |
/* Changed by Chenm001 */ |
/* Changed by Chenm001 */ |
65 |
#ifndef WIN32 |
#ifndef WIN32 |
560 |
} |
} |
561 |
} |
} |
562 |
|
|
563 |
*quant = BitstreamGetBits(bs, dec->quant_bits); // vop_quant |
if((*quant = BitstreamGetBits(bs, dec->quant_bits)) < 1) // vop_quant |
564 |
|
*quant = 1; |
565 |
|
|
566 |
//DEBUG1("quant", *quant); |
//DEBUG1("quant", *quant); |
567 |
|
|
568 |
if (coding_type != I_VOP) |
if (coding_type != I_VOP) |
652 |
25fps res=25 inc=1 |
25fps res=25 inc=1 |
653 |
29.97fps res=30000 inc=1001 |
29.97fps res=30000 inc=1001 |
654 |
*/ |
*/ |
655 |
|
#ifdef BFRAMES |
656 |
|
BitstreamPutBits(bs, pParam->fbase, 16); |
657 |
|
#else |
658 |
BitstreamPutBits(bs, 2, 16); |
BitstreamPutBits(bs, 2, 16); |
659 |
|
#endif |
660 |
|
|
661 |
WRITE_MARKER(); |
WRITE_MARKER(); |
662 |
|
|
738 |
|
|
739 |
// time_increment: value=nth_of_sec, nbits = log2(resolution) |
// time_increment: value=nth_of_sec, nbits = log2(resolution) |
740 |
#ifdef BFRAMES |
#ifdef BFRAMES |
741 |
BitstreamPutBits(bs, frame->ticks, 5); |
BitstreamPutBits(bs, frame->ticks, log2bin(pParam->fbase)); |
742 |
dprintf("[%i:%i] %c\n", frame->seconds, frame->ticks, frame->coding_type == I_VOP ? 'I' : frame->coding_type == P_VOP ? 'P' : 'B'); |
dprintf("[%i:%i] %c\n", frame->seconds, frame->ticks, frame->coding_type == I_VOP ? 'I' : frame->coding_type == P_VOP ? 'P' : 'B'); |
743 |
#else |
#else |
744 |
BitstreamPutBits(bs, 1, 1); |
BitstreamPutBits(bs, 1, 1); |
748 |
|
|
749 |
BitstreamPutBits(bs, 1, 1); // vop_coded |
BitstreamPutBits(bs, 1, 1); // vop_coded |
750 |
|
|
751 |
if (frame->coding_type != I_VOP) |
if (frame->coding_type == P_VOP) |
752 |
BitstreamPutBits(bs, frame->rounding_type, 1); |
BitstreamPutBits(bs, frame->rounding_type, 1); |
753 |
|
|
754 |
BitstreamPutBits(bs, 0, 3); // intra_dc_vlc_threshold |
BitstreamPutBits(bs, 0, 3); // intra_dc_vlc_threshold |