[NUT-devel] Welcome...
Oded Shimon
ods15 at ods15.dyndns.org
Sun Feb 12 19:26:11 CET 2006
On Sun, Feb 12, 2006 at 07:04:31PM +0100, Michael Niedermayer wrote:
> On Sun, Feb 12, 2006 at 07:37:55PM +0200, Oded Shimon wrote:
> > Anyway, the only thing I'm kind of worried about is how to put this in
> > spec. Just have 2 fixed codes in the stream header, for keyframes and for
> > non keyframes?... Also, do ALL frames get it, or can it be flagged off?
>
> dunno, but we might even add it into the framecode table so each framecode
> could have a different "prefix"
> * no flag needed
> * fully optional on the muxer side
> * still as easy for the demuxer as if its in the stream header
> * theoretically lower overhead / more flexible
Yeah, I was thinking same thing, only reason I wanted to avoid it is that
it's just slightly unfriendly to C - dynamic array for any possible
prefixes in stream header.. But that's just a slight implementation issue.
Ok, here's my proposed patch...
Note that data_size does NOT include the length of prefix, because it would
make all stream headers essential to demux nut file.
- ods15
-------------- next part --------------
Index: DOCS/tech/mpcf.txt
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/tech/mpcf.txt,v
retrieving revision 1.104
diff -u -r1.104 mpcf.txt
--- DOCS/tech/mpcf.txt 12 Feb 2006 17:40:02 -0000 1.104
+++ DOCS/tech/mpcf.txt 12 Feb 2006 18:25:31 -0000
@@ -130,6 +130,7 @@
version v
stream_count v
max_distance v
+ tmp_prefix=1
tmp_pts=0
tmp_mul=1
tmp_stream=0
@@ -138,16 +139,17 @@
tmp_fields v
if(tmp_fields>0) tmp_sflag v
else tmp_sflag=0
- if(tmp_fields>1) tmp_pts s
- if(tmp_fields>2) tmp_mul v
- if(tmp_fields>3) tmp_stream v
- if(tmp_fields>4) tmp_size v
+ if(tmp_fields>1) tmp_prefix v
+ if(tmp_fields>2) tmp_pts s
+ if(tmp_fields>3) tmp_mul v
+ if(tmp_fields>4) tmp_stream v
+ if(tmp_fields>5) tmp_size v
else tmp_size=0
- if(tmp_fields>5) tmp_res v
+ if(tmp_fields>6) tmp_res v
else tmp_res=0
- if(tmp_fields>6) count v
+ if(tmp_fields>7) count v
else count= tmp_mul - tmp_size
- for(j=7; j<tmp_fields; j++){
+ for(j=8; j<tmp_fields; j++){
tmp_reserved[i] v
}
for(j=0; j<count && i<256; j++, i++){
@@ -158,6 +160,7 @@
}
flags[i]= tmp_flag;
stream_flags[i]= tmp_sflag;
+ frame_prefix_plus1[i]= tmp_prefix;
stream_id_plus1[i]= tmp_stream;
data_size_mul[i]= tmp_mul;
data_size_lsb[i]= tmp_size + j;
@@ -182,6 +185,10 @@
fixed_fps u(1)
reserved u(7)
codec_specific_data vb
+ nprefixes v
+ prefix_data[0] = zero-length-data
+ for(i=0; i<nprefixes; i++)
+ prefix_data[i+1] vb
video_stream_header:
stream_header
@@ -222,6 +229,9 @@
if(flags[frame_code]&2){
coded_stream_flags v
}
+ if(frame_prefix_plus1[i]==0){
+ frame_prefix v
+ }
for(i=0; i<reserved_count[frame_code]; i++)
reserved v
if (after_syncpoint){
@@ -492,6 +502,11 @@
must be <250
if it is 0, then the stream_id is coded in the frame
+frame_prefix
+ Index to prefix_data array set up in stream header.
+ Specifies data to prefix to frame data, e.g. a codec startcode.
+ If frame_prefix is zero, no data is prefixed to frame.
+
data_size_mul[frame_code]
must be <16384
@@ -503,6 +518,7 @@
data_size
data_size= data_size_lsb + data_size_msb*data_size_mul;
+ data_size does not include length of frame_prefix.
coded_pts
if coded_pts < (1<<msb_pts_shift) then it is an lsb
More information about the NUT-devel
mailing list