The automated book training scripts managed to create a few residue
authorMonty <xiphmont@xiph.org>
Fri, 22 Jun 2007 03:34:25 +0000 (03:34 +0000)
committerMonty <xiphmont@xiph.org>
Fri, 22 Jun 2007 03:34:25 +0000 (03:34 +0000)
commit119bfda524fbbf1e6a3cfe13e60a753dd0e78539
tree14a37b6645a6db4daf98f3b4c2e1ee8ce5838259
parenta359a8ad3ed36159af74b10d0c66e2ff44924c82
The automated book training scripts managed to create a few residue
books with no codewords (in that mode with that partitioning scheme,
no values happened to fall into that partition).  This is not really
an error.

However, the residue encoding code did not account for the possibility
of looking up a codebook best match and finding no entries.  Because
the unused book only came up very rarely (four hours of training audio
didn't hit it once), it took a while to notice and only comes up on
platforms with subtly different FP than the machine used to do
training.

This bug affects very low bitrate stereo 8, 11, 16 and 22kHz modes;
added code to check for 'no match in codebook' (correct behavior is to
encode nothing) and for good measure, removed the four dummy codebooks
as there's no point in wasting a few bytes in the header to pack a
nothing.

Closes bug 1142.

svn path=/trunk/vorbis/; revision=13170
lib/books/coupled/res_books_stereo.h
lib/modes/residue_16.h
lib/modes/residue_8.h