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

Monty xiphmont at xiph.org
Fri Jul 12 23:12:51 PDT 2002



xiphmont    02/07/12 23:12:50

  Modified:    examples encoder_example.c
               lib      mapping0.c psy.c psy.h
               lib/modes psych_44.h setup_32.h
  Log:
  Turn off HF dipole stereo.  The elliptical stereo from rc3, despite
  slightly more centered hiss, simply works better.
  
  Monty

Revision  Changes    Path
1.49      +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.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- encoder_example.c	2002/07/12 15:07:52	1.48
+++ encoder_example.c	2002/07/13 06:12:45	1.49
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: simple example encoder
- last mod: $Id: encoder_example.c,v 1.48 2002/07/12 15:07:52 giles Exp $
+ last mod: $Id: encoder_example.c,v 1.49 2002/07/13 06:12:45 xiphmont Exp $
 
  ********************************************************************/
 
@@ -126,7 +126,7 @@
 
    *********************************************************************/
 
-  ret=vorbis_encode_init_vbr(&vi,2,44100,.3);
+  ret=vorbis_encode_init_vbr(&vi,2,44100,.5);
 
   /* do not continue if setup failed; this can happen if we ask for a
      mode that libVorbis does not support (eg, too low a bitrate, etc,

<p><p>1.53      +3 -2      vorbis/lib/mapping0.c

Index: mapping0.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/mapping0.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- mapping0.c	2002/07/01 11:20:11	1.52
+++ mapping0.c	2002/07/13 06:12:46	1.53
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: channel mapping 0 implementation
- last mod: $Id: mapping0.c,v 1.52 2002/07/01 11:20:11 xiphmont Exp $
+ last mod: $Id: mapping0.c,v 1.53 2002/07/13 06:12:46 xiphmont Exp $
 
  ********************************************************************/
 
@@ -513,8 +513,9 @@
 
     if(info->coupling_steps){
       mag_memo=_vp_quantize_couple_memo(vb,
+					&ci->psy_g_param,
                                         psy_look,
-				      info,
+					info,
                                         gmdct);    
       
       mag_sort=_vp_quantize_couple_sort(vb,

<p><p>1.73      +25 -7     vorbis/lib/psy.c

Index: psy.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/psy.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -r1.72 -r1.73
--- psy.c	2002/07/11 06:40:49	1.72
+++ psy.c	2002/07/13 06:12:46	1.73
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: psychoacoustics not including preecho
- last mod: $Id: psy.c,v 1.72 2002/07/11 06:40:49 xiphmont Exp $
+ last mod: $Id: psy.c,v 1.73 2002/07/13 06:12:46 xiphmont Exp $
 
  ********************************************************************/
 
@@ -903,7 +903,7 @@
 
 /* doing the real circular magnitude calculation is audibly superior
    to (A+B)/sqrt(2) */
-static float cardoid_hypot(float a, float b){
+static float dipole_hypot(float a, float b){
   if(a>0.){
     if(b>0.)return sqrt(a*a+b*b);
     if(a>-b)return sqrt(a*a-b*b);
@@ -913,21 +913,36 @@
   if(-a>b)return -sqrt(a*a-b*b);
   return sqrt(b*b-a*a);
 }
+static float round_hypot(float a, float b){
+  if(a>0.){
+    if(b>0.)return sqrt(a*a+b*b);
+    if(a>-b)return sqrt(a*a+b*b);
+    return -sqrt(b*b+a*a);
+  }
+  if(b<0.)return -sqrt(a*a+b*b);
+  if(-a>b)return -sqrt(a*a+b*b);
+  return sqrt(b*b+a*a);
+}
 
+/* revert to round hypot for now */
 float **_vp_quantize_couple_memo(vorbis_block *vb,
+				 vorbis_info_psy_global *g,
                                  vorbis_look_psy *p,
                                  vorbis_info_mapping0 *vi,
                                  float **mdct){
   
   int i,j,n=p->n;
   float **ret=_vorbis_block_alloc(vb,vi->coupling_steps*sizeof(*ret));
+  int limit=g->coupling_pointlimit[p->vi->blockflag][PACKETBLOBS/2];
   
   for(i=0;i<vi->coupling_steps;i++){
     float *mdctM=mdct[vi->coupling_mag[i]];
     float *mdctA=mdct[vi->coupling_ang[i]];
     ret[i]=_vorbis_block_alloc(vb,n*sizeof(**ret));
-    for(j=0;j<n;j++)
-      ret[i][j]=cardoid_hypot(mdctM[j],mdctA[j]);
+    for(j=0;j<limit;j++)
+      ret[i][j]=dipole_hypot(mdctM[j],mdctA[j]);
+    for(;j<n;j++)
+      ret[i][j]=round_hypot(mdctM[j],mdctA[j]);
   }
 
   return(ret);
@@ -940,9 +955,9 @@
 }
 
 int **_vp_quantize_couple_sort(vorbis_block *vb,
-				 vorbis_look_psy *p,
-				 vorbis_info_mapping0 *vi,
-				 float **mags){
+			       vorbis_look_psy *p,
+			       vorbis_info_mapping0 *vi,
+			       float **mags){
 
 
   if(p->vi->normal_point_p){
@@ -1085,9 +1100,12 @@
           if(l<sliding_lowpass){
             if((l>=limit && fabs(rM[l])<postpoint && fabs(rA[l])<postpoint) ||
                (fabs(rM[l])<prepoint && fabs(rA[l])<prepoint)){
+
+
               precomputed_couple_point(mag_memo[i][l],
                                        floorM[l],floorA[l],
                                        qM+l,qA+l);
+
               if(rint(qM[l])==0.f)acc+=qM[l]*qM[l];
             }else{
               couple_lossless(rM[l],rA[l],qM+l,qA+l);

<p><p>1.32      +2 -1      vorbis/lib/psy.h

Index: psy.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/psy.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- psy.h	2002/07/11 06:40:49	1.31
+++ psy.h	2002/07/13 06:12:47	1.32
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: random psychoacoustics (not including preecho)
- last mod: $Id: psy.h,v 1.31 2002/07/11 06:40:49 xiphmont Exp $
+ last mod: $Id: psy.h,v 1.32 2002/07/13 06:12:47 xiphmont Exp $
 
  ********************************************************************/
 
@@ -144,6 +144,7 @@
 extern float _vp_ampmax_decay(float amp,vorbis_dsp_state *vd);
 
 extern float **_vp_quantize_couple_memo(vorbis_block *vb,
+					vorbis_info_psy_global *g,
                                         vorbis_look_psy *p,
                                         vorbis_info_mapping0 *vi,
                                         float **mdct);

<p><p>1.26      +7 -7      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.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- psych_44.h	2002/07/11 08:57:29	1.25
+++ psych_44.h	2002/07/13 06:12:49	1.26
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: key psychoacoustic settings for 44.1/48kHz
- last mod: $Id: psych_44.h,v 1.25 2002/07/11 08:57:29 xiphmont Exp $
+ last mod: $Id: psych_44.h,v 1.26 2002/07/13 06:12:49 xiphmont Exp $
 
  ********************************************************************/
 
@@ -139,18 +139,18 @@
 static noise3 _psy_noisebias_trans_low[2]={
   /*  63     125     250     500      1k       2k      4k      8k     16k*/
   /* 0 */
-  {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  8,  8,  8,  8,  8, 10, 12, 20},
+  {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  8,  8,  8,  8, 10, 12, 14, 20},
     {-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2,  2,  2,  4,  8,  8, 15},
     {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
   /* 1 */
-  {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  4,  4,  5,  5,  5,  8,  10},
+  {{{-15,-15,-15,-15,-15,-10, -5,  0,  2,  2,  6,  6,  6,  8, 10, 12, 15},
     {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2,  0,  0,  0,  2,  4,  10},
     {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -4, -4, -4,  -2}}},
 };
 static noise3 _psy_noisebias_long_low[2]={
     /*63     125     250     500      1k       2k      4k      8k     16k*/
   /* 0 */
-  {{{-10,-10,-10,-10,-10, -4,  0,  0,  0,  6,  6,  6,  6, 10, 10, 10,  20},
+  {{{-10,-10,-10,-10,-10, -4,  0,  0,  0,  6,  6,  6,  6, 10, 10, 12,  20},
     {-20,-20,-20,-20,-20,-20,-10, -2,  0,  0,  0,  0,  0,  2,  4,  6,  15},
     {-20,-20,-20,-20,-20,-20,-20,-10, -6, -6, -6, -6, -6, -4, -4, -4, -2}}},
   /* 1 */
@@ -287,7 +287,7 @@
     {-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,-30,-30,-24,-20,-14,-14,-16,-16,-14,-12,-10,-10,-10},
     {-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},
@@ -295,11 +295,11 @@
     {-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},
+    {-36,-36,-36,-36,-34,-32,-32,-30,-26,-26,-26,-26,-26,-22,-20,-20,-18},
     {-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,-35,-30,-30,-30,-30,-30,-30,-30,-26},
     {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
 };
 

<p><p>1.4       +2 -2      vorbis/lib/modes/setup_32.h

Index: setup_32.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/modes/setup_32.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- setup_32.h	2002/07/11 06:41:04	1.3
+++ setup_32.h	2002/07/13 06:12:49	1.4
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: toplevel settings for 32kHz
- last mod: $Id: setup_32.h,v 1.3 2002/07/11 06:41:04 xiphmont Exp $
+ last mod: $Id: setup_32.h,v 1.4 2002/07/13 06:12:49 xiphmont Exp $
 
  ********************************************************************/
 
@@ -26,7 +26,7 @@
 };
 
 static double rate_mapping_32_low[2]={
-  18000.,28000.
+  20000.,28000.
 };
 
 static double rate_mapping_32_un_low[2]={

<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