[MPlayer-dev-eng] i need help - transformation matrix

Felix Buenemann atmosfear at users.sourceforge.net
Sat Sep 7 03:45:31 CEST 2002


On Monday 26 August 2002 03:26, Arpi wrote:
> Hi,
>
> > > But - as usual - the .rm files store audio somehow reordered.
> > > It was rev.eng.'ed for 'COOK' audio, it was easy 'rotate the matrix by
> > > 90 degrees and swap row pairs' but it seems that SIPR is different and
> > > i can't find it out myself now.
> >
> > i still have no idea, but i did some more hacks.
>
> ok after some new tricks i got closer.
> this time the real demuxer operates on nibbles (half bytes) instead of
> bytes, so the only thing i need to do is splitting byte sto nibble pairs,
> reorder and then re-attach them.
> I've found that 37 nibbles are grouped together to a sub-block, so each
> block has 16 sub-blocks (16*37/2=0x128).
> Now the problem is reduced to the good old CRC matrices:
>
[matrices]
>
> so let's guess the transformation matrix/code now...
In order to make finding the algorithmn easier, I wrote a small perlscript 
that generates a html page with table containing the encoded and decoded 
matrix with each independant value having a different color, so you can see 
how the fields are moving around from encoded to decoded.

---snip---
# SYNTAX:
#
# "cat matrix1 matrix2 | ./mtxanalyze.pl <x> <y> > out.htm"
#
# Where <x> is the number of colums in _one_ matrix and <y> is
# the number of rows in _one_ matrix.
#
# NOTE: Both matrices must be of equal size and there must be no
#       empty lines (!) after the matrix in the datafiles.
#       Datafiles contain one row per line with columns delimited
#       by spaces.
---snip---

So in our case we call it with:
cat mtxenc.dat mtxdec.dat | ./mtxanalyze.pl 16 6 > output.htm

However the algorithm for choosing colors need improvement, this is what I 
currently do:
As html uses 24Bit colors, I do:
color = 0;
offset = 0xFFFFFF / (cols*rows);
Then generate html colorcode from printf("#%06X",color); color+=offset;

Probably better to generate some nice ordered palette with (col*rows) entries, 
but have no idea yet how to do it.
Maybe someone has a better approach.

I've put a sample generated html to http://mphq/~atmos4/mtxan.html

Attached are the script and sample inputs.

>
> A'rpi / Astral & ESP-team

-- 
Best Regards,
        Atmos
____________________________________________
- MPlayer Developer - http://mplayerhq.hu/ -
____________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mtxanalyze.pl
Type: text/x-perl
Size: 2349 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20020907/20fc6f6f/attachment.pl>
-------------- next part --------------
2591 1B5B 1B46 2627 1803 1C7D 1B5F 1B15 1D2E 15DC 1A75 1748 186C 1FCB 23AD 1B11
1BDB 242F 2329 1DD2 1A3C 185C 1A9B 1BF5 1FAC 1C8A 2031 1D12 2203 1FD7 1F87 1C5F
22B8 1C69 13D8 2010 1D74 19A7 1D58 1B80 1F42 1C8A 207B 135F 1824 1D7F 1C48 1CB3
197B 1879 23F9 21EE 1414 162B 1A43 1699 20BA 15F2 1A61 1EBE 2162 1A7E 184F 15E2
1A03 1796 1CB9 13E9 1F6F 1C0D 1B6C 1F3C 1FCC 21D2 1A9D 1650 17F1 1CD3 174E 1D6C
1E65 1656 1A42 20E4 1C27 14F0 1BC5 16D1 1A89 11D0 15F5 18E3 1557 1691 1BA3 1CCE
-------------- next part --------------
15E2 1A9B 1824 15F5 1803 1656 1B5F 1C5F 1BC5 1A61 1D74 1748 1F6F 1B80 21D2 162B
1C0D 15F2 2329 1A89 13D8 1F3C 1B5B 1BF5 1C48 1BA3 1A43 1D12 1650 23F9 1F87 1B15
1B6C 1557 1A3C 1A9D 1A75 19A7 14F0 1FCB 20BA 1C8A 16D1 1796 1B46 1EBE 1FAC 1CB3
1D6C 1691 1FD7 11D0 1414 1B11 2031 1CCE 1F42 242F 15DC 1D7F 2162 17F1 184F 2591
1A03 135F 1CB9 20E4 186C 1BDB 22B8 185C 1FCC 23AD 2010 2203 1A7E 1E65 174E 197B
1CD3 1C7D 1A42 13E9 1C27 1D58 1D2E 207B 1DD2 21EE 2627 18E3 1C69 1879 1C8A 1699


More information about the MPlayer-dev-eng mailing list