diff libfaad2/sbr_dec.h @ 12527:4a370c80fe5c

update to the 2.0 release of faad, patch by adland
author diego
date Wed, 02 Jun 2004 22:59:04 +0000
parents 3185f64f6350
children d81145997036
line wrap: on
line diff
--- a/libfaad2/sbr_dec.h	Wed Jun 02 22:52:00 2004 +0000
+++ b/libfaad2/sbr_dec.h	Wed Jun 02 22:59:04 2004 +0000
@@ -1,6 +1,6 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
+** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
 **  
 ** 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
@@ -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_dec.h,v 1.7 2003/09/25 12:04:31 menno Exp $
+** $Id: sbr_dec.h,v 1.2 2003/10/03 22:22:27 alex Exp $
 **/
 
 #ifndef __SBR_DEC_H__
@@ -32,6 +32,18 @@
 extern "C" {
 #endif
 
+#ifdef PS_DEC
+#include "ps_dec.h"
+#endif
+#ifdef DRM_PS
+#include "drm_dec.h"
+#endif
+
+/* MAX_NTSRHFG: maximum of number_time_slots * rate + HFGen. 16*2+8 */
+#define MAX_NTSRHFG 40
+#define MAX_NTSR    32 /* max number_time_slots * rate, ok for DRM and not DRM mode */
+
+
 typedef struct {
     real_t *x;
     uint8_t channels;
@@ -41,6 +53,9 @@
     real_t *v[2];
     uint8_t v_index;
     uint8_t channels;
+#ifdef USE_SSE
+    void (*qmf_func)(void *a, void *b, void *c, void *d);
+#endif
 } qmfs_info;
 
 typedef struct
@@ -49,6 +64,7 @@
 
     uint8_t rate;
     uint8_t just_seeked;
+    uint8_t ret;
 
     uint8_t amp_res[2];
 
@@ -131,28 +147,34 @@
     uint32_t frame;
     uint32_t header_count;
 
-    uint8_t *data;
-    uint16_t data_size;
-
     uint8_t id_aac;
     qmfa_info *qmfa[2];
     qmfs_info *qmfs[2];
 
-    qmf_t *Xsbr[2];
-    qmf_t *Xcodec[2];
+    qmf_t Xsbr[2][MAX_NTSRHFG][64];
+    qmf_t Xcodec[2][MAX_NTSRHFG][32];
 
 #ifdef DRM
 	int8_t lcstereo_flag;
 	uint8_t bs_dataextra;
-	uint16_t data_size_bits;
     uint8_t Is_DRM_SBR;
+#ifdef DRM_PS
+    drm_ps_info drm_ps;
+#endif
 #endif
 
-	uint16_t numTimeSlotsRate;
-	uint16_t numTimeSlots;
+	uint8_t numTimeSlotsRate;
+	uint8_t numTimeSlots;
 	uint8_t tHFGen;
 	uint8_t tHFAdj;
 
+#ifdef PS_DEC
+    ps_info ps;
+#endif
+#if (defined(PS_DEC) || defined(DRM_PS))
+    uint8_t ps_used;
+#endif
+
     /* to get it compiling */
     /* we'll see during the coding of all the tools, whether
        these are all used or not.
@@ -192,16 +214,22 @@
     uint8_t bs_df_noise[2][3];
 } sbr_info;
 
-sbr_info *sbrDecodeInit(uint16_t framelength
+sbr_info *sbrDecodeInit(uint16_t framelength, uint8_t id_aac,
+                        uint32_t sample_rate
 #ifdef DRM
 						, uint8_t IsDRM
 #endif
 						);
 void sbrDecodeEnd(sbr_info *sbr);
 
-void sbrDecodeFrame(sbr_info *sbr, real_t *left_channel,
-                    real_t *right_channel, uint8_t id_aac,
-                    uint8_t just_seeked, uint8_t upsample_only);
+uint8_t sbrDecodeCoupleFrame(sbr_info *sbr, real_t *left_chan, real_t *right_chan,
+                             const uint8_t just_seeked, const uint8_t upsample_only);
+uint8_t sbrDecodeSingleFrame(sbr_info *sbr, real_t *channel,
+                             const uint8_t just_seeked, const uint8_t upsample_only);
+#if (defined(PS_DEC) || defined(DRM_PS))
+uint8_t sbrDecodeSingleFramePS(sbr_info *sbr, real_t *left_channel, real_t *right_channel,
+                               const uint8_t just_seeked, const uint8_t upsample_only);
+#endif
 
 
 #ifdef __cplusplus