Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
ffmpeg2theora
Commits
9e4d0192
Commit
9e4d0192
authored
Mar 04, 2010
by
Jan Gerber
Browse files
update 5.1 downsample patch so that channel mapping works
parent
1c4f6a4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
patches/6to2channel-resample.patch
View file @
9e4d0192
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
, l
s
, r
s
,
sw
*/
+ /* 5.1 to stereo
input: [f
l,
fr
,
c
, l
fe
, r
l
,
rr]
*/
+ int fl,fr,c,rl,rr,lfe;
+ fl = input[0];
+
c
= input[1];
+
fr
= input[2];
+
r
l = input[3];
+ r
r
= input[4];
+
lfe
= input[5];
+
fr
= input[1];
+
c
= input[2];
+ l
fe
= input[3];
+ r
l
= 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
}
}
@@ -1
31
,9 +1
71
,9 @@
@@ -1
50
,9 +1
90
,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];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment