shithub: aacenc

Download patch

ref: d06f08c3669d5e96535e6950f86a11099557cb23
parent: 58e1670f7e00b6c59247bfe1dc7610d9b2f7fb98
author: menno <menno>
date: Mon Jan 10 10:14:21 EST 2000

Full support of all sample rates, and some other fixes

--- a/psych.c
+++ b/psych.c
@@ -52,9 +52,9 @@
 
 Source file:
 
-$Id: psych.c,v 1.22 2000/01/08 13:31:28 lenox Exp $
-$Id: psych.c,v 1.22 2000/01/08 13:31:28 lenox Exp $
-$Id: psych.c,v 1.22 2000/01/08 13:31:28 lenox Exp $
+$Id: psych.c,v 1.23 2000/01/10 15:14:21 menno Exp $
+$Id: psych.c,v 1.23 2000/01/10 15:14:21 menno Exp $
+$Id: psych.c,v 1.23 2000/01/10 15:14:21 menno Exp $
 
 **********************************************************************/
 
@@ -69,52 +69,106 @@
 
 SR_INFO sr_info_aac[MAX_SAMPLING_RATES+1] =
 {
-  { 8000  },
-  { 11025 },
-  { 12000 },
-  { 16000 },
-
-/* added by T. Araki (1997.10.16) */
-  { 22050, 47, 15,
-     { /*  cb_width_long[NSFB_LONG] */
-      4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  8,  8,  8,  8,  8,  8,  8,
-      8,  8,  8,  12, 12, 12, 12, 16, 16, 16, 20, 20, 24, 24, 28, 28, 32,
-      36, 36, 40, 44, 48, 52, 52, 64, 64, 64, 64, 64
-     },
-     { /* cb_width_short[NSFB_SHORT] */
-      4,  4,  4,  4,  4,  4,  4,  8,  8,  8,  8, 12, 16, 16, 20
-     }
-  },
-/* added by T. Araki (1997.10.16) end */
-
-  { 24000 },
-  { 32000 },
-
-/* added by T. Araki (1997.07.09) */
-  { 44100, 49, 14,
-     { /*  cb_width_long[NSFB_LONG] */
-      4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  8,  8,  8,  8,  8,  8,  8, 
-      12, 12, 12, 12, 16, 16, 20, 20, 24, 24, 28, 28, 32, 32, 32, 32, 32, 32,
-      32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 96 
-     }, 
-     { /* cb_width_short[NSFB_SHORT] */
-      4,  4,  4,  4,  4,  8,  8,  8, 12, 12, 12, 16, 16, 16 
-     }
-/* added by T. Araki (1997.07.09) end */
-
-  },
-  { 48000, 49, 14,
-     { /*  cb_width_long[NSFB_LONG] */
-      4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  8,  8,  8,  8,  8,  8,  8, 
-      12, 12, 12, 12, 16, 16, 20, 20, 24, 24, 28, 28, 32, 32, 32, 32, 32, 32,
-      32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 96
-     }, 
-     { /* cb_width_short[NSFB_SHORT] */
-      4,  4,  4,  4,  4,  8,  8,  8, 12, 12, 12, 16, 16, 16 
-     }
-  },
-  { 96000 },
-  { -1 }
+	{ 8000, 40, 15,
+		{
+			12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 16, 
+			16, 16, 16, 16, 16, 16, 20, 20, 20, 20, 24, 24, 24, 28, 
+			28, 32, 32, 36, 40, 44, 48, 52, 56, 60, 64, 80
+		}, {
+			4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 12, 16, 20, 20
+		}
+	}, { 11025, 43, 15,
+		{
+			8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 12, 12, 12, 
+			12, 12, 12, 12, 12, 12, 16, 16, 16, 16, 20, 20, 20, 20, 
+			24, 28, 28, 32, 40, 40, 44, 44, 48, 52, 56, 60, 64, 64, 64
+		}, {
+			4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 12, 12, 16, 20, 20
+		}
+	}, { 12000, 43, 15,
+		{
+			8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 12, 12, 12, 
+			12, 12, 12, 12, 12, 12, 16, 16, 16, 16, 20, 20, 20, 20, 
+			24, 28, 28, 32, 40, 40, 44, 44, 48, 52, 56, 60, 64, 64, 64
+		}, {
+			4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 12, 12, 16, 20, 20
+		}
+	}, { 16000, 43, 15,
+		{
+			8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 12, 12, 12, 
+			12, 12, 12, 12, 12, 12, 16, 16, 16, 16, 20, 20, 20, 20, 
+			24, 28, 28, 32, 40, 40, 44, 44, 48, 52, 56, 60, 64, 64, 64
+		}, {
+			4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 12, 12, 16, 20, 20
+		}
+	}, { 22050, 47, 15,
+		{
+			4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  8,  8,  8,  8,  8,  8,  8,
+			8,  8,  8,  12, 12, 12, 12, 16, 16, 16, 20, 20, 24, 24, 28, 28, 32,
+			36, 36, 40, 44, 48, 52, 52, 64, 64, 64, 64, 64
+		}, {
+			4,  4,  4,  4,  4,  4,  4,  8,  8,  8,  8, 12, 16, 16, 20
+		}
+	},{ 24000, 47, 15,
+		{
+			4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  8,  8,  8,  8,  8,  8,  8,
+			8,  8,  8,  12, 12, 12, 12, 16, 16, 16, 20, 20, 24, 24, 28, 28, 32,
+			36, 36, 40, 44, 48, 52, 52, 64, 64, 64, 64, 64
+		}, {
+			4,  4,  4,  4,  4,  4,  4,  8,  8,  8,  8, 12, 16, 16, 20
+		}
+	}, { 32000, 51, 14,
+		{
+			4,	4,	4,	4,	4,	4,	4,	4,	4,	4,	8,	8,	8,	8,	
+			8,	8,	8,	12,	12,	12,	12,	16,	16,	20,	20,	24,	24,	28,	
+			28,	32,	32,	32,	32,	32,	32,	32,	32,	32,	32,	32,	32,	32,
+			32,	32,	32,	32,	32,	32,	32,	32,	32
+		},{
+			4,	4,	4,	4,	4,	8,	8,	8,	12,	12,	12,	16,	16,	16
+		}
+	}, { 44100, 49, 14,
+		{
+			4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  8,  8,  8,  8,  8,  8,  8, 
+			12, 12, 12, 12, 16, 16, 20, 20, 24, 24, 28, 28, 32, 32, 32, 32, 32, 32,
+			32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 96 
+		}, {
+			4,  4,  4,  4,  4,  8,  8,  8, 12, 12, 12, 16, 16, 16 
+		}
+	}, { 48000, 49, 14,
+		{
+			4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  8,  8,  8,  8,  8,  8,  8, 
+			12, 12, 12, 12, 16, 16, 20, 20, 24, 24, 28, 28, 32, 32, 32, 32, 32, 32,
+			32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 96
+		}, {
+			4,  4,  4,  4,  4,  8,  8,  8, 12, 12, 12, 16, 16, 16 
+		}
+	}, {64000, 47, 12,
+		{
+			4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+			8, 8, 8, 8, 12, 12, 12, 16, 16, 16, 20, 24, 24, 28,
+			36, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+			40, 40, 40, 40, 40
+		},{
+			4, 4, 4, 4, 4, 4, 8, 8, 8, 16, 28, 32
+		}
+	}, { 88200, 41, 12,
+		{
+			4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+			8, 8, 8, 8, 8, 12, 12, 12, 12, 12, 16, 16, 24, 28, 
+			36, 44, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64
+		},{
+			4, 4, 4, 4, 4, 4, 8, 8, 8, 16, 28, 36
+		}
+	}, { 96000, 41, 12,
+		{
+			4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+			8, 8, 8, 8, 8, 12, 12, 12, 12, 12, 16, 16, 24, 28, 
+			36, 44, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64
+		},{
+			4, 4, 4, 4, 4, 4, 8, 8, 8, 16, 28, 36
+		}
+	},
+	{ -1 }
 };
 
 /* added by T. Araki (1997.07.10) */
@@ -150,8 +204,50 @@
   },
 /* added by T. Araki (1997.10.16) end */
 
-  { 24000 },
-  { 32000 },
+  { 24000, 70,
+     { /* w_low */
+      0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36,
+      39, 42, 45, 48, 51, 54, 57, 60, 63, 67, 71, 75, 79, 83, 88, 93, 98,
+      104, 110, 117, 124, 132, 140, 149, 158, 168, 179, 191, 204, 218, 233,
+      249, 266, 284, 304, 325, 348, 372, 398, 426, 456, 489, 525, 564, 607,
+      654, 707, 766, 833, 909, 997
+     },
+     { /* w_high */
+      1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 38, 
+      41, 44, 47, 50, 53, 56, 59, 62, 66, 70, 74, 78, 82, 87, 92, 97, 103,
+      109, 116, 123, 131, 139, 148, 157, 167, 178, 190, 203, 217, 232, 248,
+      265, 283, 303, 324, 347, 371, 397, 425, 455, 488, 524, 563, 606, 653,
+      706, 765, 832, 908, 996, 1023
+     },
+     { /* width */
+      2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 
+      3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11,
+      12, 13, 14, 15, 16, 17, 18, 20, 21, 23, 24, 26, 28, 30, 33, 36, 39,
+      43, 47, 53, 59, 67, 76, 88, 27
+     }
+  },
+  { 32000, 70,
+     { /* w_low */
+      0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36,
+      39, 42, 45, 48, 51, 54, 57, 60, 63, 67, 71, 75, 79, 83, 88, 93, 98,
+      104, 110, 117, 124, 132, 140, 149, 158, 168, 179, 191, 204, 218, 233,
+      249, 266, 284, 304, 325, 348, 372, 398, 426, 456, 489, 525, 564, 607,
+      654, 707, 766, 833, 909, 997
+     },
+     { /* w_high */
+      1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 38, 
+      41, 44, 47, 50, 53, 56, 59, 62, 66, 70, 74, 78, 82, 87, 92, 97, 103,
+      109, 116, 123, 131, 139, 148, 157, 167, 178, 190, 203, 217, 232, 248,
+      265, 283, 303, 324, 347, 371, 397, 425, 455, 488, 524, 563, 606, 653,
+      706, 765, 832, 908, 996, 1023
+     },
+     { /* width */
+      2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 
+      3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11,
+      12, 13, 14, 15, 16, 17, 18, 20, 21, 23, 24, 26, 28, 30, 33, 36, 39,
+      43, 47, 53, 59, 67, 76, 88, 27
+     }
+  },
   { 44100, 70,
      { /* w_low */
       0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36,
@@ -226,8 +322,38 @@
   },
 /* added by T. Araki (1997.10.16) end */
 
-  { 24000 },
-  { 32000 },
+  { 24000, 42, 
+     { /* w_low */
+      0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20,
+      22, 24, 26, 28, 30, 32, 35, 38, 41, 44, 48, 52, 56, 60, 65, 70, 76,
+      82, 89, 97, 106, 116
+     },
+     { /* w_high */
+      0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 21,
+      23, 25, 27, 29, 31, 34, 37, 40, 43, 47, 51, 55, 59, 64, 69, 75, 81,
+      88, 96, 105, 115, 127
+     },
+     { /* width */
+      1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
+      2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 7, 8, 9, 10, 12
+     }
+  },
+  { 32000, 42, 
+     { /* w_low */
+      0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20,
+      22, 24, 26, 28, 30, 32, 35, 38, 41, 44, 48, 52, 56, 60, 65, 70, 76,
+      82, 89, 97, 106, 116
+     },
+     { /* w_high */
+      0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 21,
+      23, 25, 27, 29, 31, 34, 37, 40, 43, 47, 51, 55, 59, 64, 69, 75, 81,
+      88, 96, 105, 115, 127
+     },
+     { /* width */
+      1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
+      2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 7, 8, 9, 10, 12
+     }
+  },
   { 44100, 42, 
      { /* w_low */
       0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20,
@@ -1203,7 +1329,7 @@
 			}
 		}
 
-		psy_var_long->npart[n] = minthr /** (w_high - w_low)*/;
+		psy_var_long->npart[n] = minthr * (w_high - w_low);
     }
 
     for(n = 0; n < p_sri->num_cb_long; n++){
@@ -1246,7 +1372,7 @@
 				}
 			}
 
-			psy_var_short->npart[i][n] = minthr /** (w_high - w_low)*/;
+			psy_var_short->npart[i][n] = minthr * (w_high - w_low);
         }
 
 		for(n = 0; n < p_sri->num_cb_short; n++){