[MPlayer-dev-eng] Lots of stuff for NUT

Michael Niedermayer michaelni at gmx.at
Thu Jan 12 16:02:21 CET 2006


Hi

On Thu, Jan 12, 2006 at 03:45:16AM +0100, Michael Niedermayer wrote:
> Hi
> 
> On Wed, Jan 11, 2006 at 09:12:49PM +0200, Oded Shimon wrote:
> > On Wed, Jan 11, 2006 at 04:54:37PM +0100, Michael Niedermayer wrote:
> > > On Wed, Jan 11, 2006 at 04:58:46PM +0200, Oded Shimon wrote:
> > > > I think if we code it efficiently, we might as well go for the "almost" 
> > > > single pts and save ourselves the high complexity, it is simply not worth 
> > > > it.
> > > 
> > > IMHO having syncpoints point to themselfs is ugly and having more then the
> > > needed pts is ugly too
> > 
> > P.S. I thought it over and I agree, here's a new back_ptr dump, the only 
> > zero back_ptr's are the first syncpoints in the file, and ones after an 
> > EOR...
> 
> try1:
> 
> syncpoint:
>         startcode                               u(64)
>         coded_pts                               v
>         stream = coded_pts % stream_count
>         pts = coded_pts/stream_count
>         u[0]= back_ptr[0]                       v
>         u_count= 1
>         for (i=1; i<stream_count; i++) {
>                 A                               v
>                 A1= A>>1;
>                 if(A&1){
>                     u[u_count]= A1;
>                     A1= u_count++;
>                 }else if(A1 >= u_count){
>                     u[u_count]= u[A1 % u_count];
>                     A1 /= u_count;
>                     if(A1&1) u[u_count] += A1>>1;
>                     else     u[u_count] -= A1>>1;
>                     A1= u_count++;
>                 }
>                 back_ptr[i]= u[A1]
>         }
> 
> try2:
> 
> syncpoint:
>         startcode                               u(64)
>         coded_pts                               v
>         stream = coded_pts % stream_count
>         pts = coded_pts/stream_count
>         u[0]= 0
>         u[1]= back_ptr[0]                       v
>         u_count= 2
>         for (i=1; i<stream_count; i++) {
>                 A                               v
>                 if(A >= u_count){
>                     u[u_count]= u[A % u_count];
>                     A /= u_count;
>                     if(A&1) u[u_count] += A>>1;
>                     else    u[u_count] -= A>>1;
>                     A= u_count++;
>                 }
>                 back_ptr[i]= u[A]
>         }

here are a few more ideas:
1. hardcode the reference stream for each stream in the stream header so
that we dont need to store the log(uniqe_streams) for them
additionally add a single bit in the coded_pts to switch between this hardcoded
relation and the variable per syncpoint relation

2. hardcode the reference stream for each stream in the stream header and
store 1 bit per stream in the syncpoint to indicate if the back_ptr is equal
if not encode the signed diference, that should look like:

syncpoint:
        startcode                               u(64)
        coded_pts                               v
        stream = coded_pts % stream_count
        pts = coded_pts/stream_count
        for (i=1; i<stream_count; i+=8)
            is_equal[i..i+8]                    u(8)
        for (i=0; i<stream_count; i++) {
            if(is_equal[i])
                back_ptr[i]= 0
            else
                back_ptr[i]                     s
            back_ptr[i] += back_ptr[ ref[i] ];
        }

[...]
-- 
Michael




More information about the MPlayer-dev-eng mailing list