]> git.sesse.net Git - vlc/blobdiff - src/ac3_decoder/ac3_rematrix.c
* Fixed a few warnings with gcc 3.0.
[vlc] / src / ac3_decoder / ac3_rematrix.c
index 1c5d4763331c6f927dce6efb417b63cd101b3eb3..9fc4b90d97c4b18fd48e9dc25cfb6f354a02bd3a 100644 (file)
@@ -1,4 +1,38 @@
-#include "int_types.h"
+/*****************************************************************************
+ * ac3_rematrix.c: ac3 audio rematrixing
+ *****************************************************************************
+ * Copyright (C) 1999, 2000 VideoLAN
+ * $Id: ac3_rematrix.c,v 1.16 2001/05/06 04:32:02 sam Exp $
+ *
+ * Authors: Michel Kaempf <maxx@via.ecp.fr>
+ *          Aaron Holtzman <aholtzma@engr.uvic.ca>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+#include "defs.h"
+
+#include <string.h>                                              /* memcpy() */
+
+#include "config.h"
+#include "common.h"
+#include "threads.h"
+#include "mtime.h"
+
+#include "stream_control.h"
+#include "input_ext-dec.h"
+
 #include "ac3_decoder.h"
 #include "ac3_internal.h"
 
@@ -7,9 +41,9 @@ struct rematrix_band_s {
     u32 end;
 };
 
-static struct rematrix_band_s rematrix_band[] = { {13,24}, {25,36}, {37 ,60}, {61,252}};
+static const struct rematrix_band_s rematrix_band[] = { {13,24}, {25,36}, {37 ,60}, {61,252}};
 
-static __inline__ u32 min (u32 a, u32 b)
+static __inline__ u32 min_value (u32 a, u32 b)
 {
     return (a < b ? a : b);
 }
@@ -36,13 +70,13 @@ void rematrix (ac3dec_t * p_ac3dec)
             continue;
 
         start = rematrix_band[i].start;
-        end = min(rematrix_band[i].end ,12 * p_ac3dec->audblk.cplbegf + 36);
+        end = min_value(rematrix_band[i].end ,12 * p_ac3dec->audblk.cplbegf + 36);
 
         for (j=start;j < end; j++) {
-            left  = 0.5f * (p_ac3dec->coeffs.fbw[0][j] + p_ac3dec->coeffs.fbw[1][j]);
-            right = 0.5f * (p_ac3dec->coeffs.fbw[0][j] - p_ac3dec->coeffs.fbw[1][j]);
-            p_ac3dec->coeffs.fbw[0][j] = left;
-            p_ac3dec->coeffs.fbw[1][j] = right;
+            left  = 0.5f * (p_ac3dec->samples[0][j] + p_ac3dec->samples[1][j]);
+            right = 0.5f * (p_ac3dec->samples[0][j] - p_ac3dec->samples[1][j]);
+            p_ac3dec->samples[0][j] = left;
+            p_ac3dec->samples[1][j] = right;
         }
     }
 }