cosmetic reformatting: tabs --> spaces, prettyprinting, trailing whitespace

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16687 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
diego 2005-10-06 11:08:43 +00:00
parent 4fe19377b1
commit f9ba1d8575
1 changed files with 487 additions and 475 deletions

View File

@ -11,15 +11,18 @@ Features / goals:
Simple
use the same encoding for nearly all fields
simple decoding, so slow CPUs (and embedded systems) can handle it
Extendible
no limit for the possible values of all fields (using universal vlc)
allow adding of new headers in the future
allow adding more fields at the end of headers
Compact
~0.2% overhead, for normal bitrates
index is <10kb per hour (1 keyframe every 3sec)
a usual header for a file is about 100 bytes (audio + video headers together)
a packet header is about ~1-8 bytes
Error resistant
seeking / playback without an index
headers & index can be repeated
@ -108,8 +111,8 @@ reserved_bytes:
reserved u(8)
[a demuxer MUST ignore any reserved bytes
a muxer MUST NOT write any reserved bytes, as this would make it
impossible to add new fields at the end of packets in the future in
a compatible way]
impossible to add new fields at the end of packets in the future
in a compatible way]
Headers:
@ -309,6 +312,7 @@ frame_startcode
index_startcode
0xDD672F23E64EULL + (((uint64_t)('N'<<8) + 'X')<<48)
info_startcode
0xAB68B596BA78ULL + (((uint64_t)('N'<<8) + 'I')<<48)
@ -375,11 +379,11 @@ global_timestamp
when a global_timestamp is encountered the last_pts of all
streams is set to the following:
ln= global_time_base_nom*time_base_denom
sn= global_timestamp
d1= global_time_base_denom
d2= time_base_nom
last_pts= (ln/d1*sn + ln%d1*sn/d1)/d2
ln = global_time_base_nom*time_base_denom
sn = global_timestamp
d1 = global_time_base_denom
d2 = time_base_nom
last_pts = (ln/d1*sn + ln%d1*sn/d1)/d2
Note: this calculation MUST be done with unsigned 64 bit integers, and
is equivalent to (ln*sn)/(d1*d2) but this would require a 96bit integer
@ -408,8 +412,8 @@ flags[frame_code]
first of the flags from MSB to LSB are called KD
if D is 1 then data_size_msb is coded, otherwise data_size_msb is 0
K is the keyframe_type
0-> no keyframe,
1-> keyframe,
0 -> no keyframe,
1 -> keyframe,
flags=4 can be used to mark illegal frame_code bytes
frame_code=78 must have flags=4
Note: frames MUST NOT depend(1) upon frames prior to the last
@ -438,8 +442,8 @@ coded_pts
pts, otherwise it is a full pts + (1<<msb_pts_shift)
lsb pts is converted to a full pts by:
mask = (1<<msb_pts_shift)-1;
delta= last_pts - mask/2
pts= ((pts_lsb-delta)&mask) + delta
delta = last_pts - mask/2
pts = ((pts_lsb-delta)&mask) + delta
lsb_pts
least significant bits of the pts in time_base precision
@ -450,7 +454,7 @@ lsb_pts
frame lsb_pts=2 -> pts=2
...
keyframe msb_pts=257 -> pts=257
frame lsb_pts=255->pts=255
frame lsb_pts=255 -> pts=255
frame lsb_pts=0 -> pts=256
frame lsb_pts=4 -> pts=260
frame lsb_pts=2 -> pts=258
@ -520,31 +524,39 @@ type
info packet types
the name of the info entry, valid names are
"StreamId" the stream(s) to which the info packet applies
"StreamId"
the stream(s) to which the info packet applies
"Author"
"Description"
"Copyright"
"Encoder" the name & version of the software used for encoding
"Encoder"
the name & version of the software used for encoding
"Title"
"Cover" an image of the (CD, DVD, VHS, ..) cover (preferably PNG or JPEG)
"Source" "DVD", "VCD", "CD", "MD", "FM radio", "VHS", "TV",
"LD"
"Cover"
image of the (CD, DVD, VHS, ..) cover (preferably PNG or JPEG)
"Source"
"DVD", "VCD", "CD", "MD", "FM radio", "VHS", "TV", "LD"
Optional: appended PAL, NTSC, SECAM, ... in parentheses
"CaptureDevice" "BT878", "BT848", "webcam", ... (more exact names are fine too)
"CreationTime" "2003-01-20 20:13:15Z", ...
"CaptureDevice"
"BT878", "BT848", "webcam", ... (more exact names are fine too)
"CreationTime"
"2003-01-20 20:13:15Z", ...
(ISO 8601 format, see http://www.cl.cam.ac.uk/~mgk25/iso-time.html)
Note: do not forget the timezone
"Keywords"
"TotalTime" total length of the stream in msecs
"Language" ISO 639 and ISO 3166 for language/country code
"TotalTime"
total length of the stream in msecs
"Language"
ISO 639 and ISO 3166 for language/country code
something like "eng" (US english), can be 0 if unknown
and "multi" if several languages
see http://www.loc.gov/standards/iso639-2/englangn.html
and http://www.din.de/gremien/nas/nabd/iso3166ma/codlstp1/en_listp1.html the language code
"Disposition" "original", "dub" (translated), "comment", "lyrics", "karaoke"
Note: if someone needs some others, please tell us about them, so we can
add them to the official standard (if they are sane)
and http://www.din.de/gremien/nas/nabd/iso3166ma/codlstp1/en_listp1.html
the language code
"Disposition"
"original", "dub" (translated), "comment", "lyrics", "karaoke"
Note: if someone needs some others, please tell us about them, so we
can add them to the official standard (if they are sane)
Note: nonstandard fields should be prefixed by "X-"
Note: MUST be less than 64 bytes long