diff options
author | Monty <xiphmont@xiph.org> | 2001-12-04 11:17:25 +0000 |
---|---|---|
committer | Monty <xiphmont@xiph.org> | 2001-12-04 11:17:25 +0000 |
commit | c6ec64eaa03fc3d09c1586c879788707e25808de (patch) | |
tree | 8ab2f54246fab6357289609dafe7241a743a3207 | |
parent | 7ed3a072522aa3879a130068db8f8cc7d3c0c376 (diff) | |
download | libvorbis-git-c6ec64eaa03fc3d09c1586c879788707e25808de.tar.gz |
incrememntal work; don't lose it.
svn path=/branches/branch_monty_20011009/vorbis/; revision=2420
-rw-r--r-- | lib/modes/floor_44.h | 142 | ||||
-rw-r--r-- | lib/modes/psych_44.h | 591 | ||||
-rw-r--r-- | lib/modes/residue_44.h | 175 |
3 files changed, 908 insertions, 0 deletions
diff --git a/lib/modes/floor_44.h b/lib/modes/floor_44.h new file mode 100644 index 00000000..ec1cdf5f --- /dev/null +++ b/lib/modes/floor_44.h @@ -0,0 +1,142 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * + * by the XIPHOPHORUS Company http://www.xiph.org/ * + * * + ******************************************************************** + + function: key floor settings for 44.1/48kHz + last mod: $Id: floor_44.h,v 1.1.2.1 2001/12/04 11:17:24 xiphmont Exp $ + + ********************************************************************/ + +#include "vorbis/codec.h" +#include "backends.h" + +#include "books/line_128x7_class1.vqh" +#include "books/line_128x7_class2.vqh" + +#include "books/line_128x7_0sub0.vqh" +#include "books/line_128x7_1sub1.vqh" +#include "books/line_128x7_1sub2.vqh" +#include "books/line_128x7_1sub3.vqh" +#include "books/line_128x7_2sub1.vqh" +#include "books/line_128x7_2sub2.vqh" +#include "books/line_128x7_2sub3.vqh" + +#include "books/line_128x19_class1.vqh" +#include "books/line_128x19_class2.vqh" + +#include "books/line_128x19_0sub0.vqh" +#include "books/line_128x19_1sub1.vqh" +#include "books/line_128x19_1sub2.vqh" +#include "books/line_128x19_1sub3.vqh" +#include "books/line_128x19_2sub1.vqh" +#include "books/line_128x19_2sub2.vqh" +#include "books/line_128x19_2sub3.vqh" + +#include "books/line_1024x31_class0.vqh" +#include "books/line_1024x31_class1.vqh" +#include "books/line_1024x31_class2.vqh" +#include "books/line_1024x31_class3.vqh" + +#include "books/line_1024x31_0sub0.vqh" +#include "books/line_1024x31_0sub1.vqh" +#include "books/line_1024x31_1sub0.vqh" +#include "books/line_1024x31_1sub1.vqh" +#include "books/line_1024x31_2sub1.vqh" +#include "books/line_1024x31_2sub2.vqh" +#include "books/line_1024x31_2sub3.vqh" +#include "books/line_1024x31_3sub1.vqh" +#include "books/line_1024x31_3sub2.vqh" +#include "books/line_1024x31_3sub3.vqh" + +static static_codebook _floor_44_128_books[2][9]={ + { + &_huff_book_line_128x7_class1, + &_huff_book_line_128x7_class2, + + &_huff_book_line_128x7_0sub0, + &_huff_book_line_128x7_1sub1, + &_huff_book_line_128x7_1sub2, + &_huff_book_line_128x7_1sub3, + &_huff_book_line_128x7_2sub1, + &_huff_book_line_128x7_2sub2, + &_huff_book_line_128x7_2sub3, + }, + { + &_huff_book_line_128x19_class1, + &_huff_book_line_128x19_class2, + + &_huff_book_line_128x19_0sub0, + &_huff_book_line_128x19_1sub1, + &_huff_book_line_128x19_1sub2, + &_huff_book_line_128x19_1sub3, + &_huff_book_line_128x19_2sub1, + &_huff_book_line_128x19_2sub2, + &_huff_book_line_128x19_2sub3, + } +}; + +static static_codebook _floor_44_1024_books[1][14]={ + { + &_huff_book_line_1024x31_class0, + &_huff_book_line_1024x31_class1, + &_huff_book_line_1024x31_class2, + &_huff_book_line_1024x31_class3, + + &_huff_book_line_1024x31_0sub0, + &_huff_book_line_1024x31_0sub1, + &_huff_book_line_1024x31_1sub0, + &_huff_book_line_1024x31_1sub1, + &_huff_book_line_1024x31_2sub1, + &_huff_book_line_1024x31_2sub2, + &_huff_book_line_1024x31_2sub3, + &_huff_book_line_1024x31_3sub1, + &_huff_book_line_1024x31_3sub2, + &_huff_book_line_1024x31_3sub3, + } +} + +static vorbis_info_floor1 _floor_44_128[2]={ + { + 3,{0,1,2},{1,3,3},{0,2,2},{-1,0,1}, + {{2},{-1,3,4,5},{-1,6,7,8}}, + 4,{0,128, 7, 2,1,4, 23,13,45}, + + 60,30,500, + 999,999,0,18., + 8,70, + -1 /* lowpass! */ + }, + { + 6,{0,1,1,1,2,2},{4,3,3},{0,2,2},{-1,0,1}, + {{2},{-1,3,4,5},{-1,6,7,8}}, + 4,{0,128, 6,17,30,58, 2,1,4, 11,8,14, 23,20,26, 41,35,48, 84,69,103}, + + 60,30,500, + 999,999,1,18., + 8,70, + -1 /* lowpass */ + } +}; + +static vorbis_info_floor1 _floor_44_1024[1]={ + { + 10,{0,1,2,2,2,2,2, 3,3,3},{3,4,3,3},{1,1,2,2},{0,1,2,3}, + {{4,5},{6,7},{-1,8,9,10},{-1,11,12,13}}, + 4,{0,1024, 88,31,243, 14,54,143,460, 6,3,10, 22,18,26, 41,36,47, + 69,61,78, 112,99,126, 185,162,211, 329,282,387, 672,553,825}, + + 60,30,400, + 20,8,1,18., + 20,600, + -1 /* lowpass */ + } +}; + diff --git a/lib/modes/psych_44.h b/lib/modes/psych_44.h new file mode 100644 index 00000000..59ca759f --- /dev/null +++ b/lib/modes/psych_44.h @@ -0,0 +1,591 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * + * by the XIPHOPHORUS Company http://www.xiph.org/ * + * * + ******************************************************************** + + function: key psychoacoustic settings for 44.1/48kHz + last mod: $Id: psych_44.h,v 1.1.2.1 2001/12/04 11:17:24 xiphmont Exp $ + + ********************************************************************/ + +#include "vorbis/codec.h" +#include "backends.h" + +/* preecho trigger settings *****************************************/ + +static vorbis_info_psy_global _psy_global_44[2]={ + + {8, /* lines per eighth octave */ + 256, {26.f,26.f,26.f,30.f}, {-90.f,-90.f,-90.f,-90.f}, -90.f, + -6.f, 0, + }, + {8, /* lines per eighth octave */ + 256, {26.f,26.f,26.f,30.f}, {-26.f,-26.f,-26.f,-30.f}, -90.f, + -6.f, 0, + } +}; + +/* noise compander lookups * low, mid, high quality ****************/ + +static float _psy_compand_44[3][NOISE_COMPAND_LEVELS]={ + /* sub-mode Z */ + { + 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, /* 7dB */ + 8.f, 9.f,10.f,11.f,12.f,13.f,14.f, 15.f, /* 15dB */ + 16.f,17.f,18.f,19.f,20.f,21.f,22.f, 23.f, /* 23dB */ + 24.f,25.f,26.f,27.f,28.f,29.f,30.f, 31.f, /* 31dB */ + 32.f,33.f,34.f,35.f,36.f,37.f,38.f, 39.f, /* 39dB */ + }, + /* mode_Z nominal */ + { + 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, /* 7dB */ + 8.f, 9.f, 9.f,10.f,10.f,10.f,11.f, 11.f, /* 15dB */ + 12.f,12.f,13.f,13.f,14.f,14.f,15.f, 15.f, /* 23dB */ + 16.f,16.f,17.f,17.f,17.f,18.f,18.f, 19.f, /* 31dB */ + 19.f,19.f,20.f,21.f,22.f,23.f,24.f, 25.f, /* 39dB */ + }, + /* mode A */ + { + 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, /* 7dB */ + 8.f, 8.f, 7.f, 6.f, 5.f, 4.f, 4.f, 4.f, /* 15dB */ + 4.f, 4.f, 5.f, 5.f, 5.f, 6.f, 6.f, 6.f, /* 23dB */ + 7.f, 7.f, 7.f, 8.f, 8.f, 8.f, 9.f, 10.f, /* 31dB */ + 11.f,12.f,13.f,14.f,15.f,16.f,17.f, 18.f, /* 39dB */ + } +}; + +/* tonal masking curve level adjustments *************************/ +static int _vp_tonemask_adj_longblock[6][17][11]={ + /* adjust for mode zero */ + { + { 10, 10, 5, }, /*63*/ + { 10, 10, 5, }, + { 10, 10, 5, }, /* 125 */ + { 10, 10, 5, }, + { 10, 10, 5, }, /* 250 */ + { 10, 10, 5, }, + { 10, 10, 5, }, /* 500 */ + { 10, 10, 5, }, + { 10, 10, 5, }, /* 1000 */ + { 10, 10, 5, }, + + { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, /* 2000 */ + { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, + { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, /* 4000 */ + { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, + { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, /* 8000 */ + { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, + { 16, 16, 14, 12, 12, 15, 15, 15, 15, 15, 10}, /* 16000 */ + }, + + /* adjust for mode two */ + { + { 10, 10, 5, }, /*63*/ + { 10, 10, 5, }, + { 10, 10, 5, }, /* 125 */ + { 10, 10, 5, }, + { 10, 10, 5, }, /* 250 */ + { 10, 10, 5, }, + { 10, 10, 5, }, /* 500 */ + { 10, 10, 5, }, + { 10, 10, 5, }, /* 1000 */ + { 10, 10, 5, }, + + { 0, }, /* 2000 */ + { 0, }, + { 10, 5, 5, }, /* 4000 */ + { 10, 10, 5, }, + { 10, 10, 7, 5, }, /* 8000 */ + { 10, 10, 7, 7, 5, 5, 10, 10, 10, 5, }, + { 16, 16, 14, 8, 8, 8, 10, 10, 10, 5, }, /* 16000 */ + }, + + /* adjust for mode four */ + { + { 10, 5, 5, }, /*63*/ + { 10, 5, 5, }, + { 10, 5, 5, }, /* 125 */ + { 10, 5, 5, }, + { 10, 5, 5, }, /* 250 */ + { 10, 5, 5, }, + { 10, 5, 5, }, /* 500 */ + { 10, 5, 5, }, + { 10, 5, 5, }, /* 1000 */ + { 10, 5, 5, }, + + { 0, }, /* 2000 */ + { 0, }, + { 0, }, /* 4000 */ + { 10, 5, 5, }, + { 10, 10, 7, 5, }, /* 8000 */ + { 10, 10, 7, 5, 5, 5, 10, 10, 10, 5, }, + { 16, 16, 14, 8, 8, 8, 10, 10, 10, 5, }, /* 16000 */ + }, + + /* adjust for mode six */ + { + { 10, 5, 5, }, /*63*/ + { 10, 5, 5, }, + { 10, 5, 5, }, /* 125 */ + { 10, 5, 5, }, + { 10, 5, 5, }, /* 250 */ + { 10, 5, 5, }, + { 10, 5, 5, }, /* 500 */ + { 10, 5, 5, }, + { 10, 5, 5, }, /* 1000 */ + { 10, 5, 5, }, + + { 0, }, /* 2000 */ + { 0, }, + { 0, }, /* 4000 */ + { 10, 5, 5, }, + { 10, 10, 7, 5, }, /* 8000 */ + { 10, 10, 7, 5, 5, 5, 5, 5, 5, }, + { 12, 10, 10, 5, 5, 5, 5, 5, 5, }, /* 16000 */ + }, + + /* adjust for mode eight */ + { + { 0, }, /*63*/ + { 0, }, + { 0, }, /* 125 */ + { 0, }, + { 0, }, /* 250 */ + { 0, }, + { 0, }, /* 500 */ + { 0, }, + { 0, }, /* 1000 */ + { 0, }, + + { 0, }, /* 2000 */ + { 0, }, + { 0, }, /* 4000 */ + { 0, }, + { 0, }, /* 8000 */ + { 0, }, + { 5, 5, 5, 5, 5, 5, 5, }, /* 16000 */ + }, + + /* adjust for mode ten */ + { + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*63*/ + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*125*/ + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*250*/ + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*500*/ + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*1000*/ + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*2000*/ + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*4000*/ + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*8000*/ + { 0, 0, 0, -5,-10,-10,-10,-15,-15,-15,-15}, + { 0, 0, 0, 0, 0, -5, -5,-10,-15,-15,-15}, /*16000*/ + }, +}; + +static int _vp_tonemask_adj_otherblock[6][17][11]={ + /* adjust for mode zero */ + { + { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, /*63*/ + { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, + { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, /*125*/ + { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, + { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, /*250*/ + { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, + { 5, 5, 5, 0, -5, -5, -5, -5, -5, -5, -5}, /*500*/ + { 5, 5, 5, 0, -5, -5, -5, -5, -5, -5, -5}, + + { 5, 5, 5, }, /*1000*/ + { 5, 5, 5, }, + + { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, /*2000*/ + { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, + { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, /*4000*/ + { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, + { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, /*8000*/ + { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, + { 16, 16, 14, 12, 12, 15, 15, 15, 15, 15, 10}, /*16000*/ + }, + + /* adjust for mode two */ + { + { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, /*63*/ + { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, + { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, /*125*/ + { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, + { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, /*250*/ + { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, + { 5, 5, 5, 0, -5, -5, -5, -5, -5, -5, -5}, /*500*/ + { 5, 5, 5, 0, -5, -5, -5, -5, -5, -5, -5}, + + { 10, 10, 5, }, /* 1000 */ + { 10, 10, 5, }, + + { 0, }, /* 2000 */ + { 0, }, + { 0, }, /* 4000 */ + { 10, 5, 5, }, + { 10, 10, 7, 5, }, /* 8000 */ + { 10, 10, 7, 7, 5, 5, 10, 10, 10, 5, }, + { 16, 16, 14, 8, 8, 8, 10, 10, 10, 5, }, /* 16000 */ + }, + + /* adjust for mode four */ + { + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*63*/ + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*125*/ + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*250*/ + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*500*/ + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, + + { 5, 5, 5, }, /* 1000 */ + { 5, 5, 5, }, + + { 0, }, /* 2000 */ + { 0, }, + { 0, }, /* 4000 */ + { 10, 5, 5, }, + { 10, 10, 7, 5, }, /* 8000 */ + { 10, 10, 7, 5, 5, 5, 10, 10, 10, 5, }, + { 16, 16, 14, 8, 8, 8, 10, 10, 10, 5, }, /* 16000 */ + }, + + /* adjust for mode six */ + { + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*63*/ + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*125*/ + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*250*/ + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*500*/ + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, + + { 5, 5, 5, }, /* 1000 */ + { 5, 5, 5, }, + + { 0, }, /* 2000 */ + { 0, }, + { 0, }, /* 4000 */ + { 10, 5, 5, }, + { 10, 10, 7, 5, }, /* 8000 */ + { 10, 10, 7, 5, 5, 5, 5, 5, 5, }, + { 12, 10, 10, 5, 5, 5, 5, 5, 5, }, /* 16000 */ + }, + + /* adjust for mode eight */ + { + {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20}, /*63*/ + {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20}, + {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20}, /*125*/ + {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20}, + {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20}, /*250*/ + {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20}, + {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20}, /*500*/ + {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20}, + + { 0,-10,-10,-15,-15,-15,-15,-15,-15,-15,-15}, + { 0,-10,-10,-15,-15,-15,-15,-15,-15,-15,-15}, + + { 0, }, /* 2000 */ + { 0, }, + { 0, }, /* 4000 */ + { 0, }, + { 0, }, /* 8000 */ + { 0, }, + { 5, 5, 5, 5, 5, 5, 5, }, /* 16000 */ + }, + + /* adjust for mode ten */ + { + { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, /*63*/ + { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, + { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, /*125*/ + { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, + { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, /*250*/ + { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, + { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, /*500*/ + { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, + { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, /*1000*/ + { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*2000*/ + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*4000*/ + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, + { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*8000*/ + { 0, 0, 0, -5,-10,-10,-10,-15,-15,-15,-15}, + { 0, 0, 0, 0, 0, -5, -5,-10,-15,-15,-15}, /*16000*/ + }, +}; + +static int _vp_peakguard_[6][17][11]={ + /* zero */ + { + {-14,-16,-18,-19,-24,-24,-24,-24,-24,-24,-24},/*63*/ + {-14,-16,-18,-19,-24,-24,-24,-24,-24,-24,-24}, + {-14,-16,-18,-19,-24,-24,-24,-24,-24,-24,-24},/*125*/ + {-14,-16,-18,-19,-24,-24,-24,-24,-24,-24,-24}, + {-14,-16,-18,-19,-24,-24,-24,-24,-24,-24,-24},/*250*/ + {-14,-16,-18,-19,-24,-24,-24,-24,-24,-24,-24}, + {-10,-10,-10,-10,-16,-16,-18,-20,-22,-24,-24},/*500*/ + {-10,-10,-10,-10,-14,-14,-16,-20,-22,-24,-24}, + {-10,-10,-10,-10,-14,-14,-16,-20,-22,-24,-24},/*1000*/ + {-10,-10,-10,-10,-14,-14,-16,-20,-22,-24,-24}, + {-10,-10,-10,-10,-14,-14,-16,-20,-22,-24,-24},/*2000*/ + {-10,-10,-10,-12,-16,-16,-16,-20,-22,-24,-24}, + {-10,-10,-10,-12,-16,-16,-16,-20,-22,-24,-24},/*4000*/ + {-10,-10,-10,-12,-12,-14,-16,-18,-22,-24,-24}, + {-10,-10,-10,-10,-10,-14,-16,-18,-22,-24,-24},/*8000*/ + {-10,-10,-10,-10,-10,-14,-16,-18,-22,-24,-24}, + {-10,-10,-10,-10,-10,-12,-16,-18,-22,-24,-24},/*16000*/ + }, + /* two */ + { + {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30},/*63*/ + {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30}, + {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30},/*125*/ + {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30}, + {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30},/*250*/ + {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30}, + {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30},/*500*/ + {-10,-10,-10,-10,-14,-14,-14,-20,-26,-30,-30}, + {-10,-10,-10,-10,-14,-14,-14,-20,-22,-30,-30},/*1000*/ + {-10,-10,-10,-10,-14,-14,-16,-20,-22,-30,-30}, + {-10,-10,-10,-10,-14,-14,-16,-20,-22,-30,-30},/*2000*/ + {-10,-10,-10,-10,-14,-14,-16,-20,-22,-30,-30}, + {-10,-10,-10,-10,-14,-14,-16,-20,-22,-30,-30},/*4000*/ + {-10,-10,-10,-10,-10,-11,-12,-13,-22,-30,-30}, + {-10,-10,-10,-10,-10,-11,-12,-13,-22,-30,-30},/*8000*/ + {-10,-10,-10,-10,-10,-10,-10,-11,-22,-30,-30}, + {-10,-10,-10,-10,-10,-10,-10,-10,-20,-30,-30},/*16000*/ + }, + /* four */ + { + {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},/*63*/ + {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40}, + {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},/*125*/ + {-14,-20,-20,-20,-20,-20,-20,-30,-32,-32,-40}, + {-14,-20,-20,-20,-20,-20,-20,-30,-32,-32,-40},/*250*/ + {-14,-20,-20,-20,-20,-20,-20,-24,-32,-32,-40}, + {-14,-20,-20,-20,-20,-20,-20,-24,-32,-32,-40},/*500*/ + {-10,-10,-10,-10,-14,-16,-20,-24,-26,-32,-40}, + {-10,-10,-10,-10,-14,-16,-20,-24,-22,-32,-40},/*1000*/ + {-10,-10,-10,-10,-14,-16,-20,-24,-22,-32,-40}, + {-10,-10,-10,-10,-14,-16,-20,-24,-22,-32,-40},/*2000*/ + {-10,-10,-10,-10,-14,-16,-20,-24,-22,-32,-40}, + {-10,-10,-10,-10,-14,-14,-16,-20,-22,-32,-40},/*4000*/ + {-10,-10,-10,-10,-10,-11,-12,-13,-22,-32,-40}, + {-10,-10,-10,-10,-10,-11,-12,-13,-22,-32,-40},/*8000*/ + {-10,-10,-10,-10,-10,-10,-10,-11,-22,-32,-40}, + {-10,-10,-10,-10,-10,-10,-10,-10,-20,-32,-40},/*16000*/ + }, + /* six */ + { + {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},/*63*/ + {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40}, + {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},/*125*/ + {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40}, + {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},/*250*/ + {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40}, + {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},/*500*/ + {-14,-14,-14,-16,-20,-22,-24,-24,-28,-32,-40}, + {-14,-14,-14,-16,-20,-22,-24,-24,-28,-32,-40},/*1000*/ + {-14,-14,-14,-16,-20,-22,-24,-24,-28,-32,-40}, + {-14,-14,-16,-20,-24,-26,-26,-28,-30,-32,-40},/*2000*/ + {-14,-14,-16,-20,-24,-26,-26,-28,-30,-32,-40}, + {-14,-14,-16,-20,-24,-26,-26,-28,-30,-32,-40},/*4000*/ + {-14,-14,-14,-20,-22,-22,-24,-24,-26,-32,-40}, + {-14,-14,-14,-18,-20,-20,-24,-24,-24,-32,-40},/*8000*/ + {-14,-14,-14,-18,-20,-20,-24,-24,-24,-32,-40}, + {-14,-14,-14,-18,-20,-20,-22,-24,-24,-32,-40},/*16000*/ + }, + /* eight */ + { + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*63*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*88*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*125*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*170*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*250*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*350*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*500*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*700*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*1000*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*1400*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*2000*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*2800*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*4000*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*5600*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*8000*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*11500*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*16600*/ + }, + /* ten */ + { + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*63*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*88*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*125*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*170*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*250*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*350*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*500*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*700*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*1000*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*1400*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*2000*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*2800*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*4000*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*5600*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*8000*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*11500*/ + {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*16600*/ + } +}; + +static int _psy_noisebias_long[11][17]={ + /*63 125 250 500 1k 2k 4k 8k 16k*/ + {-20,-20,-16,-16,-16,-16,-14, -8, -4, 0, 2, 2, 3, 3, 3, 3, 10}, + {-20,-20,-20,-20,-20,-20,-20,-10, -6, -2, 1, 2, 3, 3, 3, 3, 10}, + {-20,-20,-20,-20,-20,-20,-20,-10, -6, -2, 0, 0, 0, 1, 2, 3, 8}, + {-20,-20,-20,-20,-20,-20,-20,-10, -6, -2, -1, -1, 0, 0, 2, 3, 6}, + {-20,-20,-20,-20,-20,-20,-20,-10, -6, -2, -3, -3, 0, 0, 1, 1, 4}, + {-20,-20,-20,-20,-20,-20,-20,-14,-10, -6, -6, -6, -3, 0, 0, 1, 2}, + {-24,-24,-24,-24,-24,-24,-24,-18,-14, -8, -8, -6, -3, -2, -2, 0, 1}, + {-24,-24,-24,-24,-24,-24,-24,-18,-14, -8, -8, -6, -3, -2, -2, -1, 0}, + {-24,-24,-24,-24,-24,-24,-24,-18,-14, -8, -8, -8, -4, -3, -3, -2, -2}, + {-28,-28,-28,-28,-28,-26,-24,-18,-14,-10,-10,-10, -8, -7, -7, -6, -6}, + {-50,-50,-50,-50,-50,-50,-50,-48,-44,-40,-40,-40,-40,-40,-40,-40,-40}, +} + +static int _psy_noisebias_other[11][17]={ + /*63 125 250 500 1k 2k 4k 8k 16k*/ + {-26,-26,-26,-26,-26,-22,-20,-14,-10, 0, 2, 2, 3, 3, 3, 3, 10}, + {-30,-30,-30,-30,-26,-22,-20,-14,-10, -2, 1, 2, 3, 3, 3, 3, 10}, + {-30,-30,-30,-30,-26,-22,-20,-14,-10, -2, 0, 0, 0, 1, 2, 3, 8}, + {-30,-30,-30,-30,-26,-22,-20,-14,-10, -2, -1, -1, 0, 0, 2, 3, 6}, + {-30,-30,-30,-30,-26,-22,-20,-14,-10, -2, -3, -3, 0, 0, 1, 1, 4}, + {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -3, 0, 0, 1, 2}, + {-34,-34,-34,-34,-30,-26,-24,-18,-14, -8, -8, -6, -3, -2, -2, 0, 1}, + {-34,-34,-34,-34,-30,-26,-24,-18,-14, -8, -8, -6, -3, -2, -2, -1, 0}, + {-34,-34,-34,-34,-30,-26,-24,-18,-14, -8, -8, -8, -4, -3, -3, -2, -2}, + {-34,-34,-34,-34,-30,-26,-24,-18,-14,-10,-10,-10, -8, -7, -7, -6, -6}, + {-50,-50,-50,-50,-50,-50,-50,-48,-44,-40,-40,-40,-40,-40,-40,-40,-40}, +}; + +static vorbis_info_psy _psy_settings[11]={ + /* zero */ + { /* ATH style ,float,min */ + ATH_Bark_dB_lineaggressive,-100.,-110., + + /* tonemask att,guard,suppr,curves peakattp,curvelimitp,peaksettings*/ + 3.f, -18.f,-10.f, NULL, 1, 0, NULL, + + /*noisemaskp,supp, low/high window, low/hi guard, minimum */ + 1, -0.f, .5f, .5f, 0,0,0, + {0},NULL,95.f,NULL + }, + /* one */ + { + ATH_Bark_dB_lineaggressive,-100.,-110., + 0.f,-24.f,-20.f, NULL, 1,0,NULL, + 1,-24.f,.5f,.5f,0,0,0, + {0},NULL,95.f,NULL + }, + /* two */ + { + ATH_Bark_dB_lineaggressive,-100.,-120., + 0.f,-24.f,-20.f, NULL, 1,0,NULL, + 1,-24.f,.5f,.5f,0,0,0, + {0},NULL,95.f,NULL + }, + /* three */ + { + ATH_Bark_dB_lineaggressive,-100.,-140., + 0.f,-24.f,-20.f, NULL, 1,0,NULL, + 1,-24.f,.5f,.5f,0,0,0, + {0},NULL,95.f,NULL + }, + /* four */ + { + ATH_Bark_dB_lineaggressive,-100.,-140., + 0.f,-26.f,-30.f, NULL, 1,4,NULL, + 1,-24.f,.5f,.5f,0,0,0, + {0},NULL,95.f,NULL + }, + /* five */ + { + ATH_Bark_dB_lineaggressive,-100.,-140., + 0.f,-40.f,-30.f, NULL, 1,4,NULL, + 1,-30.f,.5f,.5f,0,0,0, + {0},NULL,105.f,NULL + }, + /* six */ + { + ATH_Bark_dB_lineaggressive,-100.,-140., + 0.f,-40.f,-40.f, NULL, 1,30,NULL, + 1,-40.f,.5f,.5f,0,0,0, + {0},NULL,105.f,NULL + }, + /* seven */ + { + ATH_Bark_dB_lineconservative,-100.,-140., + 0.f,-40.f,-40.f, NULL, 1,30,NULL, + 1,-40.f,.5f,.5f,0,0,0, + {0},NULL,105.f,NULL + }, + /* eight */ + { + ATH_Bark_dB_lineconservative,-100.,-140., + 0.f,-45.f,-45.f, NULL, 1,30,NULL, + 1,-45.f,.5f,.5f,0,0,0, + {0},NULL,105.f,NULL + }, + /* nine */ + { + ATH_Bark_dB_lineconservative,-110.,-140., + 0.f,-45.f,-45.f, NULL, 1,30,NULL, + 1,-45.f,.5f,.5f,0,0,0, + {0},NULL,105.f,NULL + }, + /* ten */ + { + ATH_Bark_dB_lineconservative,-120.,-150., + 0.f,-45.f,-45.f, NULL, 1,30,NULL, + 1,-45.f,.5f,.5f,0,0,0, + {0},NULL,105.f,NULL + } +}; + +/* noise compander lookups * low, mid, high quality ****************/ + +static float ATH_Bark_dB[][27]={ + { + 0, 15, 15, 15, 11, 10, 8, 7, 7, 7, + 6, 2, 0, 0, -2, -5, -6, -6, -4, 4, + 14, 20, 19, 17, 30, 60, 60, + } + { + 0, 15, 15, 15, 11, 10, 8, 7, 7, 7, + 6, 2, 0, 0, -2, -5, -6, -6, -4, 0, + 2, 6, 5, 5, 15, 25, 35 + }, + { + 0, 15, 15, 15, 11, 10, 8, 7, 7, 7, + 6, 2, 0, 0, -3, -5, -6, -6,-4.5f, 0f, + 2, 6, 5, 5, 15, 15, 15 + }, +}; diff --git a/lib/modes/residue_44.h b/lib/modes/residue_44.h new file mode 100644 index 00000000..5115ee94 --- /dev/null +++ b/lib/modes/residue_44.h @@ -0,0 +1,175 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * + * by the XIPHOPHORUS Company http://www.xiph.org/ * + * * + ******************************************************************** + + function: toplevel residue templates for 32/44.1/48kHz + last mod: $Id: residue_44.h,v 1.1.2.1 2001/12/04 11:17:25 xiphmont Exp $ + + ********************************************************************/ + +#include "vorbis/codec.h" +#include "backends.h" + +static bitrate_manager_info _bm_44_default={ + /* progressive coding and bitrate controls */ + 2.,.5, + 2., 0, 0, + 0, 0, + + 4.0, 0., -1., .05, + -.05, .05, + 3.5,5.0, + -10.f,+2.f +}; + +/***** residue backends *********************************************/ + +/* the books used depend on stereo-or-not, but the residue setup below + can apply to coupled or not. These templates are for a first pass; + a last pass is mechanically added in vorbisenc for residue backfill + at 1/3 and 1/9, as well as an optional middle pass for stereo + backfill */ + +/* 0 1 2 4 22 1 2 4 22 + + 0 0 0 0 + + 0 1 2 3 4 5 6 7 8 9 + 1 . . . + 2 . . . + 4 . . . . . . . + + 0 4 4 4 3 4 4 4 3 7 */ +static vorbis_info_residue0 _residue_44_low={ + 0,-1, -1, 10,-1, + /* 0 1 2 3 4 5 6 7 8 9 */ + { 0, 4, 4, 4, 3, 4, 4, 4, 3, 7}, + {-1}, + {9999, 9999, 9999, 9999, 9999, 9999, 9999, 9999, 9999}, + { .5, 1.5, 2.5, 4.5, 22.5, 1.5, 2.5, 4.5, 22.5}, + {0}, + { 99, -1, -1, -1, -1, 99, 99, 99, 99} +}; + +/* 0 1 2 4 1 2 4 22 84 + + 0 0 0 + + 0 1 2 3 4 5 6 7 8 9 + 1 . . . + 2 . . . + 4 . . . . . . . + + 0 4 4 4 4 4 4 3 3 7 */ +static vorbis_info_residue0 _residue_44_mid={ + 0,-1, -1, 10,-1, + /* 0 1 2 3 4 5 6 7 8 9 */ + { 0, 4, 4, 4, 4, 4, 4, 3, 3, 7}, + {-1}, + {9999, 9999, 9999, 9999, 9999, 9999, 9999, 9999, 9999}, + { .5, 1.5, 2.5, 4.5, 1.5, 2.5, 4.5, 22.5, 84.5}, + {0}, + { 99, -1, -1, -1, 99, 99, 99, 99, 99} +}; + + +/* 0 4 22 1 2 4 7 22 84 + + 0 0 0 + + 0 1 2 3 4 5 6 7 8 9 + 1 . . . . + 2 . . . . + 4 . . . . . . + + 0 4 3 4 4 4 4 3 3 7 */ +static vorbis_info_residue0 _residue_44_high={ + 0,-1, -1, 10,-1, + /* 0 1 2 3 4 5 6 7 8 9 */ + { 0, 4, 3, 4, 4, 4, 4, 3, 3, 7}, + {-1}, + {9999, 9999, 9999, 9999, 9999, 9999, 9999, 9999, 9999}, + { .5, 4.5, 22.5, 1.5, 2.5, 4.5, 7.5, 22.5, 84.5}, + {0}, + { 99, -1, -1, 99, 99, 99, 99, 99, 99} +}; + +/* residue backfill is entered in the template array as if stereo + backfill is not in use. It's up to vorbisenc to make the + appropriate index adjustment */ +#ifdef 0 +static vorbis_residue_template _residue_template_44_stereo[11]={ + /* mode 0; 64-ish */ + {&residue_44_low, {&44c0_short,&44c0_long}, + { {{-1}}, /* lossless stereo */ + {{-1}}, /* 6dB (2.5) stereo */ + {{-1}}, /* 12dB (4.5) stereo */ + {{-1}}, /* 17dB (7.5) stereo */ + {{&44c0_s0_p1_0},{&44c0_s0_p2_0},{&44c0_s0_p3_0},{&44c0_s0_p4_0,&44c0_p4_1}, + {&44c0_s1_p5_0},{&44c0_s1_p6_0},{&44c0_s2_p7_0},{&44c0_s4_p8_0,&44c0_s4_p8_1}, + {&44c0_s4_p9_0,&44c0_s4_p9_1,&44c0_s4_p9_2}}, /* 22dB (12.5) stereo */ + {{-1}}, /* 27dB (22.5) stereo */ + }, + { {-1}, /* lossless stereo */ + {-1}, /* 6dB (2.5) stereo */ + {-1}, /* 12dB (4.5) stereo */ + {-1}, /* 17dB (7.5) stereo */ + {-1,-1,-1,-1,-1,-1,-1,-1,&44c0_s4_s8,&44c0_s4_s9},/* 22dB (12.5) stereo */ + {-1}, /* 27dB (22.5) stereo */ + }, + { {{-1}}, /* lossless stereo */ + {{-1}}, /* 6dB (2.5) stereo */ + {{-1}}, /* 12dB (4.5) stereo */ + {{&44c0_s0_r0_0,&44c0_s0_r0_1},{&44c0_s0_r1_0,&44c0_s0_r1_1}, + {&44c0_s0_r2_0,&44c0_s0_r2_1},{&44c0_s0_r3_0,&44c0_s0_r3_1}, + {&44c0_s0_r4_0,&44c0_s0_r4_1},{&44c0_s1_r5_0,&44c0_s1_r5_1}, + {&44c0_s1_r6_0,&44c0_s1_r6_1},{&44c0_s2_r7_0,&44c0_s2_r7_1}, + {&44c0_s4_r8_0,&44c0_s3_r8_1},{&44c0_s4_r9_0,&44c0_s3_r9_1}}, /* 17dB (7.5) stereo */ + {{-1}}, /* 22dB (12.5) stereo */ + {{-1}}, /* 27dB (22.5) stereo */ + }, + } + + /* mode 1; 80-ish */ + +} +#endif + +#include "books/res_44c_Z_128aux.vqh" +#include "books/res_44c_Z_1024aux.vqh" + +static vorbis_residue_template _residue_template_44_stereo_temp[11]={ + /* mode 0; 64-ish */ + {&residue_44_low, {&_huff_book_res_44c_Z_128aux, + &_huff_book_res_44c_Z_1024aux}, + { {{-1}}, /* lossless stereo */ + {{-1}}, /* 6dB (2.5) stereo */ + {{-1}}, /* 12dB (4.5) stereo */ + {{-1}}, /* 17dB (7.5) stereo */ + {{-1}}, + {{-1}}, /* 27dB (22.5) stereo */ + }, + { {-1}, /* lossless stereo */ + {-1}, /* 6dB (2.5) stereo */ + {-1}, /* 12dB (4.5) stereo */ + {-1}, /* 17dB (7.5) stereo */ + {-1}, + {-1}, /* 27dB (22.5) stereo */ + }, + { {{-1}}, /* lossless stereo */ + {{-1}}, /* 6dB (2.5) stereo */ + {{-1}}, /* 12dB (4.5) stereo */ + {{-1}}, + {{-1}}, /* 22dB (12.5) stereo */ + {{-1}}, /* 27dB (22.5) stereo */ + }, + } + + /* mode 1; 80-ish */ + +} |