From 6e695dc64f0310745a32e2399a955fbf1368cd1a Mon Sep 17 00:00:00 2001 From: bircoph Date: Wed, 13 May 2009 15:22:13 +0000 Subject: Remove all kind of trailing whitespaces from all MPlayer's files. This affects all kind of spaces (' ',^I,^M,^L,...): actually [:space:] regex character set. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29306 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libfaad2/analysis.h | 8 +- libfaad2/bits.c | 8 +- libfaad2/cfft.h | 8 +- libfaad2/codebook/hcb.h | 8 +- libfaad2/codebook/hcb_1.h | 8 +- libfaad2/codebook/hcb_10.h | 8 +- libfaad2/codebook/hcb_11.h | 8 +- libfaad2/codebook/hcb_2.h | 8 +- libfaad2/codebook/hcb_3.h | 8 +- libfaad2/codebook/hcb_4.h | 8 +- libfaad2/codebook/hcb_5.h | 8 +- libfaad2/codebook/hcb_6.h | 8 +- libfaad2/codebook/hcb_7.h | 8 +- libfaad2/codebook/hcb_8.h | 8 +- libfaad2/codebook/hcb_9.h | 8 +- libfaad2/codebook/hcb_sf.h | 8 +- libfaad2/decoder.c | 4 +- libfaad2/decoder.h | 8 +- libfaad2/drc.c | 8 +- libfaad2/drc.h | 8 +- libfaad2/drm_dec.c | 240 ++++++++++++++++++++++---------------------- libfaad2/drm_dec.h | 26 ++--- libfaad2/error.c | 8 +- libfaad2/error.h | 8 +- libfaad2/filtbank.c | 8 +- libfaad2/filtbank.h | 8 +- libfaad2/fixed.h | 8 +- libfaad2/hcr.c | 160 ++++++++++++++--------------- libfaad2/huffman.c | 20 ++-- libfaad2/huffman.h | 8 +- libfaad2/ic_predict.c | 10 +- libfaad2/ic_predict.h | 8 +- libfaad2/iq_table.h | 8 +- libfaad2/is.c | 8 +- libfaad2/is.h | 8 +- libfaad2/kbd_win.h | 8 +- libfaad2/local_changes.diff | 76 +++++++------- libfaad2/lt_predict.c | 8 +- libfaad2/lt_predict.h | 8 +- libfaad2/mdct.c | 10 +- libfaad2/mdct.h | 8 +- libfaad2/mdct_tab.h | 8 +- libfaad2/mp4.c | 8 +- libfaad2/mp4.h | 8 +- libfaad2/ms.c | 10 +- libfaad2/ms.h | 8 +- libfaad2/output.h | 8 +- libfaad2/pns.c | 8 +- libfaad2/pns.h | 8 +- libfaad2/ps_dec.c | 2 +- libfaad2/ps_dec.h | 8 +- libfaad2/pulse.c | 8 +- libfaad2/pulse.h | 8 +- libfaad2/rvlc.c | 10 +- libfaad2/rvlc.h | 8 +- libfaad2/sbr_dct.h | 8 +- libfaad2/sbr_dec.c | 10 +- libfaad2/sbr_e_nf.c | 8 +- libfaad2/sbr_e_nf.h | 8 +- libfaad2/sbr_fbt.c | 10 +- libfaad2/sbr_fbt.h | 8 +- libfaad2/sbr_hfadj.c | 52 +++++----- libfaad2/sbr_hfadj.h | 8 +- libfaad2/sbr_hfgen.c | 10 +- libfaad2/sbr_hfgen.h | 8 +- libfaad2/sbr_huff.c | 8 +- libfaad2/sbr_huff.h | 8 +- libfaad2/sbr_noise.h | 8 +- libfaad2/sbr_qmf.h | 8 +- libfaad2/sbr_syntax.c | 8 +- libfaad2/sbr_syntax.h | 8 +- libfaad2/sbr_tf_grid.c | 8 +- libfaad2/sbr_tf_grid.h | 8 +- libfaad2/sine_win.h | 8 +- libfaad2/specrec.c | 6 +- libfaad2/specrec.h | 8 +- libfaad2/ssr.c | 8 +- libfaad2/ssr.h | 8 +- libfaad2/ssr_fb.c | 8 +- libfaad2/ssr_fb.h | 8 +- libfaad2/ssr_ipqf.c | 10 +- libfaad2/ssr_ipqf.h | 8 +- libfaad2/ssr_win.h | 8 +- libfaad2/syntax.c | 14 +-- libfaad2/syntax.h | 8 +- libfaad2/tns.c | 8 +- libfaad2/tns.h | 10 +- 87 files changed, 617 insertions(+), 617 deletions(-) (limited to 'libfaad2') diff --git a/libfaad2/analysis.h b/libfaad2/analysis.h index 25dd9d90ce..6f6a261cea 100644 --- a/libfaad2/analysis.h +++ b/libfaad2/analysis.h @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** 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 ** 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 +** 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 diff --git a/libfaad2/bits.c b/libfaad2/bits.c index 0801e0e4ff..34efbd4f71 100644 --- a/libfaad2/bits.c +++ b/libfaad2/bits.c @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** 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 ** 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 +** 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 diff --git a/libfaad2/cfft.h b/libfaad2/cfft.h index c39a9a59a6..0b4f3330b4 100644 --- a/libfaad2/cfft.h +++ b/libfaad2/cfft.h @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** 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 ** 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 +** 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 diff --git a/libfaad2/codebook/hcb.h b/libfaad2/codebook/hcb.h index 19f5ec8292..093dfb265b 100644 --- a/libfaad2/codebook/hcb.h +++ b/libfaad2/codebook/hcb.h @@ -1,19 +1,19 @@ /* ** 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 +** 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 diff --git a/libfaad2/codebook/hcb_1.h b/libfaad2/codebook/hcb_1.h index 3d7be72bc4..cee50fcccf 100644 --- a/libfaad2/codebook/hcb_1.h +++ b/libfaad2/codebook/hcb_1.h @@ -1,19 +1,19 @@ /* ** 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 +** 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 diff --git a/libfaad2/codebook/hcb_10.h b/libfaad2/codebook/hcb_10.h index 1fffec82a6..7fc2fd5526 100644 --- a/libfaad2/codebook/hcb_10.h +++ b/libfaad2/codebook/hcb_10.h @@ -1,19 +1,19 @@ /* ** 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 +** 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 diff --git a/libfaad2/codebook/hcb_11.h b/libfaad2/codebook/hcb_11.h index ac4e6cfdb8..f0052423dc 100644 --- a/libfaad2/codebook/hcb_11.h +++ b/libfaad2/codebook/hcb_11.h @@ -1,19 +1,19 @@ /* ** 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 +** 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 diff --git a/libfaad2/codebook/hcb_2.h b/libfaad2/codebook/hcb_2.h index 816b543254..ba56a0cf22 100644 --- a/libfaad2/codebook/hcb_2.h +++ b/libfaad2/codebook/hcb_2.h @@ -1,19 +1,19 @@ /* ** 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 +** 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 diff --git a/libfaad2/codebook/hcb_3.h b/libfaad2/codebook/hcb_3.h index cf21100372..27cf9e9e2f 100644 --- a/libfaad2/codebook/hcb_3.h +++ b/libfaad2/codebook/hcb_3.h @@ -1,19 +1,19 @@ /* ** 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 +** 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 diff --git a/libfaad2/codebook/hcb_4.h b/libfaad2/codebook/hcb_4.h index 4f29519d35..11e36fed7f 100644 --- a/libfaad2/codebook/hcb_4.h +++ b/libfaad2/codebook/hcb_4.h @@ -1,19 +1,19 @@ /* ** 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 +** 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 diff --git a/libfaad2/codebook/hcb_5.h b/libfaad2/codebook/hcb_5.h index 5ba861e99f..277dc6319b 100644 --- a/libfaad2/codebook/hcb_5.h +++ b/libfaad2/codebook/hcb_5.h @@ -1,19 +1,19 @@ /* ** 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 +** 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 diff --git a/libfaad2/codebook/hcb_6.h b/libfaad2/codebook/hcb_6.h index 85753ab22d..0d517037da 100644 --- a/libfaad2/codebook/hcb_6.h +++ b/libfaad2/codebook/hcb_6.h @@ -1,19 +1,19 @@ /* ** 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 +** 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 diff --git a/libfaad2/codebook/hcb_7.h b/libfaad2/codebook/hcb_7.h index ac9af46349..a39096838c 100644 --- a/libfaad2/codebook/hcb_7.h +++ b/libfaad2/codebook/hcb_7.h @@ -1,19 +1,19 @@ /* ** 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 +** 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 diff --git a/libfaad2/codebook/hcb_8.h b/libfaad2/codebook/hcb_8.h index d8111afb0f..c87c7d673f 100644 --- a/libfaad2/codebook/hcb_8.h +++ b/libfaad2/codebook/hcb_8.h @@ -1,19 +1,19 @@ /* ** 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 +** 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 diff --git a/libfaad2/codebook/hcb_9.h b/libfaad2/codebook/hcb_9.h index 6c8313493a..1e2645e7ef 100644 --- a/libfaad2/codebook/hcb_9.h +++ b/libfaad2/codebook/hcb_9.h @@ -1,19 +1,19 @@ /* ** 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 +** 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 diff --git a/libfaad2/codebook/hcb_sf.h b/libfaad2/codebook/hcb_sf.h index a847901cef..3b97e91f16 100644 --- a/libfaad2/codebook/hcb_sf.h +++ b/libfaad2/codebook/hcb_sf.h @@ -1,19 +1,19 @@ /* ** 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 +** 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 diff --git a/libfaad2/decoder.c b/libfaad2/decoder.c index c9842f7a89..3b33e11b32 100644 --- a/libfaad2/decoder.c +++ b/libfaad2/decoder.c @@ -465,8 +465,8 @@ int8_t NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle *hDecoder, uint32_t samplerate if ((channels == DRMCH_MONO) || (channels == DRMCH_STEREO)) (*hDecoder)->sbr_present_flag = 0; else - (*hDecoder)->sbr_present_flag = 1; -#endif + (*hDecoder)->sbr_present_flag = 1; +#endif (*hDecoder)->fb = filter_bank_init((*hDecoder)->frameLength); diff --git a/libfaad2/decoder.h b/libfaad2/decoder.h index 1b0c683afc..c06b396e2d 100644 --- a/libfaad2/decoder.h +++ b/libfaad2/decoder.h @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** 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 ** 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 +** 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 diff --git a/libfaad2/drc.c b/libfaad2/drc.c index 0b199c3304..12b0c0a94b 100644 --- a/libfaad2/drc.c +++ b/libfaad2/drc.c @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** 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 ** 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 +** 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 diff --git a/libfaad2/drc.h b/libfaad2/drc.h index 030939f19d..9d2ea9b04e 100644 --- a/libfaad2/drc.h +++ b/libfaad2/drc.h @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** 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 ** 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 +** 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 diff --git a/libfaad2/drm_dec.c b/libfaad2/drm_dec.c index 8bf905169d..d6f76d8720 100644 --- a/libfaad2/drm_dec.c +++ b/libfaad2/drm_dec.c @@ -46,7 +46,7 @@ typedef const int8_t (*drm_ps_huff_tab)[2]; /* binary search huffman tables */ -static const int8_t f_huffman_sa[][2] = +static const int8_t f_huffman_sa[][2] = { { /*0*/ -15, 1 }, /* index 0: 1 bits: x */ { 2, 3 }, /* index 1: 2 bits: 1x */ @@ -64,7 +64,7 @@ static const int8_t f_huffman_sa[][2] = { /*-7*/ -22, /*-6*/ -21 } /* index 13: 7 bits: 111111x */ }; -static const int8_t t_huffman_sa[][2] = +static const int8_t t_huffman_sa[][2] = { { /*0*/ -15, 1 }, /* index 0: 1 bits: x */ { 2, 3 }, /* index 1: 2 bits: 1x */ @@ -82,7 +82,7 @@ static const int8_t t_huffman_sa[][2] = { /*6*/ -9, /*7*/ -8 } /* index 13: 9 bits: 11111111x */ }; -static const int8_t f_huffman_pan[][2] = +static const int8_t f_huffman_pan[][2] = { { /*0*/ -15, 1 }, /* index 0: 1 bits: x */ { /*-1*/ -16, 2 }, /* index 1: 2 bits: 1x */ @@ -114,7 +114,7 @@ static const int8_t f_huffman_pan[][2] = { /*12*/ -3, /*14*/ -1 } /* index 27: 16 bits: 111111111111111x */ }; -static const int8_t t_huffman_pan[][2] = +static const int8_t t_huffman_pan[][2] = { { /*0*/ -15, 1 }, /* index 0: 1 bits: x */ { /*-1*/ -16, 2 }, /* index 1: 2 bits: 1x */ @@ -147,7 +147,7 @@ static const int8_t t_huffman_pan[][2] = }; /* There are 3 classes in the standard but the last 2 are identical */ -static const real_t sa_quant[8][2] = +static const real_t sa_quant[8][2] = { { FRAC_CONST(0.0000), FRAC_CONST(0.0000) }, { FRAC_CONST(0.0501), FRAC_CONST(0.1778) }, @@ -161,7 +161,7 @@ static const real_t sa_quant[8][2] = /* We don't need the actual quantizer values */ #if 0 -static const real_t pan_quant[8][5] = +static const real_t pan_quant[8][5] = { { COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000) }, { COEF_CONST(0.1661), COEF_CONST(0.1661), COEF_CONST(0.3322), COEF_CONST(0.3322), COEF_CONST(0.3322) }, @@ -200,35 +200,35 @@ static const real_t pan_pow_2_neg[8][5] = { /* 2^(pan_quant[x][y]/30) */ static const real_t pan_pow_2_30_pos[8][5] = { - { COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1) }, - { COEF_CONST(1.003845098), COEF_CONST(1.003845098), COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.007704982) }, - { COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.01546933), COEF_CONST(1.019373909), COEF_CONST(1.019373909) }, - { COEF_CONST(1.011579706), COEF_CONST(1.01546933), COEF_CONST(1.023293502), COEF_CONST(1.035142941), COEF_CONST(1.039123167) }, + { COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1) }, + { COEF_CONST(1.003845098), COEF_CONST(1.003845098), COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.007704982) }, + { COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.01546933), COEF_CONST(1.019373909), COEF_CONST(1.019373909) }, + { COEF_CONST(1.011579706), COEF_CONST(1.01546933), COEF_CONST(1.023293502), COEF_CONST(1.035142941), COEF_CONST(1.039123167) }, { COEF_CONST(1.01546933), COEF_CONST(1.023293502), COEF_CONST(1.035142941), COEF_CONST(1.051155908), COEF_CONST(1.059252598) }, - { COEF_CONST(1.019373909), COEF_CONST(1.03117796), COEF_CONST(1.051155908), COEF_CONST(1.071518432), COEF_CONST(1.0839263) }, - { COEF_CONST(1.023293502), COEF_CONST(1.043118698), COEF_CONST(1.067414119), COEF_CONST(1.092277933), COEF_CONST(1.113439626) }, + { COEF_CONST(1.019373909), COEF_CONST(1.03117796), COEF_CONST(1.051155908), COEF_CONST(1.071518432), COEF_CONST(1.0839263) }, + { COEF_CONST(1.023293502), COEF_CONST(1.043118698), COEF_CONST(1.067414119), COEF_CONST(1.092277933), COEF_CONST(1.113439626) }, { COEF_CONST(1.03117796), COEF_CONST(1.055195268), COEF_CONST(1.0839263), COEF_CONST(1.113439626), COEF_CONST(1.143756546) } }; /* 2^(-pan_quant[x][y]/30) */ static const real_t pan_pow_2_30_neg[8][5] = { { COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1) }, - { COEF_CONST(0.99616963), COEF_CONST(0.99616963), COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.99235393) }, - { COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.984766325), COEF_CONST(0.980994305), COEF_CONST(0.980994305) }, - { COEF_CONST(0.988552848), COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.962349827) }, - { COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.951333663), COEF_CONST(0.944061881) }, - { COEF_CONST(0.980994305), COEF_CONST(0.969764715), COEF_CONST(0.951333663), COEF_CONST(0.933255062), COEF_CONST(0.922571949) }, - { COEF_CONST(0.977236734), COEF_CONST(0.958663671), COEF_CONST(0.936843519), COEF_CONST(0.915517901), COEF_CONST(0.898117847) }, + { COEF_CONST(0.99616963), COEF_CONST(0.99616963), COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.99235393) }, + { COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.984766325), COEF_CONST(0.980994305), COEF_CONST(0.980994305) }, + { COEF_CONST(0.988552848), COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.962349827) }, + { COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.951333663), COEF_CONST(0.944061881) }, + { COEF_CONST(0.980994305), COEF_CONST(0.969764715), COEF_CONST(0.951333663), COEF_CONST(0.933255062), COEF_CONST(0.922571949) }, + { COEF_CONST(0.977236734), COEF_CONST(0.958663671), COEF_CONST(0.936843519), COEF_CONST(0.915517901), COEF_CONST(0.898117847) }, { COEF_CONST(0.969764715), COEF_CONST(0.947691892), COEF_CONST(0.922571949), COEF_CONST(0.898117847), COEF_CONST(0.874311936) } }; static const real_t g_decayslope[MAX_SA_BAND] = { - FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.95),FRAC_CONST(0.9), FRAC_CONST(0.85), FRAC_CONST(0.8), - FRAC_CONST(0.75),FRAC_CONST(0.7), FRAC_CONST(0.65),FRAC_CONST(0.6), FRAC_CONST(0.55),FRAC_CONST(0.5), FRAC_CONST(0.45), + FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.95),FRAC_CONST(0.9), FRAC_CONST(0.85), FRAC_CONST(0.8), + FRAC_CONST(0.75),FRAC_CONST(0.7), FRAC_CONST(0.65),FRAC_CONST(0.6), FRAC_CONST(0.55),FRAC_CONST(0.5), FRAC_CONST(0.45), FRAC_CONST(0.4), FRAC_CONST(0.35),FRAC_CONST(0.3), FRAC_CONST(0.25),FRAC_CONST(0.2), FRAC_CONST(0.15), FRAC_CONST(0.1), - FRAC_CONST(0.05),FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), - FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), - FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), + FRAC_CONST(0.05),FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), + FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), + FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0) }; @@ -243,26 +243,26 @@ static const real_t sa_sqrt_1_minus[8][2] = { { FRAC_CONST(0.929071574), FRAC_CONST(0) } }; -static const uint8_t sa_freq_scale[9][2] = +static const uint8_t sa_freq_scale[9][2] = { - { 0, 0}, - { 1, 1}, - { 2, 2}, - { 3, 3}, - { 5, 5}, - { 7, 7}, - {10,10}, - {13,13}, + { 0, 0}, + { 1, 1}, + { 2, 2}, + { 3, 3}, + { 5, 5}, + { 7, 7}, + {10,10}, + {13,13}, {46,23} }; -static const uint8_t pan_freq_scale[21] = +static const uint8_t pan_freq_scale[21] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 22, 26, 32, 64 }; -static const uint8_t pan_quant_class[20] = +static const uint8_t pan_quant_class[20] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4 @@ -270,42 +270,42 @@ static const uint8_t pan_quant_class[20] = /* Inverse mapping lookup */ static const uint8_t pan_inv_freq[64] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19 }; static const uint8_t sa_inv_freq[MAX_SA_BAND] = { 0, 1, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }; -static const real_t filter_coeff[] = +static const real_t filter_coeff[] = { FRAC_CONST(0.65143905754106), FRAC_CONST(0.56471812200776), FRAC_CONST(0.48954165955695) }; -static const uint8_t delay_length[][2] = +static const uint8_t delay_length[][2] = { { 1, 3 }, { 2, 4 }, { 3, 5 } }; -static const real_t delay_fraction[] = +static const real_t delay_fraction[] = { FRAC_CONST(0.43), FRAC_CONST(0.75), FRAC_CONST(0.347) }; -static const real_t peak_decay[2] = +static const real_t peak_decay[2] = { FRAC_CONST(0.58664621951003), FRAC_CONST(0.76592833836465) }; -static const real_t smooth_coeff[2] = +static const real_t smooth_coeff[2] = { FRAC_CONST(0.6), FRAC_CONST(0.25) }; @@ -545,7 +545,7 @@ static int8_t sa_delta_clip(drm_ps_info *ps, int8_t i) } static int8_t pan_delta_clip(drm_ps_info *ps, int8_t i) -{ +{ if (i < -7) { /* printf(" PANminclip %d", i); */ ps->pan_decode_error = 1; @@ -558,34 +558,34 @@ static int8_t pan_delta_clip(drm_ps_info *ps, int8_t i) return i; } -static void drm_ps_delta_decode(drm_ps_info *ps) +static void drm_ps_delta_decode(drm_ps_info *ps) { - uint8_t band; + uint8_t band; - if (ps->bs_enable_sa) - { - if (ps->bs_sa_dt_flag && !ps->g_last_had_sa) - { + if (ps->bs_enable_sa) + { + if (ps->bs_sa_dt_flag && !ps->g_last_had_sa) + { for (band = 0; band < DRM_NUM_SA_BANDS; band++) - { + { ps->g_prev_sa_index[band] = 0; - } - } + } + } if (ps->bs_sa_dt_flag) { - ps->g_sa_index[0] = sa_delta_clip(ps, ps->g_prev_sa_index[0]+ps->bs_sa_data[0]); + ps->g_sa_index[0] = sa_delta_clip(ps, ps->g_prev_sa_index[0]+ps->bs_sa_data[0]); } else { - ps->g_sa_index[0] = sa_delta_clip(ps,ps->bs_sa_data[0]); + ps->g_sa_index[0] = sa_delta_clip(ps,ps->bs_sa_data[0]); } - + for (band = 1; band < DRM_NUM_SA_BANDS; band++) - { + { if (ps->bs_sa_dt_flag) { ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_prev_sa_index[band] + ps->bs_sa_data[band]); } else { - ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_sa_index[band-1] + ps->bs_sa_data[band]); + ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_sa_index[band-1] + ps->bs_sa_data[band]); } } } @@ -597,45 +597,45 @@ static void drm_ps_delta_decode(drm_ps_info *ps) ps->bs_enable_pan = ps->g_last_had_pan; ps->bs_enable_sa = ps->g_last_had_sa; } - - - if (ps->bs_enable_sa) - { + + + if (ps->bs_enable_sa) + { if (ps->sa_decode_error) { for (band = 0; band < DRM_NUM_SA_BANDS; band++) - { + { ps->g_sa_index[band] = ps->g_last_good_sa_index[band]; } } else { for (band = 0; band < DRM_NUM_SA_BANDS; band++) - { + { ps->g_last_good_sa_index[band] = ps->g_sa_index[band]; } } } - - if (ps->bs_enable_pan) + + if (ps->bs_enable_pan) { - if (ps->bs_pan_dt_flag && !ps->g_last_had_pan) + if (ps->bs_pan_dt_flag && !ps->g_last_had_pan) { /* The DRM PS spec doesn't say anything about this case. (deltacoded in time without a previous frame) - AAC PS spec you must tread previous frame as 0, so that's what we try. + AAC PS spec you must tread previous frame as 0, so that's what we try. */ for (band = 0; band < DRM_NUM_PAN_BANDS; band++) - { + { ps->g_prev_pan_index[band] = 0; } - } + } if (ps->bs_pan_dt_flag) - { + { ps->g_pan_index[0] = pan_delta_clip(ps, ps->g_prev_pan_index[0]+ps->bs_pan_data[0]); } else { ps->g_pan_index[0] = pan_delta_clip(ps, ps->bs_pan_data[0]); } - + for (band = 1; band < DRM_NUM_PAN_BANDS; band++) - { + { if (ps->bs_pan_dt_flag) { ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_prev_pan_index[band] + ps->bs_pan_data[band]); @@ -643,23 +643,23 @@ static void drm_ps_delta_decode(drm_ps_info *ps) ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_pan_index[band-1] + ps->bs_pan_data[band]); } } - + if (ps->pan_decode_error) { for (band = 0; band < DRM_NUM_PAN_BANDS; band++) - { + { ps->g_pan_index[band] = ps->g_last_good_pan_index[band]; } } else { for (band = 0; band < DRM_NUM_PAN_BANDS; band++) - { + { ps->g_last_good_pan_index[band] = ps->g_pan_index[band]; } } } } -static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64], uint8_t rateselect) -{ +static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64], uint8_t rateselect) +{ uint8_t s, b, k; complex_t qfrac, tmp0, tmp, in, R0; real_t peakdiff; @@ -675,7 +675,7 @@ static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64], uint8_t ra for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS][rateselect]; b++) { - /* set delay indices */ + /* set delay indices */ for (k = 0; k < NUM_OF_LINKS; k++) temp_delay_ser[k] = ps->delay_buf_index_ser[k]; @@ -683,7 +683,7 @@ static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64], uint8_t ra IM(Phi_Fract) = IM(Phi_Fract_Qmf[b]); for (s = 0; s < NUM_OF_SUBSAMPLES; s++) - { + { const real_t gamma = REAL_CONST(1.5); const real_t sigma = REAL_CONST(1.5625); @@ -718,8 +718,8 @@ static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64], uint8_t ra } else { transratio = MUL_R(DIV_R(nrg, MUL_R(peakdiff, gamma)), sigma); } - - for (k = 0; k < NUM_OF_LINKS; k++) + + for (k = 0; k < NUM_OF_LINKS; k++) { new_delay_slopes[k] = MUL_F(g_decayslope[b], filter_coeff[k]); } @@ -731,14 +731,14 @@ static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64], uint8_t ra IM(ps->d_buff[0][b]) = IM(ps->d_buff[1][b]); RE(ps->d_buff[1][b]) = RE(in); - IM(ps->d_buff[1][b]) = IM(in); + IM(ps->d_buff[1][b]) = IM(in); ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract)); RE(R0) = RE(tmp); IM(R0) = IM(tmp); - for (k = 0; k < NUM_OF_LINKS; k++) + for (k = 0; k < NUM_OF_LINKS; k++) { RE(qfrac) = RE(Q_Fract_allpass_Qmf[b][k]); IM(qfrac) = IM(Q_Fract_allpass_Qmf[b][k]); @@ -766,19 +766,19 @@ static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64], uint8_t ra if (++temp_delay_ser[k] >= delay_length[k][rateselect]) temp_delay_ser[k] = 0; } - } + } } for (k = 0; k < NUM_OF_LINKS; k++) ps->delay_buf_index_ser[k] = temp_delay_ser[k]; } -static void drm_add_ambiance(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[38][64], qmf_t X_right[38][64]) +static void drm_add_ambiance(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[38][64], qmf_t X_right[38][64]) { - uint8_t s, b, ifreq, qclass; + uint8_t s, b, ifreq, qclass; real_t sa_map[MAX_SA_BAND], sa_dir_map[MAX_SA_BAND], k_sa_map[MAX_SA_BAND], k_sa_dir_map[MAX_SA_BAND]; real_t new_dir_map, new_sa_map; - + if (ps->bs_enable_sa) { /* Instead of dequantization and mapping, we use an inverse mapping @@ -793,11 +793,11 @@ static void drm_add_ambiance(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[3 sa_map[b] = sa_quant[ps->g_prev_sa_index[ifreq]][qclass]; new_sa_map = sa_quant[ps->g_sa_index[ifreq]][qclass]; - k_sa_map[b] = MUL_F(inv_f_num_of_subsamples, (new_sa_map - sa_map[b])); - - sa_dir_map[b] = sa_sqrt_1_minus[ps->g_prev_sa_index[ifreq]][qclass]; + k_sa_map[b] = MUL_F(inv_f_num_of_subsamples, (new_sa_map - sa_map[b])); + + sa_dir_map[b] = sa_sqrt_1_minus[ps->g_prev_sa_index[ifreq]][qclass]; new_dir_map = sa_sqrt_1_minus[ps->g_sa_index[ifreq]][qclass]; - + k_sa_dir_map[b] = MUL_F(inv_f_num_of_subsamples, (new_dir_map - sa_dir_map[b])); } @@ -805,35 +805,35 @@ static void drm_add_ambiance(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[3 for (s = 0; s < NUM_OF_SUBSAMPLES; s++) { for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS][rateselect]; b++) - { + { QMF_RE(X_right[s][b]) = MUL_F(QMF_RE(X_left[s][b]), sa_dir_map[b]) - MUL_F(QMF_RE(ps->SA[s][b]), sa_map[b]); QMF_IM(X_right[s][b]) = MUL_F(QMF_IM(X_left[s][b]), sa_dir_map[b]) - MUL_F(QMF_IM(ps->SA[s][b]), sa_map[b]); QMF_RE(X_left[s][b]) = MUL_F(QMF_RE(X_left[s][b]), sa_dir_map[b]) + MUL_F(QMF_RE(ps->SA[s][b]), sa_map[b]); QMF_IM(X_left[s][b]) = MUL_F(QMF_IM(X_left[s][b]), sa_dir_map[b]) + MUL_F(QMF_IM(ps->SA[s][b]), sa_map[b]); - + sa_map[b] += k_sa_map[b]; sa_dir_map[b] += k_sa_dir_map[b]; } for (b = sa_freq_scale[DRM_NUM_SA_BANDS][rateselect]; b < NUM_OF_QMF_CHANNELS; b++) - { + { QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]); QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]); } } - } + } else { for (s = 0; s < NUM_OF_SUBSAMPLES; s++) { for (b = 0; b < NUM_OF_QMF_CHANNELS; b++) { QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]); - QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]); + QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]); } } } } -static void drm_add_pan(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[38][64], qmf_t X_right[38][64]) +static void drm_add_pan(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[38][64], qmf_t X_right[38][64]) { uint8_t s, b, qclass, ifreq; real_t tmp, coeff1, coeff2; @@ -843,7 +843,7 @@ static void drm_add_pan(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[38][64 if (ps->bs_enable_pan) { - for (b = 0; b < NUM_OF_QMF_CHANNELS; b++) + for (b = 0; b < NUM_OF_QMF_CHANNELS; b++) { /* Instead of dequantization, 20->64 mapping and 2^G(x,y) we do an inverse mapping 64->20 and look up the 2^G(x,y) values directly */ @@ -852,7 +852,7 @@ static void drm_add_pan(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[38][64 if (ps->g_prev_pan_index[ifreq] >= 0) { - pan_base[b] = pan_pow_2_pos[ps->g_prev_pan_index[ifreq]][qclass]; + pan_base[b] = pan_pow_2_pos[ps->g_prev_pan_index[ifreq]][qclass]; } else { pan_base[b] = pan_pow_2_neg[-ps->g_prev_pan_index[ifreq]][qclass]; } @@ -861,7 +861,7 @@ static void drm_add_pan(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[38][64 /* a en b can be negative so we may need to inverse parts */ if (ps->g_pan_index[ifreq] >= 0) { - if (ps->g_prev_pan_index[ifreq] >= 0) + if (ps->g_prev_pan_index[ifreq] >= 0) { pan_delta[b] = MUL_C(pan_pow_2_30_pos[ps->g_pan_index[ifreq]][qclass], pan_pow_2_30_neg[ps->g_prev_pan_index[ifreq]][qclass]); @@ -870,7 +870,7 @@ static void drm_add_pan(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[38][64 pan_pow_2_30_pos[-ps->g_prev_pan_index[ifreq]][qclass]); } } else { - if (ps->g_prev_pan_index[ifreq] >= 0) + if (ps->g_prev_pan_index[ifreq] >= 0) { pan_delta[b] = MUL_C(pan_pow_2_30_neg[-ps->g_pan_index[ifreq]][qclass], pan_pow_2_30_neg[ps->g_prev_pan_index[ifreq]][qclass]); @@ -889,7 +889,7 @@ static void drm_add_pan(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[38][64 tmp = pan_base[b]; coeff2 = DIV_R(REAL_CONST(2.0), (REAL_CONST(1.0) + tmp)); - coeff1 = MUL_R(coeff2, tmp); + coeff1 = MUL_R(coeff2, tmp); QMF_RE(temp_l) = QMF_RE(X_left[s][b]); QMF_IM(temp_l) = QMF_IM(X_left[s][b]); @@ -900,20 +900,20 @@ static void drm_add_pan(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[38][64 QMF_IM(X_left[s][b]) = MUL_R(QMF_IM(temp_l), coeff1); QMF_RE(X_right[s][b]) = MUL_R(QMF_RE(temp_r), coeff2); QMF_IM(X_right[s][b]) = MUL_R(QMF_IM(temp_r), coeff2); - + /* 2^(a+k*b) = 2^a * 2^b * ... * 2^b */ /* ^^^^^^^^^^^^^^^ k times */ pan_base[b] = MUL_C(pan_base[b], pan_delta[b]); - } - } - } + } + } + } } drm_ps_info *drm_ps_init(void) { drm_ps_info *ps = (drm_ps_info*)faad_malloc(sizeof(drm_ps_info)); - memset(ps, 0, sizeof(drm_ps_info)); + memset(ps, 0, sizeof(drm_ps_info)); return ps; } @@ -927,14 +927,14 @@ void drm_ps_free(drm_ps_info *ps) uint8_t drm_ps_decode(drm_ps_info *ps, uint8_t guess, uint32_t samplerate, qmf_t X_left[38][64], qmf_t X_right[38][64]) { uint8_t rateselect = (samplerate >= 24000); - - if (ps == NULL) + + if (ps == NULL) { memcpy(X_right, X_left, sizeof(qmf_t)*30*64); - return 0; - } + return 0; + } - if (!ps->drm_ps_data_available && !guess) + if (!ps->drm_ps_data_available && !guess) { memcpy(X_right, X_left, sizeof(qmf_t)*30*64); memset(ps->g_prev_sa_index, 0, sizeof(ps->g_prev_sa_index)); @@ -949,13 +949,13 @@ uint8_t drm_ps_decode(drm_ps_info *ps, uint8_t guess, uint32_t samplerate, qmf_t ps->sa_decode_error = 0; ps->pan_decode_error = 0; drm_ps_delta_decode(ps); - } else + } else { ps->sa_decode_error = 1; ps->pan_decode_error = 1; /* don't even bother decoding */ } - + ps->drm_ps_data_available = 0; drm_calc_sa_side_signal(ps, X_left, rateselect); @@ -963,19 +963,19 @@ uint8_t drm_ps_decode(drm_ps_info *ps, uint8_t guess, uint32_t samplerate, qmf_t if (ps->bs_enable_sa) { - ps->g_last_had_sa = 1; + ps->g_last_had_sa = 1; - memcpy(ps->g_prev_sa_index, ps->g_sa_index, sizeof(int8_t) * DRM_NUM_SA_BANDS); + memcpy(ps->g_prev_sa_index, ps->g_sa_index, sizeof(int8_t) * DRM_NUM_SA_BANDS); } else { ps->g_last_had_sa = 0; } - + if (ps->bs_enable_pan) { drm_add_pan(ps, rateselect, X_left, X_right); - - ps->g_last_had_pan = 1; + + ps->g_last_had_pan = 1; memcpy(ps->g_prev_pan_index, ps->g_pan_index, sizeof(int8_t) * DRM_NUM_PAN_BANDS); diff --git a/libfaad2/drm_dec.h b/libfaad2/drm_dec.h index e90b2340bd..90f2534ecb 100644 --- a/libfaad2/drm_dec.h +++ b/libfaad2/drm_dec.h @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** 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 ** 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 +** 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 @@ -45,7 +45,7 @@ extern "C" { #define MAX_DELAY 5 typedef struct -{ +{ uint8_t drm_ps_data_available; uint8_t bs_enable_sa; uint8_t bs_enable_pan; @@ -58,28 +58,28 @@ typedef struct int8_t bs_sa_data[DRM_NUM_SA_BANDS]; int8_t bs_pan_data[DRM_NUM_PAN_BANDS]; - + int8_t g_sa_index[DRM_NUM_SA_BANDS]; - int8_t g_pan_index[DRM_NUM_PAN_BANDS]; + int8_t g_pan_index[DRM_NUM_PAN_BANDS]; int8_t g_prev_sa_index[DRM_NUM_SA_BANDS]; - int8_t g_prev_pan_index[DRM_NUM_PAN_BANDS]; + int8_t g_prev_pan_index[DRM_NUM_PAN_BANDS]; int8_t sa_decode_error; int8_t pan_decode_error; int8_t g_last_good_sa_index[DRM_NUM_SA_BANDS]; int8_t g_last_good_pan_index[DRM_NUM_PAN_BANDS]; - - qmf_t SA[NUM_OF_SUBSAMPLES][MAX_SA_BAND]; + + qmf_t SA[NUM_OF_SUBSAMPLES][MAX_SA_BAND]; complex_t d_buff[2][MAX_SA_BAND]; complex_t d2_buff[NUM_OF_LINKS][MAX_DELAY][MAX_SA_BAND]; - uint8_t delay_buf_index_ser[NUM_OF_LINKS]; - + uint8_t delay_buf_index_ser[NUM_OF_LINKS]; + real_t prev_nrg[MAX_SA_BAND]; real_t prev_peakdiff[MAX_SA_BAND]; - real_t peakdecay_fast[MAX_SA_BAND]; + real_t peakdecay_fast[MAX_SA_BAND]; } drm_ps_info; diff --git a/libfaad2/error.c b/libfaad2/error.c index 0d3c7a6e0d..7839878974 100644 --- a/libfaad2/error.c +++ b/libfaad2/error.c @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** 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 ** 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 +** 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 diff --git a/libfaad2/error.h b/libfaad2/error.h index 6c5b8192df..ff88c9b438 100644 --- a/libfaad2/error.h +++ b/libfaad2/error.h @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** 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 ** 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 +** 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 diff --git a/libfaad2/filtbank.c b/libfaad2/filtbank.c index 4dc48dc119..4f022d15a4 100644 --- a/libfaad2/filtbank.c +++ b/libfaad2/filtbank.c @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** 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 ** 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 +** 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 diff --git a/libfaad2/filtbank.h b/libfaad2/filtbank.h index 529435bbde..c254ad5b49 100644 --- a/libfaad2/filtbank.h +++ b/libfaad2/filtbank.h @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** 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 ** 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 +** 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 diff --git a/libfaad2/fixed.h b/libfaad2/fixed.h index bfedd081b0..afaf6df623 100644 --- a/libfaad2/fixed.h +++ b/libfaad2/fixed.h @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** 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 ** 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 +** 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 diff --git a/libfaad2/hcr.c b/libfaad2/hcr.c index d57ce9ff63..00cb655fb0 100644 --- a/libfaad2/hcr.c +++ b/libfaad2/hcr.c @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2004 G.C. Pascutto, 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 +** 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 @@ -34,15 +34,15 @@ #include "specrec.h" #include "huffman.h" -/* ISO/IEC 14496-3/Amd.1 - * 8.5.3.3: Huffman Codeword Reordering for AAC spectral data (HCR) +/* ISO/IEC 14496-3/Amd.1 + * 8.5.3.3: Huffman Codeword Reordering for AAC spectral data (HCR) * - * HCR devides the spectral data in known fixed size segments, and - * sorts it by the importance of the data. The importance is firstly - * the (lower) position in the spectrum, and secondly the largest - * value in the used codebook. + * HCR devides the spectral data in known fixed size segments, and + * sorts it by the importance of the data. The importance is firstly + * the (lower) position in the spectrum, and secondly the largest + * value in the used codebook. * The most important data is written at the start of each segment - * (at known positions), the remaining data is interleaved inbetween, + * (at known positions), the remaining data is interleaved inbetween, * with the writing direction alternating. * Data length is not increased. */ @@ -57,10 +57,10 @@ #define VCB11_FIRST 16 #define VCB11_LAST 31 -static const uint8_t PreSortCB_STD[NUM_CB] = +static const uint8_t PreSortCB_STD[NUM_CB] = { 11, 9, 7, 5, 3, 1}; -static const uint8_t PreSortCB_ER[NUM_CB_ER] = +static const uint8_t PreSortCB_ER[NUM_CB_ER] = { 11, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 9, 7, 5, 3, 1}; /* 8.5.3.3.2 Derivation of segment width */ @@ -71,7 +71,7 @@ static const uint8_t maxCwLen[MAX_CB] = {0, 11, 9, 20, 16, 13, 11, 14, 12, 17, 1 #define segmentWidth(cb) min(maxCwLen[cb], ics->length_of_longest_codeword) /* bit-twiddling helpers */ -static const uint8_t S[] = {1, 2, 4, 8, 16}; +static const uint8_t S[] = {1, 2, 4, 8, 16}; static const uint32_t B[] = {0x55555555, 0x33333333, 0x0F0F0F0F, 0x00FF00FF, 0x0000FFFF}; typedef struct @@ -85,11 +85,11 @@ typedef struct /* rewind and reverse */ /* 32 bit version */ static uint32_t rewrev_word(uint32_t v, const uint8_t len) -{ +{ /* 32 bit reverse */ - v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]); - v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]); - v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]); + v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]); + v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]); + v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]); v = ((v >> S[3]) & B[3]) | ((v << S[3]) & ~B[3]); v = ((v >> S[4]) & B[4]) | ((v << S[4]