shithub: aacdec

Download patch

ref: e743e6011523c606726e39f6ff8d47af5377b178
parent: 038d26cd2251feec441a438a5b54b733aa025039
author: menno <menno>
date: Wed Mar 5 09:24:55 EST 2003

Added capabilities function

--- 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.28 2003/02/13 13:02:27 menno Exp $
+** $Id: main.c,v 1.29 2003/03/05 14:24:50 menno Exp $
 **/
 
 #ifdef _WIN32
@@ -512,10 +512,19 @@
     clock_t begin;
 #endif
 
-    fprintf(stderr, "FAAD2 (Freeware AAC Decoder) Compiled on: " __DATE__ "\n");
-    fprintf(stderr, "Version:     %s\n", FAAD2_VERSION);
-    fprintf(stderr, "Copyright:   M. Bakker\n");
-    fprintf(stderr, "             http://www.audiocoding.com\n\n");
+    unsigned long cap = faacDecGetCapabilities();
+
+    fprintf(stderr, " ****** FAAD2 (Freeware AAC Decoder) V%s ******\n\n", FAAD2_VERSION);
+    fprintf(stderr, "        Build: %s\n", __DATE__);
+    fprintf(stderr, "        Copyright: M. Bakker\n");
+    fprintf(stderr, "                   Ahead Software AG\n");
+    fprintf(stderr, "        http://www.audiocoding.com\n");
+    if (cap & FIXED_POINT_CAP)
+        fprintf(stderr, "        Fixed point version\n");
+    else
+        fprintf(stderr, "        Floating point version\n");
+    fprintf(stderr, "\n");
+    fprintf(stderr, " ****************************************************\n\n");
 
     /* begin process command line */
     progName = argv[0];
--- a/include/faad.h
+++ b/include/faad.h
@@ -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: faad.h,v 1.19 2003/02/09 20:42:48 menno Exp $
+** $Id: faad.h,v 1.20 2003/03/05 14:24:52 menno Exp $
 **/
 
 #ifndef __AACDEC_H__
@@ -64,6 +64,14 @@
 #define FAAD_FMT_16BIT_M_SHAPE 7
 #define FAAD_FMT_16BIT_H_SHAPE 8
 
+/* Capabilities */
+#define LC_DEC_CAP            (1<<0)
+#define MAIN_DEC_CAP          (1<<1)
+#define LTP_DEC_CAP           (1<<2)
+#define LD_DEC_CAP            (1<<3)
+#define ERROR_RESILIENCE_CAP  (1<<4)
+#define FIXED_POINT_CAP       (1<<5)
+
 /* A decode call can eat up to FAAD_MIN_STREAMSIZE octets per decoded channel,
    so at least so much octets per channel should be available in this stream */
 #define FAAD_MIN_STREAMSIZE 768 /* 6144 bits/channel */
@@ -108,6 +116,8 @@
 } faacDecFrameInfo;
 
 char* FAADAPI faacDecGetErrorMessage(unsigned char errcode);
+
+unsigned long FAADAPI faacDecGetCapabilities();
 
 faacDecHandle FAADAPI faacDecOpen();
 
--- a/libfaad/decoder.c
+++ b/libfaad/decoder.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: decoder.c,v 1.52 2003/02/24 15:02:25 menno Exp $
+** $Id: decoder.c,v 1.53 2003/03/05 14:24:53 menno Exp $
 **/
 
 #include "common.h"
@@ -52,6 +52,32 @@
 int8_t* FAADAPI faacDecGetErrorMessage(uint8_t errcode)
 {
     return err_msg[errcode];
+}
+
+uint32_t FAADAPI faacDecGetCapabilities()
+{
+    uint32_t cap = 0;
+
+    /* can't do without it */
+    cap += LC_DEC_CAP;
+
+#ifdef MAIN_DEC
+    cap += MAIN_DEC_CAP;
+#endif
+#ifdef LTP_DEC
+    cap += LTP_DEC_CAP;
+#endif
+#ifdef LD_DEC
+    cap += LD_DEC_CAP;
+#endif
+#ifdef ERROR_RESILIENCE
+    cap += ERROR_RESILIENCE_CAP;
+#endif
+#ifdef FIXED_POINT
+    cap += FIXED_POINT_CAP;
+#endif
+
+    return cap;
 }
 
 faacDecHandle FAADAPI faacDecOpen()
--- a/libfaad/decoder.h
+++ b/libfaad/decoder.h
@@ -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: decoder.h,v 1.20 2002/12/10 14:53:15 menno Exp $
+** $Id: decoder.h,v 1.21 2003/03/05 14:24:55 menno Exp $
 **/
 
 #ifndef __DECODER_H__
@@ -54,8 +54,16 @@
 #define FAAD_FMT_16BIT_M_SHAPE 7
 #define FAAD_FMT_16BIT_H_SHAPE 8
 
+#define LC_DEC_CAP            (1<<0)
+#define MAIN_DEC_CAP          (1<<1)
+#define LTP_DEC_CAP           (1<<2)
+#define LD_DEC_CAP            (1<<3)
+#define ERROR_RESILIENCE_CAP  (1<<4)
+#define FIXED_POINT_CAP       (1<<5)
 
 int8_t* FAADAPI faacDecGetErrorMessage(uint8_t errcode);
+
+uint32_t FAADAPI faacDecGetCapabilities();
 
 faacDecHandle FAADAPI faacDecOpen();