shithub: aacenc

Download patch

ref: 013430142e873cd3379dbf43fa382f49a20f6c80
parent: 8219b973cf391a44be346991a05e26b2eb696fe5
author: lenox <lenox>
date: Mon Feb 28 03:19:03 EST 2000

removed unused parameters

--- a/block.h
+++ b/block.h
@@ -30,7 +30,6 @@
 #define OUT_DATATYPE double
 
 #define BLOCK_LEN_LONG	   1024
-#define BLOCK_LEN_MEDIUM   512
 #define BLOCK_LEN_SHORT    128
 
 #define NWINLONG	(BLOCK_LEN_LONG)
--- a/enc_tf.c
+++ b/enc_tf.c
@@ -584,9 +584,6 @@
 							nok_tmp_DTimeSigBuf[leftChan], 
 							block_type[leftChan], 
 							WS_SIN,
-							block_size_samples,
-							1,
-							block_size_samples/short_win_in_long, 
 							&sfb_offset_table[leftChan][0], 
 							nr_of_sfb[leftChan],
 							&nok_lt_status[leftChan]);
@@ -593,7 +590,7 @@
 
 						nok_lt_status[rightChan].global_pred_flag = 
 							nok_lt_status[leftChan].global_pred_flag;
-						for(i = 0; i < NOK_MAX_BLOCK_LEN_LONG; i++)
+						for(i = 0; i < BLOCK_LEN_LONG; i++)
 							nok_lt_status[rightChan].pred_mdct[i] = 
 							nok_lt_status[leftChan].pred_mdct[i];
 						for(i = 0; i < MAX_SCFAC_BANDS; i++)
@@ -607,9 +604,6 @@
 							nok_tmp_DTimeSigBuf[rightChan], 
 							block_type[rightChan], 
 							WS_SIN,
-							block_size_samples,
-							1,
-							block_size_samples/short_win_in_long, 
 							&sfb_offset_table[rightChan][0], 
 							nr_of_sfb[rightChan],
 							&nok_lt_status[rightChan]);
@@ -621,9 +615,6 @@
 					nok_tmp_DTimeSigBuf[chanNum], 
 					block_type[chanNum], 
 					WS_SIN,
-					block_size_samples,
-					1,
-					block_size_samples/short_win_in_long, 
 					&sfb_offset_table[chanNum][0], 
 					nr_of_sfb[chanNum],
 					&nok_lt_status[chanNum]);
@@ -716,9 +707,7 @@
 			for (chanNum=0;chanNum<max_ch;chanNum++) {
 				nok_ltp_reconstruct(reconstructed_spectrum[chanNum],
 					block_type[chanNum],
-					WS_SIN, block_size_samples,
-					block_size_samples/2,
-					block_size_samples/short_win_in_long,
+					WS_SIN,
 					&sfb_offset_table[chanNum][0],
 					nr_of_sfb[chanNum],
 					&nok_lt_status[chanNum]);
--- a/nok_ltp_common.h
+++ b/nok_ltp_common.h
@@ -47,27 +47,11 @@
 #endif
 
 /*
-  Macro:	BLOCK_LEN_LONG
-  Purpose:	Length of one long window
-  Explanation:	-  */
-#ifndef BLOCK_LEN_LONG
-#define BLOCK_LEN_LONG LN2
-#endif
-
-
-/*
-  Macro:	NOK_MAX_BLOCK_LEN_LONG
-  Purpose:	Informs the routine of the maximum block size used.
-  Explanation:	This is needed since the TwinVQ long window
-  		is different from the AAC long window.  */
-#define	NOK_MAX_BLOCK_LEN_LONG BLOCK_LEN_LONG //(2 * BLOCK_LEN_LONG) 
-
-/*
   Macro:	NOK_LT_BLEN
   Purpose:	Length of the history buffer.
   Explanation:	Has to hold two long windows of time domain data.  */
 #ifndef	NOK_LT_BLEN
-#define NOK_LT_BLEN (4 * NOK_MAX_BLOCK_LEN_LONG)
+#define NOK_LT_BLEN (4 * BLOCK_LEN_LONG)
 #endif
 
 /*
@@ -77,7 +61,7 @@
 typedef struct
   {
     short buffer[NOK_LT_BLEN];
-    double pred_mdct[2 * NOK_MAX_BLOCK_LEN_LONG];
+    double pred_mdct[2 * BLOCK_LEN_LONG];
     int weight_idx;
     double weight;
     int sbk_prediction_used[MAX_SHORT_WINDOWS];
--- a/nok_ltp_enc.c
+++ b/nok_ltp_enc.c
@@ -34,9 +34,9 @@
 /**************************************************************************
   Version Control Information			Method: CVS
   Identifiers:
-  $Revision: 1.8 $
-  $Date: 2000/02/22 18:54:44 $ (check in)
-  $Author: thebard $
+  $Revision: 1.9 $
+  $Date: 2000/02/28 08:19:03 $ (check in)
+  $Author: lenox $
   *************************************************************************/
 
 
@@ -120,7 +120,7 @@
 	for (i = 0; i < NOK_LT_BLEN; i++)
 		lt_status->buffer[i] = 0;
 
-	for (i = 0; i < NOK_MAX_BLOCK_LEN_LONG; i++)
+	for (i = 0; i < BLOCK_LEN_LONG; i++)
 		lt_status->pred_mdct[i] = 0;
 
 	lt_status->weight_idx = 0;
@@ -180,14 +180,13 @@
 
 int
 nok_ltp_enc(double *p_spectrum, double *p_time_signal, enum WINDOW_TYPE win_type,
-            Window_shape win_shape, int block_size_long, int block_size_medium,
-	    int block_size_short, int *sfb_offset, int num_of_sfb,
+            Window_shape win_shape, int *sfb_offset, int num_of_sfb,
             NOK_LT_PRED_STATUS *lt_status)
 {
     int i;
     int last_band;
     double num_bit[MAX_SHORT_WINDOWS];
-    double predicted_samples[2 * NOK_MAX_BLOCK_LEN_LONG];
+    double predicted_samples[2 * BLOCK_LEN_LONG];
 
     lt_status->global_pred_flag = 0;
     lt_status->side_info = 1;
@@ -199,12 +198,12 @@
 	case SHORT_LONG_WINDOW:
 		last_band = (num_of_sfb < NOK_MAX_LT_PRED_LONG_SFB) ? num_of_sfb : NOK_MAX_LT_PRED_LONG_SFB;
 
-		lt_status->delay[0] = estimate_delay (p_time_signal, lt_status->buffer, 2 * block_size_long);
+		lt_status->delay[0] = estimate_delay (p_time_signal, lt_status->buffer, 2 * BLOCK_LEN_LONG);
 
 //		fprintf(stderr, "(LTP) lag : %i ", lt_status->delay[0]);
 
 		pitch (p_time_signal, predicted_samples, lt_status->buffer,
-			&lt_status->weight_idx, lt_status->delay[0], 2 * block_size_long);
+			&lt_status->weight_idx, lt_status->delay[0], 2 * BLOCK_LEN_LONG);
 
 		/* Transform prediction to frequency domain and save it for subsequent use. */
 		buffer2freq (predicted_samples, lt_status->pred_mdct, NULL, win_type, WS_SIN, WS_SIN, MNON_OVERLAPPED);
@@ -267,14 +266,12 @@
 
 void
 nok_ltp_reconstruct(double *p_spectrum, enum WINDOW_TYPE win_type, 
-                    Window_shape win_shape,
-		    int block_size_long, int block_size_medium,
-                    int block_size_short, int *sfb_offset, int num_of_sfb,
+                    Window_shape win_shape, int *sfb_offset, int num_of_sfb,
                     NOK_LT_PRED_STATUS *lt_status)
 {
 	int i, j, last_band;
-	double predicted_samples[2 * NOK_MAX_BLOCK_LEN_LONG];
-	double overlap_buffer[2 * NOK_MAX_BLOCK_LEN_LONG];
+	double predicted_samples[2 * BLOCK_LEN_LONG];
+	double overlap_buffer[2 * BLOCK_LEN_LONG];
 
     
 	switch(win_type)
@@ -291,16 +288,16 @@
 		/* Finally update the time domain history buffer. */
 		freq2buffer (p_spectrum, predicted_samples, overlap_buffer, win_type, WS_SIN, WS_SIN, MNON_OVERLAPPED);
 
-		for (i = 0; i < NOK_LT_BLEN - block_size_long; i++)
-			lt_status->buffer[i] = lt_status->buffer[i + block_size_long];
+		for (i = 0; i < NOK_LT_BLEN - BLOCK_LEN_LONG; i++)
+			lt_status->buffer[i] = lt_status->buffer[i + BLOCK_LEN_LONG];
 
-		j = NOK_LT_BLEN - 2 * block_size_long;
-		for (i = 0; i < block_size_long; i++)
+		j = NOK_LT_BLEN - 2 * BLOCK_LEN_LONG;
+		for (i = 0; i < BLOCK_LEN_LONG; i++)
 		{
 			lt_status->buffer[i + j] =
 				double_to_int (predicted_samples[i] + lt_status->buffer[i + j]);
-			lt_status->buffer[NOK_LT_BLEN - block_size_long + i] =
-				double_to_int (predicted_samples[i + block_size_long]);
+			lt_status->buffer[NOK_LT_BLEN - BLOCK_LEN_LONG + i] =
+				double_to_int (predicted_samples[i + BLOCK_LEN_LONG]);
 		}
 		break;
 
--- a/nok_ltp_enc.h
+++ b/nok_ltp_enc.h
@@ -33,13 +33,11 @@
 
 extern int nok_ltp_enc(double *p_spectrum, double *p_time_signal,
 		       enum WINDOW_TYPE win_type, Window_shape win_shape,
-		       int block_size_long, int block_size_medium,
-		       int block_size_short, int *sfb_offset, int num_of_sfb,
+		       int *sfb_offset, int num_of_sfb,
 		       NOK_LT_PRED_STATUS *lt_status);
 
 extern void nok_ltp_reconstruct(double *p_spectrum, enum WINDOW_TYPE win_type, 
-                                Window_shape win_shape, int block_size_long, 
-                                int block_size_medium, int block_size_short, 
+                                Window_shape win_shape, 
                                 int *sfb_offset, int num_of_sfb,
                                 NOK_LT_PRED_STATUS *lt_status);
 
--- a/tns.c
+++ b/tns.c
@@ -116,7 +116,7 @@
 
 	default:
 		numberOfWindows = 1;
-		windowSize = LN2;
+		windowSize = BLOCK_LEN_LONG;
 		startBand = tnsInfo->tnsMinBandNumberLong;
 		stopBand = numberOfBands;
 		lengthInBands = stopBand - startBand;