Log in

View Full Version : Can BCD be converted to standard time table using a calculator?


Brother Darrell
10th July 2003, 05:23
Yup, really stupid question I'm sure.
but a few things I have noticed in remuxing using a respective m2v, the original ifo & ifo edit.
It seems to always remux to a time of BCD:21383126 Time:01:46:47.06.
I can fix this part in VTS_PGC1 I simply open the original ifo & find the BCD:34810345. This of course translates to 02:13:29.29. /30fps

My question is HOW does it work.
Can I do this with a calculator?
It would be a little faster for me, beside..I love playing with this stuff.

An alternate way to translate the BCD would be a nice thing to learn.

Okay. I have part of it figured out
What threw me off was expecting the BCD to be HEX or some equivalent binary format. NOPE.
BCD is the DECIMAL equivalent of the time, which is ACTUALLY the HEX number.
Like I said...ALMOST. I have not figured out the frame rate yet.

For those that are interested & maybe suffer from acute boredom, or simply would like to see how far I'm willing to go to show what everybody prolly already knows...(except me..)
34810345 is the "decimal" equivalent of 02:13:29.29. /30fps. If you enter 02:13:29.29 in a calculator in hex(as 2132929),then convert to dec, you get 34810153. This ain't the same number, you say.
Well, yes it is. Sorta. It will give you the correct time in IFOEDIT but will say illegal fps. I have not figured out the framerate flags.
If anyone can enlighten me, I would say thank you now & name one of my children after you.

mpucoder
10th July 2003, 18:43
BCD means Binary Coded Decimal. Each decimal digit uses 4 bits, the same as a hex digit. So, look at the time in hex, and you will see it looks like a decimal number. The only tricky part is the framerate, which is coded into bits 7 and 6 of the last byte, where the frame within the second of time is encoded. 11 is 30fps, 01 is 25fps, the other values are illegal. So if the byte is greater than 0xCx, it is 30fps, otherwise it is 25fps. To interpret the frame number mentally remove those 2 bits (easy to do after 35+ years of staring at hex numbers), or here's an aesy guide to the ten's digit:

code for
value 25fps 30fps
0 4 C
1 5 D
2 6 E

Brother Darrell
14th July 2003, 10:23
Very Cool. That's what I needed.
I did not think of simply using 01 & 11 as additives. I was looking for some kind of mask.
As far as the illegal bitrates..Uh, just because they are illegal, goes that also mean they don't exist?
This might have some interesting outcomes.
Wonder if there is a way to define a different bitstream?
NTSC FILM perhaps...yeah yeah, I know.
But a guy can dream. Besides, Svcd works just fine as 23.937
NonStandard does not mean NonWorking.
Oops, there I go again.
Thanks for the information.
Now to go play. :D

mpucoder
15th July 2003, 02:58
These are the only 2 framerates for time codes. I don't know what would happen if one of the illegal codes was used, but that's what is meant by "unpredictable results". Anyway, these flags only affect the interpretation of the time code. Also, NTSC film is encoded at 23.976, but has pulldown flags added so that the display framerate is 29.97, and so uses 30fps timecodes.

Zeul
21st August 2003, 20:33
mpucoder

if i have the following hex sequence 01 51 16 52,
according to the above the time is 01:51:16, ifoedit reports the frame as 12 and 25fps

in binary 52 = 0101 0010

bit 7&6 is 01 = pal 25fps

how to i interpret the remaining 6 bits 01 0010 to give 12 frames?

edit: found it
if the bit 7&6 is 01 then replace it with 00

sequence is now 0001 0010 = 12