[MPlayer-dev-eng] NUT pts/startcode optimization proposal
Ville Saari
114263 at foo.bar.org
Mon May 3 22:15:00 CEST 2004
On Sun, May 02, 2004 at 02:57:18PM -0400, D Richard Felker III wrote:
> >From the nut spec:
>
> coded_timestamp
> if coded_timestamp < (1<<msb_timestamp_shift) then its a
> lsb timestamp, otherwise its a full timestamp + (1<<msb_timestamp_shift)
> lsb timestamps are converted to full timesamps by:
> mask = (1<<msb_timestamp_shift)-1;
> delta= last_timestamp - mask/2
> timestamp= ((timestamp_lsb-delta)&mask) + delta
> a full timestamp must be used if there is no reference timestamp
> available after the last frame_startcode with the current stream_id
Is there some reason for the definition of the lsb timestamps to be so
complicated? It gives the exact same range of lsb-encodable timestamps
as would the much more obvious definition:
bias = -((1<<msb_timestamp_shift-1)-1)
timestamp = last_timestamp + bias + timestamp_lsb
In this case "delta" would be more appropriate name than "lsb".
A more useful range could be accomplished by adding some
educated guess of the delta to the bias. For example the median of
initial_timestamp_predictors. Or would the average of minimum and
maximum initial_timestamp_predictor be better?
--
Ville
More information about the MPlayer-dev-eng
mailing list