|
-
Aug 14th, 2002, 03:27 PM
#1
Thread Starter
Fanatic Member
parsing string
ive got this info:
Byte# Data Details
===================================================================
1-4 Sequence header In Hex 000001B3
code
12 bits Horizontal size In pixels
12 bits Vertical size In pixels
ive been trying to figure out how to parse it, its for an MPEG file, can someone help me out?
thanks
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Aug 14th, 2002, 03:32 PM
#2
Monday Morning Lunatic
Is it binary data stored sequentially in a buffer? If it is, you can use the shifting << >> and masking & | ^ operators.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 14th, 2002, 06:55 PM
#3
Thread Starter
Fanatic Member
huh?
lol
im reading it in from a file. i read in like the first 256 bytes approx
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Aug 14th, 2002, 07:15 PM
#4
I asume that you want the numbers?
You can try to find them by searching for text around it, if your data is in a string, then:
int pos = file.find("Sequence header In Hex ")+23//23=length of string
istringstream hex_str(file.substr(pos,8));
int hex_data;
hex_str >> setbase(16) >> hex_data;
And so on for each field you want to know.
-
Aug 14th, 2002, 07:21 PM
#5
Thread Starter
Fanatic Member
well according to the format, itll be here:
Code:
00 00 01 B3 16 00 F0 C4 02 A3 20 A5 10 12 12 14
14 14 16 16 16 16 18 18 19 18 18 1A 1B 1B 1B 1B
1A 1C 1D 1E 1E 1E 1D 1C 1E 1F 20 21 21 20 1F 1E
21 23 23 24 23 23 21 25 26 27 27 26 25 29 2A 2A
2A 29 2D 2D 2D 2D 30 31 30 34 34 38 16 00 F0 C4
00 00 01 B8 00 08 00 00 00 00 01 00 00 0A 72 00
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|