summaryrefslogtreecommitdiffstats
path: root/contrib/a52dec/A00-dpl2.patch
diff options
context:
space:
mode:
authorkonablend <[email protected]>2009-03-01 17:03:11 +0000
committerkonablend <[email protected]>2009-03-01 17:03:11 +0000
commit4dbce6b69967c1e14092637aa95b6c31855a81fc (patch)
tree516c17095967698eeb419c70ce72dbd2c11bf754 /contrib/a52dec/A00-dpl2.patch
parentc47939541ccec1e5e57753b16b28baed2613f586 (diff)
BuildSystem: conversion from jam-based to make-based system.
KNOWN ISSUES: 1. OSX + Xcode builds do not support parallel builds; attempting to use them may cause unbounded number of jobs. However, disabling via configure --disable-xcode avoids the issue. 2. OSX ppc binary produces binary which has audio-scan problems. 3. OSX ppc64 binary has not been runtime tested. ADDED: 00-BuildUserGuide.txt contrib/*/module.* doc/ make/ libhb/module.* test/module.* macos/module.* gtk/module.* DROPPED: BUILD BuildContribDarwin.sh DownloadMacOsXContribBinaries.sh Jamfile Jamrules MacOsXContribBinariesVersion.txt Makefile Makefile.config jam libhb/Jamefile libhb/Makefile test/BUILDSHARED test/Makefile contrib/Jamfile contrib/Makefile contrib/patch-ffmpeg.patch contrib/patch-x264-idr.patch contrib/patch-x264-linux.patch RENAMED: contrib/*.patch -> contrib/MODULE/[AP]??-*.patch macosx/HandBrake.plist -> macosx/Info.plist MODIFIED: libhb/decavcodec.c Patched to use cleaner include "libavcodec/audioconvert". Second part to support this cleanup is ffmpeg A02-audioconvert.patch . MODIFIED: libhb/hb.c MODIFIED: libhb/hb.h MODIFIED: libhb/muxmkv.c MODIFIED: libhb/muxmp4.c MODIFIED: libhb/update.c Patched to use "project.h" for project metadata. Renamed HB_BUILD -> HB_PROJECT_BUILD. Renamed HB_VERSION -> HB_PROJECT_VERSION. MODIFIED: test/test.c: Patched HandBrakeCLI to support I/O on Mac OS X ZFS filesystems. Reference r1803 as similar patch for HandBrake.app . Unpatched behavior is crash/buserror when using ZFS. MODIFIED: macosx/Growl.framework/ Upgraded 0.7.6 (i386,ppc) -> 1.1.2 (i386,x86_64,ppc,ppc64). New architectures facilitate x86_64 and ppc64 builds. MODIFIED: macosx/HandBrake.xcodeproj/ Bumped compatibilty mode from 2.4 -> 3.1 . Dumped old configurations Deployment, Developer. Added configurations standard, sebug as replacements. Added standard.i386, standard.x86_64, standard.ppc, standard.ppc64 . for explicit architecture build. All configurations settings cleaned up and normalized. Build output directories adjusted to support new build system. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2180 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'contrib/a52dec/A00-dpl2.patch')
-rw-r--r--contrib/a52dec/A00-dpl2.patch114
1 files changed, 114 insertions, 0 deletions
diff --git a/contrib/a52dec/A00-dpl2.patch b/contrib/a52dec/A00-dpl2.patch
new file mode 100644
index 000000000..cf1c8a64a
--- /dev/null
+++ b/contrib/a52dec/A00-dpl2.patch
@@ -0,0 +1,114 @@
+diff -Naur a52dec_original/include/a52.h a52dec_patched/include/a52.h
+--- a52dec_original/include/a52.h 2002-01-28 05:37:54.000000000 +0000
++++ a52dec_patched/include/a52.h 2007-04-04 19:12:57.000000000 +0100
+@@ -48,6 +48,10 @@
+ #define A52_LFE 16
+ #define A52_ADJUST_LEVEL 32
+
++// this next constant can be ORed with A52_DOLBY to tell liba52 to use 5.0 DPLII matrix encoding,
++// rather than just 4.0 Dolby Surround matrix encoding
++#define A52_USE_DPLII 64
++
+ a52_state_t * a52_init (uint32_t mm_accel);
+ sample_t * a52_samples (a52_state_t * state);
+ int a52_syncinfo (uint8_t * buf, int * flags,
+diff -Naur a52dec_original/liba52/a52_internal.h a52dec_patched/liba52/a52_internal.h
+--- a52dec_original/liba52/a52_internal.h 2002-07-28 02:52:06.000000000 +0100
++++ a52dec_patched/liba52/a52_internal.h 2007-04-04 19:11:43.000000000 +0100
+@@ -93,6 +93,10 @@
+ #define LEVEL_45DB 0.5946035575013605
+ #define LEVEL_6DB 0.5
+
++// these next two constants are used for DPL matrix encoding in downmix.c
++#define LEVEL_SQRT_1_2 0.5
++#define LEVEL_SQRT_3_4 0.8660254037844386
++
+ #define EXP_REUSE (0)
+ #define EXP_D15 (1)
+ #define EXP_D25 (2)
+diff -Naur a52dec_original/liba52/downmix.c a52dec_patched/liba52/downmix.c
+--- a52dec_original/liba52/downmix.c 2002-01-28 05:37:54.000000000 +0000
++++ a52dec_patched/liba52/downmix.c 2007-04-06 13:47:49.000000000 +0100
+@@ -34,6 +34,7 @@
+ int a52_downmix_init (int input, int flags, sample_t * level,
+ sample_t clev, sample_t slev)
+ {
++
+ static uint8_t table[11][8] = {
+ {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_STEREO,
+ A52_STEREO, A52_STEREO, A52_STEREO, A52_STEREO},
+@@ -148,6 +149,9 @@
+ break;
+ }
+
++ // add the DPLII flag back into the output if it was passed in
++ output = output | (flags & A52_USE_DPLII);
++
+ return output;
+ }
+
+@@ -418,17 +422,46 @@
+ }
+ }
+
+-static void mix32toS (sample_t * samples, sample_t bias)
++static void mix32toS (sample_t * samples, sample_t bias, int use_dpl2)
+ {
+- int i;
+- sample_t common, surround;
+
+- for (i = 0; i < 256; i++) {
+- common = samples[i + 256] + bias;
+- surround = samples[i + 768] + samples[i + 1024];
+- samples[i] += common - surround;
+- samples[i + 256] = samples[i + 512] + common + surround;
+- }
++ if (use_dpl2 == 1) {
++
++ int i;
++ sample_t cc, Lt, Rt, Ls, Rs, Lss, Rss;
++
++ for (i = 0; i < 256; i++) {
++
++ cc = samples[i + 256] * LEVEL_3DB;
++
++ Lt = samples[i] + cc;
++ Rt = samples[i + 512] + cc;
++
++ Ls = samples[i + 768];
++ Rs = samples[i + 1024];
++
++ Lss = (LEVEL_SQRT_3_4 * Ls) - (LEVEL_SQRT_1_2 * Rs);
++ Rss = -(LEVEL_SQRT_1_2 * Ls) + (LEVEL_SQRT_3_4 * Rs);
++
++ samples[i] = bias + Lt + Lss;
++ samples[i + 256] = bias + Rt + Rss;
++
++ }
++
++ } else {
++
++ int i;
++ sample_t common, surround;
++
++ for (i = 0; i < 256; i++) {
++ common = samples[i + 256] + bias;
++ surround = samples[i + 768] + samples[i + 1024];
++ samples[i] += common - surround;
++ samples[i + 256] = samples[i + 512] + common + surround;
++ }
++
++ }
++
+ }
+
+ static void move2to1 (sample_t * src, sample_t * dest, sample_t bias)
+@@ -533,7 +566,7 @@
+ break;
+
+ case CONVERT (A52_3F2R, A52_DOLBY):
+- mix32toS (samples, bias);
++ mix32toS (samples, bias, ((output & A52_USE_DPLII) == A52_USE_DPLII));
+ break;
+
+ case CONVERT (A52_3F1R, A52_3F):