[MPlayer-dev-eng] Lots of stuff for NUT
Rich Felker
dalias at aerifal.cx
Sat Dec 31 07:00:28 CET 2005
On Sat, Dec 31, 2005 at 07:30:30AM +0200, Oded Shimon wrote:
> In other news:
>
> I've completed a frame code table generator! And it kicks ass quite a bit.
> Brings the overhead to 1 byte per packet in audio and 2 bytes per packet in
> video.
> The general idea:
>
> 1. Store ALL possible combinations of (stream, pts diff, size, is_key) in a
> hash, saying how many times each combination appeared.
> 2. Pick the top 10 items in the hash, and write explicit frame codes which
> handle them. This just about takes care of the entire audio stream, it
> appears almost all mp3 packets have the exact same size.
> 3. Take what is left in the hash, and resort by combinations of (stream,
> size, is_key) (discard size).
> 4. According to how "popular" a combination is, allocate it whatever is
> left of the ~230 frame codes where only msb needs to be written after
> frame code. The more popular, the bigger "mul" it gets.
>
> Here's the funny thing, in part 4, when deciding how popular a combination
> is, I had a bug at first making it decide not by how many packets there
> were with this combination, but by how many different sizes there were for
> this combinations (how many sub-combinations this combination had). It
> actually gave (slightly) BETTER results...
>
> Does anyone have any ideas to improove this generator?
> BTW, it's written in perl and it's slow as fuck, takes about 6 seconds to
> generate a table.
Anyone can make an optimal framecode table if you know the content in
advance. The tricky thing is making good framecode tables that work
well in just one pass.
Rich
More information about the MPlayer-dev-eng
mailing list