Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
bitstream_test.c
Package: dvd-munitions.tar.gz [view]
Upload User: aoeyumen
Upload Date: 2007-01-06
Package Size: 3329k
Code Size: 1k
Category:
DVD
Development Platform:
Unix_Linux
- /*
- * bitstream_test.c
- *
- * Aaron Holtzman - May 1999
- *
- */
- #include <stdlib.h>
- #include <stdio.h>
- #include "ac3.h"
- #include "bitstream.h"
- void print_bits(unsigned long data,unsigned long num_bits);
- void print_bits(unsigned long data,unsigned long num_bits)
- {
- long i;
- for (i=num_bits-1; i >= 0; i--)
- {
- printf("%1d",data & (1 << i) ? 1 : 0);
- }
- }
- #define BIT_SIZE (10 * 128)
- int main(void)
- {
- bitstream_t *bs;
- unsigned long num_bits = 0;
- unsigned long data;
- long i = 0;
- FILE *f;
- f = fopen("bitstream_test.dat","r");
- bs = bitstream_open(f);
- while (i < BIT_SIZE)
- {
- if(abs(i - BIT_SIZE) < 32)
- num_bits = abs(i - (BIT_SIZE));
- else
- num_bits = rand() % 32;
- data = bitstream_get(bs,num_bits);
- print_bits(data,num_bits);
- i += num_bits;
- }
- return 0;
- }