[MPlayer-dev-eng] [PATCH] Realplayer codec support

Arpi arpi at thot.banki.hu
Fri Jun 7 22:57:02 CEST 2002


Hi,

> > i hope it's constructed by the transform stuff.
> 
> > 
> > but i have the feeling that it's come from rv30.so, their sub-demuxer.
> 
> I will look at the input/output of rv30.so. But I hope we don't need 
> this dll.
> 
Mee too... but.. :(

i've tracked down the routine using that table and disassembled, psuedo code:

## if(num_sub_packets_in_block_minus_one==0) return 1;

## esi=something1();  // block start_pos ???
## [ebp-4]=something2(); // block end_pos ???
## eax=8*transin1[1]; // eax=first_offset (always 0)
## if(eax>esi) goto 0x4065d9e7; // start_pos<first_offset -> error 
## if(esi>=[ebp-4]) goto 0x4065d9e7;  // end_pos<=start_pos -> error

## if((edi=1) >= num_sub_packets_in_block_minus_one) goto 0x4065d9c7
## eax=8*transin1[1+1*2];
## if(eax>esi) goto 0x4065d9c7

loop:
## if(++edi >= num_sub_packets_in_block_minus_one) goto 0x4065d9c7
## eax = 8*transin1[1+edi*2];
## if(eax<=esi) goto loop;

0x4065d9c7:
## if(num_sub_packets_in_block_minus_one!=edi) goto 0x4065d9f0;
## if( ([ebp-4]-esi)>7 ) goto 0x4065da20;
## if( (eax=something3()) == 0 ) goto 0x4065da20;

0x4065d9e7:
## return(0);

0x4065d9f0:
## eax=8*transin1[1+edi*2]-esi;
## if(eax>7) goto 0x4065da20;
## if(something4(num_sub_packets_in_block_minus_one,eax,0,0)==0) goto 0x4065da20;
## return transin1[edi*2];

0x4065da20:
## return transin1[(edi-1)*2];

so. first i thought this is a tipical vlc/huffman decoder (tree walker),
especially that 'left vs right' decision at the end reminds me to my old
huffman stuff.
but after about 50 times re-reading this, i think i found the purpose of
this hack. this is just a table (pair of dwords) of sub-blocks (offset + size),
and this routine is called to fill up bit-buffers (or its pointers). this
explains those 8* multiplications before comparing start/end (bit)position

it seems they were just too lazy to append sub-chunks in their demuxer,
rather they created an indexed table of them and do this mess in the codec.

time to compare demuxer's debug prints with transin1[] dump from realplayer


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