summaryrefslogtreecommitdiffstats
path: root/libhb/downmix.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-05-30 17:26:03 +0000
committerjstebbins <[email protected]>2010-05-30 17:26:03 +0000
commit4e02d96c397f8912bda8ca975ffc398ccec77ca1 (patch)
tree0c54d80f8b02c94fb7ec5e971438f604f899c916 /libhb/downmix.c
parente13377c88ac8e220993217b0725d9994344e40ae (diff)
Improve left/right dplii surround separation
This analysis and measurement shows that a difference of 4.8db between Ls and Rs in Lt and Rt provides better separation than 3db http://forum.doom9.org/showthread.php?t=57988 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3336 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/downmix.c')
-rw-r--r--libhb/downmix.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/libhb/downmix.c b/libhb/downmix.c
index b713f9bce..2a441e9f0 100644
--- a/libhb/downmix.c
+++ b/libhb/downmix.c
@@ -16,8 +16,8 @@
#define LVL_45DB 0.5946035575013605
#define LVL_6DB 0.5
-#define LVL_SQRT_1_3 0.577350269
-#define LVL_SQRT_2_3 0.816496581
+#define LVL_SQRT_1_4 0.5
+#define LVL_SQRT_3_4 0.866025404
#define HB_CH_FRONT_LEFT 0x00000001
#define HB_CH_FRONT_RIGHT 0x00000002
@@ -605,8 +605,8 @@ hb_sample_t downmix_matrix[DOWNMIX_NUM_MODES][DOWNMIX_NUM_MODES][8][8] =
// DPLII out
{ { 1, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 1, 0, 0, 0, 0, 0, 0 },
- { LVL_SQRT_2_3, -LVL_SQRT_1_3, 0, 0, 0, 0, 0, 0 },
- { -LVL_SQRT_1_3, LVL_SQRT_2_3, 0, 0, 0, 0, 0, 0 },
+ { -LVL_SQRT_3_4, LVL_SQRT_1_4, 0, 0, 0, 0, 0, 0 },
+ { -LVL_SQRT_1_4, LVL_SQRT_3_4, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 1, 0, 0, 0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DB, LVL_SQRT_3_4*LVL_3DB, 0, 0, 0, 0, 0, 0 },
+ { -LVL_SQRT_3_4*LVL_3DB, LVL_SQRT_1_4*LVL_3DB, 0, 0, 0, 0, 0, 0 },
+ { -LVL_SQRT_1_4*LVL_3DB, LVL_SQRT_3_4*LVL_3DB, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 1, 0, 0, 0, 0, 0 } }
},
};
@@ -1349,7 +1349,7 @@ void hb_downmix_adjust_level( hb_downmix_t * downmix )
break;
case MIXMODE(DOWNMIX_2F2R, DOWNMIX_DPLII):
- level /= 1 + LVL_SQRT_1_3 + LVL_SQRT_2_3;
+ level /= 1 + LVL_SQRT_1_4 + LVL_SQRT_3_4;
break;
case MIXMODE(DOWNMIX_3F2R, DOWNMIX_MONO):
@@ -1366,7 +1366,7 @@ void hb_downmix_adjust_level( hb_downmix_t * downmix )
break;
case MIXMODE(DOWNMIX_3F2R, DOWNMIX_DPLII):
- level /= 1 + LVL_3DB + LVL_SQRT_1_3 + LVL_SQRT_2_3;
+ level /= 1 + LVL_3DB + LVL_SQRT_1_4 + LVL_SQRT_3_4;
break;
case MIXMODE(DOWNMIX_3F4R, DOWNMIX_STEREO):
@@ -1382,7 +1382,7 @@ void hb_downmix_adjust_level( hb_downmix_t * downmix )
break;
case MIXMODE(DOWNMIX_3F4R, DOWNMIX_DPLII):
- level /= 1 + LVL_3DB + 2 * LVL_SQRT_1_3 + 2 * LVL_SQRT_2_3;
+ level /= 1 + LVL_3DB + 2 * LVL_SQRT_1_4 + 2 * LVL_SQRT_3_4;
}
downmix->level = level;