Commit 119bfda5 authored by Monty's avatar Monty

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
parent a359a8ad
This diff is collapsed.
......@@ -11,7 +11,7 @@
********************************************************************
function: toplevel residue templates 16/22kHz
last mod: $Id: residue_16.h,v 1.3 2002/07/11 10:27:55 xiphmont Exp $
last mod: $Id$
********************************************************************/
......@@ -21,7 +21,7 @@ static static_bookblock _resbook_16s_0={
{
{0},
{0,0,&_16c0_s_p1_0},
{0,0,&_16c0_s_p2_0},
{0},
{0,0,&_16c0_s_p3_0},
{0,0,&_16c0_s_p4_0},
{0,0,&_16c0_s_p5_0},
......@@ -35,7 +35,7 @@ static static_bookblock _resbook_16s_1={
{
{0},
{0,0,&_16c1_s_p1_0},
{0,0,&_16c1_s_p2_0},
{0},
{0,0,&_16c1_s_p3_0},
{0,0,&_16c1_s_p4_0},
{0,0,&_16c1_s_p5_0},
......
......@@ -11,7 +11,7 @@
********************************************************************
function: toplevel residue templates 8/11kHz
last mod: $Id: residue_8.h,v 1.2 2002/07/11 06:41:04 xiphmont Exp $
last mod: $Id$
********************************************************************/
......@@ -22,17 +22,29 @@
static static_bookblock _resbook_8s_0={
{
{0},{0,0,&_8c0_s_p1_0},{0,0,&_8c0_s_p2_0},{0,0,&_8c0_s_p3_0},
{0,0,&_8c0_s_p4_0},{0,0,&_8c0_s_p5_0},{0,0,&_8c0_s_p6_0},
{&_8c0_s_p7_0,&_8c0_s_p7_1},{&_8c0_s_p8_0,&_8c0_s_p8_1},
{0},
{0,0,&_8c0_s_p1_0},
{0},
{0,0,&_8c0_s_p3_0},
{0,0,&_8c0_s_p4_0},
{0,0,&_8c0_s_p5_0},
{0,0,&_8c0_s_p6_0},
{&_8c0_s_p7_0,&_8c0_s_p7_1},
{&_8c0_s_p8_0,&_8c0_s_p8_1},
{&_8c0_s_p9_0,&_8c0_s_p9_1,&_8c0_s_p9_2}
}
};
static static_bookblock _resbook_8s_1={
{
{0},{0,0,&_8c1_s_p1_0},{0,0,&_8c1_s_p2_0},{0,0,&_8c1_s_p3_0},
{0,0,&_8c1_s_p4_0},{0,0,&_8c1_s_p5_0},{0,0,&_8c1_s_p6_0},
{&_8c1_s_p7_0,&_8c1_s_p7_1},{&_8c1_s_p8_0,&_8c1_s_p8_1},
{0},
{0,0,&_8c1_s_p1_0},
{0},
{0,0,&_8c1_s_p3_0},
{0,0,&_8c1_s_p4_0},
{0,0,&_8c1_s_p5_0},
{0,0,&_8c1_s_p6_0},
{&_8c1_s_p7_0,&_8c1_s_p7_1},
{&_8c1_s_p8_0,&_8c1_s_p8_1},
{&_8c1_s_p9_0,&_8c1_s_p9_1,&_8c1_s_p9_2}
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment