[xiph-cvs] cvs commit: vorbis/lib/modes psych_44.h

Monty xiphmont at xiph.org
Mon Jul 1 14:56:48 PDT 2002



xiphmont    02/07/01 14:56:48

  Modified:    examples encoder_example.c
               lib      bitrate.c vorbisenc.c
               lib/modes psych_44.h
  Log:
  Substantially increase the number of bits given to noise encoding in
  impulse blocks.  All you Aphex Twin freaks can quiet down now :-)

Revision  Changes    Path
1.44      +2 -2      vorbis/examples/encoder_example.c

Index: encoder_example.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/examples/encoder_example.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- encoder_example.c	2002/07/01 11:20:09	1.43
+++ encoder_example.c	2002/07/01 21:56:46	1.44
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: simple example encoder
- last mod: $Id: encoder_example.c,v 1.43 2002/07/01 11:20:09 xiphmont Exp $
+ last mod: $Id: encoder_example.c,v 1.44 2002/07/01 21:56:46 xiphmont Exp $
 
  ********************************************************************/
 
@@ -97,8 +97,8 @@
   /* (quality mode .4: 44kHz stereo coupled, roughly 128kbps VBR) */
   vorbis_info_init(&vi);
   
-  vorbis_encode_init(&vi,2,44100,-1,80000,-1);
-  //vorbis_encode_init_vbr(&vi,2,44100,-.1);
+  vorbis_encode_init(&vi,2,44100,-1,320000,-1);
+  //vorbis_encode_init_vbr(&vi,2,44100,.3);
 
   //vorbis_encode_setup_managed(&vi,2,44100,-1,128000,-1);
   //vorbis_encode_ctl(&vi,OV_ECTL_RATEMANAGE_AVG,NULL);

<p><p>1.16      +0 -0      vorbis/lib/bitrate.c

Index: bitrate.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/bitrate.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- bitrate.c	2002/07/01 11:20:10	1.15
+++ bitrate.c	2002/07/01 21:56:46	1.16
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: bitrate tracking and management
- last mod: $Id: bitrate.c,v 1.15 2002/07/01 11:20:10 xiphmont Exp $
+ last mod: $Id: bitrate.c,v 1.16 2002/07/01 21:56:46 xiphmont Exp $
 
  ********************************************************************/
 

<p><p>1.45      +2 -2      vorbis/lib/vorbisenc.c

Index: vorbisenc.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/vorbisenc.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- vorbisenc.c	2002/07/01 11:20:11	1.44
+++ vorbisenc.c	2002/07/01 21:56:46	1.45
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: simple programmatic interface for encoder mode setup
- last mod: $Id: vorbisenc.c,v 1.44 2002/07/01 11:20:11 xiphmont Exp $
+ last mod: $Id: vorbisenc.c,v 1.45 2002/07/01 21:56:46 xiphmont Exp $
 
  ********************************************************************/
 
@@ -760,7 +760,7 @@
                                      setup->psy_noise_dBsuppress,
                                      setup->psy_noise_bias_impulse,
                                      setup->psy_noiseguards,
-				     hi->impulse_noisetune);
+				     (i0==0?hi->impulse_noisetune:0.));
   ret|=vorbis_encode_noisebias_setup(vi,hi->block[1].noise_bias_setting,1,
                                      setup->psy_noise_dBsuppress,
                                      setup->psy_noise_bias_padding,

<p><p>1.21      +62 -11    vorbis/lib/modes/psych_44.h

Index: psych_44.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/modes/psych_44.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- psych_44.h	2002/07/01 11:20:19	1.20
+++ psych_44.h	2002/07/01 21:56:47	1.21
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: key psychoacoustic settings for 44.1/48kHz
- last mod: $Id: psych_44.h,v 1.20 2002/07/01 11:20:19 xiphmont Exp $
+ last mod: $Id: psych_44.h,v 1.21 2002/07/01 21:56:47 xiphmont Exp $
 
  ********************************************************************/
 
@@ -256,6 +256,7 @@
     {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
 };
 
+#if 0
 static noise3 _psy_noisebias_impulse[11]={
   /*  63     125     250     500      1k      2k      4k      8k     16k*/
   /* 0 */
@@ -303,7 +304,57 @@
     {-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-30,-30,-30,-30,-30,-30,-20},
     {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
 };
+#endif
 
+static noise3 _psy_noisebias_impulse[11]={
+  /*  63     125     250     500      1k      2k      4k      8k     16k*/
+  /* 0 */
+  {{{-10,-10,-10,-10,-10,-4,   0,  0,  4,  8,  8,  8,  8, 14, 20, 20, 30},
+    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -2,  2,  2,  2,  2,  3,  6},
+    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
+  /* 1 */
+  {{{-12,-12,-12,-12,-12, -8, -6, -4,  0,  4,  4,  4,  4, 10, 12, 14, 20},
+    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -4, -4, -2, -2, -2, -2,  2},
+    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8,-10,-10, -8, -8, -8, -6, -4}}},
+  /* 2 */
+  {{{-14,-14,-14,-14,-14,-10, -8, -6, -2,  2,  2,  2,  2,  8, 10, 10, 16},
+    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2,  0},
+    {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
+  /* 3 */
+  {{{-14,-14,-14,-14,-14,-10, -8, -6, -2,  2,  2,  2,  2,  6,  8,  8, 14},
+    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2,  0},
+    {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
+  /* 4 */
+  {{{-16,-16,-16,-16,-16,-12,-10, -6, -2,  0,  0,  0,  0,  4,  6,  6, 12},
+    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2,  0},
+    {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
+  /* 5 */
+  {{{-20,-20,-20,-20,-20,-18,-14,-10, -4,  0,  0,  0,  0,  4,  4,  6, 11},
+    {-32,-32,-32,-32,-28,-24,-22,-16,-10, -6, -8, -8, -6, -6, -6, -4, -2},
+    {-34,-34,-34,-34,-30,-26,-24,-18,-14,-12,-12,-12,-12,-12,-10, -9, -5}}},
+  /* 6 */
+  {{{-20,-20,-20,-20,-20,-18,-14,-10, -4,  0,  0,  0,  0,  4,  4,  6, 11},
+    {-34,-34,-34,-34,-30,-30,-24,-20,-12,-12,-14,-14,-10, -9, -8, -6, -4},
+    {-34,-34,-34,-34,-34,-30,-26,-20,-16,-15,-15,-15,-15,-15,-13,-12, -8}}},
+  /* 7 */
+  {{{-22,-22,-22,-22,-22,-20,-14,-10, -6,  0,  0,  0,  0,  4,  4,  6, 11},
+    {-34,-34,-34,-34,-30,-30,-24,-20,-14,-14,-16,-16,-14,-12,-10,-10, -8},
+    {-34,-34,-34,-34,-32,-32,-30,-24,-20,-19,-19,-19,-19,-19,-17,-16,-12}}},
+  /* 8 */
+  {{{-24,-24,-24,-24,-24,-22,-14,-10, -6, -1, -1, -1, -1,  3,  3,  5, 10},
+    {-34,-34,-34,-34,-30,-30,-30,-24,-20,-20,-20,-20,-20,-18,-16,-16,-14},
+    {-36,-36,-36,-36,-36,-34,-28,-24,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
+  /* 9 */
+  {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2,  2},
+    {-36,-36,-36,-36,-34,-32,-32,-30,-26,-26,-26,-26,-26,-22,-20,-20,-16},
+    {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
+  /* 10 */
+  {{{-30,-30,-30,-30,-30,-26,-24,-24,-24,-20,-16,-16,-16,-16,-16,-14,-12},
+    {-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-30,-30,-30,-30,-30,-30,-20},
+    {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
+};
+
+
 static noise3 _psy_noisebias_padding[11]={
   /*  63     125     250     500      1k       2k      4k      8k     16k*/
   /* 0 */
@@ -443,23 +494,23 @@
    {  6,  6,  6,  8,  8,  8,  8,  8,  8,  8, 10, 10, 10, 10, 10},
    { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
   /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         5  */
-  {{  1,  1,  1,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
-   {  3,  3,  3,  3,  3,  2,  2,  2,  2,  2,  2,  1,  1,  0,  0},
+  {{  2,  2,  2,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
+   {  3,  3,  3,  3,  3,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0},
    {  6,  6,  8,  8,  8,  8, 10, 10, 10, 10, 10, 10, 10, 10, 10},
    { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
   /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         6  */
   {{  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
-   {  3,  3,  3,  2,  2,  2,  1,  1,  1,  1,  1,  0,  0,  0,  0},
+   {  3,  3,  3,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0},
    {  8,  8,  8,  8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
    { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
   /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         7  */
   {{  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
-   {  2,  2,  2,  1,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0},
+   {  3,  3,  3,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
    {  8,  8,  8,  8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
    { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
   /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         8  */
   {{  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
-   {  2,  2,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
+   {  2,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
    {  8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
    { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
   /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         9  */
@@ -505,10 +556,10 @@
 /* noise normalization **********/
 
 static int _noise_start_short_44[10]={
-  16,16,16,16,32,64,9999,9999,9999,9999
+  16,16,16,16,32,32,9999,9999,9999,9999
 };
 static int _noise_start_long_44[10]={
-  128,128,128,256,512,9999,9999,9999,9999,9999
+  128,128,128,256,512,512,9999,9999,9999,9999
 };
 static int _noise_part_short_44[10]={
   8,8,8,8,8,8,8,8,8,8
@@ -517,10 +568,10 @@
   32,32,32,32,32,32,32,32,32,32
 };
 static double _noise_thresh_44[10]={
-  .2,.2,.3,.4,.5,.5,.5,.5,.5,.5,
+  .2,.2,.3,.4,.5,.5,9999.,9999.,9999.,9999.,
 };
-static double _noise_thresh_44_2[10]={
-  .5,.5,.5,.5,.5,.5,.5,.5,.5,.5,
+static double _noise_thresh_44_2[2]={
+  .5,.5,
 };
 
 

<p><p><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 'cvs-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 commits mailing list