shithub: aacenc

Download patch

ref: e5677863a99d7944a2739735ac278ef05289fef5
parent: e0aff59eb79425e8bdeaeeaeca59627a1db0fae8
author: menno <menno>
date: Fri Jan 7 10:46:15 EST 2000

Added option to disable LTP (-nl)

--- a/aacenc.h
+++ b/aacenc.h
@@ -19,6 +19,7 @@
 	                   // if it is -1 MS is totally off.
 	int use_IS;        // If 1, IS stereo is on, if 0, it is off
 	int use_TNS;       // If 1, TNS is on, if 0, it is off
+	int use_LTP;       // If 1, LTP is on, if 0, it is off
 } faacAACConfig;
 
 // This structure is for internal use of the encoder only.
@@ -35,6 +36,7 @@
 	int use_MS;
 	int use_IS;
 	int use_TNS;
+	int use_LTP;
 	int profile;
 	double **inputBuffer;
 } faacAACStream;
--- a/enc_tf.c
+++ b/enc_tf.c
@@ -530,7 +530,7 @@
 		/*******************************************************************************/
 		for(chanNum=0;chanNum<max_ch;chanNum++) 
 		{
-			if(block_type[chanNum] != ONLY_SHORT_WINDOW) 
+			if(as->use_LTP && (block_type[chanNum] != ONLY_SHORT_WINDOW)) 
 			{
 				if(channelInfo[chanNum].cpe)
 				{
--- a/encoder.c
+++ b/encoder.c
@@ -65,6 +65,7 @@
 	as->use_MS = ac->use_MS;
 	as->use_IS = ac->use_IS;
 	as->use_TNS = ac->use_TNS;
+	as->use_LTP = ac->use_LTP;
 	as->profile = ac->profile;
 	as->is_first_frame = 1;
 
@@ -280,7 +281,7 @@
 	faacVersion *faacv = malloc(sizeof(faacVersion));
 
 	faacv->DLLMajorVersion = 2;
-	faacv->DLLMinorVersion = 0;
+	faacv->DLLMinorVersion = 10;
 	faacv->MajorVersion = 0;
 	faacv->MinorVersion = 55;
 	strcpy(faacv->HomePage, "http://www.slimline.net/aac/");
@@ -345,6 +346,7 @@
 	printf(" -nm   Don't use mid/side stereo coding.\n");
 	printf("       The default for MS is intelligent switching.\n");
 	printf(" -nt   Don't use TNS (Temporal Noise Shaping).\n");
+	printf(" -np   Don't use LTP (Long Term Prediction).\n");
 	printf(" -nh   No header will be written to the AAC file.\n");
 	printf(" -is   Use intensity stereo coding.\n");
 	printf(" -oX   Set output directory.\n");
@@ -375,7 +377,7 @@
 	int i, frames, cfr;
 	int profile = MAIN_PROFILE;
 	int no_header = 0;
-	int use_IS = 0, use_MS = 0, use_TNS = 1;
+	int use_IS = 0, use_MS = 0, use_TNS = 1, use_LTP = 1;
 	int bit_rate = 128;
 	char out_dir[255];
 	int out_dir_set = 0;
@@ -466,6 +468,8 @@
 					use_MS = -1;
 				else if (argv[i][2] == 't' || 'T')
 					use_TNS = 0;
+				else if (argv[i][2] == 'p' || 'P')
+					use_LTP = 0;
 				else
 					no_header = 1;
 				break;
@@ -551,6 +555,7 @@
 		ac.use_MS = use_MS;
 		ac.use_IS = use_IS;
 		ac.use_TNS = use_TNS;
+		ac.use_LTP = use_LTP;
 		ac.write_header = !no_header;
 
 		as = faacEncodeInit(&ac, &readNumSample, &bitBufSize, &headerSize);