From 1a2f14f3e6c17aaf602f88904a78c1c85fda0e19 Mon Sep 17 00:00:00 2001 From: ayhanyalcinsoy Date: Thu, 23 Jul 2015 16:02:04 +0300 Subject: [PATCH] a52dec:moved into main for pisi 2.0 --- multimedia/sound/a52dec/actions.py | 25 ++ .../a52dec/files/a52dec-0.7.4-build.patch | 30 ++ multimedia/sound/a52dec/files/constant.patch | 299 ++++++++++++++++++ .../sound/a52dec/files/use-djbfft.patch | 20 ++ multimedia/sound/a52dec/pspec.xml | 74 +++++ multimedia/sound/a52dec/translations.xml | 13 + 6 files changed, 461 insertions(+) create mode 100644 multimedia/sound/a52dec/actions.py create mode 100644 multimedia/sound/a52dec/files/a52dec-0.7.4-build.patch create mode 100644 multimedia/sound/a52dec/files/constant.patch create mode 100644 multimedia/sound/a52dec/files/use-djbfft.patch create mode 100644 multimedia/sound/a52dec/pspec.xml create mode 100644 multimedia/sound/a52dec/translations.xml diff --git a/multimedia/sound/a52dec/actions.py b/multimedia/sound/a52dec/actions.py new file mode 100644 index 0000000000..4df17e106d --- /dev/null +++ b/multimedia/sound/a52dec/actions.py @@ -0,0 +1,25 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU General Public License, version 3. +# See the file http://www.gnu.org/licenses/gpl.txt + +from pisi.actionsapi import autotools +from pisi.actionsapi import pisitools +from pisi.actionsapi import shelltools +from pisi.actionsapi import get + +def setup(): + autotools.autoreconf("-vfi") + autotools.configure("--enable-shared \ + --disable-static \ + --enable-djbfft") + +def build(): + autotools.make('CFLAGS="%s"' % get.CFLAGS()) + +def install(): + autotools.rawInstall('DESTDIR="%s" docdir=/%s/%s/html' % (get.installDIR(), get.docDIR(), get.srcNAME())) + + pisitools.insinto("/usr/include/a52dec", "liba52/a52_internal.h") + pisitools.dodoc("AUTHORS", "ChangeLog", "NEWS", "README", "doc/liba52.txt") diff --git a/multimedia/sound/a52dec/files/a52dec-0.7.4-build.patch b/multimedia/sound/a52dec/files/a52dec-0.7.4-build.patch new file mode 100644 index 0000000000..bc1aa988f3 --- /dev/null +++ b/multimedia/sound/a52dec/files/a52dec-0.7.4-build.patch @@ -0,0 +1,30 @@ +diff -Naur a52dec-0.7.4.orig/liba52/Makefile.am a52dec-0.7.4/liba52/Makefile.am +--- a52dec-0.7.4.orig/liba52/Makefile.am 2002-01-27 20:36:48.000000000 -0800 ++++ a52dec-0.7.4/liba52/Makefile.am 2004-11-05 01:10:21.317401872 -0800 +@@ -1,4 +1,4 @@ +-CFLAGS = @CFLAGS@ @LIBA52_CFLAGS@ ++AM_CFLAGS = @CFLAGS@ @LIBA52_CFLAGS@ + + lib_LTLIBRARIES = liba52.la + +diff -Naur a52dec-0.7.4.orig/liba52/configure.incl a52dec-0.7.4/liba52/configure.incl +--- a52dec-0.7.4.orig/liba52/configure.incl 2002-01-27 20:36:48.000000000 -0800 ++++ a52dec-0.7.4/liba52/configure.incl 2004-11-05 01:11:38.172672216 -0800 +@@ -2,7 +2,7 @@ + AC_SUBST([LIBA52_LIBS]) + + dnl avoid -fPIC when possible +-LIBA52_CFLAGS="$LIBA52_CFLAGS -prefer-non-pic" ++dnl LIBA52_CFLAGS="$LIBA52_CFLAGS -prefer-non-pic" + + AC_ARG_ENABLE([double], + [ --enable-double use double-precision samples]) +diff -Naur a52dec-0.7.4.orig/src/Makefile.am a52dec-0.7.4/src/Makefile.am +--- a52dec-0.7.4.orig/src/Makefile.am 2002-06-22 18:51:57.000000000 -0700 ++++ a52dec-0.7.4/src/Makefile.am 2004-11-05 01:10:21.320401375 -0800 +@@ -1,4 +1,4 @@ +-CFLAGS = @A52DEC_CFLAGS@ ++AM_CFLAGS = @A52DEC_CFLAGS@ + + bin_PROGRAMS = a52dec extract_a52 + a52dec_SOURCES = a52dec.c getopt.c gettimeofday.c diff --git a/multimedia/sound/a52dec/files/constant.patch b/multimedia/sound/a52dec/files/constant.patch new file mode 100644 index 0000000000..a4994ebe41 --- /dev/null +++ b/multimedia/sound/a52dec/files/constant.patch @@ -0,0 +1,299 @@ +Index: a52dec-0.7.4/liba52/bit_allocate.c +=================================================================== +--- a52dec-0.7.4.orig/liba52/bit_allocate.c ++++ a52dec-0.7.4/liba52/bit_allocate.c +@@ -28,7 +28,7 @@ + #include "a52.h" + #include "a52_internal.h" + +-static int hthtab[3][50] = { ++static const int hthtab[3][50] = { + {0x730, 0x730, 0x7c0, 0x800, 0x820, 0x840, 0x850, 0x850, 0x860, 0x860, + 0x860, 0x860, 0x860, 0x870, 0x870, 0x870, 0x880, 0x880, 0x890, 0x890, + 0x8a0, 0x8a0, 0x8b0, 0x8b0, 0x8c0, 0x8c0, 0x8d0, 0x8e0, 0x8f0, 0x900, +@@ -46,7 +46,7 @@ static int hthtab[3][50] = { + 0x8d0, 0x8b0, 0x840, 0x7f0, 0x790, 0x760, 0x7a0, 0x7c0, 0x7b0, 0x720} + }; + +-static int8_t baptab[305] = { ++static const int8_t baptab[305] = { + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, +@@ -71,11 +71,11 @@ static int8_t baptab[305] = { + 0, 0, 0, 0 /* 148 padding elems */ + }; + +-static int bndtab[30] = {21, 22, 23, 24, 25, 26, 27, 28, 31, 34, ++static const int bndtab[30] = {21, 22, 23, 24, 25, 26, 27, 28, 31, 34, + 37, 40, 43, 46, 49, 55, 61, 67, 73, 79, + 85, 97, 109, 121, 133, 157, 181, 205, 229, 253}; + +-static int8_t latab[256] = { ++static const int8_t latab[256] = { + -64, -63, -62, -61, -60, -59, -58, -57, -56, -55, -54, -53, + -52, -52, -51, -50, -49, -48, -47, -47, -46, -45, -44, -44, + -43, -42, -41, -41, -40, -39, -38, -38, -37, -36, -36, -35, +@@ -125,9 +125,9 @@ void a52_bit_allocate (a52_state_t * sta + int start, int end, int fastleak, int slowleak, + expbap_t * expbap) + { +- static int slowgain[4] = {0x540, 0x4d8, 0x478, 0x410}; +- static int dbpbtab[4] = {0xc00, 0x500, 0x300, 0x100}; +- static int floortab[8] = {0x910, 0x950, 0x990, 0x9d0, ++ static const int slowgain[4] = {0x540, 0x4d8, 0x478, 0x410}; ++ static const int dbpbtab[4] = {0xc00, 0x500, 0x300, 0x100}; ++ static const int floortab[8] = {0x910, 0x950, 0x990, 0x9d0, + 0xa10, 0xa90, 0xb10, 0x1400}; + + int i, j; +@@ -135,8 +135,8 @@ void a52_bit_allocate (a52_state_t * sta + int8_t * bap; + int fdecay, fgain, sdecay, sgain, dbknee, floor, snroffset; + int psd, mask; +- int8_t * deltba; +- int * hth; ++ const int8_t * deltba; ++ const int * hth; + int halfrate; + + halfrate = state->halfrate; +Index: a52dec-0.7.4/liba52/imdct.c +=================================================================== +--- a52dec-0.7.4.orig/liba52/imdct.c ++++ a52dec-0.7.4/liba52/imdct.c +@@ -56,6 +56,7 @@ static uint8_t fftorder[] = { + 6,134, 70,198, 38,166,230,102,246,118, 54,182, 22,150,214, 86 + }; + ++#ifndef HARDCODED_TABLES + /* Root values for IFFT */ + static sample_t roots16[3]; + static sample_t roots32[7]; +@@ -69,6 +70,13 @@ static complex_t pre2[64]; + static complex_t post2[32]; + + static sample_t a52_imdct_window[256]; ++#else ++# ifdef LIBA52_DOUBLE ++# include "imdct_tables_double.h" ++# else ++# include "imdct_tables_float.h" ++# endif ++#endif + + static void (* ifft128) (complex_t * buf); + static void (* ifft64) (complex_t * buf); +@@ -178,7 +186,7 @@ static inline void ifft8 (complex_t * bu + BUTTERFLY_HALF (buf[1], buf[3], buf[5], buf[7], roots16[1]); + } + +-static void ifft_pass (complex_t * buf, sample_t * weight, int n) ++static void ifft_pass (complex_t * buf, const sample_t * weight, int n) + { + complex_t * buf1; + complex_t * buf2; +@@ -351,6 +359,7 @@ void a52_imdct_256(sample_t * data, samp + } + } + ++#ifndef HARDCODED_TABLES + static double besselI0 (double x) + { + double bessel = 1; +@@ -361,9 +370,11 @@ static double besselI0 (double x) + while (--i); + return bessel; + } ++#endif + + void a52_imdct_init (uint32_t mm_accel) + { ++#ifndef HARDCODED_TABLES + int i, k; + double sum; + +@@ -416,6 +427,7 @@ void a52_imdct_init (uint32_t mm_accel) + post2[i].real = cos ((M_PI / 128) * (i + 0.5)); + post2[i].imag = sin ((M_PI / 128) * (i + 0.5)); + } ++#endif + + #ifdef LIBA52_DJBFFT + if (mm_accel & MM_ACCEL_DJBFFT) { +Index: a52dec-0.7.4/liba52/imdct-gentables.c +=================================================================== +--- /dev/null ++++ a52dec-0.7.4/liba52/imdct-gentables.c +@@ -0,0 +1,139 @@ ++#include ++#include ++#include ++ ++#ifndef LIBA52_DOUBLE ++typedef float sample_t; ++#else ++typedef double sample_t; ++#endif ++ ++typedef struct complex_s { ++ sample_t real; ++ sample_t imag; ++} complex_t; ++ ++static uint8_t fftorder[] = { ++ 0,128, 64,192, 32,160,224, 96, 16,144, 80,208,240,112, 48,176, ++ 8,136, 72,200, 40,168,232,104,248,120, 56,184, 24,152,216, 88, ++ 4,132, 68,196, 36,164,228,100, 20,148, 84,212,244,116, 52,180, ++ 252,124, 60,188, 28,156,220, 92, 12,140, 76,204,236,108, 44,172, ++ 2,130, 66,194, 34,162,226, 98, 18,146, 82,210,242,114, 50,178, ++ 10,138, 74,202, 42,170,234,106,250,122, 58,186, 26,154,218, 90, ++ 254,126, 62,190, 30,158,222, 94, 14,142, 78,206,238,110, 46,174, ++ 6,134, 70,198, 38,166,230,102,246,118, 54,182, 22,150,214, 86 ++}; ++ ++/* Root values for IFFT */ ++static sample_t roots16[3]; ++static sample_t roots32[7]; ++static sample_t roots64[15]; ++static sample_t roots128[31]; ++ ++/* Twiddle factors for IMDCT */ ++static complex_t pre1[128]; ++static complex_t post1[64]; ++static complex_t pre2[64]; ++static complex_t post2[32]; ++ ++static sample_t a52_imdct_window[256]; ++ ++static double besselI0 (double x) ++{ ++ double bessel = 1; ++ int i = 100; ++ ++ do ++ bessel = bessel * x / (i * i) + 1; ++ while (--i); ++ return bessel; ++} ++ ++int main() { ++ int i, k; ++ double sum; ++ ++ /* compute imdct window - kaiser-bessel derived window, alpha = 5.0 */ ++ sum = 0; ++ for (i = 0; i < 256; i++) { ++ sum += besselI0 (i * (256 - i) * (5 * M_PI / 256) * (5 * M_PI / 256)); ++ a52_imdct_window[i] = sum; ++ } ++ sum++; ++ for (i = 0; i < 256; i++) ++ a52_imdct_window[i] = sqrt (a52_imdct_window[i] / sum); ++ ++ for (i = 0; i < 3; i++) ++ roots16[i] = cos ((M_PI / 8) * (i + 1)); ++ ++ for (i = 0; i < 7; i++) ++ roots32[i] = cos ((M_PI / 16) * (i + 1)); ++ ++ for (i = 0; i < 15; i++) ++ roots64[i] = cos ((M_PI / 32) * (i + 1)); ++ ++ for (i = 0; i < 31; i++) ++ roots128[i] = cos ((M_PI / 64) * (i + 1)); ++ ++ for (i = 0; i < 64; i++) { ++ k = fftorder[i] / 2 + 64; ++ pre1[i].real = cos ((M_PI / 256) * (k - 0.25)); ++ pre1[i].imag = sin ((M_PI / 256) * (k - 0.25)); ++ } ++ ++ for (i = 64; i < 128; i++) { ++ k = fftorder[i] / 2 + 64; ++ pre1[i].real = -cos ((M_PI / 256) * (k - 0.25)); ++ pre1[i].imag = -sin ((M_PI / 256) * (k - 0.25)); ++ } ++ ++ for (i = 0; i < 64; i++) { ++ post1[i].real = cos ((M_PI / 256) * (i + 0.5)); ++ post1[i].imag = sin ((M_PI / 256) * (i + 0.5)); ++ } ++ ++ for (i = 0; i < 64; i++) { ++ k = fftorder[i] / 4; ++ pre2[i].real = cos ((M_PI / 128) * (k - 0.25)); ++ pre2[i].imag = sin ((M_PI / 128) * (k - 0.25)); ++ } ++ ++ for (i = 0; i < 32; i++) { ++ post2[i].real = cos ((M_PI / 128) * (i + 0.5)); ++ post2[i].imag = sin ((M_PI / 128) * (i + 0.5)); ++ } ++ ++#define print_table_samples(name, size) \ ++ do { \ ++ int i; \ ++ printf("static const sample_t " #name "[" #size "] = {\n"); \ ++ for(i = 0; i < size; i++) { \ ++ printf(" %a%s\n", name[i], i < size-1 ? ", " : ""); \ ++ } \ ++ printf("\n};\n\n"); \ ++ } while(0); ++ ++#define print_table_complex(name, size) \ ++ do { \ ++ int i; \ ++ printf("static const complex_t " #name "[" #size "] = {\n"); \ ++ for(i = 0; i < size; i++) { \ ++ printf(" { %a, %a }%s\n", name[i].real, name[i].imag, i < size-1 ? ", " : ""); \ ++ } \ ++ printf("\n};\n\n"); \ ++ } while(0); ++ ++ print_table_samples(roots16, 3); ++ print_table_samples(roots32, 7); ++ print_table_samples(roots64, 15); ++ print_table_samples(roots128, 31); ++ ++ print_table_complex(pre1, 128); ++ print_table_complex(post1, 64); ++ print_table_complex(pre2, 64); ++ print_table_complex(post2, 32); ++ ++ print_table_samples(a52_imdct_window, 256); ++ ++ return 0; ++} +Index: a52dec-0.7.4/liba52/Makefile.am +=================================================================== +--- a52dec-0.7.4.orig/liba52/Makefile.am ++++ a52dec-0.7.4/liba52/Makefile.am +@@ -2,8 +2,26 @@ CFLAGS = @CFLAGS@ @LIBA52_CFLAGS@ + + lib_LTLIBRARIES = liba52.la + +-liba52_la_SOURCES = bitstream.c imdct.c bit_allocate.c parse.c downmix.c ++liba52_la_SOURCES = bitstream.c imdct.c bit_allocate.c parse.c downmix.c imdct_tables_double.h imdct_tables_float.h + liba52_la_LIBADD = @LIBA52_LIBS@ -lm + liba52_la_LDFLAGS = -no-undefined + ++noinst_PROGRAMS = imdct-gentables-double imdct-gentables-float ++ ++imdct_gentables_double_SOURCES = imdct-gentables.c ++imdct_gentables_double_CFLAGS = $(CFLAGS) -DLIBA52_DOUBLE ++imdct_gentables_double_LDADD = -lm ++ ++imdct_gentables_float_SOURCES = imdct-gentables.c ++imdct_gentables_float_CFLAGS = $(CFLAGS) -ULIBA52_DOUBLE ++imdct_gentables_float_LDADD = -lm ++ ++imdct_tables_double.h: imdct-gentables-double ++ ./$^ > $@ ++ ++imdct_tables_float.h: imdct-gentables-float ++ ./$^ > $@ ++ ++imdct.c: imdct_tables_double.h imdct_tables_float.h ++ + EXTRA_DIST = configure.incl a52_internal.h bitstream.h tables.h diff --git a/multimedia/sound/a52dec/files/use-djbfft.patch b/multimedia/sound/a52dec/files/use-djbfft.patch new file mode 100644 index 0000000000..ef374afae3 --- /dev/null +++ b/multimedia/sound/a52dec/files/use-djbfft.patch @@ -0,0 +1,20 @@ +--- liba52/imdct.c 2002-07-28 04:52:07.000000000 +0300 ++++ liba52/imdct.c 2007-05-01 17:41:11.000000000 +0300 +@@ -418,15 +418,12 @@ + } + + #ifdef LIBA52_DJBFFT +- if (mm_accel & MM_ACCEL_DJBFFT) { + fprintf (stderr, "Using djbfft for IMDCT transform\n"); + ifft128 = (void (*) (complex_t *)) fftc4_un128; + ifft64 = (void (*) (complex_t *)) fftc4_un64; +- } else +-#endif +- { ++#else + fprintf (stderr, "No accelerated IMDCT transform found\n"); + ifft128 = ifft128_c; + ifft64 = ifft64_c; +- } ++#endif + } diff --git a/multimedia/sound/a52dec/pspec.xml b/multimedia/sound/a52dec/pspec.xml new file mode 100644 index 0000000000..cb73bbd861 --- /dev/null +++ b/multimedia/sound/a52dec/pspec.xml @@ -0,0 +1,74 @@ + + + + + a52dec + http://liba52.sourceforge.net/ + + PisiLinux Community + admins@pisilinux.org + + GPLv2 + library + DVD ATSC A/52 streams decoder library + liba52 is a free library for decoding ATSC A/52 streams. The A/52 standard is used in a variety of applications, including digital television and DVD. It is also known as AC-3. + http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz + + glibc-devel + djbfft-devel + + + a52dec-0.7.4-build.patch + use-djbfft.patch + constant.patch + + + + + a52dec + + djbfft + + + /usr/bin + /usr/lib + /usr/share/doc + /usr/share/man + + + + + a52dec-devel + Development files for a52dec + + a52dec + + + /usr/include + + + + + + 2014-05-20 + 0.7.4 + Rebuild. + Serdar Soytetir + kaptan@pisilinux.org + + + 2014-01-31 + 0.7.4 + some fixes and rebuild + Alihan Öztürk + alihan@pisilinux.org + + + 2010-10-12 + 0.7.4 + First release + Pisi Linux Admins + admins@pisilinux.org + + + diff --git a/multimedia/sound/a52dec/translations.xml b/multimedia/sound/a52dec/translations.xml new file mode 100644 index 0000000000..5da9560080 --- /dev/null +++ b/multimedia/sound/a52dec/translations.xml @@ -0,0 +1,13 @@ + + + + a52dec + DVD'de kullanılan ATSC A/52 akımını çözen kütüphane + liba52 ATSC A/52 yayınlarının kodlarını çözen ücretsiz bir kütüphanedir. A/52 standart dijital televizyon ve DVD programlarını da içeren çeşitli uygulamalar tarafından kullanılmaktadır. + + + + a52dec-devel + a52dec için geliştirme dosyaları + +