[vorbis-dev] lossless ogg encoding with good compression rate

Francesco R. francesco at pnpitalia.it
Fri Jun 27 01:46:45 PDT 2003



First of all, sorry I've lost quite all the thread, I'm subscribed again
with this mail address

the difference on my files has NEVER been over 0xFFF, but what you say
it's correct.

Now we can procede in two ways, accept the in the real life there are
some risks and accept them ;) or intercept this cases and round them
to the maior number we can, it's time consuming but also on the encoding
part of the process.

Francesco Riosa

<p>----- Original Message ----- 
From: "Lourens Veen" <lourens at rainbowdesert.net>
To: <vorbis-dev at xiph.org>; "Beni Cherniavsky"
<cben at techunix.technion.ac.il>; "General purpose mail"
<maillist at pnpitalia.it>
Sent: Thursday, June 26, 2003 9:01 PM
Subject: Re: [vorbis-dev] lossless ogg encoding with good compression rate

<p>On Thu 26 June 2003 12:53, Beni Cherniavsky wrote:
> Charles Keepax wrote on 2003-06-26:
> > Just to add my 2 cents, surely the difference will always be
> > quite small , thus you don't need the full 16-bits for each one
> > in the PCM file. i.e. say each difference could be 8-bits, thus
> > halfing the difference file size. Although just a passing
> > though and might not work in practice.
>
> You can't be 100% sure, what if in one sample of million it
> isn't? Bzip2 will take advantage of the values being small
> anyway.

There's another problem though. The difference of two signed 16-bit
numbers is somewhere between 32767 - (-32768) = 65535 and (-32768)
- 32767 = -65535. That is, you need 17 bits to specify the
difference in the most general case. The PHP code given in the
other post chops off the most significant bit of the difference. Oh
and incidentally, the last four bytes of the file not being copied
is the result in an off-by-one error in the for loop, it should
read

  for($i=0; $i < $blockSize; $i += 2) {

instead of

  for($i=0; $i < $blockSize -2; $i += 2) {

and the other two bytes are in

 $blockSize = max(filesize($filename1) -2, 0);

which I figure should be

 $blockSize = max(filesize($filename1), 0);

Lourens

-- 
GPG public key: http://home.student.utwente.nl/l.e.veen/lourens.key

<p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.




More information about the Vorbis-dev mailing list