summaryrefslogtreecommitdiffstats
path: root/libfaad2
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-30 22:30:28 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-30 22:30:28 +0000
commit32063c433915b8dddd143a951ad90ae901ac1b38 (patch)
tree88aaee983b0885b5bb22d870476f7afdaa8a7010 /libfaad2
parent264633eec589baddfdcd79dde08fd7f1f47fba51 (diff)
downloadmpv-32063c433915b8dddd143a951ad90ae901ac1b38.tar.bz2
mpv-32063c433915b8dddd143a951ad90ae901ac1b38.tar.xz
libfaad2 v2.0rc1 imported
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10726 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libfaad2')
-rw-r--r--libfaad2/Makefile39
-rw-r--r--libfaad2/README1
-rw-r--r--libfaad2/analysis.h49
-rw-r--r--libfaad2/bits.c173
-rw-r--r--libfaad2/bits.h260
-rw-r--r--libfaad2/cfft.c556
-rw-r--r--libfaad2/cfft.h59
-rw-r--r--libfaad2/cfft_tab.h1682
-rw-r--r--libfaad2/codebook/hcb.h142
-rw-r--r--libfaad2/codebook/hcb_1.h183
-rw-r--r--libfaad2/codebook/hcb_10.h309
-rw-r--r--libfaad2/codebook/hcb_11.h412
-rw-r--r--libfaad2/codebook/hcb_2.h182
-rw-r--r--libfaad2/codebook/hcb_3.h193
-rw-r--r--libfaad2/codebook/hcb_4.h196
-rw-r--r--libfaad2/codebook/hcb_5.h193
-rw-r--r--libfaad2/codebook/hcb_6.h179
-rw-r--r--libfaad2/codebook/hcb_7.h159
-rw-r--r--libfaad2/codebook/hcb_8.h170
-rw-r--r--libfaad2/codebook/hcb_9.h369
-rw-r--r--libfaad2/codebook/hcb_sf.h273
-rw-r--r--libfaad2/common.c165
-rw-r--r--libfaad2/common.h320
-rw-r--r--libfaad2/config.h28
-rw-r--r--libfaad2/decoder.c1122
-rw-r--r--libfaad2/decoder.h139
-rw-r--r--libfaad2/dither.c130
-rw-r--r--libfaad2/dither.h47
-rw-r--r--libfaad2/drc.c170
-rw-r--r--libfaad2/drc.h46
-rw-r--r--libfaad2/error.c49
-rw-r--r--libfaad2/error.h41
-rw-r--r--libfaad2/faad.h193
-rw-r--r--libfaad2/filtbank.c334
-rw-r--r--libfaad2/filtbank.h63
-rw-r--r--libfaad2/fixed.h145
-rw-r--r--libfaad2/hcr.c628
-rw-r--r--libfaad2/huffman.h350
-rw-r--r--libfaad2/ic_predict.c196
-rw-r--r--libfaad2/ic_predict.h53
-rw-r--r--libfaad2/iq_table.h2112
-rw-r--r--libfaad2/is.c105
-rw-r--r--libfaad2/is.h64
-rw-r--r--libfaad2/kbd_win.h4544
-rw-r--r--libfaad2/lt_predict.c146
-rw-r--r--libfaad2/lt_predict.h61
-rw-r--r--libfaad2/mdct.c284
-rw-r--r--libfaad2/mdct.h46
-rw-r--r--libfaad2/mp4.c256
-rw-r--r--libfaad2/mp4.h49
-rw-r--r--libfaad2/ms.c74
-rw-r--r--libfaad2/ms.h41
-rw-r--r--libfaad2/output.c238
-rw-r--r--libfaad2/output.h48
-rw-r--r--libfaad2/pns.c234
-rw-r--r--libfaad2/pns.h65
-rw-r--r--libfaad2/pulse.c55
-rw-r--r--libfaad2/pulse.h40
-rw-r--r--libfaad2/rvlc.c514
-rw-r--r--libfaad2/rvlc.h65
-rw-r--r--libfaad2/sbr_dct.c4274
-rw-r--r--libfaad2/sbr_dct.h45
-rw-r--r--libfaad2/sbr_dec.c357
-rw-r--r--libfaad2/sbr_dec.h199
-rw-r--r--libfaad2/sbr_e_nf.c357
-rw-r--r--libfaad2/sbr_e_nf.h44
-rw-r--r--libfaad2/sbr_fbt.c541
-rw-r--r--libfaad2/sbr_fbt.h52
-rw-r--r--libfaad2/sbr_hfadj.c987
-rw-r--r--libfaad2/sbr_hfadj.h74
-rw-r--r--libfaad2/sbr_hfgen.c497
-rw-r--r--libfaad2/sbr_hfgen.h56
-rw-r--r--libfaad2/sbr_huff.c233
-rw-r--r--libfaad2/sbr_huff.h54
-rw-r--r--libfaad2/sbr_noise.h560
-rw-r--r--libfaad2/sbr_qmf.c363
-rw-r--r--libfaad2/sbr_qmf.h544
-rw-r--r--libfaad2/sbr_syntax.c817
-rw-r--r--libfaad2/sbr_syntax.h71
-rw-r--r--libfaad2/sbr_tf_grid.c226
-rw-r--r--libfaad2/sbr_tf_grid.h48
-rw-r--r--libfaad2/sine_win.h8548
-rw-r--r--libfaad2/specrec.c626
-rw-r--r--libfaad2/specrec.h52
-rw-r--r--libfaad2/ssr.c175
-rw-r--r--libfaad2/ssr.h56
-rw-r--r--libfaad2/ssr_fb.c182
-rw-r--r--libfaad2/ssr_fb.h50
-rw-r--r--libfaad2/ssr_ipqf.c188
-rw-r--r--libfaad2/ssr_ipqf.h43
-rw-r--r--libfaad2/ssr_win.h632
-rw-r--r--libfaad2/structs.h427
-rw-r--r--libfaad2/syntax.c1960
-rw-r--r--libfaad2/syntax.h144
-rw-r--r--libfaad2/tns.c303
-rw-r--r--libfaad2/tns.h55
96 files changed, 42879 insertions, 0 deletions
diff --git a/libfaad2/Makefile b/libfaad2/Makefile
new file mode 100644
index 0000000000..36d7b1ea14
--- /dev/null
+++ b/libfaad2/Makefile
@@ -0,0 +1,39 @@
+
+LIBNAME = libfaad2.a
+
+include ../config.mak
+
+SRCS = bits.c cfft.c common.c decoder.c dither.c drc.c error.c filtbank.c hcr.c ic_predict.c is.c lt_predict.c mdct.c mp4.c ms.c output.c pns.c pulse.c rvlc.c sbr_dct.c sbr_dec.c sbr_e_nf.c sbr_fbt.c sbr_hfadj.c sbr_hfgen.c sbr_huff.c sbr_qmf.c sbr_syntax.c sbr_tf_grid.c specrec.c ssr.c ssr_fb.c ssr_ipqf.c syntax.c tns.c
+OBJS = $(SRCS:.c=.o)
+
+CFLAGS = -I. $(OPTFLAGS)
+
+.SUFFIXES: .c .o
+
+# .PHONY: all clean
+
+.c.o:
+ $(CC) -c $(CFLAGS) -o $@ $<
+
+$(LIBNAME): $(OBJS)
+ $(AR) r $(LIBNAME) $(OBJS)
+
+all: $(LIBNAME)
+
+clean:
+ rm -f *.o *.a *~
+
+distclean:
+ rm -f test *.o *.a *~ .depend
+
+dep: depend
+
+depend:
+ $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
+
+#
+# include dependency files if they exist
+#
+ifneq ($(wildcard .depend),)
+include .depend
+endif
diff --git a/libfaad2/README b/libfaad2/README
new file mode 100644
index 0000000000..5943bdb18c
--- /dev/null
+++ b/libfaad2/README
@@ -0,0 +1 @@
+files from libfaad v2.0rc1 tarball's libfaad/ and include/ subdir
diff --git a/libfaad2/analysis.h b/libfaad2/analysis.h
new file mode 100644
index 0000000000..f05c876269
--- /dev/null
+++ b/libfaad2/analysis.h
@@ -0,0 +1,49 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** 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-1307, USA.
+**
+** Any non-GPL usage of this software or parts of this software is strictly
+** forbidden.
+**
+** Commercial non-GPL licensing of this software is possible.
+** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
+**
+** $Id: analysis.h,v 1.3 2003/07/29 08:20:12 menno Exp $
+**/
+
+#ifndef __ANALYSIS_H__
+#define __ANALYSIS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#ifdef ANALYSIS
+#define DEBUGDEC ,uint8_t print,uint16_t var,uint8_t *dbg
+#define DEBUGVAR(A,B,C) ,A,B,C
+extern uint16_t dbg_count;
+#else
+#define DEBUGDEC
+#define DEBUGVAR(A,B,C)
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/libfaad2/bits.c b/libfaad2/bits.c
new file mode 100644
index 0000000000..00f9ad0090
--- /dev/null
+++ b/libfaad2/bits.c
@@ -0,0 +1,173 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** 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-1307, USA.
+**
+** Any non-GPL usage of this software or parts of this software is strictly
+** forbidden.
+**
+** Commercial non-GPL licensing of this software is possible.
+** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
+**
+** $Id: bits.c,v 1.22 2003/07/29 08:20:12 menno Exp $
+**/
+
+#include "common.h"
+#include "structs.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include "bits.h"
+
+/* initialize buffer, call once before first getbits or showbits */
+void faad_initbits(bitfile *ld, void *_buffer, uint32_t buffer_size)
+{
+ uint32_t tmp;
+
+ ld->buffer = malloc((buffer_size+12)*sizeof(uint8_t));
+ memset(ld->buffer, 0, (buffer_size+12)*sizeof(uint8_t));
+ memcpy(ld->buffer, _buffer, buffer_size*sizeof(uint8_t));
+
+ ld->buffer_size = buffer_size;
+
+ tmp = getdword((uint32_t*)ld->buffer);
+#ifndef ARCH_IS_BIG_ENDIAN
+ BSWAP(tmp);
+#endif
+ ld->bufa = tmp;
+
+ tmp = getdword((uint32_t*)ld->buffer + 1);
+#ifndef ARCH_IS_BIG_ENDIAN
+ BSWAP(tmp);
+#endif
+ ld->bufb = tmp;
+
+ ld->start = (uint32_t*)ld->buffer;
+ ld->tail = ((uint32_t*)ld->buffer + 2);
+
+ ld->bits_left = 32;
+
+ ld->bytes_used = 0;
+ ld->no_more_reading = 0;
+ ld->error = 0;
+}
+
+void faad_endbits(bitfile *ld)
+{
+ if (ld)
+ if (ld->buffer) free(ld->buffer);
+}
+
+
+uint32_t faad_get_processed_bits(bitfile *ld)
+{
+ return 8 * (4*(ld->tail - ld->start) - 4) - (ld->bits_left);
+}
+
+uint8_t faad_byte_align(bitfile *ld)
+{
+ uint8_t remainder = (uint8_t)((32 - ld->bits_left) % 8);
+
+ if (remainder)
+ {
+ faad_flushbits(ld, 8 - remainder);
+ return (8 - remainder);
+ }
+ return 0;
+}
+
+/* rewind to beginning */
+void faad_rewindbits(bitfile *ld)
+{
+ uint32_t tmp;
+
+ tmp = ld->start[0];
+#ifndef ARCH_IS_BIG_ENDIAN
+ BSWAP(tmp);
+#endif
+ ld->bufa = tmp;
+
+ tmp = ld->start[1];
+#ifndef ARCH_IS_BIG_ENDIAN
+ BSWAP(tmp);
+#endif
+ ld->bufb = tmp;
+ ld->bits_left = 32;
+ ld->tail = &ld->start[2];
+ ld->bytes_used = 0;
+ ld->no_more_reading = 0;
+}
+
+uint8_t *faad_getbitbuffer(bitfile *ld, uint32_t bits
+ DEBUGDEC)
+{
+ uint16_t i;
+ uint8_t temp;
+ uint16_t bytes = (uint16_t)bits / 8;
+ uint8_t remainder = (uint8_t)bits % 8;
+
+ uint8_t *buffer = (uint8_t*)malloc((bytes+1)*sizeof(uint8_t));
+
+ for (i = 0; i < bytes; i++)
+ {
+ buffer[i] = (uint8_t)faad_getbits(ld, 8 DEBUGVAR(print,var,dbg));
+ }
+
+ if (remainder)
+ {
+ temp = (uint8_t)faad_getbits(ld, remainder DEBUGVAR(print,var,dbg)) << (8-remainder);
+
+ buffer[bytes] = temp;
+ }
+
+ return buffer;
+}
+
+/* reversed bit reading routines, used for RVLC and HCR */
+void faad_initbits_rev(bitfile *ld, void *buffer,
+ uint32_t bits_in_buffer)
+{
+ uint32_t tmp;
+ int32_t index;
+
+ ld->buffer_size = bit2byte(bits_in_buffer);
+
+ index = (bits_in_buffer+31)/32 - 1;
+
+ ld->start = (uint32_t*)buffer + index - 2;
+
+ tmp = getdword((uint32_t*)buffer + index);
+#ifndef ARCH_IS_BIG_ENDIAN
+ BSWAP(tmp);
+#endif
+ ld->bufa = tmp;
+
+ tmp = getdword((uint32_t*)buffer + index - 1);
+#ifndef ARCH_IS_BIG_ENDIAN
+ BSWAP(tmp);
+#endif
+ ld->bufb = tmp;
+
+ ld->tail = (uint32_t*)buffer + index;
+
+ ld->bits_left = bits_in_buffer % 32;
+ if (ld->bits_left == 0)
+ ld->bits_left = 32;
+
+ ld->bytes_used = 0;
+ ld->no_more_reading = 0;
+ ld->error = 0;
+}
diff --git a/libfaad2/bits.h b/libfaad2/bits.h
new file mode 100644
index 0000000000..fbe2295215
--- /dev/null
+++ b/libfaad2/bits.h
@@ -0,0 +1,260 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003 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
+** 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-1307, USA.
+**
+** Any non-GPL usage of this software or parts of this software is strictly
+** forbidden.
+**
+** Commercial non-GPL licensing of this software is possible.
+** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
+**
+** $Id$
+**/
+
+#ifndef __BITS_H__
+#define __BITS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "analysis.h"
+#ifdef ANALYSIS
+#include <stdio.h>
+#endif
+
+#define BYTE_NUMBIT 8
+#define bit2byte(a) ((a+7)/BYTE_NUMBIT)
+
+typedef struct _bitfile
+{
+ /* bit input */
+ uint32_t bufa;
+ uint32_t