shithub: aacdec

Download patch

ref: 44c69a9de9e43b10300cd04fc5308afa373bd305
parent: ac3398aa16ced0bc75de9640f93c1348f986d5dc
author: menno <menno>
date: Wed Dec 17 11:37:34 EST 2003

Small DRM fixes

--- a/libfaad/common.h
+++ b/libfaad/common.h
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
 **
-** $Id: common.h,v 1.39 2003/12/17 14:43:16 menno Exp $
+** $Id: common.h,v 1.40 2003/12/17 16:37:34 menno Exp $
 **/
 
 #ifndef __COMMON_H__
@@ -110,6 +110,12 @@
 #  define SBR_LOW_POWER
 # endif
 #endif // FIXED_POINT
+
+#ifdef DRM
+# ifndef SCALABLE_DEC
+#  define SCALABLE_DEC
+# endif
+#endif
 
 #if ((defined(_WIN32) && !defined(_WIN32_WCE)) || ((__GNUC__ >= 3) && defined(i386)))
 #ifndef FIXED_POINT
--- a/libfaad/sbr_syntax.c
+++ b/libfaad/sbr_syntax.c
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
 **
-** $Id: sbr_syntax.c,v 1.16 2003/12/17 14:43:16 menno Exp $
+** $Id: sbr_syntax.c,v 1.17 2003/12/17 16:37:34 menno Exp $
 **/
 
 #include "common.h"
@@ -320,8 +320,13 @@
                 DEBUGVAR(1,227,"sbr_single_channel_element(): bs_extension_id"));
             nr_bits_left -= 2;
             /* sbr_extension(ld, sbr, 0, nr_bits_left); */
-            sbr->bs_extension_data = (uint8_t)faad_getbits(ld, 6
-                DEBUGVAR(1,279,"sbr_single_channel_element(): bs_extension_data"));
+#ifdef DRM
+            if (!sbr->Is_DRM_SBR)
+#endif
+            {
+                sbr->bs_extension_data = (uint8_t)faad_getbits(ld, 6
+                    DEBUGVAR(1,279,"sbr_single_channel_element(): bs_extension_data"));
+            }
         }
 
         /* Corrigendum */
@@ -446,8 +451,13 @@
                 DEBUGVAR(1,236,"sbr_channel_pair_element(): bs_extension_id"));
             nr_bits_left -= 2;
             /* sbr_extension(ld, sbr, 0, nr_bits_left); */
-            sbr->bs_extension_data = (uint8_t)faad_getbits(ld, 6
-                DEBUGVAR(1,280,"sbr_channel_pair_element(): bs_extension_data"));
+#ifdef DRM
+            if (!sbr->Is_DRM_SBR)
+#endif
+            {
+                sbr->bs_extension_data = (uint8_t)faad_getbits(ld, 6
+                    DEBUGVAR(1,280,"sbr_channel_pair_element(): bs_extension_data"));
+            }
         }
 
         /* Corrigendum */
--- a/libfaad/specrec.c
+++ b/libfaad/specrec.c
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
 **
-** $Id: specrec.c,v 1.34 2003/12/17 14:43:16 menno Exp $
+** $Id: specrec.c,v 1.35 2003/12/17 16:37:34 menno Exp $
 **/
 
 /*
@@ -488,7 +488,7 @@
 #else
     if (q < 0)
     {
-        if (-q > IQ_TABLE_SIZE)
+        if (-q >= IQ_TABLE_SIZE)
             return 0;
 
         /* tab contains a value for all possible q [0,8192] */
@@ -495,7 +495,7 @@
         return -tab[-q];
     }
 
-    if (q > IQ_TABLE_SIZE)
+    if (q >= IQ_TABLE_SIZE)
         return 0;
 
     /* tab contains a value for all possible q [0,8192] */