shithub: aacenc

Download patch

ref: 81555133ae325cfdd73b5114a90adba7d61cc7ee
parent: 4da5aaebe94a8a13ceea2c001b1fd5161ef33e9b
author: menno <menno>
date: Tue May 8 09:19:08 EDT 2001

Better support for main profile in frontends

--- a/frontend/faac.dsp
+++ b/frontend/faac.dsp
@@ -25,7 +25,7 @@
 # PROP AllowPerConfigDependencies 0
 # PROP Scc_ProjName ""
 # PROP Scc_LocalPath ""
-CPP=xicl6.exe
+CPP=cl.exe
 RSC=rc.exe
 
 !IF  "$(CFG)" == "faac - Win32 Release"
@@ -48,10 +48,10 @@
 BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo
 # ADD BSC32 /nologo
-LINK32=xilink6.exe
+LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 libsndfile.lib libc.lib libm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /profile /machine:I386 /nodefaultlib
-# SUBTRACT LINK32 /debug
+# ADD LINK32 libsndfile.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# SUBTRACT LINK32 /profile /debug /nodefaultlib
 
 !ELSEIF  "$(CFG)" == "faac - Win32 Debug"
 
@@ -73,7 +73,7 @@
 BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo
 # ADD BSC32 /nologo
-LINK32=xilink6.exe
+LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
 # ADD LINK32 libsndfiled.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
 
--- a/frontend/faacgui.dsp
+++ b/frontend/faacgui.dsp
@@ -25,7 +25,7 @@
 # PROP AllowPerConfigDependencies 0
 # PROP Scc_ProjName ""
 # PROP Scc_LocalPath ""
-CPP=xicl6.exe
+CPP=cl.exe
 MTL=midl.exe
 RSC=rc.exe
 
@@ -51,10 +51,10 @@
 BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo
 # ADD BSC32 /nologo
-LINK32=xilink6.exe
+LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
-# ADD LINK32 libsndfile.lib libc.lib libm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib
-# SUBTRACT LINK32 /profile
+# ADD LINK32 libsndfile.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
+# SUBTRACT LINK32 /profile /nodefaultlib
 
 !ELSEIF  "$(CFG)" == "faacgui - Win32 Debug"
 
@@ -78,7 +78,7 @@
 BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo
 # ADD BSC32 /nologo
-LINK32=xilink6.exe
+LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
 # ADD LINK32 libsndfiled.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
 
--- a/frontend/faacgui.rc
+++ b/frontend/faacgui.rc
@@ -52,51 +52,50 @@
 // Dialog
 //
 
-IDD_MAINDIALOG DIALOGEX 0, 0, 277, 175
+IDD_MAINDIALOG DIALOGEX 0, 0, 264, 185
 STYLE DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | 
     WS_SYSMENU
 CAPTION "FAAC GUI"
 FONT 8, "MS Sans Serif"
 BEGIN
-    PUSHBUTTON      "...",IDC_SELECT_INPUTFILE,238,12,19,14,0,
+    PUSHBUTTON      "...",IDC_SELECT_INPUTFILE,225,12,19,14,0,
                     WS_EX_STATICEDGE
-    PUSHBUTTON      "...",IDC_SELECT_OUTPUTFILE,238,33,19,14,WS_DISABLED,
+    PUSHBUTTON      "...",IDC_SELECT_OUTPUTFILE,225,33,19,14,WS_DISABLED,
                     WS_EX_STATICEDGE
     CONTROL         "Allow Mid/Side",IDC_ALLOWMIDSIDE,"Button",
-                    BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,13,78,71,10
-    EDITTEXT        IDC_BITRATE,138,77,31,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_BANDWIDTH,138,95,31,14,ES_AUTOHSCROLL
-    DEFPUSHBUTTON   "Encode",IDOK,75,154,50,14,WS_DISABLED
-    PUSHBUTTON      "Quit",IDCANCEL,141,154,50,14
-    EDITTEXT        IDC_INPUTFILENAME,61,12,171,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_OUTPUTFILENAME,61,33,171,14,ES_AUTOHSCROLL | 
+                    BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,14,81,71,10
+    EDITTEXT        IDC_BITRATE,98,82,52,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_BANDWIDTH,98,109,52,14,ES_AUTOHSCROLL
+    DEFPUSHBUTTON   "Encode",IDOK,75,164,50,14,WS_DISABLED
+    PUSHBUTTON      "Quit",IDCANCEL,141,164,50,14
+    EDITTEXT        IDC_INPUTFILENAME,61,12,158,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_OUTPUTFILENAME,61,33,158,14,ES_AUTOHSCROLL | 
                     WS_DISABLED
     LTEXT           "Input File:",IDC_STATIC,18,13,38,8
     LTEXT           "Output File:",IDC_STATIC,18,34,37,8
     CONTROL         "",IDC_STATIC,"Static",SS_BLACKFRAME | SS_SUNKEN,7,54,
-                    263,1
+                    250,1
     LTEXT           "-",IDC_INPUTPARAMS,32,66,55,8
     LTEXT           "In:",IDC_STATIC,14,66,12,8
     CONTROL         "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,7,
-                    126,263,10
-    GROUPBOX        "Output Format",IDC_STATIC,92,62,178,59
-    CTEXT           "- - -",IDC_TIME,7,142,263,8
-    LTEXT           "Bandwidth:",IDC_STATIC,97,98,37,8
-    LTEXT           "Bitrate:",IDC_STATIC,97,80,37,8
-    LTEXT           "bps/ch",IDC_STATIC,173,80,24,8
-    LTEXT           "Hz",IDC_STATIC,173,98,10,8
+                    135,250,10
+    GROUPBOX        "Output Format",IDC_STATIC,93,62,164,67
+    CTEXT           "- - -",IDC_TIME,7,151,250,8
+    LTEXT           "Bandwidth:",IDC_STATIC,98,100,37,8
+    LTEXT           "Bitrate:",IDC_STATIC,98,73,37,8
+    LTEXT           "bps/ch",IDC_STATIC,151,85,24,8
+    LTEXT           "Hz",IDC_STATIC,152,112,10,8
     CONTROL         "Use LFE channel",IDC_USELFE,"Button",BS_AUTOCHECKBOX | 
-                    BS_LEFTTEXT | WS_DISABLED | WS_TABSTOP,13,100,71,10
+                    BS_LEFTTEXT | WS_DISABLED | WS_TABSTOP,14,103,71,10
     CONTROL         "Use TNS",IDC_USETNS,"Button",BS_AUTOCHECKBOX | 
-                    BS_LEFTTEXT | WS_TABSTOP,13,89,71,10
-    RTEXT           "-",IDC_COMPILEDATE,207,160,63,8
-    GROUPBOX        "AAC Profile",IDC_STATIC,200,71,61,46
-    CONTROL         "MPEG4 LTP",IDC_MPEG4LTP,"Button",BS_AUTORADIOBUTTON,204,
-                    103,56,10
-    CONTROL         "MPEG2 LC",IDC_MPEG2LC,"Button",BS_AUTORADIOBUTTON,204,
-                    81,51,10
-    CONTROL         "MPEG4 LC",IDC_MPEG4LC,"Button",BS_AUTORADIOBUTTON,204,
-                    92,51,10
+                    BS_LEFTTEXT | WS_TABSTOP,14,92,71,10
+    RTEXT           "-",IDC_COMPILEDATE,194,170,63,8
+    COMBOBOX        IDC_MPEGVERSION,183,82,67,63,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_OBJECTTYPE,183,109,67,59,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    LTEXT           "MPEG Verion",IDC_STATIC,183,73,44,8
+    LTEXT           "AAC Object Type",IDC_STATIC,183,100,56,8
 END
 
 
@@ -111,12 +110,25 @@
     IDD_MAINDIALOG, DIALOG
     BEGIN
         LEFTMARGIN, 7
-        RIGHTMARGIN, 270
+        RIGHTMARGIN, 257
         TOPMARGIN, 7
-        BOTTOMMARGIN, 168
+        BOTTOMMARGIN, 178
     END
 END
 #endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog Info
+//
+
+IDD_MAINDIALOG DLGINIT
+BEGIN
+    IDC_MPEGVERSION, 0x403, 1, 0
+"\000" 
+    0
+END
 
 #endif    // English (U.S.) resources
 /////////////////////////////////////////////////////////////////////////////
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * $Id: main.c,v 1.15 2001/05/02 05:39:14 menno Exp $
+ * $Id: main.c,v 1.16 2001/05/08 13:19:08 menno Exp $
  */
 
 #ifdef _WIN32
@@ -74,12 +74,12 @@
 	{
 		printf("USAGE: %s -options infile outfile\n", argv[0]);
 		printf("Options:\n");
-		printf("  -pX   AAC object type, X=LC2 gives MPEG2 LC,\n");
-		printf("        X=LC4 gives MPEG4 LC and X=LTP gives LTP\n");
-		printf("  -nm   Don\'t use mid/side coding\n");
-		printf("  -tns  Use TNS coding\n");
-		printf("  -bwX  Set the bandwidth, X in Hz\n");
-		printf("  -brX  Set the bitrate per channel, X in bps\n\n");
+		printf("  -mX   AAC MPEG version, X can be 2 or 4.\n");
+		printf("  -pX   AAC object type, X can be LC, MAIN or LTP.\n");
+		printf("  -nm   Don\'t use mid/side coding.\n");
+		printf("  -tns  Use TNS coding.\n");
+		printf("  -bwX  Set the bandwidth, X in Hz.\n");
+		printf("  -brX  Set the bitrate per channel, X in bps.\n\n");
 		return 1;
 	}
 
@@ -120,16 +120,20 @@
 				switch(argv[i][1]) {
 				case 'p': case 'P':
 					if ((argv[i][2] == 'l') || (argv[i][2] == 'L')) {
-						myFormat->aacObjectType = LOW;
-						if (argv[i][4] == '2')
-							myFormat->mpegVersion = MPEG2;
-						else
-							myFormat->mpegVersion = MPEG4;
-					} else if ((argv[i][2] == 'l') || (argv[i][2] == 'L')) {
-						if ((argv[i][3] == 't') || (argv[i][2] == 'T')) {
+						if ((argv[i][3] == 'c') || (argv[i][2] == 'C')) {
+							myFormat->aacObjectType = LOW;
+						} else if ((argv[i][3] == 't') || (argv[i][2] == 'T')) {
 							myFormat->aacObjectType = LTP;
-							myFormat->mpegVersion = MPEG4;
 						}
+					} else if ((argv[i][2] == 'm') || (argv[i][2] == 'M')) {
+						myFormat->aacObjectType = MAIN;
+					}
+				break;
+				case 'm': case 'M':
+					if (argv[i][2] == '4') {
+						myFormat->mpegVersion = MPEG4;
+					} else {
+						myFormat->mpegVersion = MPEG2;
 					}
 				break;
 				case 't': case 'T':
--- a/frontend/maingui.c
+++ b/frontend/maingui.c
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * $Id: maingui.c,v 1.14 2001/04/19 13:20:33 menno Exp $
+ * $Id: maingui.c,v 1.15 2001/05/08 13:19:08 menno Exp $
  */
 
 #include <windows.h>
@@ -26,7 +26,7 @@
 
 #include <sndfile.h>  /* http://www.zip.com.au/~erikd/libsndfile/ */
 
-#include "faac.h"
+#include <faac.h>
 #include "resource.h"
 
 
@@ -157,18 +157,12 @@
 			config->allowMidside = IsDlgButtonChecked(hWnd, IDC_ALLOWMIDSIDE) == BST_CHECKED ? 1 : 0;
 			config->useTns = IsDlgButtonChecked(hWnd, IDC_USETNS) == BST_CHECKED ? 1 : 0;
 			config->useLfe = IsDlgButtonChecked(hWnd, IDC_USELFE) == BST_CHECKED ? 1 : 0;
-			if (IsDlgButtonChecked(hWnd, IDC_MPEG2LC) == BST_CHECKED) {
-				config->aacObjectType = LOW;
-				config->mpegVersion = MPEG2;
-			}
-			if (IsDlgButtonChecked(hWnd, IDC_MPEG4LC) == BST_CHECKED) {
-				config->aacObjectType = LOW;
-				config->mpegVersion = MPEG4;
-			}
-			if (IsDlgButtonChecked(hWnd, IDC_MPEG4LTP) == BST_CHECKED) {
+
+			config->mpegVersion = SendMessage(GetDlgItem(hWnd, IDC_MPEGVERSION), CB_GETCURSEL, 0, 0);
+			config->aacObjectType = SendMessage(GetDlgItem(hWnd, IDC_OBJECTTYPE), CB_GETCURSEL, 0, 0);
+			if (config->aacObjectType == SSR) /* Set to LTP */
 				config->aacObjectType = LTP;
-				config->mpegVersion = MPEG4;
-			}
+
 			GetDlgItemText(hWnd, IDC_BITRATE, szTemp, sizeof(szTemp));
 			config->bitRate = atoi(szTemp);
 			GetDlgItemText(hWnd, IDC_BANDWIDTH, szTemp, sizeof(szTemp));
@@ -300,9 +294,17 @@
 	{
     case WM_INITDIALOG:
 
-		inputFilename [0] = 0x00;
+		inputFilename[0] = 0x00;
 
-		CheckDlgButton(hWnd, IDC_MPEG4LTP, TRUE);
+		SendMessage(GetDlgItem(hWnd, IDC_MPEGVERSION), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"MPEG4");
+		SendMessage(GetDlgItem(hWnd, IDC_MPEGVERSION), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"MPEG2");
+		SendMessage(GetDlgItem(hWnd, IDC_MPEGVERSION), CB_SETCURSEL, 1, 0);
+
+		SendMessage(GetDlgItem(hWnd, IDC_OBJECTTYPE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"Main");
+		SendMessage(GetDlgItem(hWnd, IDC_OBJECTTYPE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"Low Complexity");
+		SendMessage(GetDlgItem(hWnd, IDC_OBJECTTYPE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"LTP");
+		SendMessage(GetDlgItem(hWnd, IDC_OBJECTTYPE), CB_SETCURSEL, 1, 0);
+
 		CheckDlgButton(hWnd, IDC_ALLOWMIDSIDE, TRUE);
 		CheckDlgButton(hWnd, IDC_USELFE, FALSE);
 		CheckDlgButton(hWnd, IDC_USETNS, TRUE);
--- a/frontend/resource.h
+++ b/frontend/resource.h
@@ -16,17 +16,16 @@
 #define IDC_USELFE                      1011
 #define IDC_USETNS                      1012
 #define IDC_COMPILEDATE                 1018
-#define IDC_MPEG4LTP                    1019
-#define IDC_MPEG2LC                     1020
-#define IDC_MPEG4LC                     1021
+#define IDC_MPEGVERSION                 1020
+#define IDC_OBJECTTYPE                  1021
 
 // Next default values for new objects
 // 
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        103
+#define _APS_NEXT_RESOURCE_VALUE        104
 #define _APS_NEXT_COMMAND_VALUE         40001
-#define _APS_NEXT_CONTROL_VALUE         1020
+#define _APS_NEXT_CONTROL_VALUE         1022
 #define _APS_NEXT_SYMED_VALUE           101
 #endif
 #endif