[MPlayer-dev-eng] NUT cleanup
Michael Niedermayer
michaelni at gmx.at
Tue Sep 6 03:23:03 CEST 2005
Hi
On Mon, Sep 05, 2005 at 10:36:06PM +0300, Oded Shimon wrote:
> On Mon, Sep 05, 2005 at 02:59:46PM -0400, Rich Felker wrote:
> > On Mon, Sep 05, 2005 at 09:43:47PM +0300, Oded Shimon wrote:
[...]
>
> New patch.
comments added, feel free to apply the hunks with "ok" unless of
course there are objections from someone
note, a lack of a ok doesnt mean i disagree, just that iam not sure /
too tired ATM ...
resend the remaining and ill write some meaningfull comments or more
oks
[...]
> --- ../main/DOCS/tech/mpcf.txt 2005-06-19 12:17:44.000000000 +0300
> +++ mpcf.txt 2005-09-05 22:32:21.000000000 +0300
> @@ -126,7 +126,7 @@
> for(i=0; i<256; ){
> tmp_flag v
> tmp_fields v
> - if(tmp_fields>0) tmp_timestamp s
> + if(tmp_fields>0) tmp_pts s
> if(tmp_fields>1) tmp_mul v
> if(tmp_fields>2) tmp_stream v
> if(tmp_fields>3) tmp_size v
ok
> @@ -143,7 +143,7 @@
> stream_id_plus1[i]= tmp_stream;
> data_size_mul[i]= tmp_mul;
> data_size_lsb[i]= tmp_size + j;
> - timestamp_delta[i]= tmp_timestamp;
> + pts_delta[i]= tmp_pts;
> reserved_count[i]= tmp_res;
> }
> }
ok
> @@ -156,10 +156,9 @@
> stream_id v
> stream_class v
> fourcc vb
> - average_bitrate v
> time_base_nom v
> time_base_denom v
> - msb_timestamp_shift v
> + msb_pts_shift v
> decode_delay v
> fixed_fps u(1)
> reserved u(6)
ok
> @@ -183,6 +182,11 @@
> reserved_bytes
> checksum u(32)
>
> +other_stream_header:
> + stream_header
> + reserved_bytes
> + checksum u(32)
> +
> Basic Packets:
>
> frame:
ok
> @@ -190,8 +194,8 @@
> if(stream_id_plus1[frame_code]==0){
> stream_id v
> }
> - if(timestamp_delta[frame_code]==0){
> - coded_timestamp v
> + if(pts_delta[frame_code]==0){
> + coded_pts v
> }
> if(flags[frame_code]&1){
> data_size_msb v
ok
[...]
> for(i=0; i<stream_count; i++){
> if(next_packet==video_stream_header)
> video_stream_header
> - else
> + else if(next_packet==audio_stream_header)
> audio_stream_header
> + else
> + other_stream_header
> }
> while(next_code != main_startcode){
> if(next_code == info_startcode)
ok
[...]
> Tag description:
>
> forward_ptr
> - size of the packet (exactly the distance from the first byte of the
> - startcode of the current packet to the first byte of the following
> - packet
> + size of the packet data (exactly the distance from the first byte
> + after the forward_ptr to the first byte of the next packet)
>
> file_id_string
> "nut/multimedia container\0"
ok
[...]
> @@ -313,11 +324,8 @@
> SHOULD be set to <=32768 or at least <=65536 unless there is a very
> good reason to set it higher
>
> -stream_id[FIXME]
> +stream_id
> Stream identifier
> - Note: streams with a lower relative class MUST have a lower relative id
> - so a stream with class 0 MUST always have an id which is lower than any
> - stream with class > 0
> stream_id MUST be < stream_count
>
> stream_class
ok
[...]
> @@ -335,45 +345,38 @@
> if needed
>
> time_base_nom / time_base_denom = time_base
> - the number of timer ticks per second, this MUST be equal to the fps
> + the length of a timer tick in seconds, this MUST be equal to the 1/fps
> if the fixed_fps is 1
> - time_base_denom MUST NOT be 0
> + time_base_nom and time_base_denom MUST NOT be 0
> time_base_nom and time_base_denom MUST be relatively prime
> - time_base_nom MUST be < 2^31
> + time_base_denom MUST be < 2^31
> examples:
> fps time_base_nom time_base_denom
> - 30 30 1
> - 29.97 30000 1001
> - 23.976 24000 1001
> - sample_rate sample_rate_mul time_base_nom time_base_denom
> - 44100 1 44100 1
> - 44100 64 11025 16
> - 48000 1024 375 8
> -
> - Note: the advantage to using a large sample_rate_mul is that
> - the timestamps need fewer bits
> + 30 1 30
> + 29.97 1001 30000
> + 23.976 1001 24000
>
> global_time_base_nom / global_time_base_denom = global_time_base
> - the number of timer ticks per second
> - global_time_base_denom MUST NOT be 0
> + the length of a timer tick in seconds
> + global_time_base_nom and global_time_base_denom MUST NOT be 0
> global_time_base_nom and global_time_base_denom MUST be relatively prime
> - global_time_base_nom MUST be < 2^31
> + global_time_base_denom MUST be < 2^31
ok
[...]
> -msb_timestamp_shift
> - amount of bits in lsb_timestamp
> +msb_pts_shift
> + amount of bits in lsb_pts
> MUST be <16
>
> decode_delay
ok
> @@ -416,47 +419,44 @@
> data_size_lsb[frame_code]
> must be <16384
>
> -timestamp_delta[frame_code]
> +pts_delta[frame_code]
> must be <16384 and >-16384
>
> data_size
> data_size= data_size_lsb + data_size_msb*data_size_mul;
>
ok
[...]
>
> -lsb_timestamp
> - least significant bits of the timestamp in time_base precision
> +lsb_pts
> + least significant bits of the pts in time_base precision
> Example: IBBP display order
> - keyframe timestamp=0 -> timestamp=0
> - frame lsb_timestamp=3 -> timestamp=3
> - frame lsb_timestamp=1 -> timestamp=1
> - frame lsb_timestamp=2 -> timestamp=2
> + keyframe pts=0 -> pts=0
> + frame lsb_pts=3 -> pts=3
> + frame lsb_pts=1 -> pts=1
> + frame lsb_pts=2 -> pts=2
> ...
> - keyframe msb_timestamp=257 -> timestamp=257
> - frame lsb_timestamp=255->timestamp=255
> - frame lsb_timestamp=0 -> timestamp=256
> - frame lsb_timestamp=4 -> timestamp=260
> - frame lsb_timestamp=2 -> timestamp=258
> - frame lsb_timestamp=3 -> timestamp=259
> - all timestamps of keyframes of a single stream MUST be monotone
> + keyframe msb_pts=257 -> pts=257
> + frame lsb_pts=255->pts=255
> + frame lsb_pts=0 -> pts=256
> + frame lsb_pts=4 -> pts=260
> + frame lsb_pts=2 -> pts=258
> + frame lsb_pts=3 -> pts=259
> + all pts's of keyframes of a single stream MUST be monotone
>
> dts
> dts is calculated by using a decode_delay+1 sized buffer for each
> stream, into which the current pts is inserted and the element with
> the smallest value is removed, this is then the current dts
> this buffer is initalized with decode_delay -1 elements
> - all frames with dts == timestamp must be monotone, that means a frame
> - which occures later in the stream must have a larger or equal dts
> - than an earlier frame
> - FIXME rename timestamp* to pts* ?
> + all frames must be monotone, that means a frame which occures later
> + in the stream must have a larger or equal dts than an earlier
> + frame.
>
> width/height
> MUST be set to the coded width/height
ok
[...]
> @@ -490,6 +496,11 @@
> 2 consecutive index entries if they are more than max_index_distance
> apart
>
> +index_ptr
> + length in bytes from the first bytes of the first index startcode
> + to the first byte of the index_ptr. If there is no index, index_ptr
> + MUST be zero.
> +
> id
> the id of the type/name pair, so it's more compact
> 0 means end
ok
> @@ -582,6 +593,8 @@
>
> Index
> Note: with realtime streaming, there is no end, so no index there either
> +An index SHOULD be written for every stream. Indexes MUST be placed at end
> +of file. Indexes MAY be repeated for a stream.
>
> Info packets
> the info_packet can be repeated, and can also contain different names & values
ok
[...]
> @@ -692,3 +709,4 @@
> Gereoffy, Arpad (arpi at thot.banki.hu)
> Hess, Andreas (jaska at gmx.net)
> Niedermayer, Michael (michaelni at gmx.at)
> + Shimon, Oded (ods15 at ods15.dyndns.org)
ok
[...]
--
Michael
More information about the MPlayer-dev-eng
mailing list