[MPlayer-dev-eng] [PATCH] real demuxer fix V3

Arpi arpi at thot.banki.hu
Thu Feb 13 00:15:54 CET 2003


Hi,

> 
> > ah  ((x&0x1F)<0x18 is not correct now I realize

((x&0x1F)<0x18) is equivalent to (!(s&0x10)||!(s&0x08))

> > as eg. 7? is I/P
> aaaaaa no i meant  ((x&0x4F)==0x40) 
huh?

> is not correct as 6? is I/P
> (you had a typo there too didn't you :])
> 
> I am tired + this is what I am talking about :]

please understand that i'm not fighting with this 'optimization' by fun,
but it's still much more reliable (and faster :)) than your 'list 57
numbers i've found in the samples i've tested in a long if()) because
it will work with the rest (you didn't checked/have sample) too.

all video formats (supporting B frames) i know stores image type in 2 bits.
mostly at fixed position, depending on codec.
the rest (6 bits!) is unrelated, so we should mask them out, and only
check that 1-2 bits we care of.

for realmedia it seems that there are 2 bits, the first (0x10) means
keyframe (0=keyframe 0x10=non-keyframe), and teh other bit is the P vs B
when non-keyframe (0=P 8=B). it results in 0x18=B 0x10=P 0x00/0x08=I

it has no sense to rely on the other bits, they are unrelated to frame type,
at least for RV30. probably the bits masks/values for RV40 are different, it
has to be rev.eng'ed for that format. your values suggest that same 2 bits
are present there but a bit shifted up...
it's quite easy job anyway, just print that byte in binary for every frame,
and then the timestamps (the LSB part from frame header) and then check that
which bits are significant for frame type. you can expect IBBPBBPBBPBBIBBP..
structure, but it's clearly visible from the timestamps.
if you're unable to do it, tell me that instead of flaming about the patch.

also did you notice that vd_realvid has an commented debug part (unless alex
removd at cleanup) to get the codec do this calculation, so you can verify
if your math is correct. i've did it for rv30 thus i'm sure my code (what
you called broken) is 100% correct, at least for samples i had that time.


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
    "However, many people beg for its inclusion in Debian. Why?" - Gabucino
  "Because having new software in Debian is good." - Josselin Mouette
"Because having good software in Debian is new." - Gabucino


More information about the MPlayer-dev-eng mailing list