20 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
21 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 |
* |
* |
23 |
* $Id: bitstream.c,v 1.39.2.11 2003-06-09 13:51:34 edgomez Exp $ |
* $Id: bitstream.c,v 1.39.2.13 2003-06-12 14:16:41 Isibaar Exp $ |
24 |
* |
* |
25 |
****************************************************************************/ |
****************************************************************************/ |
26 |
|
|
36 |
static uint32_t __inline |
static uint32_t __inline |
37 |
log2bin(uint32_t value) |
log2bin(uint32_t value) |
38 |
{ |
{ |
|
/* Changed by Chenm001 */ |
|
|
#if !defined(_MSC_VER) |
|
39 |
int n = 0; |
int n = 0; |
40 |
|
|
41 |
while (value) { |
while (value) { |
43 |
n++; |
n++; |
44 |
} |
} |
45 |
return n; |
return n; |
|
#else |
|
|
__asm { |
|
|
bsr eax, value |
|
|
inc eax |
|
|
} |
|
|
#endif |
|
46 |
} |
} |
47 |
|
|
48 |
|
|
1014 |
|
|
1015 |
DPRINTF(XVID_DEBUG_STARTCODE, "<user_data>: %s\n", tmp); |
DPRINTF(XVID_DEBUG_STARTCODE, "<user_data>: %s\n", tmp); |
1016 |
|
|
1017 |
|
/* read xvid bitstream version */ |
1018 |
|
if(strncmp(tmp, "XviD", 4) == 0) { |
1019 |
|
sscanf(tmp, "XviD%d", &dec->bs_version); |
1020 |
|
DPRINTF(XVID_DEBUG_HEADER, "xvid bitstream version=%i", dec->bs_version); |
1021 |
|
} |
1022 |
|
|
1023 |
/* divx detection */ |
/* divx detection */ |
1024 |
i = sscanf(tmp, "DivX%dBuild%d%c", &version, &build, &packed); |
i = sscanf(tmp, "DivX%dBuild%d%c", &version, &build, &packed); |
1025 |
if (i < 2) |
if (i < 2) |