[MPlayer-dev-eng] [PATCH] Alternative RealAudio decoder

Arpi arpi at thot.banki.hu
Thu Jun 13 17:53:00 CEST 2002


Hi,

> > i really didn't want to duplicate your work :(
> > i've just found it easy to implement based on your docs, of course it turn
> ed
> > out at the end that it is not so easy (interleaving etc) but i didn't gave
> > it up then ;)
> > 
> 
> I have only understood parts of the interface at that time. This 
> interleaving had been an interesting thing - it took some time to 
> understand what they really want.

it was not new for me, not even surprise, knowing how similar rm to asf is
asf uses teh same thing for audio (even teh video sub-demuxer is similar)
just different reordering algo (asf just rotate matrix by 90 degrees but
doesn't reorder columns)

> > yes, i see it in your patch now
> > anyway it's more difficult imho, there is the lotr_trailer2.rm, it plays
> > well with 20fps, but actually it uses 30fps, but lots of skipped frames
> > 
> 
> How (and why) did they do that? When I understand you correctly, the 
> player gets the information that the frame rate is 20 fps, but then 
> playing we get 30 frames per second and we have to remove several frames 
> by ourselves.

no
they compressed that rm from 30fps (ntsc?) source, but to keep the very
restricted bitrate and acceptable quality, they dropped frames.
so they have 30fps in the header (as wanted playback rate) but actually
there is avg 20 frames per second stored in the file.

atmos told me that rm codec can do interpolation in such cases to get the
missing frames - maybe those custonmcalls are to control this, and mayeb
postprocessing and other cpu-eating thingies

> There are some other problematic files (Pen3.rm on the ftp server) - it 
> plays mostly garbage with sunday's cvs. Maybe it is fixed by now.

no, it's abd and Albeu's files are all bad.
i cannot find the reason, everything seems to be ok, but...
some packets is not finished - ie no 0x8X hdr bytes but seq number changes
and starts a new packet. it's handled anyway...

but, by tracing realplayer i found that it actually don;t pass all teh data
to the codec!!! for example, there is 19XXX byte long packet (assembled from
19 sub-packets) but it passes only 17XXX bytes and offsets of first 17
sub-packets.

i don't know why does it ignore last 0-3 sub-packets of big packets

> > anyway the trick i use is not perfect, when there are more B frames than t
> he
> > encoder predicted (when encoded the next reference frame), the timestamp i
> s
> > bad (behind the previous in time). in such cases i have to re-calc it, by
> > adding 1/fps to the previous valid timestamp
> > 
> > i've found what the numbers in transform_out[5] means:
> > [0] - number of decoded frames (zero for first P frame after I)
> 
> counted from the last I-frame? sorry, but I've never tried to understand 
> the values (except the last two)

no, they are absolute timestamps from teh beginning teh file. only if you
passed packet timestamp in transin1.
if you pass zero in transin1 (as is in the cvs now) it will restart counting
from 0 at every I/P frame

but i already have working a-v sync code (perfect sync), just needs to
cleanup before i can commit

> > [1] - flags: keyframe, predicted frame (frame type I/P/B can be determined
> )
> > [2] - timestamp (it's calculated from that 12 bits in video data and the
> > packet timestamp you pass in transin1[])
> > [3] - w
> > [4] - h
> > 
> > so, realplayer probably gets the accurate timestamp (so fps is not used)
> 
> When I understand you correctly, the problem still persists. Can't check 
> it here (windoze machine).

solved in my hdd, but too messy to be commitable to cvs
(it uses static globals to keep states, i'll move them to ds struct, and i
have to implement pts prediction for cases when it's bad or missing)

> >>from the video decoder.
> > 
> > anyway rv30 is nice, it uses 2..6 B frames between P frames
> > 
> 
> Is the problem only in rv20?

no
i didn't check rv20 yet, only rv30

> BTW: Does anyone know a Region 2 DVD (sold in Germany) that uses 
> multiple angle extensivly (not only "präsentiert" <-> "presents") and is 
> no adult movie? I'd like to have different views or un-cut scenes, i.e. 
> different versions of the movies.

afaik The Matrix has such scenes, but i don't have that dvd
i'm also hunting for such discs


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list