Commit 9e4d0192 authored by Jan Gerber's avatar Jan Gerber
Browse files

update 5.1 downsample patch so that channel mapping works

parent 1c4f6a4f
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 @@ Index: libavcodec/resample.c
/* 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 @@ Index: libavcodec/resample.c
+ 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 @@ Index: libavcodec/resample.c
}
}
@@ -131,9 +171,9 @@
@@ -150,9 +190,9 @@
{
ReSampleContext *s;
......@@ -81,7 +81,7 @@ Index: libavcodec/resample.c
return NULL;
}
@@ -205,7 +245,7 @@
@@ -312,7 +352,7 @@
} else if (s->output_channels >= 2) {
buftmp3[0] = bufout[0];
buftmp3[1] = bufout[1];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment