Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 16 Aug 2012 14:12:45 +0000 (16:12 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 16 Aug 2012 14:20:30 +0000 (16:20 +0200)
* qatar/master:
  Fix even more missing includes after the common.h removal
  build: Factor out rangecoder dependencies to CONFIG_RANGECODER
  build: Factor out error resilience dependencies to CONFIG_ERROR_RESILIENCE
  x86: avcodec: Consistently name all init files
  Add more missing includes after removing the implicit common.h
  Add some more missing includes after removing the implicit common.h
  Don't include common.h from avutil.h
  rtmp: Automatically compute the hash for SWFVerification

Conflicts:
configure
doc/APIchanges
doc/examples/decoding_encoding.c
libavcodec/Makefile
libavcodec/assdec.c
libavcodec/audio_frame_queue.c
libavcodec/avpacket.c
libavcodec/dv_profile.c
libavcodec/dwt.c
libavcodec/libtheoraenc.c
libavcodec/rawdec.c
libavcodec/rv40dsp.c
libavcodec/tiff.c
libavcodec/tiffenc.c
libavcodec/v210dec.h
libavcodec/vc1dsp.c
libavcodec/x86/Makefile
libavfilter/asrc_anullsrc.c
libavfilter/avfilter.c
libavfilter/buffer.c
libavfilter/formats.c
libavfilter/vf_ass.c
libavfilter/vf_drawtext.c
libavfilter/vf_fade.c
libavfilter/vf_select.c
libavfilter/video.c
libavfilter/vsrc_testsrc.c
libavformat/version.h
libavutil/audioconvert.c
libavutil/error.h
libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
232 files changed:
1  2 
configure
doc/examples/decoding_encoding.c
doc/protocols.texi
libavcodec/8bps.c
libavcodec/8svx.c
libavcodec/Makefile
libavcodec/a64multienc.c
libavcodec/aac_ac3_parser.c
libavcodec/acelp_filters.c
libavcodec/acelp_pitch_delay.c
libavcodec/acelp_vectors.c
libavcodec/allcodecs.c
libavcodec/amr.h
libavcodec/amrwbdec.c
libavcodec/ansi.c
libavcodec/ass.c
libavcodec/assdec.c
libavcodec/assenc.c
libavcodec/atrac.c
libavcodec/audio_frame_queue.c
libavcodec/audioconvert.c
libavcodec/aura.c
libavcodec/avpacket.c
libavcodec/bitstream_filter.c
libavcodec/cavsdsp.c
libavcodec/celp_filters.c
libavcodec/celp_math.c
libavcodec/cinepak.c
libavcodec/codec_desc.c
libavcodec/cscd.c
libavcodec/cyuv.c
libavcodec/dct.c
libavcodec/dirac_parser.c
libavcodec/dnxhddata.c
libavcodec/dpxenc.c
libavcodec/dump_extradata_bsf.c
libavcodec/dv_profile.c
libavcodec/dvdsub_parser.c
libavcodec/dwt.c
libavcodec/dxa.c
libavcodec/eacmv.c
libavcodec/eaidct.c
libavcodec/elbg.c
libavcodec/faanidct.c
libavcodec/fmtconvert.c
libavcodec/g722enc.c
libavcodec/h264_mp4toannexb_bsf.c
libavcodec/h264dsp.c
libavcodec/h264idct_template.c
libavcodec/idcinvideo.c
libavcodec/iirfilter.c
libavcodec/imgconvert.c
libavcodec/intrax8dsp.c
libavcodec/jpegls.h
libavcodec/kgv1dec.c
libavcodec/lclenc.c
libavcodec/libfaac.c
libavcodec/libfdk-aacenc.c
libavcodec/libgsm.c
libavcodec/libilbc.c
libavcodec/libmp3lame.c
libavcodec/libopencore-amr.c
libavcodec/libspeexdec.c
libavcodec/libspeexenc.c
libavcodec/libtheoraenc.c
libavcodec/libvo-amrwbenc.c
libavcodec/libvpxdec.c
libavcodec/libvpxenc.c
libavcodec/libx264.c
libavcodec/lpc.c
libavcodec/lzw.c
libavcodec/mace.c
libavcodec/motion-test.c
libavcodec/movsub_bsf.c
libavcodec/mp3_header_compress_bsf.c
libavcodec/mp3_header_decompress_bsf.c
libavcodec/mpegaudio_parser.c
libavcodec/msvideo1.c
libavcodec/noise_bsf.c
libavcodec/nuv.c
libavcodec/options.c
libavcodec/options_table.h
libavcodec/parser.c
libavcodec/pnm.c
libavcodec/ppc/dsputil_ppc.c
libavcodec/ppc/fmtconvert_altivec.c
libavcodec/ppc/gmc_altivec.c
libavcodec/ppc/h264_altivec_template.c
libavcodec/ppc/vp8dsp_altivec.c
libavcodec/proresdsp.c
libavcodec/psymodel.c
libavcodec/pthread.c
libavcodec/ptx.c
libavcodec/qdrw.c
libavcodec/r210dec.c
libavcodec/ra144.c
libavcodec/ra288.h
libavcodec/raw.c
libavcodec/rawdec.c
libavcodec/rawenc.c
libavcodec/resample.c
libavcodec/resample2.c
libavcodec/rl2.c
libavcodec/rle.c
libavcodec/rpza.c
libavcodec/rtjpeg.h
libavcodec/rv40dsp.c
libavcodec/s302m.c
libavcodec/sinewin_tablegen.h
libavcodec/sipr.h
libavcodec/sipr16k.c
libavcodec/sparc/dsputil_vis.c
libavcodec/sparc/simple_idct_vis.c
libavcodec/srtdec.c
libavcodec/sunrast.c
libavcodec/targaenc.c
libavcodec/tiff.c
libavcodec/tiffenc.c
libavcodec/tmv.c
libavcodec/truemotion1.c
libavcodec/v210dec.c
libavcodec/v210x.c
libavcodec/v410dec.c
libavcodec/v410enc.c
libavcodec/vc1dsp.c
libavcodec/vcr1.c
libavcodec/vmdav.c
libavcodec/vmnc.c
libavcodec/vorbis_data.c
libavcodec/vp3dsp.c
libavcodec/vp56dsp.c
libavcodec/vp8dsp.c
libavcodec/ws-snd1.c
libavcodec/x86/Makefile
libavcodec/x86/idct_mmx_xvid.c
libavcodec/x86/idct_sse2_xvid.c
libavcodec/x86/lpc_mmx.c
libavcodec/x86/mlpdsp.c
libavcodec/x86/motion_est_mmx.c
libavcodec/x86/pngdsp_init.c
libavcodec/x86/proresdsp_init.c
libavcodec/x86/rv40dsp_init.c
libavcodec/x86/simple_idct_mmx.c
libavcodec/x86/vc1dsp_mmx.c
libavcodec/x86/vp8dsp_init.c
libavcodec/xbmenc.c
libavcodec/xl.c
libavcodec/zmbv.c
libavcodec/zmbvenc.c
libavdevice/avdevice.c
libavdevice/timefilter.c
libavfilter/af_aformat.c
libavfilter/af_amix.c
libavfilter/af_anull.c
libavfilter/af_asyncts.c
libavfilter/af_channelmap.c
libavfilter/af_channelsplit.c
libavfilter/af_join.c
libavfilter/allfilters.c
libavfilter/asink_anullsink.c
libavfilter/asrc_anullsrc.c
libavfilter/audio.c
libavfilter/avfilter.c
libavfilter/avfiltergraph.c
libavfilter/buffer.c
libavfilter/buffersink.c
libavfilter/buffersrc.c
libavfilter/drawutils.c
libavfilter/f_settb.c
libavfilter/fifo.c
libavfilter/formats.c
libavfilter/graphparser.c
libavfilter/split.c
libavfilter/vf_aspect.c
libavfilter/vf_blackframe.c
libavfilter/vf_boxblur.c
libavfilter/vf_copy.c
libavfilter/vf_crop.c
libavfilter/vf_cropdetect.c
libavfilter/vf_delogo.c
libavfilter/vf_drawbox.c
libavfilter/vf_drawtext.c
libavfilter/vf_fade.c
libavfilter/vf_fieldorder.c
libavfilter/vf_format.c
libavfilter/vf_fps.c
libavfilter/vf_gradfun.c
libavfilter/vf_hflip.c
libavfilter/vf_hqdn3d.c
libavfilter/vf_lut.c
libavfilter/vf_null.c
libavfilter/vf_overlay.c
libavfilter/vf_pad.c
libavfilter/vf_pixdesctest.c
libavfilter/vf_scale.c
libavfilter/vf_select.c
libavfilter/vf_setpts.c
libavfilter/vf_showinfo.c
libavfilter/vf_slicify.c
libavfilter/vf_transpose.c
libavfilter/vf_vflip.c
libavfilter/video.c
libavfilter/vsink_nullsink.c
libavfilter/vsrc_testsrc.c
libavfilter/x86/gradfun.c
libavfilter/x86/yadif.c
libavformat/network.c
libavformat/rtmpproto.c
libavformat/version.h
libavresample/utils.c
libavutil/audioconvert.c
libavutil/avstring.c
libavutil/dict.c
libavutil/error.c
libavutil/eval.c
libavutil/fifo.h
libavutil/file.c
libavutil/file.h
libavutil/imgutils.c
libavutil/log.c
libavutil/mem.h
libavutil/opt.c
libavutil/parseutils.c
libavutil/samplefmt.c
libavutil/samplefmt.h
libavutil/timer.h
libavutil/tree.c
libavutil/version.h
libswscale/colorspace-test.c
libswscale/swscale.h
libswscale/swscale_internal.h
tools/graph2dot.c

diff --cc configure
+++ b/configure
@@@ -1527,11 -1361,11 +1529,12 @@@ dnxhd_encoder_select="aandcttables mpeg
  dxa_decoder_select="zlib"
  eac3_decoder_select="ac3_decoder"
  eac3_encoder_select="mdct ac3dsp"
- eamad_decoder_select="aandcttables"
+ eamad_decoder_select="aandcttables error_resilience"
  eatgq_decoder_select="aandcttables"
- eatqi_decoder_select="aandcttables mpegvideo"
+ eatqi_decoder_select="aandcttables error_resilience mpegvideo"
 +exr_decoder_select="zlib"
- ffv1_decoder_select="golomb"
+ ffv1_decoder_select="golomb rangecoder"
+ ffv1_encoder_select="rangecoder"
  flac_decoder_select="golomb"
  flac_encoder_select="golomb lpc"
  flashsv_decoder_select="zlib"
@@@ -1548,8 -1381,7 +1551,8 @@@ h263_encoder_select="aandcttables error
  h263_vaapi_hwaccel_select="vaapi h263_decoder"
  h263i_decoder_select="h263_decoder"
  h263p_encoder_select="h263_encoder"
- h264_decoder_select="golomb h264chroma h264dsp h264pred h264qpel mpegvideo"
 +h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
+ h264_decoder_select="error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo"
  h264_dxva2_hwaccel_deps="dxva2api_h"
  h264_dxva2_hwaccel_select="dxva2 h264_decoder"
  h264_vaapi_hwaccel_select="vaapi h264_decoder"
@@@ -1581,17 -1412,13 +1584,17 @@@ mpeg_vdpau_decoder_select="vdpau mpegvi
  mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
  mpeg_xvmc_decoder_select="mpegvideo_decoder"
  mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
- mpeg1video_decoder_select="mpegvideo"
- mpeg1video_encoder_select="aandcttables mpegvideoenc"
 +mpeg1_vdpau_hwaccel_select="vdpau mpeg1video_decoder"
+ mpeg1video_decoder_select="error_resilience mpegvideo"
+ mpeg1video_encoder_select="aandcttables error_resilience mpegvideoenc"
 +mpeg2_crystalhd_decoder_select="crystalhd"
  mpeg2_dxva2_hwaccel_deps="dxva2api_h"
  mpeg2_dxva2_hwaccel_select="dxva2 mpeg2video_decoder"
 +mpeg2_vdpau_hwaccel_select="vdpau mpeg2video_decoder"
  mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
- mpeg2video_decoder_select="mpegvideo"
- mpeg2video_encoder_select="aandcttables mpegvideoenc"
+ mpeg2video_decoder_select="error_resilience mpegvideo"
+ mpeg2video_encoder_select="aandcttables error_resilience mpegvideoenc"
 +mpeg4_crystalhd_decoder_select="crystalhd"
  mpeg4_decoder_select="h263_decoder mpeg4video_parser"
  mpeg4_encoder_select="h263_encoder"
  mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"
@@@ -1615,18 -1441,15 +1618,18 @@@ rv10_decoder_select="h263_decoder
  rv10_encoder_select="h263_encoder"
  rv20_decoder_select="h263_decoder"
  rv20_encoder_select="h263_encoder"
- rv30_decoder_select="golomb h264chroma h264pred h264qpel mpegvideo"
- rv40_decoder_select="golomb h264chroma h264pred h264qpel mpegvideo"
+ rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo"
+ rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo"
  shorten_decoder_select="golomb"
  sipr_decoder_select="lsp"
- snow_decoder_select="dwt"
- snow_encoder_select="aandcttables dwt mpegvideoenc"
+ snow_decoder_select="dwt rangecoder"
+ snow_encoder_select="aandcttables dwt error_resilience mpegvideoenc rangecoder"
 +sonic_decoder_select="golomb"
 +sonic_encoder_select="golomb"
 +sonic_ls_encoder_select="golomb"
- svq1_decoder_select="mpegvideo"
- svq1_encoder_select="aandcttables mpegvideoenc"
- svq3_decoder_select="golomb h264chroma h264dsp h264pred h264qpel mpegvideo"
+ svq1_decoder_select="error_resilience mpegvideo"
+ svq1_encoder_select="aandcttables error_resilience mpegvideoenc"
+ svq3_decoder_select="error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo"
  svq3_decoder_suggest="zlib"
  theora_decoder_select="vp3_decoder"
  tiff_decoder_suggest="zlib"
@@@ -1676,14 -1497,12 +1679,14 @@@ vda_deps="VideoDecodeAcceleration_VDADe
  vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  
  # parsers
- h264_parser_select="golomb h264dsp h264pred mpegvideo"
- mpeg4video_parser_select="mpegvideo"
- mpegvideo_parser_select="mpegvideo"
- vc1_parser_select="mpegvideo"
+ h264_parser_select="error_resilience golomb h264dsp h264pred mpegvideo"
+ mpeg4video_parser_select="error_resilience mpegvideo"
+ mpegvideo_parser_select="error_resilience mpegvideo"
+ vc1_parser_select="error_resilience mpegvideo"
  
  # external libraries
 +libaacplus_encoder_deps="libaacplus"
 +libcelt_decoder_deps="libcelt"
  libfaac_encoder_deps="libfaac"
  libfdk_aac_encoder_deps="libfdk_aac"
  libgsm_decoder_deps="libgsm"
   * format handling
   */
  
 -#include <stdlib.h>
 -#include <stdio.h>
 -#include <string.h>
 -
 -#ifdef HAVE_AV_CONFIG_H
 -#undef HAVE_AV_CONFIG_H
 -#endif
 +#include <math.h>
  
 -#include "libavcodec/avcodec.h"
 -#include "libavutil/audioconvert.h"
 -#include "libavutil/common.h"
 -#include "libavutil/imgutils.h"
 -#include "libavutil/mathematics.h"
 -#include "libavutil/samplefmt.h"
 +#include <libavutil/opt.h>
 +#include <libavcodec/avcodec.h>
 +#include <libavutil/audioconvert.h>
++#include <libavutil/common.h>
 +#include <libavutil/imgutils.h>
 +#include <libavutil/mathematics.h>
 +#include <libavutil/samplefmt.h>
  
  #define INBUF_SIZE 4096
  #define AUDIO_INBUF_SIZE 20480
Simple merge
Simple merge
   *
   * supports: fibonacci delta encoding
   *         : exponential encoding
 + *
 + * For more information about the 8SVX format:
 + * http://netghost.narod.ru/gff/vendspec/iff/iff.txt
 + * http://sox.sourceforge.net/AudioFormats-11.html
 + * http://aminet.net/package/mus/misc/wavepak
 + * http://amigan.1emu.net/reg/8SVX.txt
 + *
 + * Samples can be found here:
 + * http://aminet.net/mods/smpl/
   */
  
 +#include "libavutil/avassert.h"
  #include "avcodec.h"
+ #include "libavutil/common.h"
  
  /** decoder context */
  typedef struct EightSvxContext {
@@@ -36,11 -33,11 +36,12 @@@ OBJS = allcodecs.
  # parts needed for many different codecs
  OBJS-$(CONFIG_AANDCTTABLES)            += aandcttab.o
  OBJS-$(CONFIG_AC3DSP)                  += ac3dsp.o
 +OBJS-$(CONFIG_CRYSTALHD)               += crystalhd.o
  OBJS-$(CONFIG_ENCODERS)                += faandct.o jfdctfst.o jfdctint.o
  OBJS-$(CONFIG_DCT)                     += dct.o dct32_fixed.o dct32_float.o
 -OBJS-$(CONFIG_DWT)                     += dwt.o
 +OBJS-$(CONFIG_DWT)                     += dwt.o snow.o
  OBJS-$(CONFIG_DXVA2)                   += dxva2.o
+ OBJS-$(CONFIG_ERROR_RESILIENCE)        += error_resilience.o
  FFT-OBJS-$(CONFIG_HARDCODED_TABLES)    += cos_tables.o cos_fixed_tables.o
  OBJS-$(CONFIG_FFT)                     += avfft.o fft_fixed.o fft_float.o \
                                            $(FFT-OBJS-yes)
@@@ -173,18 -157,14 +175,18 @@@ OBJS-$(CONFIG_EIGHTBPS_DECODER)        
  OBJS-$(CONFIG_EIGHTSVX_EXP_DECODER)    += 8svx.o
  OBJS-$(CONFIG_EIGHTSVX_FIB_DECODER)    += 8svx.o
  OBJS-$(CONFIG_ESCAPE124_DECODER)       += escape124.o
- OBJS-$(CONFIG_FFV1_DECODER)            += ffv1.o rangecoder.o
- OBJS-$(CONFIG_FFV1_ENCODER)            += ffv1.o rangecoder.o
 +OBJS-$(CONFIG_ESCAPE130_DECODER)       += escape130.o
 +OBJS-$(CONFIG_EXR_DECODER)             += exr.o
+ OBJS-$(CONFIG_FFV1_DECODER)            += ffv1.o
+ OBJS-$(CONFIG_FFV1_ENCODER)            += ffv1.o
  OBJS-$(CONFIG_FFVHUFF_DECODER)         += huffyuv.o
  OBJS-$(CONFIG_FFVHUFF_ENCODER)         += huffyuv.o
 +OBJS-$(CONFIG_FFWAVESYNTH_DECODER)     += ffwavesynth.o
  OBJS-$(CONFIG_FLAC_DECODER)            += flacdec.o flacdata.o flac.o flacdsp.o
 -OBJS-$(CONFIG_FLAC_ENCODER)            += flacenc.o flacdata.o flac.o
 +OBJS-$(CONFIG_FLAC_ENCODER)            += flacenc.o flacdata.o flac.o vorbis_data.o
  OBJS-$(CONFIG_FLASHSV_DECODER)         += flashsv.o
  OBJS-$(CONFIG_FLASHSV_ENCODER)         += flashsvenc.o
 +OBJS-$(CONFIG_FLASHSV2_ENCODER)        += flashsv2enc.o
  OBJS-$(CONFIG_FLASHSV2_DECODER)        += flashsv.o
  OBJS-$(CONFIG_FLIC_DECODER)            += flicvideo.o
  OBJS-$(CONFIG_FOURXM_DECODER)          += 4xm.o
@@@ -198,15 -176,14 +200,14 @@@ OBJS-$(CONFIG_GIF_DECODER)             
  OBJS-$(CONFIG_GIF_ENCODER)             += gif.o lzwenc.o
  OBJS-$(CONFIG_GSM_DECODER)             += gsmdec.o gsmdec_data.o msgsmdec.o
  OBJS-$(CONFIG_GSM_MS_DECODER)          += gsmdec.o gsmdec_data.o msgsmdec.o
- OBJS-$(CONFIG_H261_DECODER)            += h261dec.o h261.o h261data.o error_resilience.o
 -OBJS-$(CONFIG_H261_DECODER)            += h261dec.o h261.o
 -OBJS-$(CONFIG_H261_ENCODER)            += h261enc.o h261.o
++OBJS-$(CONFIG_H261_DECODER)            += h261dec.o h261.o h261data.o
 +OBJS-$(CONFIG_H261_ENCODER)            += h261enc.o h261.o h261data.o
  OBJS-$(CONFIG_H263_DECODER)            += h263dec.o h263.o ituh263dec.o        \
                                            mpeg4video.o mpeg4videodec.o flvdec.o\
-                                           intelh263dec.o  error_resilience.o
+                                           intelh263dec.o
  OBJS-$(CONFIG_H263_VAAPI_HWACCEL)      += vaapi_mpeg4.o
  OBJS-$(CONFIG_H263_ENCODER)            += mpeg4videoenc.o mpeg4video.o  \
-                                           h263.o ituh263enc.o flvenc.o  \
-                                           error_resilience.o
+                                           h263.o ituh263enc.o flvenc.o
  OBJS-$(CONFIG_H264_DECODER)            += h264.o                               \
                                            h264_loopfilter.o h264_direct.o      \
                                            cabac.o h264_sei.o h264_ps.o         \
@@@ -243,9 -215,7 +243,8 @@@ OBJS-$(CONFIG_LJPEG_ENCODER)           
  OBJS-$(CONFIG_LOCO_DECODER)            += loco.o
  OBJS-$(CONFIG_MACE3_DECODER)           += mace.o
  OBJS-$(CONFIG_MACE6_DECODER)           += mace.o
- OBJS-$(CONFIG_MDEC_DECODER)            += mdec.o mpeg12.o mpeg12data.o \
-                                           error_resilience.o
+ OBJS-$(CONFIG_MDEC_DECODER)            += mdec.o mpeg12.o mpeg12data.o
 +OBJS-$(CONFIG_MICRODVD_DECODER)        += microdvddec.o ass.o
  OBJS-$(CONFIG_MIMIC_DECODER)           += mimic.o
  OBJS-$(CONFIG_MJPEG_DECODER)           += mjpegdec.o mjpeg.o
  OBJS-$(CONFIG_MJPEG_ENCODER)           += mjpegenc.o mjpeg.o
@@@ -285,21 -253,13 +284,17 @@@ OBJS-$(CONFIG_MPC7_DECODER)            
  OBJS-$(CONFIG_MPC8_DECODER)            += mpc8.o mpc.o mpegaudiodec.o      \
                                            mpegaudiodecheader.o mpegaudio.o \
                                            mpegaudiodata.o
 +OBJS-$(CONFIG_MPEGVIDEO_DECODER)       += mpeg12.o mpeg12data.o \
 +                                          mpegvideo.o error_resilience.o
  OBJS-$(CONFIG_MPEG_XVMC_DECODER)       += mpegvideo_xvmc.o
- OBJS-$(CONFIG_MPEG1VIDEO_DECODER)      += mpeg12.o mpeg12data.o \
-                                           error_resilience.o
+ OBJS-$(CONFIG_MPEG1VIDEO_DECODER)      += mpeg12.o mpeg12data.o
 -OBJS-$(CONFIG_MPEG1VIDEO_ENCODER)      += mpeg12enc.o mpeg12.o
 +OBJS-$(CONFIG_MPEG1VIDEO_ENCODER)      += mpeg12enc.o mpeg12.o          \
-                                           timecode.o                  \
-                                           error_resilience.o
++                                          timecode.o
  OBJS-$(CONFIG_MPEG2_DXVA2_HWACCEL)     += dxva2_mpeg2.o
  OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL)     += vaapi_mpeg2.o
- OBJS-$(CONFIG_MPEG2VIDEO_DECODER)      += mpeg12.o mpeg12data.o \
-                                           error_resilience.o
+ OBJS-$(CONFIG_MPEG2VIDEO_DECODER)      += mpeg12.o mpeg12data.o
 -OBJS-$(CONFIG_MPEG2VIDEO_ENCODER)      += mpeg12enc.o mpeg12.o
 +OBJS-$(CONFIG_MPEG2VIDEO_ENCODER)      += mpeg12enc.o mpeg12.o          \
-                                           timecode.o                  \
-                                           error_resilience.o
++                                          timecode.o
  OBJS-$(CONFIG_MPEG4_VAAPI_HWACCEL)     += vaapi_mpeg4.o
  OBJS-$(CONFIG_MSMPEG4V1_DECODER)       += msmpeg4.o msmpeg4data.o
  OBJS-$(CONFIG_MSMPEG4V2_DECODER)       += msmpeg4.o msmpeg4data.o h263dec.o \
@@@ -380,13 -331,9 +375,11 @@@ OBJS-$(CONFIG_RV10_DECODER)            
  OBJS-$(CONFIG_RV10_ENCODER)            += rv10enc.o
  OBJS-$(CONFIG_RV20_DECODER)            += rv10.o
  OBJS-$(CONFIG_RV20_ENCODER)            += rv20enc.o
- OBJS-$(CONFIG_RV30_DECODER)            += rv30.o rv34.o rv30dsp.o rv34dsp.o \
-                                           error_resilience.o
- OBJS-$(CONFIG_RV40_DECODER)            += rv40.o rv34.o rv34dsp.o rv40dsp.o \
-                                           error_resilience.o
+ OBJS-$(CONFIG_RV30_DECODER)            += rv30.o rv34.o rv30dsp.o rv34dsp.o
+ OBJS-$(CONFIG_RV40_DECODER)            += rv40.o rv34.o rv34dsp.o rv40dsp.o
 +OBJS-$(CONFIG_SAMI_DECODER)            += samidec.o ass.o
  OBJS-$(CONFIG_S302M_DECODER)           += s302m.o
 +OBJS-$(CONFIG_SANM_DECODER)            += sanm.o
  OBJS-$(CONFIG_SGI_DECODER)             += sgidec.o
  OBJS-$(CONFIG_SGI_ENCODER)             += sgienc.o rle.o
  OBJS-$(CONFIG_SHORTEN_DECODER)         += shorten.o
@@@ -397,27 -344,17 +390,24 @@@ OBJS-$(CONFIG_SIPR_DECODER)            
  OBJS-$(CONFIG_SMACKAUD_DECODER)        += smacker.o
  OBJS-$(CONFIG_SMACKER_DECODER)         += smacker.o
  OBJS-$(CONFIG_SMC_DECODER)             += smc.o
- OBJS-$(CONFIG_SNOW_DECODER)            += snowdec.o snow.o rangecoder.o
- OBJS-$(CONFIG_SNOW_ENCODER)            += snowenc.o snow.o rangecoder.o    \
-                                           h263.o ituh263enc.o          \
-                                           error_resilience.o
+ OBJS-$(CONFIG_SNOW_DECODER)            += snowdec.o snow.o
+ OBJS-$(CONFIG_SNOW_ENCODER)            += snowenc.o snow.o              \
+                                           h263.o ituh263enc.o
  OBJS-$(CONFIG_SOL_DPCM_DECODER)        += dpcm.o
 +OBJS-$(CONFIG_SONIC_DECODER)           += sonic.o
 +OBJS-$(CONFIG_SONIC_ENCODER)           += sonic.o
 +OBJS-$(CONFIG_SONIC_LS_ENCODER)        += sonic.o
  OBJS-$(CONFIG_SP5X_DECODER)            += sp5xdec.o mjpegdec.o mjpeg.o
  OBJS-$(CONFIG_SRT_DECODER)             += srtdec.o ass.o
 +OBJS-$(CONFIG_SRT_ENCODER)             += srtenc.o ass_split.o
 +OBJS-$(CONFIG_SUBRIP_DECODER)          += srtdec.o ass.o
 +OBJS-$(CONFIG_SUBRIP_ENCODER)          += srtenc.o ass_split.o
 +OBJS-$(CONFIG_SUBVIEWER_DECODER)       += subviewerdec.o ass.o
  OBJS-$(CONFIG_SUNRAST_DECODER)         += sunrast.o
  OBJS-$(CONFIG_SUNRAST_ENCODER)         += sunrastenc.o
- OBJS-$(CONFIG_SVQ1_DECODER)            += svq1dec.o svq1.o h263.o \
-                                           error_resilience.o
+ OBJS-$(CONFIG_SVQ1_DECODER)            += svq1dec.o svq1.o h263.o
  OBJS-$(CONFIG_SVQ1_ENCODER)            += svq1enc.o svq1.o    \
-                                           h263.o ituh263enc.o \
-                                           error_resilience.o
+                                           h263.o ituh263enc.o
  OBJS-$(CONFIG_SVQ3_DECODER)            += h264.o svq3.o                       \
                                            h264_loopfilter.o h264_direct.o     \
                                            h264_sei.o h264_ps.o h264_refs.o    \
@@@ -721,10 -628,8 +709,9 @@@ OBJS-$(CONFIG_AAC_LATM_PARSER)         
  OBJS-$(CONFIG_MJPEG_PARSER)            += mjpeg_parser.o
  OBJS-$(CONFIG_MLP_PARSER)              += mlp_parser.o mlp.o
  OBJS-$(CONFIG_MPEG4VIDEO_PARSER)       += mpeg4video_parser.o h263.o \
-                                           error_resilience.o \
                                            mpeg4videodec.o mpeg4video.o \
                                            ituh263dec.o h263dec.o
 +OBJS-$(CONFIG_PNG_PARSER)              += png_parser.o
  OBJS-$(CONFIG_MPEGAUDIO_PARSER)        += mpegaudio_parser.o \
                                            mpegaudiodecheader.o mpegaudiodata.o
  OBJS-$(CONFIG_MPEGVIDEO_PARSER)        += mpegvideo_parser.o    \
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
  #include "avcodec.h"
  #include "ass.h"
  #include "libavutil/avstring.h"
+ #include "libavutil/common.h"
  
 -/**
 - * Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS.
 - *
 - * @param avctx pointer to the AVCodecContext
 - * @param font name of the default font face to use
 - * @param font_size default font size to use
 - * @param color default text color to use (ABGR)
 - * @param back_color default background color to use (ABGR)
 - * @param bold 1 for bold text, 0 for normal text
 - * @param italic 1 for italic text, 0 for normal text
 - * @param underline 1 for underline text, 0 for normal text
 - * @param alignment position of the text (left, center, top...), defined after
 - *                  the layout of the numpad (1-3 sub, 4-6 mid, 7-9 top)
 - * @return >= 0 on success otherwise an error code <0
 - */
 -static int ff_ass_subtitle_header(AVCodecContext *avctx,
 -                                  const char *font, int font_size,
 -                                  int color, int back_color,
 -                                  int bold, int italic, int underline,
 -                                  int alignment)
 +int ff_ass_subtitle_header(AVCodecContext *avctx,
 +                           const char *font, int font_size,
 +                           int color, int back_color,
 +                           int bold, int italic, int underline,
 +                           int alignment)
  {
 -    char header[512];
 -
 -    snprintf(header, sizeof(header),
 +    avctx->subtitle_header = av_asprintf(
               "[Script Info]\r\n"
               "ScriptType: v4.00+\r\n"
               "\r\n"
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
+ #include <string.h>
  #include "avcodec.h"
  #include "ass.h"
 +#include "ass_split.h"
+ #include "libavutil/internal.h"
+ #include "libavutil/mem.h"
  
  static av_cold int ass_decode_init(AVCodecContext *avctx)
  {
Simple merge
Simple merge
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
 -#include "libavutil/mathematics.h"
 -#include "internal.h"
+ #include "libavutil/common.h"
  #include "audio_frame_queue.h"
 +#include "internal.h"
 +#include "libavutil/avassert.h"
  
  void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq)
  {
Simple merge
Simple merge
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
- #include "internal.h"
+ #include <string.h>
  #include "libavutil/avassert.h"
- #include "bytestream.h"
+ #include "libavutil/mem.h"
  #include "avcodec.h"
++#include "bytestream.h"
++#include "internal.h"
  
  void av_destruct_packet_nofree(AVPacket *pkt)
  {
Simple merge
Simple merge
Simple merge
  
  #include <inttypes.h>
  #include <limits.h>
 -#include <assert.h>
  
 +#include "libavutil/avassert.h"
  #include "avcodec.h"
 +#include "mathops.h"
  #include "celp_math.h"
+ #include "libavutil/common.h"
  
 +#ifdef G729_BITEXACT
 +/**
 + * Cosine table: base_cos[i] = (1<<15) * cos(i*PI/64)
 + */
 +static const int16_t base_cos[64] =
 +{
 +  32767,  32729,  32610,  32413,  32138,  31786,  31357,  30853,
 +  30274,  29622,  28899,  28106,  27246,  26320,  25330,  24279,
 +  23170,  22006,  20788,  19520,  18205,  16846,  15447,  14010,
 +  12540,  11039,   9512,   7962,   6393,   4808,   3212,   1608,
 +      0,  -1608,  -3212,  -4808,  -6393,  -7962,  -9512, -11039,
 + -12540, -14010, -15447, -16846, -18205, -19520, -20788, -22006,
 + -23170, -24279, -25330, -26320, -27246, -28106, -28899, -29622,
 + -30274, -30853, -31357, -31786, -32138, -32413, -32610, -32729
 +};
 +
 +/**
 + * Slope used to compute cos(x)
 + *
 + * cos(ind*64+offset) = base_cos[ind]+offset*slope_cos[ind]
 + * values multiplied by 1<<19
 + */
 +static const int16_t slope_cos[64] =
 +{
 +   -632,  -1893,  -3150,  -4399,  -5638,  -6863,  -8072,  -9261,
 + -10428, -11570, -12684, -13767, -14817, -15832, -16808, -17744,
 + -18637, -19486, -20287, -21039, -21741, -22390, -22986, -23526,
 + -24009, -24435, -24801, -25108, -25354, -25540, -25664, -25726,
 + -25726, -25664, -25540, -25354, -25108, -24801, -24435, -24009,
 + -23526, -22986, -22390, -21741, -21039, -20287, -19486, -18637,
 + -17744, -16808, -15832, -14817, -13767, -12684, -11570, -10428,
 +  -9261,  -8072,  -6863,  -5638,  -4399,  -3150,  -1893,   -632
 +};
 +
 +/**
 + * Table used to compute exp2(x)
 + *
 + * tab_exp2[i] = (1<<14) * exp2(i/32) = 2^(i/32) i=0..32
 + */
 +static const uint16_t tab_exp2[33] =
 +{
 +  16384, 16743, 17109, 17484, 17867, 18258, 18658, 19066, 19484, 19911,
 +  20347, 20792, 21247, 21713, 22188, 22674, 23170, 23678, 24196, 24726,
 +  25268, 25821, 26386, 26964, 27554, 28158, 28774, 29405, 30048, 30706,
 +  31379, 32066, 32767
 +};
 +
 +int16_t ff_cos(uint16_t arg)
 +{
 +    uint8_t offset= arg;
 +    uint8_t ind = arg >> 8;
 +
 +    av_assert2(arg < 0x4000);
 +
 +    return FFMAX(base_cos[ind] + ((slope_cos[ind] * offset) >> 12), -0x8000);
 +}
 +
 +int ff_exp2(uint16_t power)
 +{
 +    uint16_t frac_x0;
 +    uint16_t frac_dx;
 +    int result;
 +
 +    av_assert2(power <= 0x7fff);
 +
 +    frac_x0 = power >> 10;
 +    frac_dx = (power & 0x03ff) << 5;
 +
 +    result = tab_exp2[frac_x0] << 15;
 +    result += frac_dx * (tab_exp2[frac_x0+1] - tab_exp2[frac_x0]);
 +
 +    return result >> 10;
 +}
 +
 +#else // G729_BITEXACT
 +
  /**
   * Cosine table: base_cos[i] = (1<<15) * cos(i*PI/64)
   */
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
  
  #include "avcodec.h"
  #include "dnxhddata.h"
+ #include "libavutil/common.h"
  
 +/* The quantization tables below are in zigzag order! */
 +
  static const uint8_t dnxhd_1235_luma_weight[] = {
 -     0, 32, 32, 32, 33, 35, 38, 39,
 -    32, 33, 32, 33, 36, 36, 39, 42,
 -    32, 32, 33, 36, 35, 37, 41, 43,
 -    31, 33, 34, 36, 36, 40, 42, 48,
 -    32, 34, 36, 37, 39, 42, 46, 51,
 -    36, 37, 37, 39, 41, 46, 51, 55,
 -    37, 39, 41, 41, 47, 50, 55, 56,
 -    41, 42, 41, 44, 50, 53, 60, 60
 +     0, 32, 32, 32, 33, 32, 32, 32,
 +    32, 31, 32, 33, 33, 33, 33, 35,
 +    36, 36, 34, 34, 36, 37, 37, 36,
 +    36, 35, 36, 38, 39, 39, 37, 36,
 +    37, 37, 39, 41, 42, 41, 39, 39,
 +    40, 41, 42, 43, 42, 42, 41, 41,
 +    41, 44, 47, 46, 46, 48, 51, 51,
 +    50, 50, 53, 55, 55, 56, 60, 60,
  };
  
  static const uint8_t dnxhd_1235_chroma_weight[] = {
Simple merge
Simple merge
@@@ -18,7 -18,7 +18,8 @@@
  
  #include <stdint.h>
  
+ #include "libavutil/common.h"
 +#include "libavutil/intreadwrite.h"
  #include "libavutil/log.h"
  #include "libavutil/pixdesc.h"
  #include "avcodec.h"
Simple merge
   */
  
  #include "libavutil/attributes.h"
 +#include "libavutil/avassert.h"
+ #include "libavutil/common.h"
  #include "dsputil.h"
  #include "dwt.h"
 +#include "libavcodec/x86/dwt.h"
  
  int ff_slice_buffer_init(slice_buffer *buf, int line_count,
                           int max_allocated_lines, int line_width,
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
   */
  
  #include <stdint.h>
 +#include "libavutil/avassert.h"
  #include "avcodec.h"
  #include "h264dsp.h"
+ #include "libavutil/common.h"
  
  #define BIT_DEPTH 8
  #include "h264dsp_template.c"
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
  #include <stdio.h>
  #include <stdlib.h>
  
 +#include "libavutil/avassert.h"
  #include "avcodec.h"
 +#include "internal.h"
  #include "lcl.h"
+ #include "libavutil/internal.h"
+ #include "libavutil/mem.h"
  
  #include <zlib.h>
  
Simple merge
Simple merge
  #include "avcodec.h"
  #include "internal.h"
  #include "gsm.h"
+ #include "libavutil/common.h"
  
 +static av_cold int libgsm_encode_close(AVCodecContext *avctx) {
 +#if FF_API_OLD_ENCODE_AUDIO
 +    av_freep(&avctx->coded_frame);
 +#endif
 +    gsm_destroy(avctx->priv_data);
 +    avctx->priv_data = NULL;
 +    return 0;
 +}
 +
  static av_cold int libgsm_encode_init(AVCodecContext *avctx) {
      if (avctx->channels > 1) {
          av_log(avctx, AV_LOG_ERROR, "Mono required for GSM, got %d channels\n",
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -30,7 -30,8 +30,8 @@@
   * and o_ prefixes on variables which are libogg types.
   */
  
 -/* Libav includes */
 +/* FFmpeg includes */
+ #include "libavutil/common.h"
  #include "libavutil/intreadwrite.h"
  #include "libavutil/log.h"
  #include "libavutil/base64.h"
Simple merge
Simple merge
@@@ -30,8 -30,8 +30,9 @@@
  
  #include "avcodec.h"
  #include "internal.h"
 +#include "libavutil/avassert.h"
  #include "libavutil/base64.h"
+ #include "libavutil/common.h"
  #include "libavutil/mathematics.h"
  #include "libavutil/opt.h"
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
  
  #include <stdio.h>
  #include <stdlib.h>
 +#include <limits.h>
  
  #include "libavutil/bswap.h"
+ #include "libavutil/common.h"
  #include "libavutil/lzo.h"
  #include "libavutil/imgutils.h"
  #include "avcodec.h"
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
  #include "avcodec.h"
  #include "imgconvert.h"
  #include "raw.h"
 +#include "libavutil/avassert.h"
+ #include "libavutil/common.h"
  #include "libavutil/intreadwrite.h"
  #include "libavutil/imgutils.h"
 +#include "libavutil/opt.h"
  
  typedef struct RawVideoContext {
 +    AVClass *av_class;
      uint32_t palette[AVPALETTE_COUNT];
      unsigned char * buffer;  /* block of memory for holding one frame */
      int             length;  /* number of bytes in buffer */
Simple merge
Simple merge
   * @author Michael Niedermayer <michaelni@gmx.at>
   */
  
 +#include "libavutil/avassert.h"
  #include "avcodec.h"
  #include "dsputil.h"
+ #include "libavutil/common.h"
  
  #ifndef CONFIG_RESAMPLE_HP
  #define FILTER_SHIFT 15
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -27,7 -27,7 +27,8 @@@
  #include "avcodec.h"
  #include "dsputil.h"
  #include "rv34dsp.h"
 +#include "libavutil/avassert.h"
+ #include "libavutil/common.h"
  
  #define RV40_LOWPASS(OPNAME, OP) \
  static av_unused void OPNAME ## rv40_qpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride,\
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -25,7 -26,7 +25,8 @@@
   */
  
  #include "avcodec.h"
 +#include "bytestream.h"
+ #include "config.h"
  #if CONFIG_ZLIB
  #include <zlib.h>
  #endif
@@@ -34,8 -33,7 +34,8 @@@
  #if CONFIG_ZLIB
  #include <zlib.h>
  #endif
- #include "libavutil/opt.h"
  #include "bytestream.h"
++#include "internal.h"
  #include "tiff.h"
  #include "rle.h"
  #include "lzw.h"
Simple merge
Simple merge
   */
  
  #include "avcodec.h"
 +#include "v210dec.h"
  #include "libavutil/bswap.h"
+ #include "libavutil/internal.h"
+ #include "libavutil/mem.h"
  
 +#define READ_PIXELS(a, b, c)         \
 +    do {                             \
 +        val  = av_le2ne32(*src++);   \
 +        *a++ =  val & 0x3FF;         \
 +        *b++ = (val >> 10) & 0x3FF;  \
 +        *c++ = (val >> 20) & 0x3FF;  \
 +    } while (0)
 +
 +static void v210_planar_unpack_c(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width)
 +{
 +    uint32_t val;
 +    int i;
 +
 +    for( i = 0; i < width-5; i += 6 ){
 +        READ_PIXELS(u, y, v);
 +        READ_PIXELS(y, u, y);
 +        READ_PIXELS(v, y, u);
 +        READ_PIXELS(y, v, y);
 +    }
 +}
 +
  static av_cold int decode_init(AVCodecContext *avctx)
  {
 +    V210DecContext *s = avctx->priv_data;
 +
      if (avctx->width & 1) {
          av_log(avctx, AV_LOG_ERROR, "v210 needs even width\n");
          return -1;
Simple merge
Simple merge
Simple merge
@@@ -26,7 -26,8 +26,9 @@@
   */
  
  #include "vc1dsp.h"
 +#include "libavutil/avassert.h"
+ #include "libavutil/common.h"
  
  /** Apply overlap transform to horizontal edge
  */
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -25,9 -23,8 +25,9 @@@ MMX-OBJS-$(CONFIG_H264DSP)             
  MMX-OBJS-$(CONFIG_H264PRED)            += x86/h264_intrapred_init.o
  MMX-OBJS-$(CONFIG_LPC)                 += x86/lpc_mmx.o
  MMX-OBJS-$(CONFIG_MPEGAUDIODSP)        += x86/mpegaudiodec_mmx.o
- MMX-OBJS-$(CONFIG_PNG_DECODER)         += x86/pngdsp-init.o
- MMX-OBJS-$(CONFIG_PRORES_DECODER)      += x86/proresdsp-init.o
- MMX-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp-init.o
+ MMX-OBJS-$(CONFIG_PNG_DECODER)         += x86/pngdsp_init.o
+ MMX-OBJS-$(CONFIG_PRORES_DECODER)      += x86/proresdsp_init.o
++MMX-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp_init.o
  MMX-OBJS-$(CONFIG_RV30_DECODER)        += x86/rv34dsp_init.o
  MMX-OBJS-$(CONFIG_RV40_DECODER)        += x86/rv34dsp_init.o            \
                                            x86/rv40dsp_init.o
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -3,20 -3,20 +3,20 @@@
   *
   * Copyright (c) 2010-2011 Maxim Poliakovski
   *
-- * This file is part of Libav.
++ * This file is part of FFmpeg.
   *
-- * Libav is free software; you can redistribute it and/or
++ * FFmpeg is free software; you can redistribute it and/or
   * modify it under the terms of the GNU Lesser General Public
   * License as published by the Free Software Foundation; either
   * version 2.1 of the License, or (at your option) any later version.
   *
-- * Libav is distributed in the hope that it will be useful,
++ * FFmpeg is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
-- * License along with Libav; if not, write to the Free Software
++ * License along with FFmpeg; if not, write to the Free Software
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc libavcodec/xl.c
Simple merge
Simple merge
Simple merge
@@@ -16,8 -16,8 +16,9 @@@
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
 +#include "libavutil/avassert.h"
  #include "avdevice.h"
+ #include "config.h"
  
  unsigned avdevice_version(void)
  {
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
   * null audio source
   */
  
- #include "internal.h"
- #include "libavutil/audioconvert.h"
- #include "libavutil/opt.h"
+ #include <inttypes.h>
+ #include <stdio.h>
  
 +#include "audio.h"
  #include "avfilter.h"
  #include "internal.h"
 +
+ #include "libavutil/audioconvert.h"
+ #include "libavutil/internal.h"
++#include "libavutil/opt.h"
  typedef struct {
 +    const AVClass *class;
 +    char   *channel_layout_str;
      uint64_t channel_layout;
 -    int64_t sample_rate;
 +    char   *sample_rate_str;
 +    int     sample_rate;
 +    int nb_samples;             ///< number of samples per requested frame
 +    int64_t pts;
  } ANullContext;
  
 +#define OFFSET(x) offsetof(ANullContext, x)
 +
 +static const AVOption anullsrc_options[]= {
 +    { "channel_layout", "set channel_layout", OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, {.str = "stereo"}, 0, 0 },
 +    { "cl",             "set channel_layout", OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, {.str = "stereo"}, 0, 0 },
 +    { "sample_rate",    "set sample rate",    OFFSET(sample_rate_str)   , AV_OPT_TYPE_STRING, {.str = "44100"}, 0, 0 },
 +    { "r",              "set sample rate",    OFFSET(sample_rate_str)   , AV_OPT_TYPE_STRING, {.str = "44100"}, 0, 0 },
 +    { "nb_samples",     "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.dbl = 1024}, 0, INT_MAX },
 +    { "n",              "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.dbl = 1024}, 0, INT_MAX },
 +    { NULL },
 +};
 +
 +AVFILTER_DEFINE_CLASS(anullsrc);
 +
  static int init(AVFilterContext *ctx, const char *args)
  {
 -    ANullContext *priv = ctx->priv;
 -    char channel_layout_str[128] = "";
 +    ANullContext *null = ctx->priv;
 +    int ret;
  
 -    priv->sample_rate = 44100;
 -    priv->channel_layout = AV_CH_LAYOUT_STEREO;
 +    null->class = &anullsrc_class;
 +    av_opt_set_defaults(null);
  
 -    if (args)
 -        sscanf(args, "%"PRId64":%s", &priv->sample_rate, channel_layout_str);
 +    if ((ret = (av_set_options_string(null, args, "=", ":"))) < 0)
 +        return ret;
  
 -    if (priv->sample_rate < 0) {
 -        av_log(ctx, AV_LOG_ERROR, "Invalid negative sample rate: %"PRId64"\n", priv->sample_rate);
 -        return AVERROR(EINVAL);
 -    }
 +    if ((ret = ff_parse_sample_rate(&null->sample_rate,
 +                                     null->sample_rate_str, ctx)) < 0)
 +        return ret;
  
 -    if (*channel_layout_str)
 -        if (!(priv->channel_layout = av_get_channel_layout(channel_layout_str))
 -            && sscanf(channel_layout_str, "%"PRId64, &priv->channel_layout) != 1) {
 -            av_log(ctx, AV_LOG_ERROR, "Invalid value '%s' for channel layout\n",
 -                   channel_layout_str);
 -            return AVERROR(EINVAL);
 -        }
 +    if ((ret = ff_parse_channel_layout(&null->channel_layout,
 +                                        null->channel_layout_str, ctx)) < 0)
 +        return ret;
  
      return 0;
  }
@@@ -19,8 -16,8 +19,9 @@@
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
 +#include "libavutil/avassert.h"
  #include "libavutil/audioconvert.h"
+ #include "libavutil/common.h"
  
  #include "audio.h"
  #include "avfilter.h"
@@@ -19,6 -19,9 +19,7 @@@
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
 -/* #define DEBUG */
 -
+ #include "libavutil/common.h"
  #include "libavutil/pixdesc.h"
  #include "libavutil/rational.h"
  #include "libavutil/audioconvert.h"
Simple merge
@@@ -21,8 -17,7 +21,9 @@@
   */
  
  #include "libavutil/audioconvert.h"
 +#include "libavutil/avassert.h"
+ #include "libavutil/common.h"
 +#include "libavutil/imgutils.h"
  #include "libavcodec/avcodec.h"
  
  #include "avfilter.h"
Simple merge
  #include "formats.h"
  #include "internal.h"
  #include "video.h"
 +#include "avcodec.h"
  
  #include "libavutil/audioconvert.h"
+ #include "libavutil/common.h"
  #include "libavutil/fifo.h"
  #include "libavutil/imgutils.h"
  #include "libavutil/opt.h"
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
+ #include <string.h>
  #include "libavutil/avutil.h"
  #include "libavutil/colorspace.h"
+ #include "libavutil/mem.h"
  #include "libavutil/pixdesc.h"
  #include "drawutils.h"
 +#include "formats.h"
  
  enum { RED = 0, GREEN, BLUE, ALPHA };
  
Simple merge
Simple merge
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
+ #include "libavutil/common.h"
 +#include "libavutil/eval.h"
  #include "libavutil/pixdesc.h"
 +#include "libavutil/parseutils.h"
 +#include "libavutil/audioconvert.h"
  #include "avfilter.h"
  #include "internal.h"
  #include "formats.h"
Simple merge
Simple merge
@@@ -23,8 -23,8 +23,9 @@@
   * aspect ratio modification video filters
   */
  
+ #include "libavutil/common.h"
  #include "libavutil/mathematics.h"
 +#include "libavutil/parseutils.h"
  #include "avfilter.h"
  #include "internal.h"
  #include "video.h"
   * Ported from MPlayer libmpcodecs/vf_blackframe.c.
   */
  
+ #include <stdio.h>
+ #include <inttypes.h>
+ #include "libavutil/internal.h"
  #include "avfilter.h"
 +#include "internal.h"
  #include "formats.h"
  #include "internal.h"
  #include "video.h"
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -29,8 -29,8 +29,9 @@@
  #include <sys/time.h>
  #include <time.h>
  
 -#include "libavutil/colorspace.h"
 +#include "config.h"
 +#include "libavutil/avstring.h"
+ #include "libavutil/common.h"
  #include "libavutil/file.h"
  #include "libavutil/eval.h"
  #include "libavutil/opt.h"
   * based heavily on vf_negate.c by Bobby Bingham
   */
  
 +#include "libavutil/avstring.h"
+ #include "libavutil/common.h"
 +#include "libavutil/eval.h"
 +#include "libavutil/opt.h"
  #include "libavutil/pixdesc.h"
  #include "avfilter.h"
 +#include "drawutils.h"
 +#include "internal.h"
  #include "formats.h"
  #include "internal.h"
  #include "video.h"
Simple merge
   * format and noformat video filters
   */
  
+ #include <string.h>
+ #include "libavutil/internal.h"
+ #include "libavutil/mem.h"
  #include "libavutil/pixdesc.h"
  #include "avfilter.h"
 +#include "internal.h"
  #include "formats.h"
  #include "internal.h"
  #include "video.h"
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -24,7 -24,9 +24,8 @@@
   * value, and apply it to input video.
   */
  
+ #include "libavutil/common.h"
  #include "libavutil/eval.h"
 -#include "libavutil/mathematics.h"
  #include "libavutil/opt.h"
  #include "libavutil/pixdesc.h"
  #include "avfilter.h"
Simple merge
   * overlay one video on top of another
   */
  
 +/* #define DEBUG */
 +
  #include "avfilter.h"
  #include "formats.h"
+ #include "libavutil/common.h"
  #include "libavutil/eval.h"
  #include "libavutil/avstring.h"
 +#include "libavutil/opt.h"
  #include "libavutil/pixdesc.h"
  #include "libavutil/imgutils.h"
  #include "libavutil/mathematics.h"
Simple merge
Simple merge
Simple merge
  
  #include "libavutil/eval.h"
  #include "libavutil/fifo.h"
 -#include "libavutil/mathematics.h"
 +#include "libavcodec/dsputil.h"
+ #include "libavutil/internal.h"
  #include "avfilter.h"
 +#include "formats.h"
  #include "internal.h"
  #include "video.h"
  
Simple merge
@@@ -24,8 -24,8 +24,9 @@@
  
  #include "libavutil/adler32.h"
  #include "libavutil/imgutils.h"
+ #include "libavutil/internal.h"
  #include "libavutil/pixdesc.h"
 +#include "libavutil/timestamp.h"
  #include "avfilter.h"
  #include "internal.h"
  #include "video.h"
Simple merge
Simple merge
Simple merge
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
+ #include <string.h>
+ #include <stdio.h>
 +#include "libavutil/avassert.h"
  #include "libavutil/imgutils.h"
+ #include "libavutil/mem.h"
  
  #include "avfilter.h"
  #include "internal.h"
Simple merge
@@@ -35,8 -32,9 +35,9 @@@
  
  #include <float.h>
  
 -#include "libavutil/mathematics.h"
+ #include "libavutil/common.h"
  #include "libavutil/opt.h"
 +#include "libavutil/imgutils.h"
  #include "libavutil/intreadwrite.h"
  #include "libavutil/parseutils.h"
  #include "avfilter.h"
Simple merge
Simple merge
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
 +#include "libavutil/avutil.h"
  #include "network.h"
  #include "libavcodec/internal.h"
+ #include "libavutil/mem.h"
  
  #define THREADS (HAVE_PTHREADS || (defined(WIN32) && !defined(__MINGW32CE__)))
  
Simple merge
@@@ -30,8 -30,8 +30,8 @@@
  #include "libavutil/avutil.h"
  
  #define LIBAVFORMAT_VERSION_MAJOR 54
 -#define LIBAVFORMAT_VERSION_MINOR 13
 -#define LIBAVFORMAT_VERSION_MICRO  4
 +#define LIBAVFORMAT_VERSION_MINOR 24
- #define LIBAVFORMAT_VERSION_MICRO 100
++#define LIBAVFORMAT_VERSION_MICRO 101
  
  #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                 LIBAVFORMAT_VERSION_MINOR, \
@@@ -18,8 -18,9 +18,9 @@@
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
+ #include "libavutil/common.h"
  #include "libavutil/dict.h"
 -#include "libavutil/error.h"
 +// #include "libavutil/error.h"
  #include "libavutil/log.h"
  #include "libavutil/mem.h"
  #include "libavutil/opt.h"
  #include "avstring.h"
  #include "avutil.h"
  #include "audioconvert.h"
 +#include "bprint.h"
+ #include "common.h"
  
 -static const char * const channel_names[] = {
 -    [0]  = "FL",        /* front left */
 -    [1]  = "FR",        /* front right */
 -    [2]  = "FC",        /* front center */
 -    [3]  = "LFE",       /* low frequency */
 -    [4]  = "BL",        /* back left */
 -    [5]  = "BR",        /* back right */
 -    [6]  = "FLC",       /* front left-of-center  */
 -    [7]  = "FRC",       /* front right-of-center */
 -    [8]  = "BC",        /* back-center */
 -    [9]  = "SL",        /* side left */
 -    [10] = "SR",        /* side right */
 -    [11] = "TC",        /* top center */
 -    [12] = "TFL",       /* top front left */
 -    [13] = "TFC",       /* top front center */
 -    [14] = "TFR",       /* top front right */
 -    [15] = "TBL",       /* top back left */
 -    [16] = "TBC",       /* top back center */
 -    [17] = "TBR",       /* top back right */
 -    [29] = "DL",        /* downmix left */
 -    [30] = "DR",        /* downmix right */
 -    [31] = "WL",        /* wide left */
 -    [32] = "WR",        /* wide right */
 -    [33] = "SDL",       /* surround direct left */
 -    [34] = "SDR",       /* surround direct right */
 +struct channel_name {
 +    const char *name;
 +    const char *description;
 +};
 +
 +static const struct channel_name channel_names[] = {
 +     [0] = { "FL",        "front left"            },
 +     [1] = { "FR",        "front right"           },
 +     [2] = { "FC",        "front center"          },
 +     [3] = { "LFE",       "low frequency"         },
 +     [4] = { "BL",        "back left"             },
 +     [5] = { "BR",        "back right"            },
 +     [6] = { "FLC",       "front left-of-center"  },
 +     [7] = { "FRC",       "front right-of-center" },
 +     [8] = { "BC",        "back center"           },
 +     [9] = { "SL",        "side left"             },
 +    [10] = { "SR",        "side right"            },
 +    [11] = { "TC",        "top center"            },
 +    [12] = { "TFL",       "top front left"        },
 +    [13] = { "TFC",       "top front center"      },
 +    [14] = { "TFR",       "top front right"       },
 +    [15] = { "TBL",       "top back left"         },
 +    [16] = { "TBC",       "top back center"       },
 +    [17] = { "TBR",       "top back right"        },
 +    [29] = { "DL",        "downmix left"          },
 +    [30] = { "DR",        "downmix right"         },
 +    [31] = { "WL",        "wide left"             },
 +    [32] = { "WR",        "wide right"            },
 +    [33] = { "SDL",       "surround direct left"  },
 +    [34] = { "SDR",       "surround direct right" },
  };
  
  static const char *get_channel_name(int channel_id)
Simple merge
Simple merge
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
 +#undef _GNU_SOURCE
  #include "avutil.h"
  #include "avstring.h"
+ #include "common.h"
  
 +struct error_entry {
 +    int num;
 +    const char *tag;
 +    const char *str;
 +};
 +
 +#define ERROR_TAG(tag) AVERROR_##tag, #tag
 +struct error_entry error_entries[] = {
 +    { ERROR_TAG(BSF_NOT_FOUND),      "Bitstream filter not found"                     },
 +    { ERROR_TAG(BUG),                "Internal bug, should not have happened"         },
 +    { ERROR_TAG(BUG2),               "Internal bug, should not have happened"         },
 +    { ERROR_TAG(BUFFER_TOO_SMALL),   "Buffer too small"                               },
 +    { ERROR_TAG(DECODER_NOT_FOUND),  "Decoder not found"                              },
 +    { ERROR_TAG(DEMUXER_NOT_FOUND),  "Demuxer not found"                              },
 +    { ERROR_TAG(ENCODER_NOT_FOUND),  "Encoder not found"                              },
 +    { ERROR_TAG(EOF),                "End of file"                                    },
 +    { ERROR_TAG(EXIT),               "Immediate exit requested"                       },
 +    { ERROR_TAG(EXTERNAL),           "Generic error in an external library"           },
 +    { ERROR_TAG(FILTER_NOT_FOUND),   "Filter not found"                               },
 +    { ERROR_TAG(INVALIDDATA),        "Invalid data found when processing input"       },
 +    { ERROR_TAG(MUXER_NOT_FOUND),    "Muxer not found"                                },
 +    { ERROR_TAG(OPTION_NOT_FOUND),   "Option not found"                               },
 +    { ERROR_TAG(PATCHWELCOME),       "Not yet implemented in FFmpeg, patches welcome" },
 +    { ERROR_TAG(PROTOCOL_NOT_FOUND), "Protocol not found"                             },
 +    { ERROR_TAG(STREAM_NOT_FOUND),   "Stream not found"                               },
 +    { ERROR_TAG(UNKNOWN),            "Unknown error occurred"                         },
 +};
 +
  int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
  {
 -    int ret = 0;
 -    const char *errstr = NULL;
 -
 -    switch (errnum) {
 -    case AVERROR_BSF_NOT_FOUND:     errstr = "Bitstream filter not found"                   ; break;
 -    case AVERROR_DECODER_NOT_FOUND: errstr = "Decoder not found"                            ; break;
 -    case AVERROR_DEMUXER_NOT_FOUND: errstr = "Demuxer not found"                            ; break;
 -    case AVERROR_ENCODER_NOT_FOUND: errstr = "Encoder not found"                            ; break;
 -    case AVERROR_EOF:               errstr = "End of file"                                  ; break;
 -    case AVERROR_EXIT:              errstr = "Immediate exit requested"                     ; break;
 -    case AVERROR_FILTER_NOT_FOUND:  errstr = "Filter not found"                             ; break;
 -    case AVERROR_INVALIDDATA:       errstr = "Invalid data found when processing input"     ; break;
 -    case AVERROR_MUXER_NOT_FOUND:   errstr = "Muxer not found"                              ; break;
 -    case AVERROR_OPTION_NOT_FOUND:  errstr = "Option not found"                             ; break;
 -    case AVERROR_PATCHWELCOME:      errstr = "Not yet implemented in Libav, patches welcome"; break;
 -    case AVERROR_PROTOCOL_NOT_FOUND:errstr = "Protocol not found"                           ; break;
 -    case AVERROR_STREAM_NOT_FOUND:  errstr = "Stream not found"                             ; break;
 -    case AVERROR_BUG:               errstr = "Bug detected, please report the issue"        ; break;
 -    case AVERROR_UNKNOWN:           errstr = "Unknown error occurred"                       ; break;
 -    }
 +    int ret = 0, i;
 +    struct error_entry *entry = NULL;
  
 -    if (errstr) {
 -        av_strlcpy(errbuf, errstr, errbuf_size);
 +    for (i = 0; i < FF_ARRAY_ELEMS(error_entries); i++) {
 +        if (errnum == error_entries[i].num) {
 +            entry = &error_entries[i];
 +            break;
 +        }
 +    }
 +    if (entry) {
 +        av_strlcpy(errbuf, entry->str, errbuf_size);
      } else {
  #if HAVE_STRERROR_R
 -        ret = strerror_r(AVUNERROR(errnum), errbuf, errbuf_size);
 +        ret = AVERROR(strerror_r(AVUNERROR(errnum), errbuf, errbuf_size));
  #else
          ret = -1;
  #endif
@@@ -26,8 -26,8 +26,9 @@@
   * see http://joe.hotchkiss.com/programming/eval/eval.html
   */
  
 +#include <float.h>
  #include "avutil.h"
+ #include "common.h"
  #include "eval.h"
  #include "log.h"
  #include "mathematics.h"
Simple merge
Simple merge
Simple merge
   * misc image utilities
   */
  
+ #include "common.h"
  #include "imgutils.h"
  #include "internal.h"
 +#include "intreadwrite.h"
  #include "log.h"
  #include "pixdesc.h"
  
diff --cc libavutil/log.c
  #include <unistd.h>
  #endif
  #include <stdlib.h>
 -#include "avstring.h"
  #include "avutil.h"
+ #include "common.h"
  #include "log.h"
  
 +#define LINE_SZ 1024
 +
  static int av_log_level = AV_LOG_INFO;
  static int flags;
  
diff --cc libavutil/mem.h
  #ifndef AVUTIL_MEM_H
  #define AVUTIL_MEM_H
  
+ #include <limits.h>
  #include "attributes.h"
 +#include "error.h"
  #include "avutil.h"
  
  /**
diff --cc libavutil/opt.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -39,8 -37,8 +39,8 @@@
   */
  
  #define LIBAVUTIL_VERSION_MAJOR 51
- #define LIBAVUTIL_VERSION_MINOR 69
 -#define LIBAVUTIL_VERSION_MINOR 39
 -#define LIBAVUTIL_VERSION_MICRO  0
++#define LIBAVUTIL_VERSION_MINOR 70
 +#define LIBAVUTIL_VERSION_MICRO 100
  
  #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
                                                 LIBAVUTIL_VERSION_MINOR, \
Simple merge
Simple merge
Simple merge
Simple merge