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

Oded Shimon ods15 at ods15.dyndns.org
Thu Jan 12 18:49:38 CET 2006


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]
>         }

high bitrate:
Syncpoints: 27462 size: 432818  (0 subtitle streams)
Syncpoints: 27473 size: 556043  (2 subtitle streams)
Syncpoints: 27518 size: 908791  (10 subtitle streams)

low bitrate:
Syncpoints: 19403 size: 296722  (0 subtitle streams)
Syncpoints: 19413 size: 358701  (2 subtitle streams)
Syncpoints: 19439 size: 536071  (10 subtitle streams)


> 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]
>         }

high bitrate:
Syncpoints: 27463 size: 463063  (0 subtitle streams)
Syncpoints: 27477 size: 672769  (2 subtitle streams)
Syncpoints: 27518 size: 1036744 (10 subtitle streams)

low bitrate:
Syncpoints: 19404 size: 310034  (0 subtitle streams)
Syncpoints: 19414 size: 403007  (2 subtitle streams)
Syncpoints: 19440 size: 586733  (10 subtitle streams)


try3:

syncpoint:
    startcode                               u(64)
    coded_pts                               v
    stream= coded_pts % stream_count
    pts= coded_pts/stream_count
    n= 0
    cache[n++]= 0
    cache[n++]= back_ptr[0]                 v
    A= 0
    for (i=1; i<stream_count; i++) {
        if (A==0) A                         v
        if (i==stream_count-1) {
            if (A>=n) back_ptr[i]= A-n
            else back_ptr[i]= cache[A]
        } else {
            if (A&1) {
                A>>= 1
                j= A%n;
                A/= n;
            } else {
                cache[n]= A>>1
                j= n++
                A= 0
            }
            back_ptr[i]= cache[j]
        }
    }

high bitrate:
Syncpoints: 27462 size: 430989  (0 subtitle streams)
Syncpoints: 27473 size: 553144  (2 subtitle streams)
Syncpoints: 27515 size: 817419  (10 subtitle streams)

low bitrate:
Syncpoints: 19403 size: 296722  (0 subtitle streams)
Syncpoints: 19413 size: 349040  (2 subtitle streams)
Syncpoints: 19434 size: 433317  (10 subtitle streams)


I win. :)

Assuming I didn't fuck anything up... I didn't check any of these except 
staring at the code thoroughly...

What I like about try3 is that unlike the other 2 it has no garuntee of 
1 byte per stream always... Also it prooved itself to be better. :)

Your ref idea is very possibly more efficient than all of these, however it 
comes at the high price of the muxer having to choose ref streams before 
hand, which is non-trivial. :/

We still need a way to efficiently code pts's for non zero decode delay 
streams together with all this, or are you not convinced yet?...



P.S. Old stats:

high bitrate:
just single pts:             Syncpoints: 27674 size: 315730
single back_ptr and pts:     Syncpoints: 27678 size: 391804
low bitrate:
just single pts:             Syncpoints: 19315 size: 229235
single back_ptr and pts:     Syncpoints: 19315 size: 276897


- ods15




More information about the MPlayer-dev-eng mailing list