[MPlayer-dev-eng] NUT index proposal

Rich Felker dalias at aerifal.cx
Fri Jan 6 21:44:03 CET 2006


On Fri, Jan 06, 2006 at 09:05:44PM +0100, Michael Niedermayer wrote:
> Hi
> 
> heres yet another idea for a compact index for nut, it combines several ideas
> it doesnt store per stream pts but that could be added easily ...
> 
> syncpoint_count                         v
> for(i=0; i<syncpoint_count; i++){
>     pos_div8_diff                       v
>     pts_diff                            v (stored as stream_id + n*pts_diff)
> }

Hmm, when storing pts this way (different timebase for each diff,
using pts diffs), it requires a timebase conversion per syncpoint. At
25000 syncpoints for a typical file, this could take a lot of
processing time. IIRC it's several 64/32 divides. I'm not sure if it
matters or not.

With per-stream pts you never have to do any conversion to load the
index, only to see if the timestamp is less/greater than the
destination at seek time.

> for(i=0; i<stream_count; i++){
>     for(j=0; j<syncpoint_count; ){
>         x                               v
>         type= x & 3
>         if(type & 1){
>             x>>=2;
>             while(x--)
>                 has_keyframe[j++][i]=type & 2;
>             has_keyframe[j++][i]=type ^ 3;
>         }else{
>             while(x>3)[
>                 x>>=1;
>                 has_keyframe[j++][i]=x&1;
>             }
>         }
>     }
> }
> 
> if the overhead of this is small enough which i belive it is then i see
> no problem with accepting it

Yes this does look like it would be very small. :)

Rich




More information about the MPlayer-dev-eng mailing list