[MPlayer-dev-eng] [PATCH] resubmit realv4.diff

D Richard Felker III dalias at aerifal.cx
Sun Mar 9 21:44:04 CET 2003


On Sun, Mar 09, 2003 at 08:08:14PM +0100, Arpi wrote:
> Hi,
> 
> > So in this part
> > if ((priv->kf_pts==65535) || s[0]==0 || s[0]==1) {
> > +           int tmp=(timestamp&0x1fff)-kf;
> > +           if ((ABS(priv->kf_pts_error-tmp) > 100) || (priv->kf_pts==65535)) 
> > drop=1;
> > +           priv->kf_pts_error=tmp;
> > +           mp_msg(MSGT_DEMUX,MSGL_V,"kf_pts vs. stream_pts desync: 
> > %d\n",priv->kf_pts_error);
> > +       }
> 
> i've just commited my fix (mostly based on your patches but a bit cleaner)
> please test it.
> 
> > if you change "|| s[0]==0 || s[0]==1" to
> > eg. ((unsigned char)s[0]<0x10) than it works ok.
> > I don't remember why i put 0 and 1 there, maybe otherwise
> 
> for RV30 it's 0||1 while for RV40 it's <0x10 due to pict_type shifted by 2.
> (actually you're checking for pict_type<=1 but such ugly way :))
> 
> so, you were right about "discontiunity" thing, they do reset their LSB
> timestamp counters at I frames sometimes, so I've changed code in CVS to use
> 'timestamp' as-is for I frames and calculate precise value based on LSB bits
> only for P/B frames, using the base difference iof the I frame's PTS.
> it seems to work fine for all files i've tried. i've even compared values
> given by my code and the codec (patched vd_realvid.c to print transform_out[2])
> and they matched for most of frames, for the few they didn't my values seems
> better (the values given by codec were smaller than I frame's PTS).
> (maybe teh codec is right? and we should drop those frames??)

Perhaps some sort of backwards prediction?

Rich



More information about the MPlayer-dev-eng mailing list