]> git.sesse.net Git - ffmpeg/commitdiff
Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 12 May 2012 22:13:49 +0000 (00:13 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 12 May 2012 22:13:49 +0000 (00:13 +0200)
* qatar/master:
  lavfi: autoinsert resample filter when necessary.
  lavfi: add lavr-based audio resampling filter.
  x86: vc1: drop MMX loop filter implementation, which uses MMX2 instructions.

Conflicts:
configure
doc/filters.texi
libavcodec/x86/vc1dsp_mmx.c
libavfilter/Makefile
libavfilter/allfilters.c
libavfilter/avfiltergraph.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
configure
doc/filters.texi
libavcodec/x86/vc1dsp_mmx.c
libavcodec/x86/vc1dsp_yasm.asm
libavfilter/Makefile
libavfilter/allfilters.c

diff --cc configure
index 270de65f28d7c3bc935546c407d6766c0c898e83,f6cb0e2558c985b83f78b9f8bd840fb63c084124..783c9e07755ce43237298eea7830c16d0d23f7c5
+++ b/configure
@@@ -1681,21 -1526,13 +1681,22 @@@ colormatrix_filter_deps="gpl
  cropdetect_filter_deps="gpl"
  delogo_filter_deps="gpl"
  drawtext_filter_deps="libfreetype"
 -frei0r_filter_deps="frei0r dlopen strtok_r"
 +frei0r_filter_deps="frei0r dlopen"
  frei0r_filter_extralibs='$ldl'
 -frei0r_src_filter_deps="frei0r dlopen strtok_r"
 +frei0r_src_filter_deps="frei0r dlopen"
  frei0r_src_filter_extralibs='$ldl'
  hqdn3d_filter_deps="gpl"
 +movie_filter_deps="avcodec avformat"
 +mp_filter_deps="gpl avcodec swscale postproc"
 +mptestsrc_filter_deps="gpl"
 +negate_filter_deps="lut_filter"
+ resample_filter_deps="avresample"
  ocv_filter_deps="libopencv"
 +pan_filter_deps="swresample"
 +removelogo_filter_deps="avcodec avformat swscale"
 +scale_filter_deps="swscale"
 +super2xsai_filter_deps="gpl"
 +tinterlace_filter_deps="gpl"
  yadif_filter_deps="gpl"
  
  # libraries
index ef65d101a7d186c0bde525262239a9804309d232,8eff84a0e47c946dd8188ac015dd42a54d7cc81e..2af7b37d07a8b00c47433019adce7d75364f95d8
@@@ -215,293 -111,12 +215,297 @@@ amovie=input.mkv:si=5 [a5]
  
  Pass the audio source unchanged to the output.
  
 -not meant to be used directly, it is inserted automatically by libavfilter
 -whenever conversion is needed. Use the @var{aformat} filter to force a specific
 -conversion.
 +@section aresample
 +
 +Resample the input audio to the specified sample rate.
 +
 +The filter accepts exactly one parameter, the output sample rate. If not
 +specified then the filter will automatically convert between its input
 +and output sample rates.
 +
 +For example, to resample the input audio to 44100Hz:
 +@example
 +aresample=44100
 +@end example
 +
 +@section ashowinfo
 +
 +Show a line containing various information for each input audio frame.
 +The input audio is not modified.
 +
 +The shown line contains a sequence of key/value pairs of the form
 +@var{key}:@var{value}.
 +
 +A description of each shown parameter follows:
 +
 +@table @option
 +@item n
 +sequential number of the input frame, starting from 0
 +
 +@item pts
 +presentation TimeStamp of the input frame, expressed as a number of
 +time base units. The time base unit depends on the filter input pad, and
 +is usually 1/@var{sample_rate}.
 +
 +@item pts_time
 +presentation TimeStamp of the input frame, expressed as a number of
 +seconds
 +
 +@item pos
 +position of the frame in the input stream, -1 if this information in
 +unavailable and/or meaningless (for example in case of synthetic audio)
 +
 +@item fmt
 +sample format name
 +
 +@item chlayout
 +channel layout description
 +
 +@item nb_samples
 +number of samples (per each channel) contained in the filtered frame
 +
 +@item rate
 +sample rate for the audio frame
 +
 +@item planar
 +if the packing format is planar, 0 if packed
 +
 +@item checksum
 +Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame
 +
 +@item plane_checksum
 +Adler-32 checksum (printed in hexadecimal) for each input frame plane,
 +expressed in the form "[@var{c0} @var{c1} @var{c2} @var{c3} @var{c4} @var{c5}
 +@var{c6} @var{c7}]"
 +@end table
 +
 +@section asplit
 +
 +Pass on the input audio to two outputs. Both outputs are identical to
 +the input audio.
 +
 +For example:
 +@example
 +[in] asplit[out0], showaudio[out1]
 +@end example
 +
 +will create two separate outputs from the same input, one cropped and
 +one padded.
 +
 +@section astreamsync
 +
 +Forward two audio streams and control the order the buffers are forwarded.
 +
 +The argument to the filter is an expression deciding which stream should be
 +forwarded next: if the result is negative, the first stream is forwarded; if
 +the result is positive or zero, the second stream is forwarded. It can use
 +the following variables:
 +
 +@table @var
 +@item b1 b2
 +number of buffers forwarded so far on each stream
 +@item s1 s2
 +number of samples forwarded so far on each stream
 +@item t1 t2
 +current timestamp of each stream
 +@end table
 +
 +The default value is @code{t1-t2}, which means to always forward the stream
 +that has a smaller timestamp.
 +
 +Example: stress-test @code{amerge} by randomly sending buffers on the wrong
 +input, while avoiding too much of a desynchronization:
 +@example
 +amovie=file.ogg [a] ; amovie=file.mp3 [b] ;
 +[a] [b] astreamsync=(2*random(1))-1+tanh(5*(t1-t2)) [a2] [b2] ;
 +[a2] [b2] amerge
 +@end example
 +
 +@section earwax
 +
 +Make audio easier to listen to on headphones.
 +
 +This filter adds `cues' to 44.1kHz stereo (i.e. audio CD format) audio
 +so that when listened to on headphones the stereo image is moved from
 +inside your head (standard for headphones) to outside and in front of
 +the listener (standard for speakers).
 +
 +Ported from SoX.
 +
 +@section pan
 +
 +Mix channels with specific gain levels. The filter accepts the output
 +channel layout followed by a set of channels definitions.
 +
 +This filter is also designed to remap efficiently the channels of an audio
 +stream.
 +
 +The filter accepts parameters of the form:
 +"@var{l}:@var{outdef}:@var{outdef}:..."
 +
 +@table @option
 +@item l
 +output channel layout or number of channels
 +
 +@item outdef
 +output channel specification, of the form:
 +"@var{out_name}=[@var{gain}*]@var{in_name}[+[@var{gain}*]@var{in_name}...]"
 +
 +@item out_name
 +output channel to define, either a channel name (FL, FR, etc.) or a channel
 +number (c0, c1, etc.)
 +
 +@item gain
 +multiplicative coefficient for the channel, 1 leaving the volume unchanged
 +
 +@item in_name
 +input channel to use, see out_name for details; it is not possible to mix
 +named and numbered input channels
 +@end table
 +
 +If the `=' in a channel specification is replaced by `<', then the gains for
 +that specification will be renormalized so that the total is 1, thus
 +avoiding clipping noise.
 +
 +@subsection Mixing examples
 +
 +For example, if you want to down-mix from stereo to mono, but with a bigger
 +factor for the left channel:
 +@example
 +pan=1:c0=0.9*c0+0.1*c1
 +@end example
 +
 +A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
 +7-channels surround:
 +@example
 +pan=stereo: FL < FL + 0.5*FC + 0.6*BL + 0.6*SL : FR < FR + 0.5*FC + 0.6*BR + 0.6*SR
 +@end example
 +
 +Note that @command{ffmpeg} integrates a default down-mix (and up-mix) system
 +that should be preferred (see "-ac" option) unless you have very specific
 +needs.
 +
 +@subsection Remapping examples
 +
 +The channel remapping will be effective if, and only if:
 +
 +@itemize
 +@item gain coefficients are zeroes or ones,
 +@item only one input per channel output,
 +@end itemize
 +
 +If all these conditions are satisfied, the filter will notify the user ("Pure
 +channel mapping detected"), and use an optimized and lossless method to do the
 +remapping.
 +
 +For example, if you have a 5.1 source and want a stereo audio stream by
 +dropping the extra channels:
 +@example
 +pan="stereo: c0=FL : c1=FR"
 +@end example
 +
 +Given the same source, you can also switch front left and front right channels
 +and keep the input channel layout:
 +@example
 +pan="5.1: c0=c1 : c1=c0 : c2=c2 : c3=c3 : c4=c4 : c5=c5"
 +@end example
 +
 +If the input is a stereo audio stream, you can mute the front left channel (and
 +still keep the stereo channel layout) with:
 +@example
 +pan="stereo:c1=c1"
 +@end example
 +
 +Still with a stereo audio stream input, you can copy the right channel in both
 +front left and right:
 +@example
 +pan="stereo: c0=FR : c1=FR"
 +@end example
 +
 +@section silencedetect
 +
 +Detect silence in an audio stream.
 +
 +This filter logs a message when it detects that the input audio volume is less
 +or equal to a noise tolerance value for a duration greater or equal to the
 +minimum detected noise duration.
 +
 +The printed times and duration are expressed in seconds.
 +
 +@table @option
 +@item duration, d
 +Set silence duration until notification (default is 2 seconds).
 +
 +@item noise, n
 +Set noise tolerance. Can be specified in dB (in case "dB" is appended to the
 +specified value) or amplitude ratio. Default is -60dB, or 0.001.
 +@end table
 +
 +Detect 5 seconds of silence with -50dB noise tolerance:
 +@example
 +silencedetect=n=-50dB:d=5
 +@end example
 +
 +Complete example with @command{ffmpeg} to detect silence with 0.0001 noise
 +tolerance in @file{silence.mp3}:
 +@example
 +ffmpeg -f lavfi -i amovie=silence.mp3,silencedetect=noise=0.0001 -f null -
 +@end example
 +
 +@section volume
 +
 +Adjust the input audio volume.
 +
 +The filter accepts exactly one parameter @var{vol}, which expresses
 +how the audio volume will be increased or decreased.
 +
 +Output values are clipped to the maximum value.
 +
 +If @var{vol} is expressed as a decimal number, the output audio
 +volume is given by the relation:
 +@example
 +@var{output_volume} = @var{vol} * @var{input_volume}
 +@end example
 +
 +If @var{vol} is expressed as a decimal number followed by the string
 +"dB", the value represents the requested change in decibels of the
 +input audio power, and the output audio volume is given by the
 +relation:
 +@example
 +@var{output_volume} = 10^(@var{vol}/20) * @var{input_volume}
 +@end example
 +
 +Otherwise @var{vol} is considered an expression and its evaluated
 +value is used for computing the output audio volume according to the
 +first relation.
 +
 +Default value for @var{vol} is 1.0.
 +
 +@subsection Examples
 +
 +@itemize
 +@item
 +Half the input audio volume:
 +@example
 +volume=0.5
 +@end example
 +
 +The above example is equivalent to:
 +@example
 +volume=1/2
 +@end example
 +
 +@item
 +Decrease input audio power by 12 decibels:
 +@example
 +volume=-12dB
 +@end example
 +@end itemize
 +
+ @section resample
+ Convert the audio sample format, sample rate and channel layout. This filter is
++not meant to be used directly.
  @c man end AUDIO FILTERS
  
  @chapter Audio Sources
index 32891a02fe75a9d9f1b0792ba7a1a773990be8a0,e1f5145735955ce047f2f0c9cd5139dbbe67e1e8..d1cb852f09753c35ebabe4c05e6778eb128b7d25
@@@ -803,7 -789,7 +802,6 @@@ void ff_vc1dsp_init_mmx(VC1DSPContext *
  
  #if HAVE_YASM
      if (mm_flags & AV_CPU_FLAG_MMX) {
-         ASSIGN_LF(mmx);
 -        dsp->put_no_rnd_vc1_chroma_pixels_tab[0]= ff_put_vc1_chroma_mc8_mmx_nornd;
      }
      return;
      if (mm_flags & AV_CPU_FLAG_MMX2) {
Simple merge
index 962dbf63a9a7413353ae0190e206c467b0c87b3b,9cbb90847f5dc8febca1fd42f3424374204a0420..70f2c9e5ca924dac9b9fe396416779b78a4396fe
@@@ -1,19 -1,9 +1,20 @@@
 +include $(SUBDIR)../config.mak
 +
  NAME = avfilter
  FFLIBS = avutil swscale
 -FFLIBS-$(CONFIG_MOVIE_FILTER) += avformat avcodec
+ FFLIBS-$(CONFIG_RESAMPLE_FILTER) += avresample
  
 -HEADERS = avfilter.h                                                    \
 +FFLIBS-$(CONFIG_ACONVERT_FILTER)             += swresample
 +FFLIBS-$(CONFIG_AMOVIE_FILTER)               += avformat avcodec
 +FFLIBS-$(CONFIG_ARESAMPLE_FILTER)            += swresample
 +FFLIBS-$(CONFIG_MOVIE_FILTER)                += avformat avcodec
 +FFLIBS-$(CONFIG_PAN_FILTER)                  += swresample
 +FFLIBS-$(CONFIG_REMOVELOGO_FILTER)           += avformat avcodec
 +FFLIBS-$(CONFIG_MP_FILTER)                   += avcodec postproc
 +
 +HEADERS = asrc_abuffer.h                                                \
 +          avcodec.h                                                     \
 +          avfilter.h                                                    \
            avfiltergraph.h                                               \
            buffersink.h                                                  \
            buffersrc.h                                                   \
@@@ -28,42 -18,19 +29,43 @@@ OBJS = allfilters.
         defaults.o                                                       \
         drawutils.o                                                      \
         formats.o                                                        \
 +       graphdump.o                                                      \
         graphparser.o                                                    \
 +       src_buffer.o                                                     \
 +       transform.o                                                      \
         vf_scale.o                                                       \
 -       vsrc_buffer.o                                                    \
  
 +OBJS-$(CONFIG_AVCODEC)                       += avcodec.o
 +OBJS-$(CONFIG_AVFORMAT)                      += lavfutils.o
 +OBJS-$(CONFIG_SWSCALE)                       += lswsutils.o
 +
 +OBJS-$(CONFIG_ACONVERT_FILTER)               += af_aconvert.o
 +OBJS-$(CONFIG_AFORMAT_FILTER)                += af_aformat.o
 +OBJS-$(CONFIG_AMERGE_FILTER)                 += af_amerge.o
  OBJS-$(CONFIG_ANULL_FILTER)                  += af_anull.o
 +OBJS-$(CONFIG_ARESAMPLE_FILTER)              += af_aresample.o
 +OBJS-$(CONFIG_ASHOWINFO_FILTER)              += af_ashowinfo.o
 +OBJS-$(CONFIG_ASPLIT_FILTER)                 += af_asplit.o
 +OBJS-$(CONFIG_ASTREAMSYNC_FILTER)            += af_astreamsync.o
 +OBJS-$(CONFIG_EARWAX_FILTER)                 += af_earwax.o
 +OBJS-$(CONFIG_PAN_FILTER)                    += af_pan.o
+ OBJS-$(CONFIG_RESAMPLE_FILTER)               += af_resample.o
 +OBJS-$(CONFIG_SILENCEDETECT_FILTER)          += af_silencedetect.o
 +OBJS-$(CONFIG_VOLUME_FILTER)                 += af_volume.o
  
 +OBJS-$(CONFIG_AEVALSRC_FILTER)               += asrc_aevalsrc.o
 +OBJS-$(CONFIG_AMOVIE_FILTER)                 += src_movie.o
  OBJS-$(CONFIG_ANULLSRC_FILTER)               += asrc_anullsrc.o
  
 +OBJS-$(CONFIG_ABUFFERSINK_FILTER)            += sink_buffer.o
  OBJS-$(CONFIG_ANULLSINK_FILTER)              += asink_anullsink.o
  
 +OBJS-$(CONFIG_ASS_FILTER)                    += vf_ass.o
 +OBJS-$(CONFIG_BBOX_FILTER)                   += bbox.o vf_bbox.o
 +OBJS-$(CONFIG_BLACKDETECT_FILTER)            += vf_blackdetect.o
  OBJS-$(CONFIG_BLACKFRAME_FILTER)             += vf_blackframe.o
  OBJS-$(CONFIG_BOXBLUR_FILTER)                += vf_boxblur.o
 +OBJS-$(CONFIG_COLORMATRIX_FILTER)            += vf_colormatrix.o
  OBJS-$(CONFIG_COPY_FILTER)                   += vf_copy.o
  OBJS-$(CONFIG_CROP_FILTER)                   += vf_crop.o
  OBJS-$(CONFIG_CROPDETECT_FILTER)             += vf_cropdetect.o
index e4f82c96c5b7fff7b2c0a0cfaf64bcfc0a67e846,66d890f161ebf82cd7cab53f20715c9c268b3377..4e4c5d37f47c511f690a40c8b53581929a1a8b58
@@@ -34,33 -34,15 +34,34 @@@ void avfilter_register_all(void
          return;
      initialized = 1;
  
 +    REGISTER_FILTER (ACONVERT,    aconvert,    af);
 +    REGISTER_FILTER (AFORMAT,     aformat,     af);
 +    REGISTER_FILTER (AMERGE,      amerge,      af);
      REGISTER_FILTER (ANULL,       anull,       af);
 +    REGISTER_FILTER (ARESAMPLE,   aresample,   af);
 +    REGISTER_FILTER (ASHOWINFO,   ashowinfo,   af);
 +    REGISTER_FILTER (ASPLIT,      asplit,      af);
 +    REGISTER_FILTER (ASTREAMSYNC, astreamsync, af);
 +    REGISTER_FILTER (EARWAX,      earwax,      af);
 +    REGISTER_FILTER (PAN,         pan,         af);
 +    REGISTER_FILTER (SILENCEDETECT, silencedetect, af);
 +    REGISTER_FILTER (VOLUME,      volume,      af);
+     REGISTER_FILTER (RESAMPLE,    resample,    af);
  
 +    REGISTER_FILTER (ABUFFER,     abuffer,     asrc);
 +    REGISTER_FILTER (AEVALSRC,    aevalsrc,    asrc);
 +    REGISTER_FILTER (AMOVIE,      amovie,      asrc);
      REGISTER_FILTER (ANULLSRC,    anullsrc,    asrc);
  
 +    REGISTER_FILTER (ABUFFERSINK, abuffersink, asink);
      REGISTER_FILTER (ANULLSINK,   anullsink,   asink);
  
 +    REGISTER_FILTER (ASS,         ass,         vf);
 +    REGISTER_FILTER (BBOX,        bbox,        vf);
 +    REGISTER_FILTER (BLACKDETECT, blackdetect, vf);
      REGISTER_FILTER (BLACKFRAME,  blackframe,  vf);
      REGISTER_FILTER (BOXBLUR,     boxblur,     vf);
 +    REGISTER_FILTER (COLORMATRIX, colormatrix, vf);
      REGISTER_FILTER (COPY,        copy,        vf);
      REGISTER_FILTER (CROP,        crop,        vf);
      REGISTER_FILTER (CROPDETECT,  cropdetect,  vf);