[xiph-commits] r18000 - in trunk/ffmpeg2theora: . patches
j at svn.xiph.org
j at svn.xiph.org
Mon May 23 13:02:50 PDT 2011
Author: j
Date: 2011-05-23 13:02:50 -0700 (Mon, 23 May 2011)
New Revision: 18000
Removed:
trunk/ffmpeg2theora/patches/6to2channel-resample.patch
Modified:
trunk/ffmpeg2theora/get_ffmpeg.sh
Log:
6to2channel-resample.patch patch in ffmpeg-trunk now
Modified: trunk/ffmpeg2theora/get_ffmpeg.sh
===================================================================
--- trunk/ffmpeg2theora/get_ffmpeg.sh 2011-05-23 15:51:27 UTC (rev 17999)
+++ trunk/ffmpeg2theora/get_ffmpeg.sh 2011-05-23 20:02:50 UTC (rev 18000)
@@ -36,7 +36,7 @@
cd ..
}
-test -e $FFMPEG_CO_DIR/.ffmpeg2theora_patched || apply_patches
+#test -e $FFMPEG_CO_DIR/.ffmpeg2theora_patched || apply_patches
#configure and build ffmpeg
cd $FFMPEG_CO_DIR && ./configure $options && make
Deleted: trunk/ffmpeg2theora/patches/6to2channel-resample.patch
===================================================================
--- trunk/ffmpeg2theora/patches/6to2channel-resample.patch 2011-05-23 15:51:27 UTC (rev 17999)
+++ trunk/ffmpeg2theora/patches/6to2channel-resample.patch 2011-05-23 20:02:50 UTC (rev 18000)
@@ -1,65 +0,0 @@
-diff --git a/libavcodec/resample.c b/libavcodec/resample.c
-index 9e6defe..8c4eebe 100644
---- a/libavcodec/resample.c
-+++ b/libavcodec/resample.c
-@@ -108,6 +108,39 @@ static void mono_to_stereo(short *output, short *input, int n1)
- }
- }
-
-+/*
-+5.1 to stereo input: [fl, fr, c, lfe, rl, rr]
-+- Left = front_left + rear_gain * rear_left + center_gain * center
-+- Right = front_right + rear_gain * rear_right + center_gain * center
-+Where rear_gain is usually around 0.5-1.0 and
-+ center_gain is almost always 0.7 (-3 dB)
-+*/
-+static void surround_to_stereo(short **output, short *input, int channels, int samples)
-+{
-+ int i;
-+ short l, r;
-+
-+ for (i = 0; i < samples; i++) {
-+ int fl,fr,c,rl,rr,lfe;
-+ fl = input[0];
-+ fr = input[1];
-+ c = input[2];
-+ lfe = input[3];
-+ rl = input[4];
-+ rr = input[5];
-+
-+ l = av_clip_int16(fl + (0.5 * rl) + (0.7 * c));
-+ r = av_clip_int16(fr + (0.5 * rr) + (0.7 * c));
-+
-+ /* output l & r. */
-+ *output[0]++ = l;
-+ *output[1]++ = r;
-+
-+ /* increment input. */
-+ input += channels;
-+ }
-+}
-+
- static void deinterleave(short **output, short *input, int channels, int samples)
- {
- int i, j;
-@@ -301,6 +334,10 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
- } else if (s->output_channels >= 2 && s->input_channels == 1) {
- buftmp3[0] = bufout[0];
- memcpy(buftmp2[0], input, nb_samples * sizeof(short));
-+ } else if (s->input_channels == 6 && s->output_channels ==2) {
-+ buftmp3[0] = bufout[0];
-+ buftmp3[1] = bufout[1];
-+ surround_to_stereo(buftmp2, input, s->input_channels, nb_samples);
- } else if (s->output_channels >= s->input_channels && s->input_channels >= 2) {
- for (i = 0; i < s->input_channels; i++) {
- buftmp3[i] = bufout[i];
-@@ -330,7 +367,8 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
- mono_to_stereo(output, buftmp3[0], nb_samples1);
- } else if (s->output_channels == 6 && s->input_channels == 2) {
- ac3_5p1_mux(output, buftmp3[0], buftmp3[1], nb_samples1);
-- } else if (s->output_channels == s->input_channels && s->input_channels >= 2) {
-+ } else if ((s->output_channels == s->input_channels && s->input_channels >= 2) ||
-+ (s->output_channels == 2 && s->input_channels == 6)) {
- interleave(output, buftmp3, s->output_channels, nb_samples1);
- }
-
More information about the commits
mailing list