diff options
author | Monty <xiphmont@xiph.org> | 2001-10-11 20:34:16 +0000 |
---|---|---|
committer | Monty <xiphmont@xiph.org> | 2001-10-11 20:34:16 +0000 |
commit | 044a6d1e7bcdd378a0c1bc42a2396ae7e870436c (patch) | |
tree | 08131b63e573d1efe092e3b6ed01f9ce5059c31c | |
parent | 4a0b48db19e0fed8d58c7d9f67ee747c9672e29a (diff) | |
download | libvorbis-git-044a6d1e7bcdd378a0c1bc42a2396ae7e870436c.tar.gz |
Fixed Chris's encoder_example .WAV header reader; it forgot to abor
tthe loop and caused channel swapping/phase errors by munching one
extra sample (not a sample pair).
Monty
svn path=/branches/branch_monty_20011009/vorbis/; revision=2132
-rw-r--r-- | examples/encoder_example.c | 3 | ||||
-rw-r--r-- | lib/books/res_Ac_0a.vqh | 99 | ||||
-rw-r--r-- | lib/books/res_Ac_2a.vqh | 65 | ||||
-rw-r--r-- | lib/books/res_Ac_5a.vqh | 70 | ||||
-rw-r--r-- | lib/books/res_Ac_7b.vqh | 80 | ||||
-rw-r--r-- | lib/modes/mode_44c_A.h | 24 |
6 files changed, 327 insertions, 14 deletions
diff --git a/examples/encoder_example.c b/examples/encoder_example.c index 607a3ee9..d52c8214 100644 --- a/examples/encoder_example.c +++ b/examples/encoder_example.c @@ -11,7 +11,7 @@ ******************************************************************** function: simple example encoder - last mod: $Id: encoder_example.c,v 1.27.2.1 2001/10/09 04:34:44 xiphmont Exp $ + last mod: $Id: encoder_example.c,v 1.27.2.2 2001/10/11 20:34:14 xiphmont Exp $ ********************************************************************/ @@ -86,6 +86,7 @@ int main(){ { founddata = 1; fread(readbuffer,1,6,stdin); + break; } } diff --git a/lib/books/res_Ac_0a.vqh b/lib/books/res_Ac_0a.vqh new file mode 100644 index 00000000..41bc03ea --- /dev/null +++ b/lib/books/res_Ac_0a.vqh @@ -0,0 +1,99 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * + * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH * + * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * + * by the XIPHOPHORUS Company, http://www.xiph.org/ * + * * + ******************************************************************** + + function: static codebook autogenerated by vq/somethingorother + + ********************************************************************/ + +#ifndef _V_res_Ac_0a_VQH_ +#define _V_res_Ac_0a_VQH_ +#include "codebook.h" + +static long _vq_quantlist_res_Ac_0a[] = { + 2, + 1, + 3, + 0, + 4, +}; + +static long _vq_lengthlist_res_Ac_0a[] = { + 1, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 5, 4, 0, 0, 0, + 0, 0,13, 0, 0, 0, 0,12, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 8, 7, 0, 0, + 0,10, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, + 0, 0, 0, 0, 0, 7, 8, 0, 0, 0, 9, 9, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, +}; + +static float _vq_quantthresh_res_Ac_0a[] = { + -1.5, -0.5, 0.5, 1.5, +}; + +static long _vq_quantmap_res_Ac_0a[] = { + 3, 1, 0, 2, 4, +}; + +static encode_aux_threshmatch _vq_auxt_res_Ac_0a = { + _vq_quantthresh_res_Ac_0a, + _vq_quantmap_res_Ac_0a, + 5, + 5 +}; + +static static_codebook _vq_book_res_Ac_0a = { + 4, 625, + _vq_lengthlist_res_Ac_0a, + 1, -533725184, 1611661312, 3, 0, + _vq_quantlist_res_Ac_0a, + NULL, + &_vq_auxt_res_Ac_0a, + NULL, + 0 +}; + + +#endif diff --git a/lib/books/res_Ac_2a.vqh b/lib/books/res_Ac_2a.vqh new file mode 100644 index 00000000..7b7e2005 --- /dev/null +++ b/lib/books/res_Ac_2a.vqh @@ -0,0 +1,65 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * + * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH * + * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * + * by the XIPHOPHORUS Company, http://www.xiph.org/ * + * * + ******************************************************************** + + function: static codebook autogenerated by vq/somethingorother + + ********************************************************************/ + +#ifndef _V_res_Ac_2a_VQH_ +#define _V_res_Ac_2a_VQH_ +#include "codebook.h" + +static long _vq_quantlist_res_Ac_2a[] = { + 3, + 2, + 4, + 1, + 5, + 0, + 6, +}; + +static long _vq_lengthlist_res_Ac_2a[] = { + 1, 0, 0, 0, 0, 0, 0, 3, 4, 4, 0, 0, 0, 0, 3, 5, + 5, 0, 0, 0, 0, 5,10, 9, 6, 7, 0, 0, 0, 9,10, 0, + 0, 0, 0, 0,11,11, 0, 0, 0, 0, 0,11,11, 0, 0, 0, + 0, +}; + +static float _vq_quantthresh_res_Ac_2a[] = { + -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, +}; + +static long _vq_quantmap_res_Ac_2a[] = { + 5, 3, 1, 0, 2, 4, 6, +}; + +static encode_aux_threshmatch _vq_auxt_res_Ac_2a = { + _vq_quantthresh_res_Ac_2a, + _vq_quantmap_res_Ac_2a, + 7, + 7 +}; + +static static_codebook _vq_book_res_Ac_2a = { + 2, 49, + _vq_lengthlist_res_Ac_2a, + 1, -533200896, 1611661312, 3, 0, + _vq_quantlist_res_Ac_2a, + NULL, + &_vq_auxt_res_Ac_2a, + NULL, + 0 +}; + + +#endif diff --git a/lib/books/res_Ac_5a.vqh b/lib/books/res_Ac_5a.vqh new file mode 100644 index 00000000..21d9c73a --- /dev/null +++ b/lib/books/res_Ac_5a.vqh @@ -0,0 +1,70 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * + * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH * + * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * + * by the XIPHOPHORUS Company, http://www.xiph.org/ * + * * + ******************************************************************** + + function: static codebook autogenerated by vq/somethingorother + + ********************************************************************/ + +#ifndef _V_res_Ac_5a_VQH_ +#define _V_res_Ac_5a_VQH_ +#include "codebook.h" + +static long _vq_quantlist_res_Ac_5a[] = { + 4, + 3, + 5, + 2, + 6, + 1, + 7, + 0, + 8, +}; + +static long _vq_lengthlist_res_Ac_5a[] = { + 1, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 5, 0, 0, 0, 0, + 0, 0, 3, 5, 6, 0, 0, 0, 0, 0, 0, 5, 7, 7, 6, 6, + 0, 0, 0, 0, 7, 7, 7, 0, 0, 0, 0, 0, 0, 7, 8, 8, + 0, 0, 0, 0, 0, 0, 7, 8, 8, 0, 0, 0, 0, 0, 0, 8, + 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, + 0, +}; + +static float _vq_quantthresh_res_Ac_5a[] = { + -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, +}; + +static long _vq_quantmap_res_Ac_5a[] = { + 7, 5, 3, 1, 0, 2, 4, 6, + 8, +}; + +static encode_aux_threshmatch _vq_auxt_res_Ac_5a = { + _vq_quantthresh_res_Ac_5a, + _vq_quantmap_res_Ac_5a, + 9, + 9 +}; + +static static_codebook _vq_book_res_Ac_5a = { + 2, 81, + _vq_lengthlist_res_Ac_5a, + 1, -531628032, 1611661312, 4, 0, + _vq_quantlist_res_Ac_5a, + NULL, + &_vq_auxt_res_Ac_5a, + NULL, + 0 +}; + + +#endif diff --git a/lib/books/res_Ac_7b.vqh b/lib/books/res_Ac_7b.vqh new file mode 100644 index 00000000..ff27b83a --- /dev/null +++ b/lib/books/res_Ac_7b.vqh @@ -0,0 +1,80 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * + * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH * + * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * + * by the XIPHOPHORUS Company, http://www.xiph.org/ * + * * + ******************************************************************** + + function: static codebook autogenerated by vq/somethingorother + + ********************************************************************/ + +#ifndef _V_res_Ac_7b_VQH_ +#define _V_res_Ac_7b_VQH_ +#include "codebook.h" + +static long _vq_quantlist_res_Ac_7b[] = { + 6, + 5, + 7, + 4, + 8, + 3, + 9, + 2, + 10, + 1, + 11, + 0, + 12, +}; + +static long _vq_lengthlist_res_Ac_7b[] = { + 1,14,14,13,13,13,13,13,13,13,13,13,13, 4, 5, 5, + 13,13,13,13,13,13,13,13,13,13, 3, 5, 5,13,13,13, + 13,13,13,13,13,13,13, 5, 7, 7, 6, 6,13,13,13,13, + 13,13,13,13, 7, 7, 7,13,13,13,13,13,13,13,13,13, + 13, 7, 7, 7,13,13,13,13,13,13,13,13,13,13, 6, 7, + 7,13,13,13,13,13,13,13,13,13,13, 7,13,13,13,13, + 13,13, 8, 9,13,13,13,13,13,13,13,13,13,13,13,13, + 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, + 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, + 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, + 13,13,13,13,13,13,13,13,13, +}; + +static float _vq_quantthresh_res_Ac_7b[] = { + -5.5, -4.5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, + 2.5, 3.5, 4.5, 5.5, +}; + +static long _vq_quantmap_res_Ac_7b[] = { + 11, 9, 7, 5, 3, 1, 0, 2, + 4, 6, 8, 10, 12, +}; + +static encode_aux_threshmatch _vq_auxt_res_Ac_7b = { + _vq_quantthresh_res_Ac_7b, + _vq_quantmap_res_Ac_7b, + 13, + 13 +}; + +static static_codebook _vq_book_res_Ac_7b = { + 2, 169, + _vq_lengthlist_res_Ac_7b, + 1, -531103744, 1611661312, 4, 0, + _vq_quantlist_res_Ac_7b, + NULL, + &_vq_auxt_res_Ac_7b, + NULL, + 0 +}; + + +#endif diff --git a/lib/modes/mode_44c_A.h b/lib/modes/mode_44c_A.h index f2d0f750..f5d0531a 100644 --- a/lib/modes/mode_44c_A.h +++ b/lib/modes/mode_44c_A.h @@ -11,7 +11,7 @@ ******************************************************************** function: predefined encoding modes; 44kHz stereo ~64kbps true VBR - last mod: $Id: mode_44c_A.h,v 1.4.2.2 2001/10/11 15:41:55 xiphmont Exp $ + last mod: $Id: mode_44c_A.h,v 1.4.2.3 2001/10/11 20:34:16 xiphmont Exp $ ********************************************************************/ @@ -77,7 +77,7 @@ static vorbis_info_psy_global _psy_set_44c_AG={ 8, /* lines per eighth octave */ /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */ - 256, {26.f,26.f,26.f,30.f}, {-26.f,-26.f,-26.f,-30.f}, -90.f, + 256, {26.f,26.f,26.f,30.f}, {-30.f,-30.f,-30.f,-34.f}, -90.f, -6.f, 0, @@ -130,7 +130,7 @@ static vorbis_info_psy _psy_set_44c_A0={ 2, 2, 15, /*63 125 250 500 1k 2k 4k 8k 16k*/ - {-30,-30,-30,-30,-26,-22,-20,-14,-10,-2, -3, -3, 0, 0, 0, 0, 2}, + {-30,-30,-30,-30,-26,-22,-20,-14,-10,-2, -3, -3, 0, 0, 0, 1, 4}, _psy_compand_44c_A, 95.f, /* even decade + 5 is important; saves an rint() later in a @@ -155,7 +155,7 @@ static vorbis_info_psy _psy_set_44c_AT={ 4,4,100, /*63 125 250 500 1k 2k 4k 8k 16k*/ - {-30,-30,-30,-30,-26,-20,-20,-10, -6, -2, -5, -5, 0, 0, 0, 0, 2}, + {-30,-30,-30,-30,-26,-20,-20,-10, -6, -2, -3, -3, 0, 0, 0, 0, 3}, _psy_compand_44c_A, 95.f, /* even decade + 5 is important; saves an rint() later in a @@ -172,7 +172,7 @@ static vorbis_info_psy _psy_set_44c_A={ 0.f,-26.f,-30.f, &_vp_tonemask_consbass_A, /* peakattp, curvelimitp */ - 0, 4, &_vp_peakatt_A, + 1, 4, &_vp_peakatt_A, /*noisemaskp */ 1, -10.f, /* suppress any noise curve over maxspec+n */ @@ -180,7 +180,7 @@ static vorbis_info_psy _psy_set_44c_A={ 4,4,100, /*63 125 250 500 1k 2k 4k 8k 16k*/ - {-20,-20,-20,-20,-20,-20,-20,-10, -6, -2, -5, -5, 0, 0, 0, 0, 2}, + {-20,-20,-20,-20,-20,-20,-20,-10, -6, -2, -3, -3, 0, 0, 0, 0, 3}, _psy_compand_44c_A, 95.f, /* even decade + 5 is important; saves an rint() later in a @@ -243,7 +243,7 @@ static vorbis_info_floor1 _floor_set_44c_A={ 60,30,400, 20,8,1,18., 20,600, - 928}; + 896}; static vorbis_info_residue0 _residue_set_44c_A0={ 0,192, 16, 10,23, @@ -263,7 +263,7 @@ static vorbis_info_residue0 _residue_set_44c_A0={ {99,8,99,3,8,99,99,99,99,99}}; static vorbis_info_residue0 _residue_set_44c_A={ - 0,1856, 32,10,24, + 0,1792, 32,10,24, {64,4,40, 2,2,20, 18,22,22,7}, @@ -365,13 +365,11 @@ codec_setup_info info_44c_A={ 4.0, 1.,4., - 0, - 100000, + 0,0, - 0, - 0000, + 0,0, - 120000,0, + 0,0, {4,7}, 2, |