[xiph-commits] r16949 - trunk/ffmpeg2theora/patches
j at svn.xiph.org
j at svn.xiph.org
Thu Mar 4 09:53:03 PST 2010
Author: j
Date: 2010-03-04 09:53:03 -0800 (Thu, 04 Mar 2010)
New Revision: 16949
Modified:
trunk/ffmpeg2theora/patches/6to2channel-resample.patch
Log:
update 5.1 downsample patch so that channel mapping works
Modified: trunk/ffmpeg2theora/patches/6to2channel-resample.patch
===================================================================
--- trunk/ffmpeg2theora/patches/6to2channel-resample.patch 2010-03-03 23:06:07 UTC (rev 16948)
+++ trunk/ffmpeg2theora/patches/6to2channel-resample.patch 2010-03-04 17:53:03 UTC (rev 16949)
@@ -1,9 +1,9 @@
Index: libavcodec/resample.c
===================================================================
---- libavcodec/resample.c (revision 11509)
+--- libavcodec/resample.c (revision 22168)
+++ libavcodec/resample.c (working copy)
-@@ -37,6 +37,17 @@
- int input_channels, output_channels, filter_channels;
+@@ -52,6 +52,17 @@
+ unsigned buffer_size[2]; ///< sizes of allocated buffers
};
+/*
@@ -20,7 +20,7 @@
/* n1: number of samples */
static void stereo_to_mono(short *output, short *input, int n1)
{
-@@ -88,14 +99,43 @@
+@@ -103,14 +114,43 @@
}
}
@@ -43,14 +43,14 @@
+ l = input[0];
+ r = input[1];
+ } else if (channels == 6) {
-+ /* 5.1 to stereo. l, c, r, ls, rs, sw */
++ /* 5.1 to stereo input: [fl, fr, c, lfe, rl, rr] */
+ int fl,fr,c,rl,rr,lfe;
+ fl = input[0];
-+ c = input[1];
-+ fr = input[2];
-+ rl = input[3];
-+ rr = input[4];
-+ lfe = input[5];
++ fr = input[1];
++ c = input[2];
++ lfe = input[3];
++ rl = input[4];
++ rr = input[5];
+
+ l = clip_short(fl + (0.5 * rl) + (0.7 * c));
+ r = clip_short(fr + (0.5 * rr) + (0.7 * c));
@@ -69,7 +69,7 @@
}
}
-@@ -131,9 +171,9 @@
+@@ -150,9 +190,9 @@
{
ReSampleContext *s;
@@ -81,7 +81,7 @@
return NULL;
}
-@@ -205,7 +245,7 @@
+@@ -312,7 +352,7 @@
} else if (s->output_channels >= 2) {
buftmp3[0] = bufout[0];
buftmp3[1] = bufout[1];
More information about the commits
mailing list