aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspiff_ <spiff_@svn>2009-12-20 20:34:26 +0000
committerspiff_ <spiff_@svn>2009-12-20 20:34:26 +0000
commitc54dc9e3606c7f82ea00af45fb3b40a4eec3e821 (patch)
tree17b27bab9344613be1eaa65a790176c3fc7b0601
parentefce89260ba6dce0460a014fbc6a5627bf20bde9 (diff)
updated: ffmpeg to r20894
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@25892 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/Changelog5
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/Doxyfile2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/MAINTAINERS1
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/Makefile26
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/cmdutils.c72
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/cmdutils.h26
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/cmdutils_common_opts.h9
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/common.mak12
-rwxr-xr-xxbmc/cores/dvdplayer/Codecs/ffmpeg/configure675
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/APIchanges49
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/developer.texi3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/faq.texi8
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffmpeg-doc.texi46
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffplay-doc.texi10
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffserver-doc.texi10
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/general.texi21
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/libavfilter.texi200
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffmpeg.c220
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffplay.c10
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-baseline.ffpreset3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-default.ffpreset3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-fastfirstpass.ffpreset5
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-hq.ffpreset3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-ipod320.ffpreset3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-ipod640.ffpreset3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_fast.ffpreset3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_max.ffpreset3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_medium.ffpreset3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_slow.ffpreset3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_slower.ffpreset3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_ultrafast.ffpreset2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-main.ffpreset2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-max.ffpreset3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-normal.ffpreset3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-slowfirstpass.ffpreset3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/ffserver.c8
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/4xm.c4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/8bps.c4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/Makefile326
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac.c39
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac.h13
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac_adtstoasc_bsf.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3dec.c5
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3enc.c4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_filters.c33
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_filters.h19
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_pitch_delay.c65
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_pitch_delay.h32
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_vectors.c87
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_vectors.h76
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/adpcm.c14
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/alacenc.c20
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/allcodecs.c5
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/alsdec.c1260
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/apedec.c110
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/asm.S2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_arm.S34
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_armv6.S50
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_init_arm.c38
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_init_armv6.c6
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_init_neon.c70
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_neon.S25
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264dsp_neon.S437
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264idct_neon.S8
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264pred_init_arm.c76
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264pred_neon.S362
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/jrevdct_arm.S4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/simple_idct_arm.S6
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/asv1.c23
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/avcodec.h64
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/avpacket.c16
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/bitstream.c10
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cdgraphics.c380
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/celp_filters.c137
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/celp_filters.h30
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cook.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/costablegen.c56
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cscd.c3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dca.c42
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dnxhdenc.c204
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dnxhdenc.h1
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dpx.c1
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dsputil.c41
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dsputil.h79
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dv.c22
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dvdata.c285
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dvdata.h258
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxa.c4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/error_resilience.c5
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/fft.c55
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flacdec.c8
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flacenc.c63
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flashsvenc.c4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/frwu.c123
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/get_bits.h7
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/gif.c110
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h261dec.c4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h263.c28
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h263dec.c33
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264.c64
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264pred.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264pred.h1
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/huffyuv.c12
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/imgconvert.c255
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/indeo2.c15
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/jfdctfst.c4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/jfdctint.c4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lcldec.c4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libfaad.c4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libopenjpeg.c12
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libtheoraenc.c334
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libx264.c4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ljpegenc.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/loco.c12
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lpc.c64
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lsp.c52
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lsp.h41
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lzw.h9
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lzwenc.c17
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mjpegdec.c35
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mjpegdec.h4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mjpegenc.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mlp.c11
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mlpdec.c20
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mmvideo.c3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels.c57
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels_tablegen.c44
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels_tablegen.h91
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpc.c6
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpc7.c5
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpc8.c5
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg12.c224
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4audio.c43
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4audio.h6
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4video_parser.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio.h22
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio_tablegen.c60
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio_tablegen.h67
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudiodec.c73
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo.c64
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo.h4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_common.h32
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_enc.c44
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_parser.c13
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_xvmc.c10
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/msmpeg4.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/nellymoserdec.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/nellymoserenc.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/opt.h52
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/options.c5
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pamenc.c120
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pcm.c10
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pcx.c3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pngdec.c14
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnm.c53
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnm.h3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnm_parser.c63
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnmdec.c268
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnmenc.c432
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/int_altivec.c66
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pthread.c13
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/put_bits.h31
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qcelpdec.c41
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qdm2.c6
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qdrw.c16
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/r210dec.c104
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/raw.c9
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rawdec.c7
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rdft.c39
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/roqaudioenc.c21
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/roqvideoenc.c6
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rv10.c35
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rv34.c1
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/smacker.c5
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/snow.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/svq1dec.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/svq1enc.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/svq3.c3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/synth_filter.c56
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/synth_filter.h31
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tableprint.c73
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tableprint.h59
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tiff.c5
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tiffenc.c6
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/truemotion2.c8
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tscc.c4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/twinvq.c19
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ulti.c12
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/utils.c126
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/v210dec.c5
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/v210x.c14
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vb.c4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vc1.c6
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vc1.h2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vc1dec.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vdpau.c50
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vdpau.h11
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vdpau_internal.h3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vmnc.c3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vorbis_dec.c86
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vorbis_enc.c9
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp3.c207
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/w32thread.c73
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wavpack.c4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wmadec.c58
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wmaprodec.c38
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wnv1.c17
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dsputil_mmx.c116
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dsputil_yasm.asm249
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dsputilenc_mmx.c10
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/fft_mmx.asm2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/lpc_mmx.c (renamed from xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/flacdsp_mmx.c)4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/x86inc.asm10
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/xan.c3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/xl.c12
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/zmbv.c3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/zmbvenc.c37
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/Makefile8
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alldevices.c6
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alsa-audio-common.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alsa-audio-dec.c4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alsa-audio-enc.c4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/avdevice.c35
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/avdevice.h12
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/oss_audio.c33
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/v4l2.c117
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/x11grab.c153
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/Makefile9
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/allfilters.c9
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/avfilter.c105
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/avfilter.h82
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/defaults.c12
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/formats.c22
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/graphparser.c4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/parseutils.c5
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_crop.c236
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_format.c162
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_null.c58
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_scale.c196
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_slicify.c115
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_vflip.c104
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/Makefile43
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiff.h53
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiffdec.c (renamed from xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiff.c)217
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiffenc.c160
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/allformats.c3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/apetag.c31
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/asf.c12
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/asf.h3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/asfdec.c30
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/au.c8
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/avformat.h29
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/avidec.c51
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/avio.h2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aviobuf.c17
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/caf.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/cdg.c66
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/dv.c6
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/dvenc.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmdec.c14
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmenc.c14
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/flvdec.c9
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/flvenc.c25
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/gxfenc.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v1.c32
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v1.h2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v2.c15
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v2.h2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/img2.c10
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/isom.c7
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/isom.h4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/iv8.c91
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/matroskaenc.c47
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/metadata.c29
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mov.c168
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/movenc.c154
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mp3.c75
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mpeg.c6
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mpegts.c544
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mpegtsenc.c3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mtv.c30
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mvi.c1
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mxfdec.c9
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mxfenc.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/nsvdec.c4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggdec.c33
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggdec.h10
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggenc.c73
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggparseogm.c12
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggparsespeex.c51
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggparsevorbis.c10
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/options.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/os_support.h2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/raw.c7
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/riff.c26
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/riff.h2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rmdec.c116
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtmppkt.c187
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtmppkt.h16
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtmpproto.c472
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtp_h264.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtsp.c563
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtsp.h4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/sdp.c8
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/smacker.c1
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/soxdec.c12
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/swf.h4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/tmv.c41
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/tta.c20
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/utils.c162
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/voc.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/voc.h2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/vocdec.c5
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/vqf.c13
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/wc3movie.c17
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/wv.c43
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/Makefile2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/avstring.c8
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/avstring.h5
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/avutil.h12
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/common.h2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/internal.h4
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/lfg.c33
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/lfg.h8
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/log.c3
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/mathematics.c19
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/pixdesc.c (renamed from xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pixdesc.c)176
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/pixdesc.h (renamed from xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pixdesc.h)23
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/pixfmt.h1
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/tree.c11
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/utils.c12
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libpostproc/postprocess.c11
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libpostproc/postprocess.h10
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libswscale/swscale.c130
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libswscale/swscale.h22
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/libswscale/swscale_template.c70
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/subdir.mak5
-rwxr-xr-xxbmc/cores/dvdplayer/Codecs/ffmpeg/tests/codec-regression.sh363
-rwxr-xr-xxbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavf-regression.sh222
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavf.regression.ref2
-rwxr-xr-xxbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavfi-regression.sh37
-rwxr-xr-xxbmc/cores/dvdplayer/Codecs/ffmpeg/tests/regression-funcs.sh126
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/rotozoom.regression.ref168
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/seek.regression.ref7264
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/seek_test.c40
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/tiny_psnr.c2
-rw-r--r--xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/vsynth.regression.ref168
-rwxr-xr-xxbmc/cores/dvdplayer/Codecs/ffmpeg/tools/patcheck4
349 files changed, 16743 insertions, 9196 deletions
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/Changelog b/xbmc/cores/dvdplayer/Codecs/ffmpeg/Changelog
index 0d465aa1ed..c2a322c480 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/Changelog
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/Changelog
@@ -41,6 +41,11 @@ version <next>:
- Atrac1 decoder
- MD STUDIO audio demuxer
- RF64 support in WAV demuxer
+- MPEG-4 Audio Lossless Coding (ALS) decoder
+- -formats option split into -formats, -codecs, -bsfs, and -protocols
+- IV8 demuxer
+- CDG demuxer and decoder
+- R210 decoder
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/Doxyfile b/xbmc/cores/dvdplayer/Codecs/ffmpeg/Doxyfile
index ea3b021f72..784502ac9d 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/Doxyfile
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/Doxyfile
@@ -17,7 +17,7 @@
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
-PROJECT_NAME = ffmpeg
+PROJECT_NAME = FFmpeg
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/MAINTAINERS b/xbmc/cores/dvdplayer/Codecs/ffmpeg/MAINTAINERS
index 669060433d..35097fd435 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/MAINTAINERS
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/MAINTAINERS
@@ -114,6 +114,7 @@ Codecs:
atrac3* Benjamin Larsson
bmp.c Mans Rullgard, Kostya Shishkov
cavs* Stefan Gehrer
+ celp_filters.* Vitor Sessak
cinepak.c Roberto Togni
cljr Alex Beregszaszi
cook.c, cookdata.h Benjamin Larsson
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/Makefile b/xbmc/cores/dvdplayer/Codecs/ffmpeg/Makefile
index ed81397581..5fd4094710 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/Makefile
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/Makefile
@@ -8,11 +8,12 @@ PROGS-$(CONFIG_FFMPEG) += ffmpeg
PROGS-$(CONFIG_FFPLAY) += ffplay
PROGS-$(CONFIG_FFSERVER) += ffserver
-PROGS = $(addsuffix $(EXESUF), $(PROGS-yes))
+PROGS := $(addsuffix $(EXESUF), $(PROGS-yes))
PROGS_G = $(addsuffix _g$(EXESUF), $(PROGS-yes))
OBJS = $(addsuffix .o, $(PROGS-yes)) cmdutils.o
MANPAGES = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
TOOLS = $(addprefix tools/, $(addsuffix $(EXESUF), cws2fws pktdumper probetest qt-faststart trasher))
+HOSTPROGS = $(addprefix tests/, audiogen videogen rotozoom tiny_psnr)
BASENAMES = ffmpeg ffplay ffserver
ALLPROGS = $(addsuffix $(EXESUF), $(BASENAMES))
@@ -32,11 +33,11 @@ FF_LDFLAGS := $(FFLDFLAGS)
FF_EXTRALIBS := $(FFEXTRALIBS)
FF_DEP_LIBS := $(DEP_LIBS)
-ALL_TARGETS-$(BUILD_DOC) += documentation
+ALL_TARGETS-$(CONFIG_DOC) += documentation
-ifneq ($(PROGS),)
+ifdef PROGS
INSTALL_TARGETS-yes += install-progs install-data
-INSTALL_TARGETS-$(BUILD_DOC) += install-man
+INSTALL_TARGETS-$(CONFIG_DOC) += install-man
endif
INSTALL_PROGS_TARGETS-$(CONFIG_SHARED) = install-libs
@@ -47,7 +48,8 @@ $(PROGS): %$(EXESUF): %_g$(EXESUF)
$(STRIP) $@
SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
- ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS
+ ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
+ HOSTPROGS
define RESET
$(1) :=
@@ -80,8 +82,9 @@ cmdutils.o cmdutils.d: version.h
alltools: $(TOOLS)
-documentation: $(addprefix doc/, developer.html faq.html ffmpeg-doc.html ffserver-doc.html \
- ffplay-doc.html general.html $(ALLMANPAGES))
+documentation: $(addprefix doc/, developer.html faq.html ffmpeg-doc.html \
+ ffplay-doc.html ffserver-doc.html \
+ general.html libavfilter.html $(ALLMANPAGES))
doc/%.html: doc/%.texi
texi2html -monolithic -number $<
@@ -186,6 +189,7 @@ CODEC_TESTS = $(addprefix regtest-, \
dnxhd_720p_rd \
svq1 \
flashsv \
+ roq \
mp2 \
ac3 \
g726 \
@@ -194,6 +198,7 @@ CODEC_TESTS = $(addprefix regtest-, \
adpcm_ms \
adpcm_yam \
adpcm_swf \
+ alac \
flac \
wma \
pcm \
@@ -295,10 +300,10 @@ $(CODEC_TESTS) regtest-ref: tests/tiny_psnr$(HOSTEXESUF)
$(SRC_PATH)/tests/codec-regression.sh $@ rotozoom tests/vsynth2 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
$(LAVF_TESTS):
- $(SRC_PATH)/tests/codec-regression.sh $@ lavf tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
+ $(SRC_PATH)/tests/lavf-regression.sh $@ lavf tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
$(LAVFI_TESTS):
- $(SRC_PATH)/tests/codec-regression.sh $@ lavfi tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
+ $(SRC_PATH)/tests/lavfi-regression.sh $@ lavfi tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
seektest: codectest lavftest tests/seek_test$(EXESUF)
$(SRC_PATH)/tests/seek-regression.sh $(SEEK_REFFILE) "$(TARGET_EXEC)" "$(TARGET_PATH)"
@@ -322,9 +327,6 @@ tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
mkdir -p tests/data
$(BUILD_ROOT)/$< $@
-tests/%$(HOSTEXESUF): tests/%.c
- $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
-
tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/cmdutils.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/cmdutils.c
index ffa5957b71..68ef726dd3 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/cmdutils.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/cmdutils.c
@@ -130,10 +130,11 @@ void parse_options(int argc, char **argv, const OptionDef *options,
handleoptions = 0;
continue;
}
- po= find_option(options, opt + 1);
- if (!po->name && opt[1] == 'n' && opt[2] == 'o') {
+ opt++;
+ po= find_option(options, opt);
+ if (!po->name && opt[0] == 'n' && opt[1] == 'o') {
/* handle 'no' bool option */
- po = find_option(options, opt + 3);
+ po = find_option(options, opt + 2);
if (!(po->name && (po->flags & OPT_BOOL)))
goto unknown_opt;
bool_val = 0;
@@ -160,13 +161,13 @@ unknown_opt:
} else if (po->flags & OPT_BOOL) {
*po->u.int_arg = bool_val;
} else if (po->flags & OPT_INT) {
- *po->u.int_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT_MIN, INT_MAX);
+ *po->u.int_arg = parse_number_or_die(opt, arg, OPT_INT64, INT_MIN, INT_MAX);
} else if (po->flags & OPT_INT64) {
- *po->u.int64_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT64_MIN, INT64_MAX);
+ *po->u.int64_arg = parse_number_or_die(opt, arg, OPT_INT64, INT64_MIN, INT64_MAX);
} else if (po->flags & OPT_FLOAT) {
- *po->u.float_arg = parse_number_or_die(opt+1, arg, OPT_FLOAT, -1.0/0.0, 1.0/0.0);
+ *po->u.float_arg = parse_number_or_die(opt, arg, OPT_FLOAT, -1.0/0.0, 1.0/0.0);
} else if (po->flags & OPT_FUNC2) {
- if(po->u.func2_arg(opt+1, arg)<0)
+ if(po->u.func2_arg(opt, arg)<0)
goto unknown_opt;
} else {
po->u.func_arg(arg);
@@ -413,13 +414,20 @@ void show_license(void)
);
}
+void list_fmts(void (*get_fmt_string)(char *buf, int buf_size, int fmt), int nb_fmts)
+{
+ int i;
+ char fmt_str[128];
+ for (i=-1; i < nb_fmts; i++) {
+ get_fmt_string (fmt_str, sizeof(fmt_str), i);
+ fprintf(stdout, "%s\n", fmt_str);
+ }
+}
+
void show_formats(void)
{
AVInputFormat *ifmt=NULL;
AVOutputFormat *ofmt=NULL;
- URLProtocol *up=NULL;
- AVCodec *p=NULL, *p2;
- AVBitStreamFilter *bsf=NULL;
const char *last_name;
printf(
@@ -463,8 +471,12 @@ void show_formats(void)
name,
long_name ? long_name:" ");
}
- printf("\n");
+}
+void show_codecs(void)
+{
+ AVCodec *p=NULL, *p2;
+ const char *last_name;
printf(
"Codecs:\n"
" D..... = Decoding supported\n"
@@ -529,25 +541,45 @@ void show_formats(void)
printf("\n");
}
printf("\n");
+ printf(
+"Note, the names of encoders and decoders do not always match, so there are\n"
+"several cases where the above table shows encoder only or decoder only entries\n"
+"even though both encoding and decoding are supported. For example, the h263\n"
+"decoder corresponds to the h263 and h263p encoders, for file formats it is even\n"
+"worse.\n");
+}
+
+void show_bsfs(void)
+{
+ AVBitStreamFilter *bsf=NULL;
printf("Bitstream filters:\n");
while((bsf = av_bitstream_filter_next(bsf)))
- printf(" %s", bsf->name);
+ printf("%s\n", bsf->name);
printf("\n");
+}
+
+void show_protocols(void)
+{
+ URLProtocol *up=NULL;
printf("Supported file protocols:\n");
while((up = av_protocol_next(up)))
- printf(" %s:", up->name);
+ printf("%s\n", up->name);
printf("\n");
printf("Frame size, frame rate abbreviations:\n ntsc pal qntsc qpal sntsc spal film ntsc-film sqcif qcif cif 4cif\n");
- printf("\n");
- printf(
-"Note, the names of encoders and decoders do not always match, so there are\n"
-"several cases where the above table shows encoder only or decoder only entries\n"
-"even though both encoding and decoding are supported. For example, the h263\n"
-"decoder corresponds to the h263 and h263p encoders, for file formats it is even\n"
-"worse.\n");
+}
+
+void show_filters(void)
+{
+ AVFilter **filter = NULL;
+
+ printf("Filters:\n");
+#if CONFIG_AVFILTER
+ while ((filter = av_filter_next(filter)) && *filter)
+ printf("%-16s %s\n", (*filter)->name, (*filter)->description);
+#endif
}
int read_yesno(void)
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/cmdutils.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/cmdutils.h
index 826f00092f..40bdea36d1 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/cmdutils.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/cmdutils.h
@@ -131,6 +131,8 @@ void set_context_opts(void *ctx, void *opts_ctx, int flags);
void print_error(const char *filename, int err);
+void list_fmts(void (*get_fmt_string)(char *buf, int buf_size, int fmt), int nb_fmts);
+
/**
* Prints the program banner to stderr. The banner contents depend on the
* current version of the repository and of the libav* libraries used by
@@ -158,6 +160,30 @@ void show_license(void);
void show_formats(void);
/**
+ * Prints a listing containing all the codecs supported by the
+ * program.
+ */
+void show_codecs(void);
+
+/**
+ * Prints a listing containing all the filters supported by the
+ * program.
+ */
+void show_filters(void);
+
+/**
+ * Prints a listing containing all the bit stream filters supported by the
+ * program.
+ */
+void show_bsfs(void);
+
+/**
+ * Prints a listing containing all the protocols supported by the
+ * program.
+ */
+void show_protocols(void);
+
+/**
* Returns a positive value if reads from standard input a line
* starting with [yY], otherwise returns 0.
*/
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/cmdutils_common_opts.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/cmdutils_common_opts.h
new file mode 100644
index 0000000000..1c89bba198
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/cmdutils_common_opts.h
@@ -0,0 +1,9 @@
+ { "L", OPT_EXIT, {(void*)show_license}, "show license" },
+ { "h", OPT_EXIT, {(void*)show_help}, "show help" },
+ { "version", OPT_EXIT, {(void*)show_version}, "show version" },
+ { "formats" , OPT_EXIT, {(void*)show_formats }, "show available formats" },
+ { "codecs" , OPT_EXIT, {(void*)show_codecs }, "show available codecs" },
+ { "bsfs" , OPT_EXIT, {(void*)show_bsfs }, "show available bit stream filters" },
+ { "protocols", OPT_EXIT, {(void*)show_protocols}, "show available protocols" },
+ { "filters", OPT_EXIT, {(void*)show_filters }, "show available filters" },
+ { "loglevel", HAS_ARG | OPT_FUNC2, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/common.mak b/xbmc/cores/dvdplayer/Codecs/ffmpeg/common.mak
index 343ca749b5..b629cb43c7 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/common.mak
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/common.mak
@@ -61,6 +61,8 @@ FFLDFLAGS := $(addprefix -L$(BUILD_ROOT)/lib,$(ALLFFLIBS)) $(LDFLAGS)
EXAMPLES := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES)))
OBJS := $(addprefix $(SUBDIR),$(OBJS))
TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS)))
+HOSTOBJS := $(addprefix $(SUBDIR),$(addsuffix .o,$(HOSTPROGS)))
+HOSTPROGS := $(addprefix $(SUBDIR),$(addsuffix $(HOSTEXESUF),$(HOSTPROGS)))
DEP_LIBS := $(foreach NAME,$(FFLIBS),$(BUILD_ROOT_REL)/lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
@@ -68,11 +70,17 @@ ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)
SKIPHEADERS = $(addprefix $(SUBDIR),$(SKIPHEADERS-))
checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
+$(HOSTOBJS): %.o: %.c
+ $(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
+
+$(HOSTPROGS): %$(HOSTEXESUF): %.o
+ $(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
+
DEPS := $(OBJS:.o=.d)
depend dep: $(DEPS)
-CLEANSUFFIXES = *.o *~ *.ho *.map
-DISTCLEANSUFFIXES = *.d *.pc
+CLEANSUFFIXES = *.d *.o *~ *.ho *.map
+DISTCLEANSUFFIXES = *.pc
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp
-include $(wildcard $(DEPS))
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/configure b/xbmc/cores/dvdplayer/Codecs/ffmpeg/configure
index 7ce9847be0..ea07ff709c 100755
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/configure
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/configure
@@ -55,183 +55,187 @@ if test "$E1" != 0 || test "$E2" = 0; then
fi
show_help(){
- echo "Usage: configure [options]"
- echo "Options: [defaults in brackets after descriptions]"
- echo
- echo "Standard options:"
- echo " --help print this message"
- echo " --logfile=FILE log tests and output to FILE [config.err]"
- echo " --disable-logging do not log configure debug information"
- echo " --prefix=PREFIX install in PREFIX [$prefix]"
- echo " --bindir=DIR install binaries in DIR [PREFIX/bin]"
- echo " --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]"
- echo " --libdir=DIR install libs in DIR [PREFIX/lib]"
- echo " --shlibdir=DIR install shared libs in DIR [PREFIX/lib]"
- echo " --incdir=DIR install includes in DIR [PREFIX/include]"
- echo " --mandir=DIR install man page in DIR [PREFIX/share/man]"
- echo
- echo "Configuration options:"
- echo " --disable-static do not build static libraries [no]"
- echo " --enable-shared build shared libraries [no]"
- echo " --enable-gpl allow use of GPL code, the resulting libs"
- echo " and binaries will be under GPL [no]"
- echo " --enable-version3 upgrade (L)GPL to version 3 [no]"
- echo " --enable-nonfree allow use of nonfree code, the resulting libs"
- echo " and binaries will be unredistributable [no]"
- echo " --disable-ffmpeg disable ffmpeg build"
- echo " --disable-ffplay disable ffplay build"
- echo " --disable-ffserver disable ffserver build"
- echo " --enable-postproc enable GPLed postprocessing support [no]"
- echo " --enable-avfilter video filter support [no]"
- echo " --enable-avfilter-lavf video filters dependent on avformat [no]"
- echo " --enable-beosthreads use BeOS threads [no]"
- echo " --enable-os2threads use OS/2 threads [no]"
- echo " --enable-pthreads use pthreads [no]"
- echo " --enable-w32threads use Win32 threads [no]"
- echo " --enable-x11grab enable X11 grabbing [no]"
- echo " --disable-network disable network support [no]"
- echo " --disable-ipv6 disable IPv6 support [no]"
- echo " --disable-mpegaudio-hp faster (but less accurate) MPEG audio decoding [no]"
- echo " --enable-gray enable full grayscale support (slower color)"
- echo " --disable-swscale-alpha disable alpha channel support in swscale"
- echo " --disable-fastdiv disable table-based division"
- echo " --enable-small optimize for size instead of speed"
- echo " --disable-aandct disable AAN DCT code"
- echo " --disable-fft disable FFT code"
- echo " --disable-golomb disable Golomb code"
- echo " --disable-mdct disable MDCT code"
- echo " --disable-rdft disable RDFT code"
- echo " --disable-vaapi disable VAAPI code"
- echo " --disable-vdpau disable VDPAU code"
- echo " --enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)"
- echo " --enable-hardcoded-tables use hardcoded tables instead of runtime generation"
- echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
- echo " --enable-beos-netserver enable BeOS netserver"
- echo " --disable-encoder=NAME disable encoder NAME"
- echo " --enable-encoder=NAME enable encoder NAME"
- echo " --disable-encoders disable all encoders"
- echo " --disable-decoder=NAME disable decoder NAME"
- echo " --enable-decoder=NAME enable decoder NAME"
- echo " --disable-decoders disable all decoders"
- echo " --disable-hwaccel=NAME disable hwaccel NAME"
- echo " --enable-hwaccel=NAME enable hwaccel NAME"
- echo " --disable-hwaccels disable all hwaccels"
- echo " --disable-muxer=NAME disable muxer NAME"
- echo " --enable-muxer=NAME enable muxer NAME"
- echo " --disable-muxers disable all muxers"
- echo " --disable-demuxer=NAME disable demuxer NAME"
- echo " --enable-demuxer=NAME enable demuxer NAME"
- echo " --disable-demuxers disable all demuxers"
- echo " --enable-parser=NAME enable parser NAME"
- echo " --disable-parser=NAME disable parser NAME"
- echo " --disable-parsers disable all parsers"
- echo " --enable-bsf=NAME enable bitstream filter NAME"
- echo " --disable-bsf=NAME disable bitstream filter NAME"
- echo " --disable-bsfs disable all bitstream filters"
- echo " --enable-protocol=NAME enable protocol NAME"
- echo " --disable-protocol=NAME disable protocol NAME"
- echo " --disable-protocols disable all protocols"
- echo " --disable-indev=NAME disable input device NAME"
- echo " --disable-outdev=NAME disable output device NAME"
- echo " --disable-indevs disable input devices"
- echo " --disable-outdevs disable output devices"
- echo " --disable-devices disable all devices"
- echo " --enable-filter=NAME enable filter NAME"
- echo " --disable-filter=NAME disable filter NAME"
- echo " --disable-filters disable all filters"
- echo " --list-decoders show all available decoders"
- echo " --list-encoders show all available encoders"
- echo " --list-hwaccels show all available hardware accelerators"
- echo " --list-muxers show all available muxers"
- echo " --list-demuxers show all available demuxers"
- echo " --list-parsers show all available parsers"
- echo " --list-protocols show all available protocols"
- echo " --list-bsfs show all available bitstream filters"
- echo " --list-indevs show all available input devices"
- echo " --list-outdevs show all available output devices"
- echo " --list-filters show all available filters"
- echo
- echo "External library support:"
- echo " --enable-avisynth enable reading of AVISynth script files [no]"
- echo " --enable-bzlib enable bzlib [autodetect]"
- echo " --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]"
- echo " --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]"
- echo " --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394"
- echo " and libraw1394 [no]"
- echo " --enable-libdirac enable Dirac support via libdirac [no]"
- echo " --enable-libfaac enable FAAC support via libfaac [no]"
- echo " --enable-libfaad enable FAAD support via libfaad [no]"
- echo " --enable-libfaadbin open libfaad.so.0 at runtime [no]"
- echo " --enable-libgsm enable GSM support via libgsm [no]"
- echo " --enable-libmp3lame enable MP3 encoding via libmp3lame [no]"
- echo " --enable-libnut enable NUT (de)muxing via libnut,"
- echo " native (de)muxer exists [no]"
- echo " --enable-libopenjpeg enable JPEG 2000 decoding via OpenJPEG [no]"
- echo " --enable-libschroedinger enable Dirac support via libschroedinger [no]"
- echo " --enable-libspeex enable Speex decoding via libspeex [no]"
- echo " --enable-libtheora enable Theora encoding via libtheora [no]"
- echo " --enable-libvorbis enable Vorbis encoding via libvorbis,"
- echo " native implementation exists [no]"
- echo " --enable-libx264 enable H.264 encoding via x264 [no]"
- echo " --enable-libxvid enable Xvid encoding via xvidcore,"
- echo " native MPEG-4/Xvid encoder exists [no]"
- echo " --enable-mlib enable Sun medialib [no]"
- echo " --enable-zlib enable zlib [autodetect]"
- echo ""
- echo "Advanced options (experts only):"
- echo " --source-path=PATH path to source code [$source_path]"
- echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
- echo " --enable-cross-compile assume a cross-compiler is used"
- echo " --sysroot=PATH root of cross-build tree"
- echo " --sysinclude=PATH location of cross-build system headers"
- echo " --target-os=OS compiler targets OS [$target_os]"
- echo " --target-exec=CMD command to run executables on target"
- echo " --target-path=DIR path to view of build directory on target"
- echo " --nm=NM use nm tool"
- echo " --as=AS use assembler AS [$as_default]"
- echo " --cc=CC use C compiler CC [$cc_default]"
- echo " --ld=LD use linker LD"
- echo " --host-cc=HOSTCC use host C compiler HOSTCC"
- echo " --host-cflags=HCFLAGS use HCFLAGS when compiling for host"
- echo " --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host"
- echo " --host-libs=HLIBS use libs HLIBS when linking for host"
- echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
- echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
- echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
- echo " --extra-version=STRING version string suffix []"
- echo " --build-suffix=SUFFIX library name suffix []"
- echo " --arch=ARCH select architecture [$arch]"
- echo " --cpu=CPU select the minimum required CPU (affects"
- echo " instruction selection, may crash on older CPUs)"
- echo " --enable-powerpc-perf enable performance report on PPC"
- echo " (requires enabling PMC)"
- echo " --disable-altivec disable AltiVec optimizations"
- echo " --disable-amd3dnow disable 3DNow! optimizations"
- echo " --disable-amd3dnowext disable 3DNow! extended optimizations"
- echo " --disable-mmx disable MMX optimizations"
- echo " --disable-mmx2 disable MMX2 optimizations"
- echo " --disable-sse disable SSE optimizations"
- echo " --disable-ssse3 disable SSSE3 optimizations"
- echo " --disable-armv5te disable armv5te optimizations"
- echo " --disable-armv6 disable armv6 optimizations"
- echo " --disable-armv6t2 disable armv6t2 optimizations"
- echo " --disable-armvfp disable ARM VFP optimizations"
- echo " --disable-iwmmxt disable iwmmxt optimizations"
- echo " --disable-mmi disable MMI optimizations"
- echo " --disable-neon disable neon optimizations"
- echo " --disable-vis disable VIS optimizations"
- echo " --disable-yasm disable use of yasm assembler"
- echo " --enable-pic build position-independent code"
- echo
- echo "Developer options (useful when working on FFmpeg itself):"
- echo " --disable-debug disable debugging symbols"
- echo " --enable-debug=LEVEL set the debug level [$debuglevel]"
- echo " --enable-gprof enable profiling with gprof [$gprof]"
- echo " --disable-optimizations disable compiler optimizations"
- echo " --enable-extra-warnings enable more compiler warnings"
- echo " --disable-stripping disable stripping of executables and shared libraries"
- echo ""
- echo "NOTE: Object files are built at the place where configure is launched."
+cat <<EOF
+Usage: configure [options]
+Options: [defaults in brackets after descriptions]
+
+Standard options:
+ --help print this message
+ --logfile=FILE log tests and output to FILE [config.err]
+ --disable-logging do not log configure debug information
+ --prefix=PREFIX install in PREFIX [$prefix]
+ --bindir=DIR install binaries in DIR [PREFIX/bin]
+ --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]
+ --libdir=DIR install libs in DIR [PREFIX/lib]
+ --shlibdir=DIR install shared libs in DIR [PREFIX/lib]
+ --incdir=DIR install includes in DIR [PREFIX/include]
+ --mandir=DIR install man page in DIR [PREFIX/share/man]
+
+Configuration options:
+ --disable-static do not build static libraries [no]
+ --enable-shared build shared libraries [no]
+ --enable-gpl allow use of GPL code, the resulting libs
+ and binaries will be under GPL [no]
+ --enable-version3 upgrade (L)GPL to version 3 [no]
+ --enable-nonfree allow use of nonfree code, the resulting libs
+ and binaries will be unredistributable [no]
+ --disable-doc do not build documentation
+ --disable-ffmpeg disable ffmpeg build
+ --disable-ffplay disable ffplay build
+ --disable-ffserver disable ffserver build
+ --enable-postproc enable GPLed postprocessing support [no]
+ --enable-avfilter video filter support [no]
+ --enable-avfilter-lavf video filters dependent on avformat [no]
+ --enable-beosthreads use BeOS threads [no]
+ --enable-os2threads use OS/2 threads [no]
+ --enable-pthreads use pthreads [no]
+ --enable-w32threads use Win32 threads [no]
+ --enable-x11grab enable X11 grabbing [no]
+ --disable-network disable network support [no]
+ --disable-ipv6 disable IPv6 support [no]
+ --disable-mpegaudio-hp faster (but less accurate) MPEG audio decoding [no]
+ --enable-gray enable full grayscale support (slower color)
+ --disable-swscale-alpha disable alpha channel support in swscale
+ --disable-fastdiv disable table-based division
+ --enable-small optimize for size instead of speed
+ --disable-aandct disable AAN DCT code
+ --disable-fft disable FFT code
+ --disable-golomb disable Golomb code
+ --disable-lpc disable LPC code
+ --disable-mdct disable MDCT code
+ --disable-rdft disable RDFT code
+ --disable-vaapi disable VAAPI code
+ --disable-vdpau disable VDPAU code
+ --enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)
+ --enable-hardcoded-tables use hardcoded tables instead of runtime generation
+ --enable-memalign-hack emulate memalign, interferes with memory debuggers
+ --enable-beos-netserver enable BeOS netserver
+ --disable-encoder=NAME disable encoder NAME
+ --enable-encoder=NAME enable encoder NAME
+ --disable-encoders disable all encoders
+ --disable-decoder=NAME disable decoder NAME
+ --enable-decoder=NAME enable decoder NAME
+ --disable-decoders disable all decoders
+ --disable-hwaccel=NAME disable hwaccel NAME
+ --enable-hwaccel=NAME enable hwaccel NAME
+ --disable-hwaccels disable all hwaccels
+ --disable-muxer=NAME disable muxer NAME
+ --enable-muxer=NAME enable muxer NAME
+ --disable-muxers disable all muxers
+ --disable-demuxer=NAME disable demuxer NAME
+ --enable-demuxer=NAME enable demuxer NAME
+ --disable-demuxers disable all demuxers
+ --enable-parser=NAME enable parser NAME
+ --disable-parser=NAME disable parser NAME
+ --disable-parsers disable all parsers
+ --enable-bsf=NAME enable bitstream filter NAME
+ --disable-bsf=NAME disable bitstream filter NAME
+ --disable-bsfs disable all bitstream filters
+ --enable-protocol=NAME enable protocol NAME
+ --disable-protocol=NAME disable protocol NAME
+ --disable-protocols disable all protocols
+ --disable-indev=NAME disable input device NAME
+ --disable-outdev=NAME disable output device NAME
+ --disable-indevs disable input devices
+ --disable-outdevs disable output devices
+ --disable-devices disable all devices
+ --enable-filter=NAME enable filter NAME
+ --disable-filter=NAME disable filter NAME
+ --disable-filters disable all filters
+ --list-decoders show all available decoders
+ --list-encoders show all available encoders
+ --list-hwaccels show all available hardware accelerators
+ --list-muxers show all available muxers
+ --list-demuxers show all available demuxers
+ --list-parsers show all available parsers
+ --list-protocols show all available protocols
+ --list-bsfs show all available bitstream filters
+ --list-indevs show all available input devices
+ --list-outdevs show all available output devices
+ --list-filters show all available filters
+
+External library support:
+ --enable-avisynth enable reading of AVISynth script files [no]
+ --enable-bzlib enable bzlib [autodetect]
+ --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
+ --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
+ --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
+ and libraw1394 [no]
+ --enable-libdirac enable Dirac support via libdirac [no]
+ --enable-libfaac enable FAAC support via libfaac [no]
+ --enable-libfaad enable FAAD support via libfaad [no]
+ --enable-libfaadbin open libfaad.so.0 at runtime [no]
+ --enable-libgsm enable GSM support via libgsm [no]
+ --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
+ --enable-libnut enable NUT (de)muxing via libnut,
+ native (de)muxer exists [no]
+ --enable-libopenjpeg enable JPEG 2000 decoding via OpenJPEG [no]
+ --enable-libschroedinger enable Dirac support via libschroedinger [no]
+ --enable-libspeex enable Speex decoding via libspeex [no]
+ --enable-libtheora enable Theora encoding via libtheora [no]
+ --enable-libvorbis enable Vorbis encoding via libvorbis,
+ native implementation exists [no]
+ --enable-libx264 enable H.264 encoding via x264 [no]
+ --enable-libxvid enable Xvid encoding via xvidcore,
+ native MPEG-4/Xvid encoder exists [no]
+ --enable-mlib enable Sun medialib [no]
+ --enable-zlib enable zlib [autodetect]
+
+Advanced options (experts only):
+ --source-path=PATH path to source code [$source_path]
+ --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
+ --enable-cross-compile assume a cross-compiler is used
+ --sysroot=PATH root of cross-build tree
+ --sysinclude=PATH location of cross-build system headers
+ --target-os=OS compiler targets OS [$target_os]
+ --target-exec=CMD command to run executables on target
+ --target-path=DIR path to view of build directory on target
+ --nm=NM use nm tool
+ --as=AS use assembler AS [$as_default]
+ --cc=CC use C compiler CC [$cc_default]
+ --ld=LD use linker LD
+ --host-cc=HOSTCC use host C compiler HOSTCC
+ --host-cflags=HCFLAGS use HCFLAGS when compiling for host
+ --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
+ --host-libs=HLIBS use libs HLIBS when linking for host
+ --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
+ --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
+ --extra-libs=ELIBS add ELIBS [$ELIBS]
+ --extra-version=STRING version string suffix []
+ --build-suffix=SUFFIX library name suffix []
+ --arch=ARCH select architecture [$arch]
+ --cpu=CPU select the minimum required CPU (affects
+ instruction selection, may crash on older CPUs)
+ --enable-powerpc-perf enable performance report on PPC
+ (requires enabling PMC)
+ --disable-altivec disable AltiVec optimizations
+ --disable-amd3dnow disable 3DNow! optimizations
+ --disable-amd3dnowext disable 3DNow! extended optimizations
+ --disable-mmx disable MMX optimizations
+ --disable-mmx2 disable MMX2 optimizations
+ --disable-sse disable SSE optimizations
+ --disable-ssse3 disable SSSE3 optimizations
+ --disable-armv5te disable armv5te optimizations
+ --disable-armv6 disable armv6 optimizations
+ --disable-armv6t2 disable armv6t2 optimizations
+ --disable-armvfp disable ARM VFP optimizations
+ --disable-iwmmxt disable iwmmxt optimizations
+ --disable-mmi disable MMI optimizations
+ --disable-neon disable neon optimizations
+ --disable-vis disable VIS optimizations
+ --disable-yasm disable use of yasm assembler
+ --enable-pic build position-independent code
+
+Developer options (useful when working on FFmpeg itself):
+ --disable-debug disable debugging symbols
+ --enable-debug=LEVEL set the debug level [$debuglevel]
+ --enable-gprof enable profiling with gprof [$gprof]
+ --disable-optimizations disable compiler optimizations
+ --enable-extra-warnings enable more compiler warnings
+ --disable-stripping disable stripping of executables and shared libraries
+
+NOTE: Object files are built at the place where configure is launched.
+EOF
exit 0
}
@@ -777,6 +781,20 @@ check_foo_config(){
return $err
}
+check_host_cc(){
+ log check_host_cc "$@"
+ cat > $TMPC
+ log_file $TMPC
+ check_cmd $host_cc $host_cflags "$@" -c -o $TMPO $TMPC
+}
+
+check_host_cflags(){
+ log check_host_cflags "$@"
+ check_host_cc "$@" <<EOF && append host_cflags "$@"
+int x;
+EOF
+}
+
apply(){
file=$1
shift
@@ -808,6 +826,7 @@ CONFIG_LIST="
avisynth
beos_netserver
bzlib
+ doc
fastdiv
ffmpeg
ffplay
@@ -836,6 +855,7 @@ CONFIG_LIST="
libvorbis
libx264
libxvid
+ lpc
mdct
memalign_hack
mlib
@@ -1066,6 +1086,7 @@ inline_asm_deps="!tms470"
aac_decoder_select="fft mdct"
aac_encoder_select="fft mdct"
ac3_decoder_select="fft mdct"
+alac_encoder_select="lpc"
atrac3_decoder_select="fft mdct"
cavs_decoder_select="golomb"
cook_decoder_select="fft mdct"
@@ -1079,7 +1100,7 @@ eatgq_decoder_select="aandct"
eatqi_decoder_select="aandct"
ffv1_decoder_select="golomb"
flac_decoder_select="golomb"
-flac_encoder_select="golomb"
+flac_encoder_select="golomb lpc"
flashsv_decoder_select="zlib"
flashsv_encoder_select="zlib"
flv_encoder_select="h263_encoder"
@@ -1110,6 +1131,8 @@ mpeg2_vaapi_hwaccel_deps="va_va_h"
mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
mpeg4_vaapi_hwaccel_deps="va_va_h"
mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"
+mpeg4_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
+mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder"
mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
mpeg_xvmc_decoder_select="mpegvideo_decoder"
msmpeg4v1_encoder_select="h263_encoder"
@@ -1200,7 +1223,6 @@ mp4_muxer_select="mov_muxer"
mpegtsraw_demuxer_select="mpegts_demuxer"
mxf_d10_muxer_select="mxf_muxer"
psp_muxer_select="mov_muxer"
-redir_demuxer_deps="network"
rtp_muxer_deps="network rtp_protocol"
rtsp_demuxer_deps="sdp_demuxer"
sdp_demuxer_deps="rtp_protocol mpegts_demuxer"
@@ -1229,7 +1251,7 @@ v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
vfwcap_indev_deps="capCreateCaptureWindow"
vfwcap_indev_extralibs="-lvfw32"
x11_grab_device_indev_deps="x11grab XShmCreateImage"
-x11_grab_device_indev_extralibs="-lX11 -lXext"
+x11_grab_device_indev_extralibs="-lX11 -lXext -lXfixes"
# protocols
gopher_protocol_deps="network"
@@ -1247,6 +1269,7 @@ ffplay_deps="sdl"
ffserver_deps="ffm_muxer rtp_protocol rtsp_demuxer"
ffserver_extralibs='$ldl'
+doc_deps="texi2html"
# default parameters
@@ -1283,6 +1306,7 @@ host_os=$target_os
# configurable options
enable debug
+enable doc
enable fastdiv
enable ffmpeg
enable ffplay
@@ -1312,7 +1336,7 @@ LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
CC_O='-o $@'
-host_cflags='-O3 -g -Wall'
+host_cflags='-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -O3 -g -Wall'
host_libs='-lm'
target_path='.'
@@ -1589,6 +1613,51 @@ elif $cc -version 2>/dev/null | grep -q TMS470; then
esac
done
}
+elif $cc -v 2>&1 | grep -q clang; then
+ cc_type=clang
+ cc_version=__VERSION__
+ CC_DEPFLAGS='-MMD'
+ AS_DEPFLAGS='-MMD'
+elif $cc -V 2>&1 | grep -q Sun; then
+ cc_type=suncc
+ cc_version="AV_STRINGIFY(__SUNPRO_C)"
+ DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
+ DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1'
+ filter_cflags=suncc_flags
+ suncc_flags(){
+ for flag; do
+ case $flag in
+ -march=*|-mcpu=*)
+ case "${flag#*=}" in
+ native) echo -xtarget=native ;;
+ v9) echo -xarch=sparc ;;
+ ultrasparc) echo -xarch=sparcvis ;;
+ ultrasparc3|niagara*) echo -xarch=sparcvis2 ;;
+ i586|pentium) echo -xchip=pentium ;;
+ i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
+ pentium3*|c3-2) echo -xtarget=pentium3 ;;
+ pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
+ pentium4*) echo -xtarget=pentium4 ;;
+ prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
+ *-sse3) echo -xarch=sse3 ;;
+ core2) echo -xarch=ssse3 -xchip=core2 ;;
+ amdfam10|barcelona) echo -xarch=sse4_1 ;;
+ athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
+ k8|opteron|athlon64|athlon-fx)
+ echo -xarch=sse2a ;;
+ athlon*) echo -xarch=pentium_proa ;;
+ esac
+ ;;
+ -std=c99) echo -xc99 ;;
+ -fomit-frame-pointer) echo -xregs=frameptr ;;
+ -fPIC) echo -KPIC -xcode=pic32 ;;
+ -Os) echo -O5 -xspace ;;
+ -W*,*) echo $flag ;;
+ -f*-*|-W*) ;;
+ *) echo $flag ;;
+ esac
+ done
+ }
fi
test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc"
@@ -1614,6 +1683,10 @@ if test -n "$sysroot"; then
add_cppflags -I"$sysinclude"
add_ldflags --sysroot="$sysroot"
;;
+ clang)
+ add_cppflags -isysroot="$sysroot"
+ add_ldflags -isysroot="$sysroot"
+ ;;
esac
fi
@@ -1666,7 +1739,7 @@ case $cpu in
disable cmov
;;
# targets that do support conditional mov (cmov)
- i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2)
+ i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2|amdfam10)
cpuflags="-march=$cpu"
enable cmov
enable fast_cmov
@@ -1751,6 +1824,8 @@ check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
#include <stdlib.h>
EOF
+check_host_cflags -std=c99
+
case "$arch" in
alpha)
arch="alpha"
@@ -1770,6 +1845,8 @@ case "$arch" in
arch="ia64"
enable fast_64bit
spic=$shared
+ # HACK: currently fails to build if .bss is > 4MB and shared libs are built
+ enabled shared && enable_weak hardcoded_tables
;;
m68k)
arch="m68k"
@@ -1824,7 +1901,7 @@ case "$arch" in
subarch="x86_32"
enable fast_unaligned
check_cc <<EOF && enable fast_64bit && subarch="x86_64" && spic=$shared
- int test[sizeof(char*) - 7];
+ int test[(int)sizeof(char*) - 7];
EOF
if test "$subarch" = "x86_64"; then
enable cmov
@@ -1838,14 +1915,12 @@ esac
enable $arch $subarch
enabled spic && enable pic
+check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic
# OS specific
case $target_os in
beos|haiku|zeta)
prefix_default="$HOME/config"
- # helps building libavcodec
- add_cppflags -DPIC
- add_cflags -fomit-frame-pointer
# 3 gcc releases known for BeOS, each with ugly bugs
gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
case "$gcc_version" in
@@ -1871,6 +1946,7 @@ case $target_os in
sunos)
FFSERVERLDFLAGS=""
SHFLAGS='-shared -Wl,-h,$$(@F)'
+ enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
network_extralibs="-lsocket -lnsl"
add_cppflags -D__EXTENSIONS__
;;
@@ -1880,6 +1956,11 @@ case $target_os in
;;
openbsd)
enable malloc_aligned
+ # On OpenBSD 4.5. the compiler does not use PIC unless
+ # explicitly using -fPIC. FFmpeg builds fine without PIC,
+ # however the generated executable will not do anything
+ # (simply quits with exit-code 1, no crash, no output).
+ # Thus explicitly enable PIC here.
enable pic
SHFLAGS='-shared'
oss_indev_extralibs="-lossaudio"
@@ -2059,11 +2140,14 @@ check_deps $ARCH_EXT_LIST
disabled optimizations || check_cflags -fomit-frame-pointer
-if enabled pic; then
+enable_pic() {
+ enable pic
add_cppflags -DPIC
add_cflags -fPIC
add_asflags -fPIC
-fi
+}
+
+enabled pic && enable_pic
check_cc <<EOF || die "Symbol mangling check failed."
int ff_extern;
@@ -2110,6 +2194,8 @@ EOF
enabled iwmmxt && check_asm iwmmxt '"wunpckelub wr6, wr4"'
enabled neon && check_asm neon '"vadd.i16 q0, q0, q0"'
+ enabled_all armv6t2 shared !pic && enable_pic
+
elif enabled mips; then
check_asm loongson '"dmult.g $1, $2, $3"'
@@ -2119,7 +2205,7 @@ elif enabled ppc; then
check_asm dcbzl '"dcbzl 0, 1"'
check_asm ppc4xx '"maclhw r10, r11, r12"'
- check_asm xform_asm '"lwzx 0, %y0" :: "Z"(*(int*)0)'
+ check_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
# AltiVec flags: The FSF version of GCC differs from the Apple version
if enabled altivec; then
@@ -2187,11 +2273,10 @@ EOF
YASMFLAGS="-f $objformat -DARCH_$(toupper $subarch)"
enabled x86_64 && append YASMFLAGS "-m amd64"
- enabled_all x86_64 shared && append YASMFLAGS "-DPIC"
+ enabled pic && append YASMFLAGS "-DPIC"
+ test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
case "$objformat" in
elf) enabled debug && append YASMFLAGS "-g dwarf2" ;;
- macho64) append YASMFLAGS "-DPIC -DPREFIX" ;;
- *) append YASMFLAGS "-DPREFIX" ;;
esac
disabled yasm || { check_yasm "pabsw xmm0, xmm0" && enable yasm; }
@@ -2292,11 +2377,11 @@ enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg
enabled libschroedinger && add_cflags $(pkg-config --cflags schroedinger-1.0) &&
require libschroedinger schroedinger/schro.h schro_init $(pkg-config --libs schroedinger-1.0)
enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex
-enabled libtheora && require libtheora theora/theora.h theora_info_init -ltheora -logg
+enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 -lm &&
- { check_cpp_condition x264.h "X264_BUILD >= 76" ||
- die "ERROR: libx264 version must be >= 0.76."; }
+ { check_cpp_condition x264.h "X264_BUILD >= 79" ||
+ die "ERROR: libx264 version must be >= 0.79."; }
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
@@ -2314,8 +2399,9 @@ disable sdl
SDL_CONFIG="${cross_prefix}sdl-config"
if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
sdl_cflags=$("${SDL_CONFIG}" --cflags)
+ sdl_libs=$("${SDL_CONFIG}" --libs)
temp_cflags $sdl_cflags
- temp_extralibs $("${SDL_CONFIG}" --libs)
+ temp_extralibs $sdl_libs
if check_lib2 SDL.h SDL_Init; then
_sdlversion=$("${SDL_CONFIG}" --version | sed 's/[^0-9]//g')
if test "$_sdlversion" -lt 121 ; then
@@ -2392,8 +2478,15 @@ enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack
enabled x11grab &&
check_header X11/Xlib.h &&
check_header X11/extensions/XShm.h &&
+check_header X11/extensions/Xfixes.h &&
check_func XOpenDisplay -lX11 &&
-check_func XShmCreateImage -lX11 -lXext
+check_func XShmCreateImage -lX11 -lXext &&
+check_func XFixesGetCursorImage -lX11 -lXext -lXfixes
+
+check_cpp_condition \
+ vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
+ { echolog "Please upgrade to libvdpau >= 0.2 if you would like vdpau support." &&
+ disable vdpau; }
enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
@@ -2424,6 +2517,8 @@ elif enabled optimizations; then
if enabled xlc; then
add_cflags -O5
add_ldflags -O5
+ elif enabled suncc; then
+ add_cflags -O5
elif enabled ccc; then
add_cflags -fast
else
@@ -2458,6 +2553,8 @@ elif enabled ccc; then
add_cflags -msg_disable unreachcode
elif enabled gcc; then
check_cflags -fno-tree-vectorize
+elif enabled clang; then
+ check_cflags -Qunused-arguments
fi
if enabled gprof; then
@@ -2608,70 +2705,67 @@ echo "License: $license"
echo "Creating config.mak and config.h..."
-echo "# Automatically generated by configure - do not modify!" > config.mak
-echo "ifndef FFMPEG_CONFIG_MAK" >> config.mak
-echo "FFMPEG_CONFIG_MAK=1" >> config.mak
-
-echo "FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION" >> config.mak
-echo "prefix=$prefix" >> config.mak
-echo "LIBDIR=\$(DESTDIR)$libdir" >> config.mak
-echo "SHLIBDIR=\$(DESTDIR)$shlibdir" >> config.mak
-echo "INCDIR=\$(DESTDIR)$incdir" >> config.mak
-echo "BINDIR=\$(DESTDIR)$bindir" >> config.mak
-echo "DATADIR=\$(DESTDIR)$datadir" >> config.mak
-echo "MANDIR=\$(DESTDIR)$mandir" >> config.mak
-echo "SRC_PATH=\"$source_path\"" >> config.mak
-echo "SRC_PATH_BARE=$source_path" >> config.mak
-echo "BUILD_ROOT=\"$PWD\"" >> config.mak
-echo "CC=$cc" >> config.mak
-echo "AS=$as" >> config.mak
-echo "LD=$ld" >> config.mak
-echo "DEPCC=$dep_cc" >> config.mak
-echo "YASM=$yasmexe" >> config.mak
-echo "AR=$ar" >> config.mak
-echo "RANLIB=$ranlib" >> config.mak
-echo "LN_S=$ln_s" >> config.mak
-enabled stripping &&
- echo "STRIP=$strip" >> config.mak ||
- echo "STRIP=echo ignoring strip" >> config.mak
-
-echo "CPPFLAGS=$CPPFLAGS" >> config.mak
-echo "CFLAGS=$CFLAGS" >> config.mak
-echo "ASFLAGS=$ASFLAGS" >> config.mak
-echo "CC_O=$CC_O" >> config.mak
-echo "LDFLAGS=$LDFLAGS" >> config.mak
-echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak
-echo "SHFLAGS=$SHFLAGS" >> config.mak
-echo "YASMFLAGS=$YASMFLAGS" >> config.mak
-echo "BUILDSUF=$build_suffix" >> config.mak
-echo "FULLNAME=$FULLNAME" >> config.mak
-echo "LIBPREF=$LIBPREF" >> config.mak
-echo "LIBSUF=$LIBSUF" >> config.mak
-echo "LIBNAME=$LIBNAME" >> config.mak
-echo "SLIBPREF=$SLIBPREF" >> config.mak
-echo "SLIBSUF=$SLIBSUF" >> config.mak
-echo "EXESUF=$EXESUF" >> config.mak
-echo "EXTRA_VERSION=$extra_version" >> config.mak
-echo "DEPFLAGS=$DEPFLAGS" >> config.mak
-echo "CCDEP=$CCDEP" >> config.mak
-echo "ASDEP=$ASDEP" >> config.mak
-echo "CC_DEPFLAGS=$CC_DEPFLAGS" >> config.mak
-echo "AS_DEPFLAGS=$AS_DEPFLAGS" >> config.mak
-echo "HOSTCC=$host_cc" >> config.mak
-echo "HOSTCFLAGS=$host_cflags" >> config.mak
-echo "HOSTEXESUF=$HOSTEXESUF" >> config.mak
-echo "HOSTLDFLAGS=$host_ldflags" >> config.mak
-echo "HOSTLIBS=$host_libs" >> config.mak
-echo "TARGET_EXEC=$target_exec" >> config.mak
-echo "TARGET_PATH=$target_path" >> config.mak
-
-if enabled sdl; then
- echo "SDL_LIBS=$("${SDL_CONFIG}" --libs)" >> config.mak
- echo "SDL_CFLAGS=$("${SDL_CONFIG}" --cflags)" >> config.mak
-fi
-if enabled texi2html; then
- echo "BUILD_DOC=yes" >> config.mak
-fi
+enabled stripping || strip="echo skipping strip"
+
+cat > config.mak <<EOF
+# Automatically generated by configure - do not modify!
+ifndef FFMPEG_CONFIG_MAK
+FFMPEG_CONFIG_MAK=1
+FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
+prefix=$prefix
+LIBDIR=\$(DESTDIR)$libdir
+SHLIBDIR=\$(DESTDIR)$shlibdir
+INCDIR=\$(DESTDIR)$incdir
+BINDIR=\$(DESTDIR)$bindir
+DATADIR=\$(DESTDIR)$datadir
+MANDIR=\$(DESTDIR)$mandir
+SRC_PATH="$source_path"
+SRC_PATH_BARE=$source_path
+BUILD_ROOT="$PWD"
+ARCH=$arch
+CC=$cc
+AS=$as
+LD=$ld
+DEPCC=$dep_cc
+YASM=$yasmexe
+AR=$ar
+RANLIB=$ranlib
+LN_S=$ln_s
+STRIP=$strip
+CPPFLAGS=$CPPFLAGS
+CFLAGS=$CFLAGS
+ASFLAGS=$ASFLAGS
+CC_O=$CC_O
+LDFLAGS=$LDFLAGS
+FFSERVERLDFLAGS=$FFSERVERLDFLAGS
+SHFLAGS=$SHFLAGS
+YASMFLAGS=$YASMFLAGS
+BUILDSUF=$build_suffix
+FULLNAME=$FULLNAME
+LIBPREF=$LIBPREF
+LIBSUF=$LIBSUF
+LIBNAME=$LIBNAME
+SLIBPREF=$SLIBPREF
+SLIBSUF=$SLIBSUF
+EXESUF=$EXESUF
+EXTRA_VERSION=$extra_version
+DEPFLAGS=$DEPFLAGS
+CCDEP=$CCDEP
+ASDEP=$ASDEP
+CC_DEPFLAGS=$CC_DEPFLAGS
+AS_DEPFLAGS=$AS_DEPFLAGS
+HOSTCC=$host_cc
+HOSTCFLAGS=$host_cflags
+HOSTEXESUF=$HOSTEXESUF
+HOSTLDFLAGS=$host_ldflags
+HOSTLIBS=$host_libs
+TARGET_EXEC=$target_exec
+TARGET_PATH=$target_path
+SDL_LIBS=$sdl_libs
+SDL_CFLAGS=$sdl_cflags
+LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
+EXTRALIBS=$extralibs
+EOF
get_version(){
name=$1
@@ -2691,45 +2785,38 @@ get_version LIBAVFORMAT libavformat/avformat.h
get_version LIBAVUTIL libavutil/avutil.h
get_version LIBAVFILTER libavfilter/avfilter.h
-if enabled shared; then
- echo "LIBTARGET=${LIBTARGET}" >> config.mak
- echo "SLIBNAME=${SLIBNAME}" >> config.mak
- echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
- echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
- echo "SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}" >> config.mak
- echo "SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}" >> config.mak
- echo "SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}" >> config.mak
- echo "SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}" >> config.mak
-fi
-echo "LIB_INSTALL_EXTRA_CMD=${LIB_INSTALL_EXTRA_CMD}" >> config.mak
-echo "EXTRALIBS=$extralibs" >> config.mak
-
-echo "ARCH=$arch" >> config.mak
-
-
-echo "/* Automatically generated by configure - do not modify! */" > $TMPH
-echo "#ifndef FFMPEG_CONFIG_H" >> $TMPH
-echo "#define FFMPEG_CONFIG_H" >> $TMPH
-echo "#define FFMPEG_CONFIGURATION \"$(c_escape $FFMPEG_CONFIGURATION)\"" >> $TMPH
-echo "#define FFMPEG_DATADIR \"$(eval c_escape $datadir)\"" >> $TMPH
+enabled shared && cat >> config.mak <<EOF
+LIBTARGET=${LIBTARGET}
+SLIBNAME=${SLIBNAME}
+SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
+SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
+SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
+SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
+SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}
+SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}
+EOF
-echo "#define CC_TYPE \"$cc_type\"" >> $TMPH
-echo "#define CC_VERSION $cc_version" >> $TMPH
-echo "#define restrict $_restrict" >> $TMPH
+enabled asmalign_pot || align_shift="1 <<"
+
+cat > $TMPH <<EOF
+/* Automatically generated by configure - do not modify! */
+#ifndef FFMPEG_CONFIG_H
+#define FFMPEG_CONFIG_H
+#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
+#define FFMPEG_LICENSE "$(c_escape $license)"
+#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
+#define CC_TYPE "$cc_type"
+#define CC_VERSION $cc_version
+#define restrict $_restrict
+#define ASMALIGN(ZEROBITS) ".align $align_shift " #ZEROBITS "\\n\\t"
+#define EXTERN_PREFIX "${extern_prefix}"
+#define EXTERN_ASM ${extern_prefix}
+EOF
if enabled small || disabled optimizations; then
echo "#define av_always_inline" >> $TMPH
fi
-
-# Apparently it's not possible to portably echo a backslash.
-enabled asmalign_pot &&
- printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH ||
- printf '#define ASMALIGN(ZEROBITS) ".align 1 << " #ZEROBITS "\\n\\t"\n' >> $TMPH
-
-echo "#define EXTERN_PREFIX \"${extern_prefix}\"" >> $TMPH
-echo "#define EXTERN_ASM ${extern_prefix}" >> $TMPH
-
print_config ARCH_ $TMPH config.mak $ARCH_LIST
print_config HAVE_ $TMPH config.mak $HAVE_LIST
print_config CONFIG_ $TMPH config.mak $CONFIG_LIST \
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/APIchanges b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/APIchanges
index 9434d55d5c..69878b3ed4 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/APIchanges
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/APIchanges
@@ -3,7 +3,7 @@ the last major version increase.
The last version increases were:
libavcodec: ?
libavdevice: ?
-libavfilter: ?
+libavfilter: 2009-10-18
libavformat: ?
libpostproc: ?
libswscale: ?
@@ -12,6 +12,53 @@ libavutil: 2009-03-08
API changes, most recent first:
+2009-12-13 - r20834 - lavf 52.43.0 - metadata API
+ add av_metadata_set2(), AV_METADATA_DONT_STRDUP_KEY and AV_METADATA_DONT_STRDUP_VAL
+
+2009-12-13 - r20829 - lavu 50.7.0 - avstring.h API
+ add av_d2str()
+
+2009-12-13 - r20826 - lavc 52.42.0 - AVStream
+ add avg_frame_rate
+
+2009-12-12 - r20808 - lavu 50.6.0 - av_bmg_next()
+ Introduce the av_bmg_next() function.
+
+2009-12-05 - r20734 - lavfi 1.12.0 - avfilter_draw_slice()
+ Add a slice_dir parameter to avfilter_draw_slice().
+
+2009-11-26 - r20611 - lavfi 1.11.0 - AVFilter
+ Remove the next field from AVFilter, this is not anymore required.
+
+2009-11-25 - r20607 - lavfi 1.10.0 - avfilter_next()
+ Introduce the avfilter_next() function.
+
+2009-11-25 - r20605 - lavfi 1.9.0 - avfilter_register()
+ Change the signature of avfilter_register() to make it return an
+ int. This is required since now the registration operation may fail.
+
+2009-11-25 - r20603 - lavu 50.5.0 - pixdesc.h API
+ Make the pixdesc.h API public.
+
+2009-10-27 - r20385 - lavfi 1.5.0 - AVFilter.next
+ Add a next field to AVFilter, this is used for simplifying the
+ registration and management of the registered filters.
+
+2009-10-23 - r20356 - lavfi 1.4.1 - AVFilter.description
+ Add a description field to AVFilter.
+
+2009-10-19 - r20302 - lavfi 1.3.0 - avfilter_make_format_list()
+ Change the interface of avfilter_make_format_list() from
+ avfilter_make_format_list(int n, ...) to
+ avfilter_make_format_list(enum PixelFormat *pix_fmts).
+
+2009-10-18 - r20272 - lavfi 1.0.0 - avfilter_get_video_buffer()
+ Make avfilter_get_video_buffer() recursive and add the w and h
+ parameters to it.
+
+2009-10-07 - r20189 - lavfi 0.5.1 - AVFilterPic
+ Added w and h fields to AVFilterPic.
+
2009-06-22 - r19250 - lavf 52.34.1 - AVFormatContext.packet_size
This is now an unsigned int instead of a signed int.
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/developer.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/developer.texi
index f84885d3af..983f2fdd5b 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/developer.texi
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/developer.texi
@@ -252,6 +252,9 @@ keeping it as a logical unit that contains an individual change, even
if it spans multiple files. This makes reviewing your patches much easier
for us and greatly increases your chances of getting your patch applied.
+Use the patcheck tool of FFmpeg to check your patch.
+The tool is located in the tools directory.
+
Run the regression tests before submitting a patch so that you can
verify that there are no big problems.
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/faq.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/faq.texi
index 0d923a48e0..97fa3931cd 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/faq.texi
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/faq.texi
@@ -176,14 +176,6 @@ quite logical that there is a small reduction of quality. This is not a bug.
Use @file{-} as file name.
-@section Why does FFmpeg not decode audio in VOB files?
-
-The audio is AC-3 (a.k.a. A/52). AC-3 decoding is an optional component in FFmpeg
-as the component that handles AC-3 decoding is currently released under the GPL.
-Enable AC-3 decoding with @code{./configure --enable-gpl}. Take care: By
-enabling AC-3, you automatically change the license of libavcodec from
-LGPL to GPL.
-
@section Why does the chrominance data seem to be sampled at a different time from the luminance data on bt8x8 captures on Linux?
This is a well-known bug in the bt8x8 driver. For 2.4.26 there is a patch at
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffmpeg-doc.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffmpeg-doc.texi
index b6706f4c50..a0ab60d448 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffmpeg-doc.texi
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffmpeg-doc.texi
@@ -235,9 +235,20 @@ Show help.
Show version.
@item -formats
-Show available formats, codecs, bitstream filters, protocols, and frame size and frame rate abbreviations.
+Show available formats.
-The fields preceding the format and codec names have the following meanings:
+The fields preceding the format names have the following meanings:
+@table @samp
+@item D
+Decoding available
+@item E
+Encoding available
+@end table
+
+@item -codecs
+Show available codecs.
+
+The fields preceding the codec names have the following meanings:
@table @samp
@item D
Decoding available
@@ -253,6 +264,15 @@ Codec supports direct rendering
Codec can handle input truncated at random locations instead of only at frame boundaries
@end table
+@item -bsfs
+Show available bitstream filters.
+
+@item -protocols
+Show available protocols.
+
+@item -filters
+Show available libavfilter filters.
+
@item -f @var{fmt}
Force format.
@@ -485,6 +505,9 @@ stream.
@item -newvideo
Add a new video stream to the current output stream.
+@item -vlang @var{code}
+Set the ISO 639 language code (3 letters) of the current video stream.
+
@end table
@section Advanced Video Options
@@ -816,13 +839,17 @@ awkward to specify on the command line. Lines starting with the hash
('#') character are ignored and are used to provide comments. Check
the @file{ffpresets} directory in the FFmpeg source tree for examples.
-Preset files are specified with the @code{vpre}, @code{apre} and
-@code{spre} options. The options specified in a preset file are
+Preset files are specified with the @code{vpre}, @code{apre},
+@code{spre}, and @code{fpre} options. The @code{fpre} option takes the
+filename of the preset instead of a preset name as input and can be
+used for any kind of codec. For the @code{vpre}, @code{apre}, and
+@code{spre} options, the options specified in a preset file are
applied to the currently selected codec of the same type as the preset
option.
-The argument passed to the preset options identifies the preset file
-to use according to the following rules.
+The argument passed to the @code{vpre}, @code{apre}, and @code{spre}
+preset options identifies the preset file to use according to the
+following rules:
First ffmpeg searches for a file named @var{arg}.ffpreset in the
directories @file{$HOME/.ffmpeg}, and in the datadir defined at
@@ -837,11 +864,6 @@ the preset file options will be applied. For example, if you select
the video codec with @code{-vcodec libx264} and use @code{-vpre max},
then it will search for the file @file{libx264-max.ffpreset}.
-Finally, if the above rules failed and the argument specifies an
-absolute pathname, ffmpeg will search for that filename. This way you
-can specify the absolute and complete filename of the preset file, for
-example @file{./ffpresets/libx264-max.ffpreset}.
-
@anchor{FFmpeg formula evaluator}
@section FFmpeg formula evaluator
@@ -933,7 +955,7 @@ to standard output.
FFmpeg also handles many protocols specified with an URL syntax.
-Use 'ffmpeg -formats' to see a list of the supported protocols.
+Use 'ffmpeg -protocols' to see a list of the supported protocols.
The protocol @code{http:} is currently used only to communicate with
FFserver (see the FFserver documentation). When FFmpeg will be a
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffplay-doc.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffplay-doc.texi
index a92039653b..f7b8f87f33 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffplay-doc.texi
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffplay-doc.texi
@@ -36,7 +36,15 @@ Show version.
@item -L
Show license.
@item -formats
-Show available formats, codecs, protocols, ...
+Show available formats.
+@item -codecs
+Show available codecs.
+@item -bsfs
+Show available bitstream filters.
+@item -protocols
+Show available protocols.
+@item -filters
+Show available libavfilter filters.
@item -x @var{width}
Force displayed width.
@item -y @var{height}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffserver-doc.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffserver-doc.texi
index 0feface2e0..aabf33050b 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffserver-doc.texi
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffserver-doc.texi
@@ -242,7 +242,15 @@ Show version.
@item -L
Show license.
@item -formats
-Show available formats, codecs, protocols, ...
+Show available formats.
+@item -codecs
+Show available codecs.
+@item -bsfs
+Show available bitstream filters.
+@item -protocols
+Show available protocols.
+@item -filters
+Show available libavfilter filters.
@item -h
Show help.
@item -loglevel @var{loglevel}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/general.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/general.texi
index dc8620750a..2b53bcfb55 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/general.texi
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/general.texi
@@ -32,7 +32,7 @@ GPL components, GPL version 3) to use it.
@chapter Supported File Formats and Codecs
-You can use the @code{-formats} option to have an exhaustive list.
+You can use the @code{-formats} and @code{-codecs} options to have an exhaustive list.
@section File Formats
@@ -63,6 +63,8 @@ library:
@tab Used in the game Cyberia from Interplay.
@item Delphine Software International CIN @tab @tab X
@tab Multimedia format used by Delphine Software games.
+@item CD+G @tab @tab X
+ @tab Video format used by CD+G karaoke disks
@item Core Audio Format @tab @tab X
@tab Apple Core Audio Format
@item CRC testing format @tab X @tab
@@ -101,6 +103,8 @@ library:
@tab Interchange File Format
@item Interplay MVE @tab @tab X
@tab Format used in various Interplay computer games.
+@item IV8 @tab @tab X
+ @tab A format generated by IndigoVision 8000 video server.
@item LMLM4 @tab @tab X
@tab Used by Linux Media Labs MPEG-4 PCI boards
@item Matroska @tab X @tab X
@@ -199,7 +203,8 @@ library:
@item RL2 @tab @tab X
@tab Audio and video format used in some games by Entertainment Software Partners.
@item RPL/ARMovie @tab @tab X
-@item RTMP @tab @tab X
+@item RTMP @tab X @tab X
+ @tab Output is performed by publishing stream to RTMP server
@item RTP @tab @tab X
@item RTSP @tab @tab X
@item SDP @tab @tab X
@@ -326,6 +331,8 @@ following image formats are supported:
@tab Codec used in Cyberia game.
@item CamStudio @tab @tab X
@tab fourcc: CSCD
+@item CD+G @tab @tab X
+ @tab Video codec for CD+G karaoke disks
@item Chinese AVS video @tab @tab X
@tab AVS1-P2, JiZhun profile
@item Delphine Software International CIN video @tab @tab X
@@ -423,6 +430,7 @@ following image formats are supported:
@tab fourcc: 'smc '
@item QuickTime video (RPZA) @tab @tab X
@tab fourcc: rpza
+@item R210 Quicktime Uncompressed RGB 10-bit @tab @tab X
@item Raw Video @tab X @tab X
@item RealVideo 1.0 @tab X @tab X
@item RealVideo 2.0 @tab X @tab X
@@ -569,6 +577,7 @@ following image formats are supported:
@item MP2 (MPEG audio layer 2) @tab IX @tab IX
@item MP3 (MPEG audio layer 3) @tab E @tab IX
@tab encoding supported through external library LAME, ADU MP3 and MP3onMP4 also supported
+@item MPEG-4 Audio Lossless Coding (ALS) @tab @tab X
@item Musepack SV7 @tab @tab X
@item Musepack SV8 @tab @tab X
@item Nellymoser Asao @tab X @tab X
@@ -722,7 +731,7 @@ a GCC bug (see @url{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216}).
Within the MSYS shell, configure and make with:
@example
-./configure --enable-memalign-hack --extra-cflags=-fno-common
+./configure --enable-memalign-hack
make
make install
@end example
@@ -735,6 +744,12 @@ Notes:
@itemize
+@item Building natively using MSYS can be sped up by disabling implicit rules
+in the Makefile by calling @code{make -r} instead of plain @code{make}. This
+speed up is close to non-existent for normal one-off builds and is only
+noticeable when running make for a second time (for example in
+@code{make install}).
+
@item In order to compile FFplay, you must have the MinGW development library
of SDL. Get it from @url{http://www.libsdl.org}.
Edit the @file{bin/sdl-config} script so that it points to the correct prefix
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/libavfilter.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/libavfilter.texi
new file mode 100644
index 0000000000..0e473fdfee
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/libavfilter.texi
@@ -0,0 +1,200 @@
+\input texinfo @c -*- texinfo -*-
+
+@settitle Libavfilter Documentation
+@titlepage
+@sp 7
+@center @titlefont{Libavfilter Documentation}
+@sp 3
+@end titlepage
+
+
+@chapter Introduction
+
+Libavfilter is the filtering API of FFmpeg. It is the substitute of the
+now deprecated 'vhooks' and started as a Google Summer of Code project.
+
+Integrating libavfilter into the main FFmpeg repository is a work in
+progress. If you wish to try the unfinished development code of
+libavfilter then check it out from the libavfilter repository into
+some directory of your choice by:
+
+@example
+ svn checkout svn://svn.ffmpeg.org/soc/libavfilter
+@end example
+
+And then read the README file in the top directory to learn how to
+integrate it into ffmpeg and ffplay.
+
+But note that there may still be serious bugs in the code and its API
+and ABI should not be considered stable yet!
+
+@chapter Tutorial
+
+In libavfilter, it is possible for filters to have multiple inputs and
+multiple outputs.
+To illustrate the sorts of things that are possible, we can
+use a complex filter graph. For example, the following one:
+
+@example
+input --> split --> fifo -----------------------> overlay --> output
+ | ^
+ | |
+ +------> fifo --> crop --> vflip --------+
+@end example
+
+splits the stream in two streams, sends one stream through the crop filter
+and the vflip filter before merging it back with the other stream by
+overlaying it on top. You can use the following command to achieve this:
+
+@example
+./ffmpeg -i in.avi -s 240x320 -vfilters "[in] split [T1], fifo, [T2] overlay= 0:240 [out]; [T1] fifo, crop=0:0:-1:240, vflip [T2]
+@end example
+
+where input_video.avi has a vertical resolution of 480 pixels. The
+result will be that in output the top half of the video is mirrored
+onto the bottom half.
+
+Video filters are loaded using the @var{-vfilters} option passed to
+ffmpeg or to ffplay. Filters in the same linear chain are separated by
+commas. In our example, @var{split, fifo, overlay} are in one linear
+chain, and @var{fifo, crop, vflip} are in another. The points where
+the linear chains join are labeled by names enclosed in square
+brackets. In our example, that is @var{[T1]} and @var{[T2]}. The magic
+labels @var{[in]} and @var{[out]} are the points where video is input
+and output.
+
+Some filters take in input a list of parameters: they are specified
+after the filter name and an equal sign, and are separated each other
+by a semicolon.
+
+There exist so-called @var{source filters} that do not have a video
+input, and we expect in the future some @var{sink filters} that will
+not have video output.
+
+@chapter Available video filters
+
+When you configure your FFmpeg build, you can disable any of the
+existing video filters.
+The configure output will show the video filters included in your
+build.
+
+Below is a description of the currently available video filters.
+
+@section crop
+
+Crop the input video to x:y:width:height.
+
+@example
+./ffmpeg -i in.avi -vfilters "crop=0:0:0:240" out.avi
+@end example
+
+``x'' and ``y'' specify the position of the top-left corner of the
+output (non-cropped) area.
+
+The default value of ``x'' and ``y'' is 0.
+
+The ``width'' and ``height'' parameters specify the width and height
+of the output (non-cropped) area.
+
+A value of 0 is interpreted as the maximum possible size contained in
+the area delimited by the top-left corner at position x:y.
+
+For example the parameters:
+
+@example
+"crop=100:100:0:0"
+@end example
+
+will delimit the rectangle with the top-left corner placed at position
+100:100 and the right-bottom corner corresponding to the right-bottom
+corner of the input image.
+
+The default value of ``width'' and ``height'' is 0.
+
+@section format
+
+Convert the input video to one of the specified pixel formats.
+Libavfilter will try to pick one that is supported for the input to
+the next filter.
+
+The filter accepts a list of pixel format names, separated by ``:'',
+for example ``yuv420p:monow:rgb24''.
+
+The following command:
+
+@example
+./ffmpeg -i in.avi -vfilters "format=yuv420p" out.avi
+@end example
+
+will convert the input video to the format ``yuv420p''.
+
+@section noformat
+
+Force libavfilter not to use any of the specified pixel formats for the
+input to the next filter.
+
+The filter accepts a list of pixel format names, separated by ``:'',
+for example ``yuv420p:monow:rgb24''.
+
+The following command:
+
+@example
+./ffmpeg -i in.avi -vfilters "noformat=yuv420p, vflip" out.avi
+@end example
+
+will make libavfilter use a format different from ``yuv420p'' for the
+input to the vflip filter.
+
+@section null
+
+Pass the source unchanged to the output.
+
+@section scale
+
+Scale the input video to width:height and/or convert the image format.
+
+For example the command:
+
+@example
+./ffmpeg -i in.avi -vfilters "scale=200:100" out.avi
+@end example
+
+will scale the input video to a size of 200x100.
+
+If the input image format is different from the format requested by
+the next filter, the scale filter will convert the input to the
+requested format.
+
+If the value for ``width'' or ``height'' is 0, the respective input
+size is used for the output.
+
+If the value for ``width'' or ``height'' is -1, the scale filter will
+use, for the respective output size, a value that maintains the aspect
+ratio of the input image.
+
+The default value of ``width'' and ``height'' is 0.
+
+@section slicify
+
+Pass the images of input video on to next video filter as multiple
+slices.
+
+@example
+./ffmpeg -i in.avi -vfilters "slicify=32" out.avi
+@end example
+
+The filter accepts the slice height as parameter. If the parameter is
+not specified it will use the default value of 16.
+
+Adding this in the beginning of filter chains should make filtering
+faster due to better use of the memory cache.
+
+@section vflip
+
+Flip the input video vertically.
+
+@example
+./ffmpeg -i in.avi -vfilters "vflip" out.avi
+@end example
+
+@bye
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffmpeg.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffmpeg.c
index 2988419267..401b8bb29d 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffmpeg.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffmpeg.c
@@ -91,6 +91,7 @@ static const OptionDef options[];
#define MAX_FILES 20
+static const char *last_asked_format = NULL;
static AVFormatContext *input_files[MAX_FILES];
static int64_t input_files_ts_offset[MAX_FILES];
static double input_files_ts_scale[MAX_FILES][MAX_STREAMS];
@@ -109,8 +110,6 @@ static int nb_stream_maps;
static AVMetaDataMap meta_data_maps[MAX_FILES];
static int nb_meta_data_maps;
-static AVInputFormat *file_iformat;
-static AVOutputFormat *file_oformat;
static int frame_width = 0;
static int frame_height = 0;
static float frame_aspect_ratio = 0;
@@ -135,6 +134,7 @@ static int video_disable = 0;
static int video_discard = 0;
static char *video_codec_name = NULL;
static int video_codec_tag = 0;
+static char *video_language = NULL;
static int same_quality = 0;
static int do_deinterlace = 0;
static int top_field_first = -1;
@@ -220,7 +220,7 @@ static int64_t timer_start;
static uint8_t *audio_buf;
static uint8_t *audio_out;
-static uint8_t *audio_out2;
+unsigned int allocated_audio_out_size, allocated_audio_buf_size;
static short *samples;
@@ -451,7 +451,7 @@ static int av_exit(int ret)
av_free(sws_opts);
av_free(audio_buf);
av_free(audio_out);
- av_free(audio_out2);
+ allocated_audio_buf_size= allocated_audio_out_size= 0;
av_free(samples);
if (received_sigterm) {
@@ -558,21 +558,36 @@ static void do_audio_out(AVFormatContext *s,
unsigned char *buf, int size)
{
uint8_t *buftmp;
- const int audio_out_size= 4*MAX_AUDIO_PACKET_SIZE;
+ int64_t audio_out_size, audio_buf_size;
int size_out, frame_bytes, ret;
AVCodecContext *enc= ost->st->codec;
AVCodecContext *dec= ist->st->codec;
int osize= av_get_bits_per_sample_format(enc->sample_fmt)/8;
int isize= av_get_bits_per_sample_format(dec->sample_fmt)/8;
+ const int coded_bps = av_get_bits_per_sample(enc->codec->id);
- /* SC: dynamic allocation of buffers */
- if (!audio_buf)
- audio_buf = av_malloc(2*MAX_AUDIO_PACKET_SIZE);
- if (!audio_out)
- audio_out = av_malloc(audio_out_size);
- if (!audio_buf || !audio_out)
- return; /* Should signal an error ! */
+ audio_buf_size= (size + isize*dec->channels - 1) / (isize*dec->channels);
+ audio_buf_size= (audio_buf_size*enc->sample_rate + dec->sample_rate) / dec->sample_rate;
+ audio_buf_size= audio_buf_size*2 + 10000; //safety factors for the deprecated resampling API
+ audio_buf_size*= osize*enc->channels;
+
+ audio_out_size= FFMAX(audio_buf_size, enc->frame_size * osize * enc->channels);
+ if(coded_bps > 8*osize)
+ audio_out_size= audio_out_size * coded_bps / (8*osize);
+ audio_out_size += FF_MIN_BUFFER_SIZE;
+
+ if(audio_out_size > INT_MAX || audio_buf_size > INT_MAX){
+ fprintf(stderr, "Buffer sizes too large\n");
+ av_exit(1);
+ }
+
+ av_fast_malloc(&audio_buf, &allocated_audio_buf_size, audio_buf_size);
+ av_fast_malloc(&audio_out, &allocated_audio_out_size, audio_out_size);
+ if (!audio_buf || !audio_out){
+ fprintf(stderr, "Out of memory in do_audio_out\n");
+ av_exit(1);
+ }
if (enc->channels != dec->channels)
ost->audio_resample = 1;
@@ -595,10 +610,6 @@ static void do_audio_out(AVFormatContext *s,
#define MAKE_SFMT_PAIR(a,b) ((a)+SAMPLE_FMT_NB*(b))
if (!ost->audio_resample && dec->sample_fmt!=enc->sample_fmt &&
MAKE_SFMT_PAIR(enc->sample_fmt,dec->sample_fmt)!=ost->reformat_pair) {
- if (!audio_out2)
- audio_out2 = av_malloc(audio_out_size);
- if (!audio_out2)
- av_exit(1);
if (ost->reformat_ctx)
av_audio_convert_free(ost->reformat_ctx);
ost->reformat_ctx = av_audio_convert_alloc(enc->sample_fmt, 1,
@@ -672,7 +683,7 @@ static void do_audio_out(AVFormatContext *s,
if (!ost->audio_resample && dec->sample_fmt!=enc->sample_fmt) {
const void *ibuf[6]= {buftmp};
- void *obuf[6]= {audio_out2};
+ void *obuf[6]= {audio_buf};
int istride[6]= {isize};
int ostride[6]= {osize};
int len= size_out/istride[0];
@@ -682,7 +693,7 @@ static void do_audio_out(AVFormatContext *s,
av_exit(1);
return;
}
- buftmp = audio_out2;
+ buftmp = audio_buf;
size_out = len*osize;
}
@@ -724,7 +735,6 @@ static void do_audio_out(AVFormatContext *s,
}
} else {
AVPacket pkt;
- int coded_bps = av_get_bits_per_sample(enc->codec->id)/8;
av_init_packet(&pkt);
ost->sync_opts += size_out / (osize * enc->channels);
@@ -733,7 +743,12 @@ static void do_audio_out(AVFormatContext *s,
/* determine the size of the coded buffer */
size_out /= osize;
if (coded_bps)
- size_out *= coded_bps;
+ size_out = size_out*coded_bps/8;
+
+ if(size_out > audio_out_size){
+ fprintf(stderr, "Internal error, buffer size too small\n");
+ av_exit(1);
+ }
//FIXME pass ost->sync_opts as AVFrame.pts in avcodec_encode_audio()
ret = avcodec_encode_audio(enc, audio_out, size_out,
@@ -884,7 +899,7 @@ static void do_video_out(AVFormatContext *s,
*frame_size = 0;
- if(video_sync_method>0 || (video_sync_method && av_q2d(enc->time_base) > 0.001)){
+ if(video_sync_method){
double vdelta;
vdelta = get_sync_ipts(ost) / av_q2d(enc->time_base) - ost->sync_opts;
//FIXME set to 0.5 after we fix some dts/pts bugs like in avidec.c
@@ -903,7 +918,7 @@ static void do_video_out(AVFormatContext *s,
if (verbose>2)
fprintf(stderr, "*** drop!\n");
}else if (nb_frames > 1) {
- nb_frames_dup += nb_frames;
+ nb_frames_dup += nb_frames - 1;
if (verbose>2)
fprintf(stderr, "*** %d dup!\n", nb_frames-1);
}
@@ -942,6 +957,15 @@ static void do_video_out(AVFormatContext *s,
}
}
+ if( (ost->resample_height != (ist->st->codec->height - (ost->topBand + ost->bottomBand)))
+ || (ost->resample_width != (ist->st->codec->width - (ost->leftBand + ost->rightBand)))
+ || (ost->resample_pix_fmt!= ist->st->codec->pix_fmt) ) {
+
+ fprintf(stderr,"Input Stream #%d.%d frame size changed to %dx%d, %s\n", ist->file_index, ist->index, ist->st->codec->width, ist->st->codec->height,avcodec_get_pix_fmt_name(ist->st->codec->pix_fmt));
+ if(!ost->video_resample)
+ av_exit(1);
+ }
+
if (ost->video_resample) {
padding_src = NULL;
final_picture = &ost->pict_tmp;
@@ -949,7 +973,6 @@ static void do_video_out(AVFormatContext *s,
|| (ost->resample_width != (ist->st->codec->width - (ost->leftBand + ost->rightBand)))
|| (ost->resample_pix_fmt!= ist->st->codec->pix_fmt) ) {
- fprintf(stderr,"Input Stream #%d.%d frame size changed to %dx%d, %s\n", ist->file_index, ist->index, ist->st->codec->width, ist->st->codec->height,avcodec_get_pix_fmt_name(ist->st->codec->pix_fmt));
/* keep bands proportional to the frame size */
topBand = ((int64_t)ist->st->codec->height * ost->original_topBand / ost->original_height) & ~1;
bottomBand = ((int64_t)ist->st->codec->height * ost->original_bottomBand / ost->original_height) & ~1;
@@ -1219,7 +1242,7 @@ static void print_report(AVFormatContext **output_files,
"size=%8.0fkB time=%0.2f bitrate=%6.1fkbits/s",
(double)total_size / 1024, ti1, bitrate);
- if (verbose > 1)
+ if (nb_frames_dup || nb_frames_drop)
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " dup=%d drop=%d",
nb_frames_dup, nb_frames_drop);
@@ -1941,11 +1964,11 @@ static int av_encode(AVFormatContext **output_files,
ost->original_height = icodec->height;
ost->original_width = icodec->width;
- ost->resample_height = icodec->height - (frame_topBand + frame_bottomBand);
- ost->resample_width = icodec->width - (frame_leftBand + frame_rightBand);
- ost->resample_pix_fmt= icodec->pix_fmt;
codec->bits_per_raw_sample= 0;
}
+ ost->resample_height = icodec->height - (frame_topBand + frame_bottomBand);
+ ost->resample_width = icodec->width - (frame_leftBand + frame_rightBand);
+ ost->resample_pix_fmt= icodec->pix_fmt;
ost->encoding_needed = 1;
ist->decoding_needed = 1;
break;
@@ -2384,12 +2407,7 @@ static void opt_format(const char *arg)
fprintf(stderr, "pgmyuv format is deprecated, use image2\n");
}
- file_iformat = av_find_input_format(arg);
- file_oformat = guess_format(arg, NULL, NULL);
- if (!file_iformat && !file_oformat) {
- fprintf(stderr, "Unknown input or output format: %s\n", arg);
- av_exit(1);
- }
+ last_asked_format = arg;
}
static void opt_video_rc_override_string(const char *arg)
@@ -2492,10 +2510,6 @@ static void opt_frame_size(const char *arg)
fprintf(stderr, "Incorrect frame size\n");
av_exit(1);
}
- if ((frame_width % 2) != 0 || (frame_height % 2) != 0) {
- fprintf(stderr, "Frame size must be a multiple of 2\n");
- av_exit(1);
- }
}
static void opt_pad_color(const char *arg) {
@@ -2551,16 +2565,6 @@ static void opt_frame_pad_right(const char *arg)
}
}
-static void list_fmts(void (*get_fmt_string)(char *buf, int buf_size, int fmt), int nb_fmts)
-{
- int i;
- char fmt_str[128];
- for (i=-1; i < nb_fmts; i++) {
- get_fmt_string (fmt_str, sizeof(fmt_str), i);
- fprintf(stdout, "%s\n", fmt_str);
- }
-}
-
static void opt_frame_pix_fmt(const char *arg)
{
if (strcmp(arg, "list")) {
@@ -2831,9 +2835,15 @@ static void opt_input_file(const char *filename)
{
AVFormatContext *ic;
AVFormatParameters params, *ap = &params;
+ AVInputFormat *file_iformat = NULL;
int err, i, ret, rfps, rfps_base;
int64_t timestamp;
+ if (last_asked_format) {
+ file_iformat = av_find_input_format(last_asked_format);
+ last_asked_format = NULL;
+ }
+
if (!strcmp(filename, "-"))
filename = "pipe:";
@@ -2912,7 +2922,8 @@ static void opt_input_file(const char *filename)
/* update the current parameters so that they match the one of the input stream */
for(i=0;i<ic->nb_streams;i++) {
- AVCodecContext *enc = ic->streams[i]->codec;
+ AVStream *st = ic->streams[i];
+ AVCodecContext *enc = st->codec;
if(thread_count>1)
avcodec_thread_init(enc, thread_count);
enc->thread_count= thread_count;
@@ -2926,7 +2937,7 @@ static void opt_input_file(const char *filename)
audio_sample_fmt = enc->sample_fmt;
input_codecs[nb_icodecs++] = avcodec_find_decoder_by_name(audio_codec_name);
if(audio_disable)
- ic->streams[i]->discard= AVDISCARD_ALL;
+ st->discard= AVDISCARD_ALL;
break;
case CODEC_TYPE_VIDEO:
set_context_opts(enc, avcodec_opts[CODEC_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM);
@@ -2940,7 +2951,11 @@ static void opt_input_file(const char *filename)
frame_pix_fmt = enc->pix_fmt;
rfps = ic->streams[i]->r_frame_rate.num;
rfps_base = ic->streams[i]->r_frame_rate.den;
- if(enc->lowres) enc->flags |= CODEC_FLAG_EMU_EDGE;
+ if(enc->lowres) {
+ enc->flags |= CODEC_FLAG_EMU_EDGE;
+ frame_height >>= enc->lowres;
+ frame_width >>= enc->lowres;
+ }
if(me_threshold)
enc->debug |= FF_DEBUG_MV;
@@ -2958,16 +2973,16 @@ static void opt_input_file(const char *filename)
input_codecs[nb_icodecs++] = avcodec_find_decoder_by_name(video_codec_name);
if(video_disable)
- ic->streams[i]->discard= AVDISCARD_ALL;
+ st->discard= AVDISCARD_ALL;
else if(video_discard)
- ic->streams[i]->discard= video_discard;
+ st->discard= video_discard;
break;
case CODEC_TYPE_DATA:
break;
case CODEC_TYPE_SUBTITLE:
input_codecs[nb_icodecs++] = avcodec_find_decoder_by_name(subtitle_codec_name);
if(subtitle_disable)
- ic->streams[i]->discard = AVDISCARD_ALL;
+ st->discard = AVDISCARD_ALL;
break;
case CODEC_TYPE_ATTACHMENT:
case CODEC_TYPE_UNKNOWN:
@@ -2985,8 +3000,6 @@ static void opt_input_file(const char *filename)
dump_format(ic, nb_input_files, filename, 0);
nb_input_files++;
- file_iformat = NULL;
- file_oformat = NULL;
video_channel = 0;
@@ -3167,6 +3180,10 @@ static void new_video_stream(AVFormatContext *oc)
}
}
nb_ocodecs++;
+ if (video_language) {
+ av_metadata_set(&st->metadata, "language", video_language);
+ av_freep(&video_language);
+ }
/* reset some key parameters */
video_disable = 0;
@@ -3247,8 +3264,7 @@ static void new_audio_stream(AVFormatContext *oc)
audio_enc->time_base= (AVRational){1, audio_sample_rate};
if (audio_language) {
av_metadata_set(&st->metadata, "language", audio_language);
- av_free(audio_language);
- audio_language = NULL;
+ av_freep(&audio_language);
}
/* reset some key parameters */
@@ -3289,8 +3305,7 @@ static void new_subtitle_stream(AVFormatContext *oc)
if (subtitle_language) {
av_metadata_set(&st->metadata, "language", subtitle_language);
- av_free(subtitle_language);
- subtitle_language = NULL;
+ av_freep(&subtitle_language);
}
subtitle_disable = 0;
@@ -3337,6 +3352,7 @@ static void opt_output_file(const char *filename)
int use_video, use_audio, use_subtitle;
int input_has_video, input_has_audio, input_has_subtitle;
AVFormatParameters params, *ap = &params;
+ AVOutputFormat *file_oformat;
if (!strcmp(filename, "-"))
filename = "pipe:";
@@ -3347,7 +3363,14 @@ static void opt_output_file(const char *filename)
av_exit(1);
}
- if (!file_oformat) {
+ if (last_asked_format) {
+ file_oformat = guess_format(last_asked_format, NULL, NULL);
+ if (!file_oformat) {
+ fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
+ av_exit(1);
+ }
+ last_asked_format = NULL;
+ } else {
file_oformat = guess_format(NULL, filename, NULL);
if (!file_oformat) {
fprintf(stderr, "Unable to find a suitable output format for '%s'\n",
@@ -3470,10 +3493,6 @@ static void opt_output_file(const char *filename)
oc->flags |= AVFMT_FLAG_NONBLOCK;
set_context_opts(oc, avformat_opts, AV_OPT_FLAG_ENCODING_PARAM);
-
- /* reset some options */
- file_oformat = NULL;
- file_iformat = NULL;
}
/* same option as mencoder */
@@ -3583,26 +3602,26 @@ static void show_help(void)
static void opt_target(const char *arg)
{
- int norm = -1;
+ enum { PAL, NTSC, FILM, UNKNOWN } norm = UNKNOWN;
static const char *const frame_rates[] = {"25", "30000/1001", "24000/1001"};
if(!strncmp(arg, "pal-", 4)) {
- norm = 0;
+ norm = PAL;
arg += 4;
} else if(!strncmp(arg, "ntsc-", 5)) {
- norm = 1;
+ norm = NTSC;
arg += 5;
} else if(!strncmp(arg, "film-", 5)) {
- norm = 2;
+ norm = FILM;
arg += 5;
} else {
int fr;
/* Calculate FR via float to avoid int overflow */
fr = (int)(frame_rate.num * 1000.0 / frame_rate.den);
if(fr == 25000) {
- norm = 0;
+ norm = PAL;
} else if((fr == 29970) || (fr == 23976)) {
- norm = 1;
+ norm = NTSC;
} else {
/* Try to determine PAL/NTSC by peeking in the input files */
if(nb_input_files) {
@@ -3614,23 +3633,23 @@ static void opt_target(const char *arg)
continue;
fr = c->time_base.den * 1000 / c->time_base.num;
if(fr == 25000) {
- norm = 0;
+ norm = PAL;
break;
} else if((fr == 29970) || (fr == 23976)) {
- norm = 1;
+ norm = NTSC;
break;
}
}
- if(norm >= 0)
+ if(norm != UNKNOWN)
break;
}
}
}
- if(verbose && norm >= 0)
- fprintf(stderr, "Assuming %s for target.\n", norm ? "NTSC" : "PAL");
+ if(verbose && norm != UNKNOWN)
+ fprintf(stderr, "Assuming %s for target.\n", norm == PAL ? "PAL" : "NTSC");
}
- if(norm < 0) {
+ if(norm == UNKNOWN) {
fprintf(stderr, "Could not determine norm (PAL/NTSC/NTSC-Film) for target.\n");
fprintf(stderr, "Please prefix target with \"pal-\", \"ntsc-\" or \"film-\",\n");
fprintf(stderr, "or set a framerate with \"-r xxx\".\n");
@@ -3643,9 +3662,9 @@ static void opt_target(const char *arg)
opt_audio_codec("mp2");
opt_format("vcd");
- opt_frame_size(norm ? "352x240" : "352x288");
+ opt_frame_size(norm == PAL ? "352x288" : "352x240");
opt_frame_rate(NULL, frame_rates[norm]);
- opt_default("g", norm ? "18" : "15");
+ opt_default("g", norm == PAL ? "15" : "18");
opt_default("b", "1150000");
opt_default("maxrate", "1150000");
@@ -3671,9 +3690,9 @@ static void opt_target(const char *arg)
opt_audio_codec("mp2");
opt_format("svcd");
- opt_frame_size(norm ? "480x480" : "480x576");
+ opt_frame_size(norm == PAL ? "480x576" : "480x480");
opt_frame_rate(NULL, frame_rates[norm]);
- opt_default("g", norm ? "18" : "15");
+ opt_default("g", norm == PAL ? "15" : "18");
opt_default("b", "2040000");
opt_default("maxrate", "2516000");
@@ -3693,9 +3712,9 @@ static void opt_target(const char *arg)
opt_audio_codec("ac3");
opt_format("dvd");
- opt_frame_size(norm ? "720x480" : "720x576");
+ opt_frame_size(norm == PAL ? "720x576" : "720x480");
opt_frame_rate(NULL, frame_rates[norm]);
- opt_default("g", norm ? "18" : "15");
+ opt_default("g", norm == PAL ? "15" : "18");
opt_default("b", "6000000");
opt_default("maxrate", "9000000");
@@ -3712,9 +3731,9 @@ static void opt_target(const char *arg)
opt_format("dv");
- opt_frame_size(norm ? "720x480" : "720x576");
+ opt_frame_size(norm != PAL ? "720x480" : "720x576");
opt_frame_pix_fmt(!strncmp(arg, "dv50", 4) ? "yuv422p" :
- (norm ? "yuv411p" : "yuv420p"));
+ (norm == PAL ? "yuv420p" : "yuv411p"));
opt_frame_rate(NULL, frame_rates[norm]);
audio_sample_rate = 48000;
@@ -3773,19 +3792,19 @@ static int opt_preset(const char *opt, const char *arg)
FFMPEG_DATADIR,
};
- for(i=!base[0]; i<2 && !f; i++){
- snprintf(filename, sizeof(filename), "%s%s/%s.ffpreset", base[i], i ? "" : "/.ffmpeg", arg);
- f= fopen(filename, "r");
- if(!f){
- char *codec_name= *opt == 'v' ? video_codec_name :
- *opt == 'a' ? audio_codec_name :
- subtitle_codec_name;
- snprintf(filename, sizeof(filename), "%s%s/%s-%s.ffpreset", base[i], i ? "" : "/.ffmpeg", codec_name, arg);
+ if (*opt != 'f') {
+ for(i=!base[0]; i<2 && !f; i++){
+ snprintf(filename, sizeof(filename), "%s%s/%s.ffpreset", base[i], i ? "" : "/.ffmpeg", arg);
f= fopen(filename, "r");
+ if(!f){
+ char *codec_name= *opt == 'v' ? video_codec_name :
+ *opt == 'a' ? audio_codec_name :
+ subtitle_codec_name;
+ snprintf(filename, sizeof(filename), "%s%s/%s-%s.ffpreset", base[i], i ? "" : "/.ffmpeg", codec_name, arg);
+ f= fopen(filename, "r");
+ }
}
- }
- if(!f && ((arg[0]=='.' && arg[1]=='/') || arg[0]=='/' ||
- is_dos_path(arg))){
+ } else {
av_strlcpy(filename, arg, sizeof(filename));
f= fopen(filename, "r");
}
@@ -3823,10 +3842,7 @@ static int opt_preset(const char *opt, const char *arg)
static const OptionDef options[] = {
/* main options */
- { "L", OPT_EXIT, {(void*)show_license}, "show license" },
- { "h", OPT_EXIT, {(void*)show_help}, "show help" },
- { "version", OPT_EXIT, {(void*)show_version}, "show version" },
- { "formats", OPT_EXIT, {(void*)show_formats}, "show available formats, codecs, protocols, ..." },
+#include "cmdutils_common_opts.h"
{ "f", HAS_ARG, {(void*)opt_format}, "force format", "fmt" },
{ "i", HAS_ARG, {(void*)opt_input_file}, "input file name", "filename" },
{ "y", OPT_BOOL, {(void*)&file_overwrite}, "overwrite output files" },
@@ -3850,7 +3866,6 @@ static const OptionDef options[] = {
{ "loop_input", OPT_BOOL | OPT_EXPERT, {(void*)&loop_input}, "loop (current only works with images)" },
{ "loop_output", HAS_ARG | OPT_INT | OPT_EXPERT, {(void*)&loop_output}, "number of times to loop output in formats that support looping (0 loops forever)", "" },
{ "v", HAS_ARG | OPT_FUNC2, {(void*)opt_verbose}, "set ffmpeg verbosity level", "number" },
- { "loglevel", HAS_ARG | OPT_FUNC2, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
{ "target", HAS_ARG, {(void*)opt_target}, "specify target file type (\"vcd\", \"svcd\", \"dvd\", \"dv\", \"dv50\", \"pal-vcd\", \"ntsc-svcd\", ...)", "type" },
{ "threads", OPT_FUNC2 | HAS_ARG | OPT_EXPERT, {(void*)opt_thread_count}, "thread count", "count" },
{ "vsync", HAS_ARG | OPT_INT | OPT_EXPERT, {(void*)&video_sync_method}, "video sync method", "" },
@@ -3903,6 +3918,7 @@ static const OptionDef options[] = {
{ "dc", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&intra_dc_precision}, "intra_dc_precision", "precision" },
{ "vtag", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_video_tag}, "force video tag/fourcc", "fourcc/tag" },
{ "newvideo", OPT_VIDEO, {(void*)opt_new_video_stream}, "add a new video stream to the current output stream" },
+ { "vlang", HAS_ARG | OPT_STRING | OPT_VIDEO, {(void *)&video_language}, "set the ISO 639 language code (3 letters) of the current video stream" , "code" },
{ "qphist", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, { (void *)&qp_hist }, "show QP histogram" },
{ "force_fps", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&force_fps}, "force the selected framerate, disable the best supported framerate selection" },
@@ -3943,6 +3959,7 @@ static const OptionDef options[] = {
{ "apre", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_EXPERT, {(void*)opt_preset}, "set the audio options to the indicated preset", "preset" },
{ "vpre", OPT_FUNC2 | HAS_ARG | OPT_VIDEO | OPT_EXPERT, {(void*)opt_preset}, "set the video options to the indicated preset", "preset" },
{ "spre", OPT_FUNC2 | HAS_ARG | OPT_SUBTITLE | OPT_EXPERT, {(void*)opt_preset}, "set the subtitle options to the indicated preset", "preset" },
+ { "fpre", OPT_FUNC2 | HAS_ARG | OPT_EXPERT, {(void*)opt_preset}, "set options from indicated preset file", "filename" },
{ "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
{ NULL, },
@@ -3973,6 +3990,9 @@ int main(int argc, char **argv)
/* parse options */
parse_options(argc, argv, options, opt_output_file);
+ if(nb_output_files <= 0 && nb_input_files == 0)
+ show_help();
+
/* file converter / grab */
if (nb_output_files <= 0) {
fprintf(stderr, "At least one output file must be specified\n");
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffplay.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffplay.c
index bf558e4dc5..5fe054f666 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffplay.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffplay.c
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "config.h"
#include <math.h>
#include <limits.h>
#include "libavutil/avstring.h"
@@ -39,6 +40,8 @@
#endif
#undef exit
+#undef printf
+#undef fprintf
const char program_name[] = "FFplay";
const int program_birth_year = 2003;
@@ -2452,10 +2455,7 @@ static int opt_thread_count(const char *opt, const char *arg)
}
static const OptionDef options[] = {
- { "h", OPT_EXIT, {(void*)show_help}, "show help" },
- { "version", OPT_EXIT, {(void*)show_version}, "show version" },
- { "L", OPT_EXIT, {(void*)show_license}, "show license" },
- { "formats", OPT_EXIT, {(void*)show_formats}, "show available formats, codecs, protocols, ..." },
+#include "cmdutils_common_opts.h"
{ "x", HAS_ARG | OPT_FUNC2, {(void*)opt_width}, "force displayed width", "width" },
{ "y", HAS_ARG | OPT_FUNC2, {(void*)opt_height}, "force displayed height", "height" },
{ "s", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_size}, "set frame size (WxH or abbreviation)", "size" },
@@ -2487,7 +2487,6 @@ static const OptionDef options[] = {
{ "sync", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_sync}, "set audio-video sync. type (type=audio/video/ext)", "type" },
{ "threads", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_thread_count}, "thread count", "count" },
{ "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
- { "loglevel", HAS_ARG | OPT_FUNC2, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
{ NULL, },
};
@@ -2542,6 +2541,7 @@ int main(int argc, char **argv)
parse_options(argc, argv, options, opt_input_file);
if (!input_filename) {
+ show_help();
fprintf(stderr, "An input file must be specified\n");
exit(1);
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-baseline.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-baseline.ffpreset
index 47664189b2..a23b746ded 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-baseline.ffpreset
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-baseline.ffpreset
@@ -1,3 +1,4 @@
coder=0
bf=0
-flags2=-wpred-dct8x8
+flags2=-wpred-dct8x8+mbtree
+wpredp=0
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-default.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-default.ffpreset
index 1377530e78..a10c633240 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-default.ffpreset
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-default.ffpreset
@@ -18,4 +18,5 @@ bf=3
refs=3
directpred=1
trellis=1
-flags2=+mixed_refs+wpred+dct8x8+fastpskip
+flags2=+mixed_refs+wpred+dct8x8+fastpskip+mbtree
+wpredp=2
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-fastfirstpass.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-fastfirstpass.ffpreset
index 20aecf1c83..7cf6faae41 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-fastfirstpass.ffpreset
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-fastfirstpass.ffpreset
@@ -3,7 +3,7 @@ flags=+loop
cmp=+chroma
partitions=-parti8x8-parti4x4-partp8x8-partp4x4-partb8x8
me_method=dia
-subq=1
+subq=2
me_range=16
g=250
keyint_min=25
@@ -18,4 +18,5 @@ bf=3
refs=1
directpred=3
trellis=0
-flags2=-bpyramid-wpred-mixed_refs-dct8x8+fastpskip
+flags2=-bpyramid-wpred-mixed_refs-dct8x8+fastpskip+mbtree
+wpredp=2
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-hq.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-hq.ffpreset
index 32b64f1799..eafc52e410 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-hq.ffpreset
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-hq.ffpreset
@@ -18,4 +18,5 @@ bf=3
refs=4
directpred=3
trellis=1
-flags2=+wpred+mixed_refs+dct8x8+fastpskip
+flags2=+wpred+mixed_refs+dct8x8+fastpskip+mbtree
+wpredp=2
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-ipod320.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-ipod320.ffpreset
index 89441c7deb..b10205025e 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-ipod320.ffpreset
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-ipod320.ffpreset
@@ -1,6 +1,7 @@
coder=0
bf=0
-flags2=-wpred-dct8x8
+flags2=-wpred-dct8x8+mbtree
level=13
maxrate=768000
bufsize=3000000
+wpredp=0
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-ipod640.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-ipod640.ffpreset
index fd58e2ad71..aa731dccc5 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-ipod640.ffpreset
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-ipod640.ffpreset
@@ -1,7 +1,8 @@
coder=0
bf=0
refs=1
-flags2=-wpred-dct8x8
+flags2=-wpred-dct8x8+mbtree
level=30
maxrate=10000000
bufsize=10000000
+wpredp=0
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_fast.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_fast.ffpreset
index dcf418afda..9bbabf5f7c 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_fast.ffpreset
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_fast.ffpreset
@@ -15,5 +15,6 @@ qmin=10
qmax=51
qdiff=4
directpred=1
-flags2=+fastpskip
+flags2=+fastpskip+mbtree
cqp=0
+wpredp=0
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_max.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_max.ffpreset
index b8506c227f..d4ba018b75 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_max.ffpreset
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_max.ffpreset
@@ -16,5 +16,6 @@ qmax=51
qdiff=4
refs=16
directpred=1
-flags2=+mixed_refs+dct8x8+fastpskip
+flags2=+mixed_refs+dct8x8+fastpskip+mbtree
cqp=0
+wpredp=2
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_medium.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_medium.ffpreset
index 99fb6b9d07..c4133c2279 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_medium.ffpreset
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_medium.ffpreset
@@ -15,5 +15,6 @@ qmin=10
qmax=51
qdiff=4
directpred=1
-flags2=+fastpskip
+flags2=+fastpskip+mbtree
cqp=0
+wpredp=2
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_slow.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_slow.ffpreset
index 2ecb55b07e..1421b95603 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_slow.ffpreset
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_slow.ffpreset
@@ -16,5 +16,6 @@ qmax=51
qdiff=4
refs=2
directpred=1
-flags2=+dct8x8+fastpskip
+flags2=+dct8x8+fastpskip+mbtree
cqp=0
+wpredp=2
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_slower.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_slower.ffpreset
index dd499c7afd..942445921e 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_slower.ffpreset
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_slower.ffpreset
@@ -16,5 +16,6 @@ qmax=51
qdiff=4
refs=4
directpred=1
-flags2=+mixed_refs+dct8x8+fastpskip
+flags2=+mixed_refs+dct8x8+fastpskip+mbtree
cqp=0
+wpredp=2
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_ultrafast.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_ultrafast.ffpreset
index 1c429f21ff..3c44488e8d 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_ultrafast.ffpreset
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-lossless_ultrafast.ffpreset
@@ -15,5 +15,5 @@ qmin=10
qmax=51
qdiff=4
directpred=1
-flags2=+fastpskip
+flags2=+fastpskip+mbtree
cqp=0
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-main.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-main.ffpreset
index d1dc7ddae9..0868c53cff 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-main.ffpreset
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-main.ffpreset
@@ -1 +1 @@
-flags2=-dct8x8
+flags2=-dct8x8+mbtree
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-max.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-max.ffpreset
index fe498bb297..4289ab531e 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-max.ffpreset
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-max.ffpreset
@@ -18,4 +18,5 @@ bf=3
refs=16
directpred=3
trellis=2
-flags2=+wpred+mixed_refs+dct8x8-fastpskip
+flags2=+wpred+mixed_refs+dct8x8-fastpskip+mbtree
+wpredp=2
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-normal.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-normal.ffpreset
index c0a6c8ec1e..dd7991bab4 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-normal.ffpreset
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-normal.ffpreset
@@ -18,4 +18,5 @@ bf=3
refs=2
directpred=3
trellis=0
-flags2=+wpred+dct8x8+fastpskip
+flags2=+wpred+dct8x8+fastpskip+mbtree
+wpredp=2
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-slowfirstpass.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-slowfirstpass.ffpreset
index 280c336dc9..ba49065c14 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-slowfirstpass.ffpreset
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-slowfirstpass.ffpreset
@@ -18,4 +18,5 @@ bf=3
refs=1
directpred=3
trellis=0
-flags2=+wpred+dct8x8+fastpskip
+flags2=+wpred+dct8x8+fastpskip+mbtree
+wpredp=2
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffserver.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffserver.c
index da45cfa443..fdb504f84a 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffserver.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffserver.c
@@ -4463,7 +4463,7 @@ static void opt_debug(void)
logfilename[0] = '-';
}
-static void opt_show_help(void)
+static void show_help(void)
{
printf("usage: ffserver [options]\n"
"Hyper fast multi format Audio/Video streaming server\n");
@@ -4472,11 +4472,7 @@ static void opt_show_help(void)
}
static const OptionDef options[] = {
- { "h", OPT_EXIT, {(void*)opt_show_help}, "show help" },
- { "version", OPT_EXIT, {(void*)show_version}, "show version" },
- { "L", OPT_EXIT, {(void*)show_license}, "show license" },
- { "formats", OPT_EXIT, {(void*)show_formats}, "show available formats, codecs, protocols, ..." },
- { "loglevel", HAS_ARG | OPT_FUNC2, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
+#include "cmdutils_common_opts.h"
{ "n", OPT_BOOL, {(void *)&no_launch }, "enable no-launch mode" },
{ "d", 0, {(void*)opt_debug}, "enable debug mode" },
{ "f", HAS_ARG | OPT_STRING, {(void*)&config_filename }, "use configfile instead of /etc/ffserver.conf", "configfile" },
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/4xm.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/4xm.c
index cc0bcd4f86..d2172ba256 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/4xm.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/4xm.c
@@ -832,6 +832,10 @@ static av_cold int decode_end(AVCodecContext *avctx){
f->cfrm[i].allocated_size= 0;
}
free_vlc(&f->pre_vlc);
+ if(f->current_picture.data[0])
+ avctx->release_buffer(avctx, &f->current_picture);
+ if(f->last_picture.data[0])
+ avctx->release_buffer(avctx, &f->last_picture);
return 0;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/8bps.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/8bps.c
index 28187b0360..fb5ef71732 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/8bps.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/8bps.c
@@ -159,10 +159,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
c->pic.data[0] = NULL;
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return 1;
- }
-
switch (avctx->bits_per_coded_sample) {
case 8:
avctx->pix_fmt = PIX_FMT_PAL8;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/Makefile b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/Makefile
index 14e292807b..0a093b2e6b 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/Makefile
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/Makefile
@@ -27,21 +27,31 @@ OBJS = allcodecs.o \
# parts needed for many different codecs
OBJS-$(CONFIG_AANDCT) += aandcttab.o
OBJS-$(CONFIG_ENCODERS) += faandct.o jfdctfst.o jfdctint.o
-OBJS-$(CONFIG_FFT) += fft.o
+FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o
+OBJS-$(CONFIG_FFT) += fft.o $(FFT-OBJS-yes)
OBJS-$(CONFIG_GOLOMB) += golomb.o
+OBJS-$(CONFIG_LPC) += lpc.o
OBJS-$(CONFIG_MDCT) += mdct.o
-OBJS-$(CONFIG_RDFT) += rdft.o
+RDFT-OBJS-$(CONFIG_HARDCODED_TABLES) += sin_tables.o
+OBJS-$(CONFIG_RDFT) += rdft.o $(RDFT-OBJS-yes)
OBJS-$(CONFIG_VAAPI) += vaapi.o
OBJS-$(CONFIG_VDPAU) += vdpau.o
# decoders/encoders/hardware accelerators
-OBJS-$(CONFIG_AAC_DECODER) += aac.o aactab.o mpeg4audio.o aac_parser.o aac_ac3_parser.o
-OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o aacpsy.o aactab.o psymodel.o iirfilter.o mpeg4audio.o
+OBJS-$(CONFIG_AAC_DECODER) += aac.o aactab.o mpeg4audio.o \
+ aac_parser.o aac_ac3_parser.o
+OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o \
+ aacpsy.o aactab.o \
+ psymodel.o iirfilter.o \
+ mpeg4audio.o
OBJS-$(CONFIG_AASC_DECODER) += aasc.o msrledec.o
-OBJS-$(CONFIG_AC3_DECODER) += ac3dec.o ac3tab.o ac3dec_data.o ac3.o ac3_parser.o aac_ac3_parser.o
+OBJS-$(CONFIG_AC3_DECODER) += ac3dec.o ac3tab.o \
+ ac3dec_data.o ac3.o \
+ ac3_parser.o aac_ac3_parser.o
OBJS-$(CONFIG_AC3_ENCODER) += ac3enc.o ac3tab.o ac3.o
OBJS-$(CONFIG_ALAC_DECODER) += alac.o
-OBJS-$(CONFIG_ALAC_ENCODER) += alacenc.o lpc.o
+OBJS-$(CONFIG_ALAC_ENCODER) += alacenc.o
+OBJS-$(CONFIG_ALS_DECODER) += alsdec.o
OBJS-$(CONFIG_AMV_DECODER) += sp5xdec.o mjpegdec.o mjpeg.o
OBJS-$(CONFIG_APE_DECODER) += apedec.o
OBJS-$(CONFIG_ASV1_DECODER) += asv1.o mpeg12data.o
@@ -56,16 +66,21 @@ OBJS-$(CONFIG_BFI_DECODER) += bfi.o
OBJS-$(CONFIG_BMP_DECODER) += bmp.o msrledec.o
OBJS-$(CONFIG_BMP_ENCODER) += bmpenc.o
OBJS-$(CONFIG_C93_DECODER) += c93.o
-OBJS-$(CONFIG_CAVS_DECODER) += cavs.o cavsdec.o cavsdsp.o mpeg12data.o mpegvideo.o
+OBJS-$(CONFIG_CAVS_DECODER) += cavs.o cavsdec.o cavsdsp.o \
+ mpeg12data.o mpegvideo.o
+OBJS-$(CONFIG_CDGRAPHICS_DECODER) += cdgraphics.o
OBJS-$(CONFIG_CINEPAK_DECODER) += cinepak.o
OBJS-$(CONFIG_CLJR_DECODER) += cljr.o
OBJS-$(CONFIG_CLJR_ENCODER) += cljr.o
OBJS-$(CONFIG_COOK_DECODER) += cook.o
OBJS-$(CONFIG_CSCD_DECODER) += cscd.o
OBJS-$(CONFIG_CYUV_DECODER) += cyuv.o
-OBJS-$(CONFIG_DCA_DECODER) += dca.o
+OBJS-$(CONFIG_DCA_DECODER) += dca.o synth_filter.o
OBJS-$(CONFIG_DNXHD_DECODER) += dnxhddec.o dnxhddata.o
-OBJS-$(CONFIG_DNXHD_ENCODER) += dnxhdenc.o dnxhddata.o mpegvideo_enc.o motion_est.o ratecontrol.o mpeg12data.o mpegvideo.o
+OBJS-$(CONFIG_DNXHD_ENCODER) += dnxhdenc.o dnxhddata.o \
+ mpegvideo_enc.o motion_est.o \
+ ratecontrol.o mpeg12data.o \
+ mpegvideo.o
OBJS-$(CONFIG_DPX_DECODER) += dpx.o
OBJS-$(CONFIG_DSICINAUDIO_DECODER) += dsicinav.o
OBJS-$(CONFIG_DSICINVIDEO_DECODER) += dsicinav.o
@@ -73,15 +88,19 @@ OBJS-$(CONFIG_DVBSUB_DECODER) += dvbsubdec.o
OBJS-$(CONFIG_DVBSUB_ENCODER) += dvbsub.o
OBJS-$(CONFIG_DVDSUB_DECODER) += dvdsubdec.o
OBJS-$(CONFIG_DVDSUB_ENCODER) += dvdsubenc.o
-OBJS-$(CONFIG_DVVIDEO_DECODER) += dv.o
-OBJS-$(CONFIG_DVVIDEO_ENCODER) += dv.o
+OBJS-$(CONFIG_DVVIDEO_DECODER) += dv.o dvdata.o
+OBJS-$(CONFIG_DVVIDEO_ENCODER) += dv.o dvdata.o
OBJS-$(CONFIG_DXA_DECODER) += dxa.o
OBJS-$(CONFIG_EAC3_DECODER) += eac3dec.o eac3dec_data.o
OBJS-$(CONFIG_EACMV_DECODER) += eacmv.o
-OBJS-$(CONFIG_EAMAD_DECODER) += eamad.o eaidct.o mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_EAMAD_DECODER) += eamad.o eaidct.o mpeg12.o \
+ mpeg12data.o mpegvideo.o \
+ error_resilience.o
OBJS-$(CONFIG_EATGQ_DECODER) += eatgq.o eaidct.o
OBJS-$(CONFIG_EATGV_DECODER) += eatgv.o
-OBJS-$(CONFIG_EATQI_DECODER) += eatqi.o eaidct.o mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_EATQI_DECODER) += eatqi.o eaidct.o mpeg12.o \
+ mpeg12data.o mpegvideo.o \
+ error_resilience.o
OBJS-$(CONFIG_EIGHTBPS_DECODER) += 8bps.o
OBJS-$(CONFIG_EIGHTSVX_EXP_DECODER) += 8svx.o
OBJS-$(CONFIG_EIGHTSVX_FIB_DECODER) += 8svx.o
@@ -91,22 +110,34 @@ OBJS-$(CONFIG_FFV1_ENCODER) += ffv1.o rangecoder.o
OBJS-$(CONFIG_FFVHUFF_DECODER) += huffyuv.o
OBJS-$(CONFIG_FFVHUFF_ENCODER) += huffyuv.o
OBJS-$(CONFIG_FLAC_DECODER) += flacdec.o flacdata.o flac.o
-OBJS-$(CONFIG_FLAC_ENCODER) += flacenc.o flacdata.o flac.o lpc.o
+OBJS-$(CONFIG_FLAC_ENCODER) += flacenc.o flacdata.o flac.o
OBJS-$(CONFIG_FLASHSV_DECODER) += flashsv.o
OBJS-$(CONFIG_FLASHSV_ENCODER) += flashsvenc.o
OBJS-$(CONFIG_FLIC_DECODER) += flicvideo.o
-OBJS-$(CONFIG_FLV_DECODER) += h263dec.o h263.o mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_FLV_DECODER) += h263dec.o h263.o \
+ mpegvideo.o error_resilience.o
OBJS-$(CONFIG_FOURXM_DECODER) += 4xm.o
OBJS-$(CONFIG_FRAPS_DECODER) += fraps.o huffman.o
+OBJS-$(CONFIG_FRWU_DECODER) += frwu.o
OBJS-$(CONFIG_GIF_DECODER) += gifdec.o lzw.o
OBJS-$(CONFIG_GIF_ENCODER) += gif.o
-OBJS-$(CONFIG_H261_DECODER) += h261dec.o h261.o mpegvideo.o error_resilience.o
-OBJS-$(CONFIG_H261_ENCODER) += h261enc.o h261.o mpegvideo_enc.o motion_est.o ratecontrol.o mpeg12data.o mpegvideo.o
-OBJS-$(CONFIG_H263_DECODER) += h263dec.o h263.o h263_parser.o mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_H261_DECODER) += h261dec.o h261.o \
+ mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_H261_ENCODER) += h261enc.o h261.o \
+ mpegvideo_enc.o motion_est.o \
+ ratecontrol.o mpeg12data.o \
+ mpegvideo.o
+OBJS-$(CONFIG_H263_DECODER) += h263dec.o h263.o h263_parser.o \
+ mpegvideo.o error_resilience.o
OBJS-$(CONFIG_H263_VAAPI_HWACCEL) += vaapi_mpeg4.o
-OBJS-$(CONFIG_H263I_DECODER) += h263dec.o h263.o mpegvideo.o error_resilience.o
-OBJS-$(CONFIG_H263_ENCODER) += mpegvideo_enc.o motion_est.o ratecontrol.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
-OBJS-$(CONFIG_H264_DECODER) += h264.o h264idct.o h264pred.o h264_parser.o cabac.o mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_H263I_DECODER) += h263dec.o h263.o \
+ mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_H263_ENCODER) += mpegvideo_enc.o motion_est.o \
+ ratecontrol.o h263.o mpeg12data.o \
+ mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_H264_DECODER) += h264.o h264idct.o h264pred.o \
+ h264_parser.o cabac.o \
+ mpegvideo.o error_resilience.o
OBJS-$(CONFIG_H264_ENCODER) += h264enc.o h264dspenc.o
OBJS-$(CONFIG_HUFFYUV_DECODER) += huffyuv.o
OBJS-$(CONFIG_HUFFYUV_ENCODER) += huffyuv.o
@@ -116,43 +147,74 @@ OBJS-$(CONFIG_INDEO2_DECODER) += indeo2.o
OBJS-$(CONFIG_INDEO3_DECODER) += indeo3.o
OBJS-$(CONFIG_INTERPLAY_DPCM_DECODER) += dpcm.o
OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o
-OBJS-$(CONFIG_JPEGLS_DECODER) += jpeglsdec.o jpegls.o mjpegdec.o mjpeg.o
+OBJS-$(CONFIG_JPEGLS_DECODER) += jpeglsdec.o jpegls.o \
+ mjpegdec.o mjpeg.o
OBJS-$(CONFIG_JPEGLS_ENCODER) += jpeglsenc.o jpegls.o
OBJS-$(CONFIG_KMVC_DECODER) += kmvc.o
-OBJS-$(CONFIG_LJPEG_ENCODER) += ljpegenc.o mjpegenc.o mjpeg.o mpegvideo_enc.o motion_est.o ratecontrol.o mpeg12data.o mpegvideo.o
+OBJS-$(CONFIG_LJPEG_ENCODER) += ljpegenc.o mjpegenc.o mjpeg.o \
+ mpegvideo_enc.o motion_est.o \
+ ratecontrol.o mpeg12data.o \
+ mpegvideo.o
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 mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_MDEC_DECODER) += mdec.o mpeg12.o mpeg12data.o \
+ mpegvideo.o error_resilience.o
OBJS-$(CONFIG_MIMIC_DECODER) += mimic.o
OBJS-$(CONFIG_MJPEG_DECODER) += mjpegdec.o mjpeg.o
-OBJS-$(CONFIG_MJPEG_ENCODER) += mjpegenc.o mjpeg.o mpegvideo_enc.o motion_est.o ratecontrol.o mpeg12data.o mpegvideo.o
+OBJS-$(CONFIG_MJPEG_ENCODER) += mjpegenc.o mjpeg.o \
+ mpegvideo_enc.o motion_est.o \
+ ratecontrol.o mpeg12data.o \
+ mpegvideo.o
OBJS-$(CONFIG_MJPEGB_DECODER) += mjpegbdec.o mjpegdec.o mjpeg.o
OBJS-$(CONFIG_MLP_DECODER) += mlpdec.o mlp_parser.o mlp.o mlpdsp.o
OBJS-$(CONFIG_MMVIDEO_DECODER) += mmvideo.o
OBJS-$(CONFIG_MOTIONPIXELS_DECODER) += motionpixels.o
-OBJS-$(CONFIG_MP1_DECODER) += mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o
-OBJS-$(CONFIG_MP2_DECODER) += mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o
-OBJS-$(CONFIG_MP2_ENCODER) += mpegaudioenc.o mpegaudio.o mpegaudiodata.o
-OBJS-$(CONFIG_MP3ADU_DECODER) += mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o
-OBJS-$(CONFIG_MP3ON4_DECODER) += mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o mpeg4audio.o
-OBJS-$(CONFIG_MP3_DECODER) += mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o
-OBJS-$(CONFIG_MPC7_DECODER) += mpc7.o mpc.o mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o
-OBJS-$(CONFIG_MPC8_DECODER) += mpc8.o mpc.o mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o
+OBJS-$(CONFIG_MP1_DECODER) += mpegaudiodec.o mpegaudiodecheader.o \
+ mpegaudio.o mpegaudiodata.o
+OBJS-$(CONFIG_MP2_DECODER) += mpegaudiodec.o mpegaudiodecheader.o \
+ mpegaudio.o mpegaudiodata.o
+OBJS-$(CONFIG_MP2_ENCODER) += mpegaudioenc.o mpegaudio.o \
+ mpegaudiodata.o
+OBJS-$(CONFIG_MP3ADU_DECODER) += mpegaudiodec.o mpegaudiodecheader.o \
+ mpegaudio.o mpegaudiodata.o
+OBJS-$(CONFIG_MP3ON4_DECODER) += mpegaudiodec.o mpegaudiodecheader.o \
+ mpegaudio.o mpegaudiodata.o mpeg4audio.o
+OBJS-$(CONFIG_MP3_DECODER) += mpegaudiodec.o mpegaudiodecheader.o \
+ mpegaudio.o mpegaudiodata.o
+OBJS-$(CONFIG_MPC7_DECODER) += mpc7.o mpc.o mpegaudiodec.o \
+ mpegaudiodecheader.o mpegaudio.o \
+ mpegaudiodata.o
+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_MPEGVIDEO_DECODER) += mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
-OBJS-$(CONFIG_MPEG1VIDEO_DECODER) += mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
-OBJS-$(CONFIG_MPEG1VIDEO_ENCODER) += mpeg12enc.o mpegvideo_enc.o motion_est.o ratecontrol.o mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_MPEG1VIDEO_DECODER) += mpeg12.o mpeg12data.o \
+ mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_MPEG1VIDEO_ENCODER) += mpeg12enc.o mpegvideo_enc.o \
+ motion_est.o ratecontrol.o \
+ mpeg12.o mpeg12data.o \
+ mpegvideo.o error_resilience.o
OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL) += vaapi_mpeg2.o
-OBJS-$(CONFIG_MPEG2VIDEO_DECODER) += mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
-OBJS-$(CONFIG_MPEG2VIDEO_ENCODER) += mpeg12enc.o mpegvideo_enc.o motion_est.o ratecontrol.o mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
-OBJS-$(CONFIG_MPEG4_DECODER) += h263dec.o h263.o mpeg4video_parser.o mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_MPEG2VIDEO_DECODER) += mpeg12.o mpeg12data.o \
+ mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_MPEG2VIDEO_ENCODER) += mpeg12enc.o mpegvideo_enc.o \
+ motion_est.o ratecontrol.o \
+ mpeg12.o mpeg12data.o \
+ mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_MPEG4_DECODER) += h263dec.o h263.o mpeg4video_parser.o \
+ mpegvideo.o error_resilience.o
OBJS-$(CONFIG_MPEG4_VAAPI_HWACCEL) += vaapi_mpeg4.o
-OBJS-$(CONFIG_MSMPEG4V1_DECODER) += msmpeg4.o msmpeg4data.o h263dec.o h263.o mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_MSMPEG4V1_DECODER) += msmpeg4.o msmpeg4data.o h263dec.o \
+ h263.o mpegvideo.o error_resilience.o
OBJS-$(CONFIG_MSMPEG4V1_ENCODER) += msmpeg4.o msmpeg4data.o
-OBJS-$(CONFIG_MSMPEG4V2_DECODER) += msmpeg4.o msmpeg4data.o h263dec.o h263.o mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_MSMPEG4V2_DECODER) += msmpeg4.o msmpeg4data.o h263dec.o \
+ h263.o mpegvideo.o error_resilience.o
OBJS-$(CONFIG_MSMPEG4V2_ENCODER) += msmpeg4.o msmpeg4data.o
-OBJS-$(CONFIG_MSMPEG4V3_DECODER) += msmpeg4.o msmpeg4data.o h263dec.o h263.o mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_MSMPEG4V3_DECODER) += msmpeg4.o msmpeg4data.o h263dec.o \
+ h263.o mpegvideo.o error_resilience.o
OBJS-$(CONFIG_MSMPEG4V3_ENCODER) += msmpeg4.o msmpeg4data.o
OBJS-$(CONFIG_MSRLE_DECODER) += msrle.o msrledec.o
OBJS-$(CONFIG_MSVIDEO1_DECODER) += msvideo1.o
@@ -160,28 +222,32 @@ OBJS-$(CONFIG_MSZH_DECODER) += lcldec.o
OBJS-$(CONFIG_NELLYMOSER_DECODER) += nellymoserdec.o nellymoser.o
OBJS-$(CONFIG_NELLYMOSER_ENCODER) += nellymoserenc.o nellymoser.o
OBJS-$(CONFIG_NUV_DECODER) += nuv.o rtjpeg.o
-OBJS-$(CONFIG_PAM_DECODER) += pnmenc.o pnm.o
-OBJS-$(CONFIG_PAM_ENCODER) += pnmenc.o
-OBJS-$(CONFIG_PBM_DECODER) += pnmenc.o pnm.o
-OBJS-$(CONFIG_PBM_ENCODER) += pnmenc.o
+OBJS-$(CONFIG_PAM_DECODER) += pnmdec.o pnm.o
+OBJS-$(CONFIG_PAM_ENCODER) += pamenc.o pnm.o
+OBJS-$(CONFIG_PBM_DECODER) += pnmdec.o pnm.o
+OBJS-$(CONFIG_PBM_ENCODER) += pnmenc.o pnm.o
OBJS-$(CONFIG_PCX_DECODER) += pcx.o
OBJS-$(CONFIG_PCX_ENCODER) += pcxenc.o
-OBJS-$(CONFIG_PGM_DECODER) += pnmenc.o pnm.o
-OBJS-$(CONFIG_PGM_ENCODER) += pnmenc.o
-OBJS-$(CONFIG_PGMYUV_DECODER) += pnmenc.o pnm.o
-OBJS-$(CONFIG_PGMYUV_ENCODER) += pnmenc.o
+OBJS-$(CONFIG_PGM_DECODER) += pnmdec.o pnm.o
+OBJS-$(CONFIG_PGM_ENCODER) += pnmenc.o pnm.o
+OBJS-$(CONFIG_PGMYUV_DECODER) += pnmdec.o pnm.o
+OBJS-$(CONFIG_PGMYUV_ENCODER) += pnmenc.o pnm.o
OBJS-$(CONFIG_PGSSUB_DECODER) += pgssubdec.o
OBJS-$(CONFIG_PNG_DECODER) += png.o pngdec.o
OBJS-$(CONFIG_PNG_ENCODER) += png.o pngenc.o
-OBJS-$(CONFIG_PPM_DECODER) += pnmenc.o pnm.o
-OBJS-$(CONFIG_PPM_ENCODER) += pnmenc.o
+OBJS-$(CONFIG_PPM_DECODER) += pnmdec.o pnm.o
+OBJS-$(CONFIG_PPM_ENCODER) += pnmenc.o pnm.o
OBJS-$(CONFIG_PTX_DECODER) += ptx.o
-OBJS-$(CONFIG_QCELP_DECODER) += qcelpdec.o lsp.o celp_math.o celp_filters.o acelp_vectors.o
-OBJS-$(CONFIG_QDM2_DECODER) += qdm2.o mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o
+OBJS-$(CONFIG_QCELP_DECODER) += qcelpdec.o lsp.o celp_math.o \
+ celp_filters.o acelp_vectors.o
+OBJS-$(CONFIG_QDM2_DECODER) += qdm2.o mpegaudiodec.o \
+ mpegaudiodecheader.o mpegaudio.o \
+ mpegaudiodata.o
OBJS-$(CONFIG_QDRAW_DECODER) += qdrw.o
OBJS-$(CONFIG_QPEG_DECODER) += qpeg.o
OBJS-$(CONFIG_QTRLE_DECODER) += qtrle.o
OBJS-$(CONFIG_QTRLE_ENCODER) += qtrleenc.o
+OBJS-$(CONFIG_R210_DECODER) += r210dec.o
OBJS-$(CONFIG_RA_144_DECODER) += ra144.o celp_filters.o
OBJS-$(CONFIG_RA_288_DECODER) += ra288.o celp_math.o celp_filters.o
OBJS-$(CONFIG_RAWVIDEO_DECODER) += rawdec.o
@@ -192,12 +258,16 @@ OBJS-$(CONFIG_ROQ_ENCODER) += roqvideoenc.o roqvideo.o elbg.o
OBJS-$(CONFIG_ROQ_DPCM_DECODER) += dpcm.o
OBJS-$(CONFIG_ROQ_DPCM_ENCODER) += roqaudioenc.o
OBJS-$(CONFIG_RPZA_DECODER) += rpza.o
-OBJS-$(CONFIG_RV10_DECODER) += rv10.o h263.o mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_RV10_DECODER) += rv10.o h263.o \
+ mpegvideo.o error_resilience.o
OBJS-$(CONFIG_RV10_ENCODER) += rv10enc.o
-OBJS-$(CONFIG_RV20_DECODER) += rv10.o h263.o mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_RV20_DECODER) += rv10.o h263.o \
+ mpegvideo.o error_resilience.o
OBJS-$(CONFIG_RV20_ENCODER) += rv20enc.o
-OBJS-$(CONFIG_RV30_DECODER) += rv30.o rv34.o h264pred.o rv30dsp.o mpegvideo.o error_resilience.o
-OBJS-$(CONFIG_RV40_DECODER) += rv40.o rv34.o h264pred.o rv40dsp.o mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_RV30_DECODER) += rv30.o rv34.o h264pred.o rv30dsp.o \
+ mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_RV40_DECODER) += rv40.o rv34.o h264pred.o rv40dsp.o \
+ mpegvideo.o error_resilience.o
OBJS-$(CONFIG_SGI_DECODER) += sgidec.o
OBJS-$(CONFIG_SGI_ENCODER) += sgienc.o rle.o
OBJS-$(CONFIG_SHORTEN_DECODER) += shorten.o
@@ -205,16 +275,24 @@ OBJS-$(CONFIG_SMACKAUD_DECODER) += smacker.o
OBJS-$(CONFIG_SMACKER_DECODER) += smacker.o
OBJS-$(CONFIG_SMC_DECODER) += smc.o
OBJS-$(CONFIG_SNOW_DECODER) += snow.o rangecoder.o
-OBJS-$(CONFIG_SNOW_ENCODER) += snow.o rangecoder.o motion_est.o ratecontrol.o h263.o mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_SNOW_ENCODER) += snow.o rangecoder.o motion_est.o \
+ ratecontrol.o h263.o \
+ mpegvideo.o error_resilience.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_SUNRAST_DECODER) += sunrast.o
-OBJS-$(CONFIG_SVQ1_DECODER) += svq1dec.o svq1.o h263.o mpegvideo.o error_resilience.o
-OBJS-$(CONFIG_SVQ1_ENCODER) += svq1enc.o svq1.o motion_est.o h263.o mpegvideo.o error_resilience.o
-OBJS-$(CONFIG_SVQ3_DECODER) += h264.o h264idct.o h264pred.o h264_parser.o cabac.o mpegvideo.o error_resilience.o svq1dec.o svq1.o h263.o
+OBJS-$(CONFIG_SVQ1_DECODER) += svq1dec.o svq1.o h263.o \
+ mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_SVQ1_ENCODER) += svq1enc.o svq1.o \
+ motion_est.o h263.o \
+ mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_SVQ3_DECODER) += h264.o h264idct.o h264pred.o \
+ h264_parser.o cabac.o \
+ mpegvideo.o error_resilience.o \
+ svq1dec.o svq1.o h263.o
OBJS-$(CONFIG_TARGA_DECODER) += targa.o
OBJS-$(CONFIG_TARGA_ENCODER) += targaenc.o rle.o
OBJS-$(CONFIG_THEORA_DECODER) += xiph.o
@@ -243,11 +321,15 @@ OBJS-$(CONFIG_VCR1_ENCODER) += vcr1.o
OBJS-$(CONFIG_VMDAUDIO_DECODER) += vmdav.o
OBJS-$(CONFIG_VMDVIDEO_DECODER) += vmdav.o
OBJS-$(CONFIG_VMNC_DECODER) += vmnc.o
-OBJS-$(CONFIG_VORBIS_DECODER) += vorbis_dec.o vorbis.o vorbis_data.o xiph.o
-OBJS-$(CONFIG_VORBIS_ENCODER) += vorbis_enc.o vorbis.o vorbis_data.o
+OBJS-$(CONFIG_VORBIS_DECODER) += vorbis_dec.o vorbis.o \
+ vorbis_data.o xiph.o
+OBJS-$(CONFIG_VORBIS_ENCODER) += vorbis_enc.o vorbis.o \
+ vorbis_data.o
OBJS-$(CONFIG_VP3_DECODER) += vp3.o vp3dsp.o
-OBJS-$(CONFIG_VP5_DECODER) += vp5.o vp56.o vp56data.o vp3dsp.o
-OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o vp3dsp.o vp6dsp.o huffman.o
+OBJS-$(CONFIG_VP5_DECODER) += vp5.o vp56.o vp56data.o \
+ vp3dsp.o
+OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o \
+ vp3dsp.o vp6dsp.o huffman.o
OBJS-$(CONFIG_VQA_DECODER) += vqavideo.o
OBJS-$(CONFIG_WAVPACK_DECODER) += wavpack.o
OBJS-$(CONFIG_WMAPRO_DECODER) += wmaprodec.o wma.o
@@ -255,9 +337,15 @@ OBJS-$(CONFIG_WMAV1_DECODER) += wmadec.o wma.o
OBJS-$(CONFIG_WMAV1_ENCODER) += wmaenc.o wma.o
OBJS-$(CONFIG_WMAV2_DECODER) += wmadec.o wma.o
OBJS-$(CONFIG_WMAV2_ENCODER) += wmaenc.o wma.o
-OBJS-$(CONFIG_WMV1_DECODER) += h263dec.o h263.o mpegvideo.o error_resilience.o
-OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o msmpeg4.o msmpeg4data.o h263dec.o h263.o intrax8.o intrax8dsp.o mpegvideo.o error_resilience.o
-OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o msmpeg4.o msmpeg4data.o
+OBJS-$(CONFIG_WMV1_DECODER) += h263dec.o h263.o \
+ mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o \
+ msmpeg4.o msmpeg4data.o \
+ h263dec.o h263.o \
+ intrax8.o intrax8dsp.o \
+ mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o \
+ msmpeg4.o msmpeg4data.o
OBJS-$(CONFIG_WNV1_DECODER) += wnv1.o
OBJS-$(CONFIG_WS_SND1_DECODER) += ws-snd1.o
OBJS-$(CONFIG_XAN_DPCM_DECODER) += dpcm.o
@@ -359,20 +447,26 @@ OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcm.o
# libavformat dependencies
OBJS-$(CONFIG_ADTS_MUXER) += mpeg4audio.o
-OBJS-$(CONFIG_EAC3_DEMUXER) += ac3_parser.o ac3tab.o aac_ac3_parser.o
+OBJS-$(CONFIG_DV_DEMUXER) += dvdata.o
+OBJS-$(CONFIG_DV_MUXER) += dvdata.o
+OBJS-$(CONFIG_EAC3_DEMUXER) += ac3_parser.o ac3tab.o \
+ aac_ac3_parser.o
OBJS-$(CONFIG_FLAC_DEMUXER) += flacdec.o flacdata.o flac.o
OBJS-$(CONFIG_FLAC_MUXER) += flacdec.o flacdata.o flac.o
OBJS-$(CONFIG_FLV_DEMUXER) += mpeg4audio.o
OBJS-$(CONFIG_GXF_DEMUXER) += mpeg12data.o
-OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER) += xiph.o mpeg4audio.o flacdec.o flacdata.o flac.o
+OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER) += xiph.o mpeg4audio.o \
+ flacdec.o flacdata.o flac.o
OBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio.o
-OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o mpeg4audio.o flacdec.o flacdata.o flac.o
+OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o mpeg4audio.o \
+ flacdec.o flacdata.o flac.o
OBJS-$(CONFIG_MOV_DEMUXER) += mpeg4audio.o mpegaudiodata.o
OBJS-$(CONFIG_MPEGTS_MUXER) += mpegvideo.o
OBJS-$(CONFIG_NUT_MUXER) += mpegaudiodata.o
OBJS-$(CONFIG_OGG_DEMUXER) += flacdec.o flacdata.o flac.o
OBJS-$(CONFIG_OGG_MUXER) += xiph.o flacdec.o flacdata.o flac.o
OBJS-$(CONFIG_RTP_MUXER) += mpegvideo.o
+OBJS-$(CONFIG_SPDIF_MUXER) += aac_parser.o aac_ac3_parser.o
# external codec libraries
OBJS-$(CONFIG_LIBDIRAC_DECODER) += libdiracdec.o
@@ -389,8 +483,12 @@ OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER) += libopencore-amr.o
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER) += libopencore-amr.o
OBJS-$(CONFIG_LIBOPENCORE_AMRWB_ENCODER) += libopencore-amr.o
OBJS-$(CONFIG_LIBOPENJPEG_DECODER) += libopenjpeg.o
-OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER) += libschroedingerdec.o libschroedinger.o libdirac_libschro.o
-OBJS-$(CONFIG_LIBSCHROEDINGER_ENCODER) += libschroedingerenc.o libschroedinger.o libdirac_libschro.o
+OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER) += libschroedingerdec.o \
+ libschroedinger.o \
+ libdirac_libschro.o
+OBJS-$(CONFIG_LIBSCHROEDINGER_ENCODER) += libschroedingerenc.o \
+ libschroedinger.o \
+ libdirac_libschro.o
OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o
OBJS-$(CONFIG_LIBTHEORA_ENCODER) += libtheoraenc.o
OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbis.o
@@ -398,8 +496,10 @@ OBJS-$(CONFIG_LIBX264_ENCODER) += libx264.o
OBJS-$(CONFIG_LIBXVID_ENCODER) += libxvidff.o libxvid_rc.o
# parsers
-OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o mpeg4audio.o
-OBJS-$(CONFIG_AC3_PARSER) += ac3_parser.o ac3tab.o aac_ac3_parser.o
+OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o \
+ mpeg4audio.o
+OBJS-$(CONFIG_AC3_PARSER) += ac3_parser.o ac3tab.o \
+ aac_ac3_parser.o
OBJS-$(CONFIG_CAVSVIDEO_PARSER) += cavs_parser.o
OBJS-$(CONFIG_DCA_PARSER) += dca_parser.o
OBJS-$(CONFIG_DIRAC_PARSER) += dirac_parser.o
@@ -408,26 +508,37 @@ OBJS-$(CONFIG_DVBSUB_PARSER) += dvbsub_parser.o
OBJS-$(CONFIG_DVDSUB_PARSER) += dvdsub_parser.o
OBJS-$(CONFIG_H261_PARSER) += h261_parser.o
OBJS-$(CONFIG_H263_PARSER) += h263_parser.o
-OBJS-$(CONFIG_H264_PARSER) += h264_parser.o h264.o h264idct.o h264pred.o cabac.o mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_H264_PARSER) += h264_parser.o h264.o h264idct.o \
+ h264pred.o cabac.o \
+ mpegvideo.o error_resilience.o
OBJS-$(CONFIG_LATM_PARSER) += latm_parser.o
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 mpegvideo.o error_resilience.o
-OBJS-$(CONFIG_MPEGAUDIO_PARSER) += mpegaudio_parser.o mpegaudiodecheader.o mpegaudiodata.o
-OBJS-$(CONFIG_MPEGVIDEO_PARSER) += mpegvideo_parser.o mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_MPEG4VIDEO_PARSER) += mpeg4video_parser.o h263.o \
+ mpegvideo.o error_resilience.o
+OBJS-$(CONFIG_MPEGAUDIO_PARSER) += mpegaudio_parser.o \
+ mpegaudiodecheader.o mpegaudiodata.o
+OBJS-$(CONFIG_MPEGVIDEO_PARSER) += mpegvideo_parser.o \
+ mpeg12.o mpeg12data.o \
+ mpegvideo.o error_resilience.o
OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o
-OBJS-$(CONFIG_VC1_PARSER) += vc1_parser.o vc1.o vc1data.o msmpeg4data.o h263dec.o h263.o error_resilience.o intrax8.o mpegvideo.o msmpeg4.o
+OBJS-$(CONFIG_VC1_PARSER) += vc1_parser.o vc1.o vc1data.o \
+ msmpeg4.o msmpeg4data.o \
+ h263dec.o h263.o intrax8.o \
+ mpegvideo.o error_resilience.o
OBJS-$(CONFIG_VP3_PARSER) += vp3_parser.o
# bitstream filters
-OBJS-$(CONFIG_AAC_ADTSTOASC_BSF) += aac_adtstoasc_bsf.o aac_parser.o aac_ac3_parser.o mpeg4audio.o
+OBJS-$(CONFIG_AAC_ADTSTOASC_BSF) += aac_adtstoasc_bsf.o aac_parser.o \
+ aac_ac3_parser.o mpeg4audio.o
OBJS-$(CONFIG_DUMP_EXTRADATA_BSF) += dump_extradata_bsf.o
OBJS-$(CONFIG_H264_MP4TOANNEXB_BSF) += h264_mp4toannexb_bsf.o
OBJS-$(CONFIG_IMX_DUMP_HEADER_BSF) += imx_dump_header_bsf.o
OBJS-$(CONFIG_MJPEGA_DUMP_HEADER_BSF) += mjpega_dump_header_bsf.o
OBJS-$(CONFIG_MOV2TEXTSUB_BSF) += movsub_bsf.o
OBJS-$(CONFIG_MP3_HEADER_COMPRESS_BSF) += mp3_header_compress_bsf.o
-OBJS-$(CONFIG_MP3_HEADER_DECOMPRESS_BSF) += mp3_header_decompress_bsf.o mpegaudiodata.o
+OBJS-$(CONFIG_MP3_HEADER_DECOMPRESS_BSF) += mp3_header_decompress_bsf.o \
+ mpegaudiodata.o
OBJS-$(CONFIG_NOISE_BSF) += noise_bsf.o
OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF) += remove_extradata_bsf.o
OBJS-$(CONFIG_TEXT2MOVSUB_BSF) += movsub_bsf.o
@@ -447,20 +558,25 @@ OBJS-$(ARCH_X86) += $(X86-OBJS-yes)
YASM-OBJS-FFT-$(HAVE_AMD3DNOW) += x86/fft_3dn.o
YASM-OBJS-FFT-$(HAVE_AMD3DNOWEXT) += x86/fft_3dn2.o
YASM-OBJS-FFT-$(HAVE_SSE) += x86/fft_sse.o
-YASM-OBJS-$(CONFIG_FFT) += x86/fft_mmx.o $(YASM-OBJS-FFT-yes)
+YASM-OBJS-$(CONFIG_FFT) += x86/fft_mmx.o \
+ $(YASM-OBJS-FFT-yes)
YASM-OBJS-$(CONFIG_GPL) += x86/h264_deblock_sse2.o \
x86/h264_idct_sse2.o \
MMX-OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsdsp_mmx.o
MMX-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_mmx.o
-MMX-OBJS-$(CONFIG_FLAC_ENCODER) += x86/flacdsp_mmx.o
MMX-OBJS-$(CONFIG_GPL) += x86/idct_mmx.o
+MMX-OBJS-$(CONFIG_LPC) += x86/lpc_mmx.o
MMX-OBJS-$(CONFIG_SNOW_DECODER) += x86/snowdsp_mmx.o
MMX-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_mmx.o
-MMX-OBJS-$(CONFIG_VP3_DECODER) += x86/vp3dsp_mmx.o x86/vp3dsp_sse2.o
-MMX-OBJS-$(CONFIG_VP5_DECODER) += x86/vp3dsp_mmx.o x86/vp3dsp_sse2.o
-MMX-OBJS-$(CONFIG_VP6_DECODER) += x86/vp3dsp_mmx.o x86/vp3dsp_sse2.o \
- x86/vp6dsp_mmx.o x86/vp6dsp_sse2.o
+MMX-OBJS-$(CONFIG_VP3_DECODER) += x86/vp3dsp_mmx.o \
+ x86/vp3dsp_sse2.o
+MMX-OBJS-$(CONFIG_VP5_DECODER) += x86/vp3dsp_mmx.o \
+ x86/vp3dsp_sse2.o
+MMX-OBJS-$(CONFIG_VP6_DECODER) += x86/vp3dsp_mmx.o \
+ x86/vp3dsp_sse2.o \
+ x86/vp6dsp_mmx.o \
+ x86/vp6dsp_sse2.o
MMX-OBJS-$(HAVE_YASM) += x86/dsputil_yasm.o \
$(YASM-OBJS-yes)
@@ -485,6 +601,7 @@ OBJS-$(ARCH_ALPHA) += alpha/dsputil_alpha.o \
OBJS-$(ARCH_ARM) += arm/dsputil_init_arm.o \
arm/dsputil_arm.o \
arm/fft_init_arm.o \
+ arm/h264pred_init_arm.o \
arm/jrevdct_arm.o \
arm/mpegvideo_arm.o \
arm/simple_idct_arm.o \
@@ -495,6 +612,7 @@ OBJS-$(HAVE_ARMV5TE) += arm/dsputil_init_armv5te.o \
arm/simple_idct_armv5te.o \
OBJS-$(HAVE_ARMV6) += arm/dsputil_init_armv6.o \
+ arm/dsputil_armv6.o \
arm/simple_idct_armv6.o \
OBJS-$(HAVE_ARMVFP) += arm/dsputil_vfp.o \
@@ -509,6 +627,7 @@ NEON-OBJS-$(CONFIG_MDCT) += arm/mdct_neon.o \
NEON-OBJS-$(CONFIG_H264_DECODER) += arm/h264dsp_neon.o \
arm/h264idct_neon.o \
+ arm/h264pred_neon.o \
NEON-OBJS-$(CONFIG_VP3_DECODER) += arm/vp3dsp_neon.o
@@ -569,8 +688,37 @@ TESTPROGS = cabac dct eval fft h264 iirfilter rangecoder snow
TESTPROGS-$(ARCH_X86) += x86/cpuid
TESTPROGS-$(HAVE_MMX) += motion
+HOSTPROGS = costablegen
+
DIRS = alpha arm bfin mlib ppc ps2 sh4 sparc x86
+CLEANFILES = sin_tables.c cos_tables.c *_tables.h *_tablegen$(HOSTEXESUF)
+
include $(SUBDIR)../subdir.mak
$(SUBDIR)dct-test$(EXESUF): $(SUBDIR)dctref.o
+
+$(SUBDIR)cos_tables.c: $(SUBDIR)costablegen$(HOSTEXESUF)
+ ./$< > $@
+
+$(SUBDIR)sin_tables.c: $(SUBDIR)costablegen$(HOSTEXESUF)
+ ./$< sin > $@
+
+ifdef CONFIG_MPEGAUDIO_HP
+$(SUBDIR)mpegaudio_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DFRAC_BITS=23
+$(SUBDIR)mpegaudio_tablegen.ho: CPPFLAGS += -DFRAC_BITS=23
+else
+$(SUBDIR)mpegaudio_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DFRAC_BITS=15
+$(SUBDIR)mpegaudio_tablegen.ho: CPPFLAGS += -DFRAC_BITS=15
+endif
+
+$(SUBDIR)%_tablegen$(HOSTEXESUF): $(SUBDIR)%_tablegen.c $(SUBDIR)tableprint.c
+ $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ $(HOSTLIBS)
+
+$(SUBDIR)%_tables.h: $(SUBDIR)%_tablegen$(HOSTEXESUF)
+ ./$< > $@
+
+ifdef CONFIG_HARDCODED_TABLES
+$(SUBDIR)mpegaudiodec.o: $(SUBDIR)mpegaudio_tables.h
+$(SUBDIR)motionpixels.o: $(SUBDIR)motionpixels_tables.h
+endif
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac.c
index 2dc79607e9..c53d56813d 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac.c
@@ -194,7 +194,7 @@ static int che_configure(AACContext *ac,
static int output_configure(AACContext *ac,
enum ChannelPosition che_pos[4][MAX_ELEM_ID],
enum ChannelPosition new_che_pos[4][MAX_ELEM_ID],
- int channel_config)
+ int channel_config, enum OCStatus oc_type)
{
AVCodecContext *avctx = ac->avccontext;
int i, type, channels = 0, ret;
@@ -239,7 +239,7 @@ static int output_configure(AACContext *ac,
avctx->channels = channels;
- ac->output_configured = 1;
+ ac->output_configured = oc_type;
return 0;
}
@@ -390,7 +390,7 @@ static int decode_ga_specific_config(AACContext *ac, GetBitContext *gb,
if ((ret = set_default_channel_config(ac, new_che_pos, channel_config)))
return ret;
}
- if ((ret = output_configure(ac, ac->che_pos, new_che_pos, channel_config)))
+ if ((ret = output_configure(ac, ac->che_pos, new_che_pos, channel_config, OC_GLOBAL_HDR)))
return ret;
if (extension_flag) {
@@ -527,7 +527,7 @@ static av_cold int aac_decode_init(AVCodecContext *avccontext)
// 32768 - Required to scale values to the correct range for the bias method
// for float to int16 conversion.
- if (ac->dsp.float_to_int16 == ff_float_to_int16_c) {
+ if (ac->dsp.float_to_int16_interleave == ff_float_to_int16_interleave_c) {
ac->add_bias = 385.0f;
ac->sf_scale = 1. / (-1024. * 32768.);
ac->sf_offset = 0;
@@ -678,7 +678,7 @@ static int decode_band_types(AACContext *ac, enum BandType band_type[120],
for (g = 0; g < ics->num_window_groups; g++) {
int k = 0;
while (k < ics->max_sfb) {
- uint8_t sect_len = k;
+ uint8_t sect_end = k;
int sect_len_incr;
int sect_band_type = get_bits(gb, 4);
if (sect_band_type == 12) {
@@ -686,17 +686,17 @@ static int decode_band_types(AACContext *ac, enum BandType band_type[120],
return -1;
}
while ((sect_len_incr = get_bits(gb, bits)) == (1 << bits) - 1)
- sect_len += sect_len_incr;
- sect_len += sect_len_incr;
- if (sect_len > ics->max_sfb) {
+ sect_end += sect_len_incr;
+ sect_end += sect_len_incr;
+ if (sect_end > ics->max_sfb) {
av_log(ac->avccontext, AV_LOG_ERROR,
"Number of bands (%d) exceeds limit (%d).\n",
- sect_len, ics->max_sfb);
+ sect_end, ics->max_sfb);
return -1;
}
- for (; k < sect_len; k++) {
+ for (; k < sect_end; k++) {
band_type [idx] = sect_band_type;
- band_type_run_end[idx++] = sect_len;
+ band_type_run_end[idx++] = sect_end;
}
}
}
@@ -1676,18 +1676,24 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
size = ff_aac_parse_header(gb, &hdr_info);
if (size > 0) {
- if (!ac->output_configured && hdr_info.chan_config) {
+ if (ac->output_configured != OC_LOCKED && hdr_info.chan_config) {
enum ChannelPosition new_che_pos[4][MAX_ELEM_ID];
memset(new_che_pos, 0, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0]));
ac->m4ac.chan_config = hdr_info.chan_config;
if (set_default_channel_config(ac, new_che_pos, hdr_info.chan_config))
return -7;
- if (output_configure(ac, ac->che_pos, new_che_pos, 1))
+ if (output_configure(ac, ac->che_pos, new_che_pos, hdr_info.chan_config, OC_TRIAL_FRAME))
return -7;
+ } else if (ac->output_configured != OC_LOCKED) {
+ ac->output_configured = OC_NONE;
}
+ if (ac->output_configured != OC_LOCKED)
+ ac->m4ac.sbr = -1;
ac->m4ac.sample_rate = hdr_info.sample_rate;
ac->m4ac.sampling_index = hdr_info.sampling_index;
ac->m4ac.object_type = hdr_info.object_type;
+ if (!ac->avccontext->sample_rate)
+ ac->avccontext->sample_rate = hdr_info.sample_rate;
if (hdr_info.num_aac_frames == 1) {
if (!hdr_info.crc_absent)
skip_bits(gb, 16);
@@ -1760,11 +1766,11 @@ static int aac_decode_frame(AVCodecContext *avccontext, void *data,
memset(new_che_pos, 0, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0]));
if ((err = decode_pce(ac, new_che_pos, &gb)))
break;
- if (ac->output_configured)
+ if (ac->output_configured > OC_TRIAL_PCE)
av_log(avccontext, AV_LOG_ERROR,
"Not evaluating a further program_config_element as this construct is dubious at best.\n");
else
- err = output_configure(ac, ac->che_pos, new_che_pos, 0);
+ err = output_configure(ac, ac->che_pos, new_che_pos, 0, OC_TRIAL_PCE);
break;
}
@@ -1804,6 +1810,9 @@ static int aac_decode_frame(AVCodecContext *avccontext, void *data,
ac->dsp.float_to_int16_interleave(data, (const float **)ac->output_data, 1024, avccontext->channels);
+ if (ac->output_configured)
+ ac->output_configured = OC_LOCKED;
+
return buf_size;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac.h
index abe13268d5..3472a6163d 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac.h
@@ -103,6 +103,17 @@ enum CouplingPoint {
};
/**
+ * Output configuration status
+ */
+enum OCStatus {
+ OC_NONE, //< Output unconfigured
+ OC_TRIAL_PCE, //< Output configuration under trial specified by an inband PCE
+ OC_TRIAL_FRAME, //< Output configuration under trial specified by a frame header
+ OC_GLOBAL_HDR, //< Output configuration set in a global header but not yet locked
+ OC_LOCKED, //< Output configuration locked in place
+};
+
+/**
* Predictor State
*/
typedef struct {
@@ -275,7 +286,7 @@ typedef struct {
DECLARE_ALIGNED(16, float, temp[128]);
- int output_configured;
+ enum OCStatus output_configured;
} AACContext;
#endif /* AVCODEC_AAC_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac_adtstoasc_bsf.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac_adtstoasc_bsf.c
index 96876dd62f..9d53a011c8 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac_adtstoasc_bsf.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac_adtstoasc_bsf.c
@@ -84,7 +84,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
buf += get_bits_count(&gb)/8;
}
avctx->extradata_size = 2 + pce_size;
- avctx->extradata = av_malloc(avctx->extradata_size);
+ avctx->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
init_put_bits(&pb, avctx->extradata, avctx->extradata_size);
put_bits(&pb, 5, hdr.object_type);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3.c
index f0f14e360c..20b339741c 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3.c
@@ -228,7 +228,7 @@ void ff_ac3_bit_alloc_calc_bap(int16_t *mask, int16_t *psd, int start, int end,
band = bin_to_band_tab[start];
do {
int m = (FFMAX(mask[band] - snr_offset - floor, 0) & 0x1FE0) + floor;
- int band_end = FFMIN(bin + ff_ac3_critical_band_size_tab[band], end);
+ int band_end = FFMIN(band_start_tab[band+1], end);
for (; bin < band_end; bin++) {
int address = av_clip((psd[bin] - m) >> 5, 0, 63);
bap[bin] = bap_tab[address];
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3dec.c
index 1ab17d72fb..82091bc6e3 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3dec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3dec.c
@@ -607,11 +607,10 @@ static void do_rematrixing(AC3DecodeContext *s)
end = FFMIN(s->end_freq[1], s->end_freq[2]);
- i = ff_ac3_rematrix_band_tab[0];
for(bnd=0; bnd<s->num_rematrixing_bands; bnd++) {
if(s->rematrixing_flags[bnd]) {
bndend = FFMIN(end, ff_ac3_rematrix_band_tab[bnd+1]);
- for(; i<bndend; i++) {
+ for(i=ff_ac3_rematrix_band_tab[bnd]; i<bndend; i++) {
int tmp0 = s->fixed_coeffs[1][i];
s->fixed_coeffs[1][i] += s->fixed_coeffs[2][i];
s->fixed_coeffs[2][i] = tmp0 - s->fixed_coeffs[2][i];
@@ -1168,7 +1167,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
for(ch=1; ch<=s->channels; ch++) {
float gain = s->mul_bias / 4194304.0f;
if(s->channel_mode == AC3_CHMODE_DUALMONO) {
- gain *= s->dynamic_range[ch-1];
+ gain *= s->dynamic_range[2-ch];
} else {
gain *= s->dynamic_range[0];
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3enc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3enc.c
index 9b3e00e6e4..6f8fe009af 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3enc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3enc.c
@@ -27,7 +27,7 @@
//#define DEBUG_BITALLOC
#include "libavutil/crc.h"
#include "avcodec.h"
-#include "get_bits.h" // for ff_reverse
+#include "libavutil/common.h" /* for av_reverse */
#include "put_bits.h"
#include "ac3.h"
#include "audioconvert.h"
@@ -138,7 +138,7 @@ static void fft(IComplex *z, int ln)
/* reverse */
for(j=0;j<np;j++) {
- int k = ff_reverse[j] >> (8 - ln);
+ int k = av_reverse[j] >> (8 - ln);
if (k < j)
FFSWAP(IComplex, z[k], z[j]);
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_filters.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_filters.c
index 2db69d595d..9f720a5b96 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_filters.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_filters.c
@@ -73,6 +73,26 @@ void ff_acelp_interpolate(int16_t* out, const int16_t* in,
}
}
+void ff_acelp_interpolatef(float *out, const float *in,
+ const float *filter_coeffs, int precision,
+ int frac_pos, int filter_length, int length)
+{
+ int n, i;
+
+ for (n = 0; n < length; n++) {
+ int idx = 0;
+ float v = 0;
+
+ for (i = 0; i < filter_length;) {
+ v += in[n + i] * filter_coeffs[idx + frac_pos];
+ idx += precision;
+ i++;
+ v += in[n - i] * filter_coeffs[idx - frac_pos];
+ }
+ out[n] = v;
+ }
+}
+
void ff_acelp_high_pass_filter(int16_t* out, int hpf_f[2],
const int16_t* in, int length)
@@ -110,3 +130,16 @@ void ff_acelp_apply_order_2_transfer_function(float *buf,
mem[0] = tmp;
}
}
+
+void ff_tilt_compensation(float *mem, float tilt, float *samples, int size)
+{
+ float new_tilt_mem = samples[size - 1];
+ int i;
+
+ for (i = size - 1; i > 0; i--)
+ samples[i] -= tilt * samples[i - 1];
+
+ samples[0] -= tilt * *mem;
+ *mem = new_tilt_mem;
+}
+
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_filters.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_filters.h
index 2cbe9bb17d..c5be5a6cb1 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_filters.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_filters.h
@@ -56,6 +56,14 @@ void ff_acelp_interpolate(int16_t* out, const int16_t* in,
int frac_pos, int filter_length, int length);
/**
+ * Floating point version of ff_acelp_interpolate()
+ */
+void ff_acelp_interpolatef(float *out, const float *in,
+ const float *filter_coeffs, int precision,
+ int frac_pos, int filter_length, int length);
+
+
+/**
* high-pass filtering and upscaling (4.2.5 of G.729).
* @param out [out] output buffer for filtered speech data
* @param hpf_f [in/out] past filtered data from previous (2 items long)
@@ -97,4 +105,15 @@ void ff_acelp_apply_order_2_transfer_function(float *samples,
float gain,
float mem[2], int n);
+/**
+ * Apply tilt compensation filter, 1 - tilt * z-1.
+ *
+ * @param mem pointer to the filter's state (one single float)
+ * @param tilt tilt factor
+ * @param samples array where the filter is applied
+ * @param size the size of the samples array
+ */
+void ff_tilt_compensation(float *mem, float tilt, float *samples, int size);
+
+
#endif /* AVCODEC_ACELP_FILTERS_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_pitch_delay.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_pitch_delay.c
index ac929c4689..c3e2409c1e 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_pitch_delay.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_pitch_delay.c
@@ -119,3 +119,68 @@ int16_t ff_acelp_decode_gain_code(
return mr_energy >> 12;
#endif
}
+
+float ff_amr_set_fixed_gain(float fixed_gain_factor, float fixed_mean_energy,
+ float *prediction_error, float energy_mean,
+ const float *pred_table)
+{
+ // Equations 66-69:
+ // ^g_c = ^gamma_gc * 100.05 (predicted dB + mean dB - dB of fixed vector)
+ // Note 10^(0.05 * -10log(average x2)) = 1/sqrt((average x2)).
+ float val = fixed_gain_factor *
+ exp2f(log2f(10.0) * 0.05 *
+ (ff_dot_productf(pred_table, prediction_error, 4) +
+ energy_mean)) /
+ sqrtf(fixed_mean_energy);
+
+ // update quantified prediction error energy history
+ memmove(&prediction_error[0], &prediction_error[1],
+ 3 * sizeof(prediction_error[0]));
+ prediction_error[3] = 20.0 * log10f(fixed_gain_factor);
+
+ return val;
+}
+
+void ff_decode_pitch_lag(int *lag_int, int *lag_frac, int pitch_index,
+ const int prev_lag_int, const int subframe,
+ int third_as_first, int resolution)
+{
+ /* Note n * 10923 >> 15 is floor(x/3) for 0 <= n <= 32767 */
+ if (subframe == 0 || (subframe == 2 && third_as_first)) {
+
+ if (pitch_index < 197)
+ pitch_index += 59;
+ else
+ pitch_index = 3 * pitch_index - 335;
+
+ } else {
+ if (resolution == 4) {
+ int search_range_min = av_clip(prev_lag_int - 5, PITCH_DELAY_MIN,
+ PITCH_DELAY_MAX - 9);
+
+ // decoding with 4-bit resolution
+ if (pitch_index < 4) {
+ // integer only precision for [search_range_min, search_range_min+3]
+ pitch_index = 3 * (pitch_index + search_range_min) + 1;
+ } else if (pitch_index < 12) {
+ // 1/3 fractional precision for [search_range_min+3 1/3, search_range_min+5 2/3]
+ pitch_index += 3 * search_range_min + 7;
+ } else {
+ // integer only precision for [search_range_min+6, search_range_min+9]
+ pitch_index = 3 * (pitch_index + search_range_min - 6) + 1;
+ }
+ } else {
+ // decoding with 5 or 6 bit resolution, 1/3 fractional precision
+ pitch_index--;
+
+ if (resolution == 5) {
+ pitch_index += 3 * av_clip(prev_lag_int - 10, PITCH_DELAY_MIN,
+ PITCH_DELAY_MAX - 19);
+ } else
+ pitch_index += 3 * av_clip(prev_lag_int - 5, PITCH_DELAY_MIN,
+ PITCH_DELAY_MAX - 9);
+ }
+ }
+ *lag_int = pitch_index * 10923 >> 15;
+ *lag_frac = pitch_index - 3 * *lag_int - 1;
+}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_pitch_delay.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_pitch_delay.h
index 2504a9e3dd..2413145beb 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_pitch_delay.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_pitch_delay.h
@@ -220,4 +220,36 @@ int16_t ff_acelp_decode_gain_code(
int subframe_size,
int max_pred_order);
+/**
+ * Calculate fixed gain (part of section 6.1.3 of AMR spec)
+ *
+ * @param fixed_gain_factor gain correction factor
+ * @param fixed_energy decoded algebraic codebook vector energy
+ * @param prediction_error vector of the quantified predictor errors of
+ * the four previous subframes. It is updated by this function.
+ * @param energy_mean desired mean innovation energy
+ * @param pred_table table of four moving average coefficients
+ */
+float ff_amr_set_fixed_gain(float fixed_gain_factor, float fixed_mean_energy,
+ float *prediction_error, float energy_mean,
+ const float *pred_table);
+
+
+/**
+ * Decode the adaptive codebook index to the integer and fractional parts
+ * of the pitch lag for one subframe at 1/3 fractional precision.
+ *
+ * The choice of pitch lag is described in 3GPP TS 26.090 section 5.6.1.
+ *
+ * @param lag_int integer part of pitch lag of the current subframe
+ * @param lag_frac fractional part of pitch lag of the current subframe
+ * @param pitch_index parsed adaptive codebook (pitch) index
+ * @param prev_lag_int integer part of pitch lag for the previous subframe
+ * @param subframe current subframe number
+ * @param third_as_first treat the third frame the same way as the first
+ */
+void ff_decode_pitch_lag(int *lag_int, int *lag_frac, int pitch_index,
+ const int prev_lag_int, const int subframe,
+ int third_as_first, int resolution);
+
#endif /* AVCODEC_ACELP_PITCH_DELAY_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_vectors.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_vectors.c
index 5443006718..b83c270190 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_vectors.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_vectors.c
@@ -23,6 +23,7 @@
#include <inttypes.h>
#include "avcodec.h"
#include "acelp_vectors.h"
+#include "celp_math.h"
const uint8_t ff_fc_2pulses_9bits_track1[16] =
{
@@ -126,6 +127,26 @@ void ff_acelp_fc_pulse_per_track(
fc_v[tab2[pulse_indexes]] += (pulse_signs & 1) ? 8191 : -8192;
}
+void ff_decode_10_pulses_35bits(const int16_t *fixed_index,
+ AMRFixed *fixed_sparse,
+ const uint8_t *gray_decode,
+ int half_pulse_count, int bits)
+{
+ int i;
+ int mask = (1 << bits) - 1;
+
+ fixed_sparse->n = 2 * half_pulse_count;
+ for (i = 0; i < half_pulse_count; i++) {
+ const int pos1 = gray_decode[fixed_index[2*i+1] & mask] + i;
+ const int pos2 = gray_decode[fixed_index[2*i ] & mask] + i;
+ const float sign = (fixed_index[2*i+1] & (1 << bits)) ? -1.0 : 1.0;
+ fixed_sparse->x[2*i+1] = pos1;
+ fixed_sparse->x[2*i ] = pos2;
+ fixed_sparse->y[2*i+1] = sign;
+ fixed_sparse->y[2*i ] = pos2 < pos1 ? -sign : sign;
+ }
+}
+
void ff_acelp_weighted_vector_sum(
int16_t* out,
const int16_t *in_a,
@@ -155,3 +176,69 @@ void ff_weighted_vector_sumf(float *out, const float *in_a, const float *in_b,
out[i] = weight_coeff_a * in_a[i]
+ weight_coeff_b * in_b[i];
}
+
+void ff_adaptative_gain_control(float *buf_out, float speech_energ,
+ int size, float alpha, float *gain_mem)
+{
+ int i;
+ float postfilter_energ = ff_dot_productf(buf_out, buf_out, size);
+ float gain_scale_factor = 1.0;
+ float mem = *gain_mem;
+
+ if (postfilter_energ)
+ gain_scale_factor = sqrt(speech_energ / postfilter_energ);
+
+ gain_scale_factor *= 1.0 - alpha;
+
+ for (i = 0; i < size; i++) {
+ mem = alpha * mem + gain_scale_factor;
+ buf_out[i] *= mem;
+ }
+
+ *gain_mem = mem;
+}
+
+void ff_scale_vector_to_given_sum_of_squares(float *out, const float *in,
+ float sum_of_squares, const int n)
+{
+ int i;
+ float scalefactor = ff_dot_productf(in, in, n);
+ if (scalefactor)
+ scalefactor = sqrt(sum_of_squares / scalefactor);
+ for (i = 0; i < n; i++)
+ out[i] = in[i] * scalefactor;
+}
+
+void ff_set_fixed_vector(float *out, const AMRFixed *in, float scale, int size)
+{
+ int i;
+
+ for (i=0; i < in->n; i++) {
+ int x = in->x[i];
+ float y = in->y[i] * scale;
+ out[x] += y;
+
+ x += in->pitch_lag;
+ while (x < size) {
+ y *= in->pitch_fac;
+ out[x] += y;
+ x += in->pitch_lag;
+ }
+ }
+}
+
+void ff_clear_fixed_vector(float *out, const AMRFixed *in, int size)
+{
+ int i;
+
+ for (i=0; i < in->n; i++) {
+ int x = in->x[i];
+ out[x] = 0.0;
+
+ x += in->pitch_lag;
+ while (x < size) {
+ out[x] = 0.0;
+ x += in->pitch_lag;
+ }
+ }
+}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_vectors.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_vectors.h
index 3a47a7b61c..10cbc08946 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_vectors.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/acelp_vectors.h
@@ -25,6 +25,15 @@
#include <stdint.h>
+/** Sparse representation for the algebraic codebook (fixed) vector */
+typedef struct {
+ int n;
+ int x[10];
+ float y[10];
+ int pitch_lag;
+ float pitch_fac;
+} AMRFixed;
+
/**
* Track|Pulse| Positions
* -------------------------------------------------------------------------
@@ -126,6 +135,24 @@ void ff_acelp_fc_pulse_per_track(
int bits);
/**
+ * Decode the algebraic codebook index to pulse positions and signs and
+ * construct the algebraic codebook vector for MODE_12k2.
+ *
+ * @note: The positions and signs are explicitly coded in MODE_12k2.
+ *
+ * @param fixed_index positions of the ten pulses
+ * @param fixed_sparse pointer to the algebraic codebook vector
+ * @param gray_decode gray decoding table
+ * @param half_pulse_count number of couples of pulses
+ * @param bits length of one pulse index in bits
+ */
+void ff_decode_10_pulses_35bits(const int16_t *fixed_index,
+ AMRFixed *fixed_sparse,
+ const uint8_t *gray_decode,
+ int half_pulse_count, int bits);
+
+
+/**
* weighted sum of two vectors with rounding.
* @param out [out] result of addition
* @param in_a first vector
@@ -164,4 +191,53 @@ void ff_acelp_weighted_vector_sum(
void ff_weighted_vector_sumf(float *out, const float *in_a, const float *in_b,
float weight_coeff_a, float weight_coeff_b, int length);
+/**
+ * Adaptative gain control (as used in AMR postfiltering)
+ *
+ * @param buf_out the input speech buffer
+ * @param speech_energ input energy
+ * @param size the input buffer size
+ * @param alpha exponential filter factor
+ * @param gain_mem a pointer to the filter memory (single float of size)
+ */
+void ff_adaptative_gain_control(float *buf_out, float speech_energ,
+ int size, float alpha, float *gain_mem);
+
+/**
+ * Set the sum of squares of a signal by scaling
+ *
+ * @param out output samples
+ * @param in input samples
+ * @param sum_of_squares new sum of squares
+ * @param n number of samples
+ *
+ * @note If the input is zero (or its energy underflows), the output is zero.
+ * This is the behavior of AGC in the AMR reference decoder. The QCELP
+ * reference decoder seems to have undefined behavior.
+ *
+ * TIA/EIA/IS-733 2.4.8.3-2/3/4/5, 2.4.8.6
+ * 3GPP TS 26.090 6.1 (6)
+ */
+void ff_scale_vector_to_given_sum_of_squares(float *out, const float *in,
+ float sum_of_squares, const int n);
+
+/**
+ * Add fixed vector to an array from a sparse representation
+ *
+ * @param out fixed vector with pitch sharpening
+ * @param in sparse fixed vector
+ * @param scale number to multiply the fixed vector by
+ * @param size the output vector size
+ */
+void ff_set_fixed_vector(float *out, const AMRFixed *in, float scale, int size);
+
+/**
+ * Clear array values set by set_fixed_vector
+ *
+ * @param out fixed vector to be cleared
+ * @param in sparse fixed vector
+ * @param size the output vector size
+ */
+void ff_clear_fixed_vector(float *out, const AMRFixed *in, int size);
+
#endif /* AVCODEC_ACELP_VECTORS_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/adpcm.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/adpcm.c
index 13f20b4293..6abe18495c 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/adpcm.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/adpcm.c
@@ -86,10 +86,12 @@ static const int AdaptationTable[] = {
768, 614, 512, 409, 307, 230, 230, 230
};
+/** Divided by 4 to fit in 8-bit integers */
static const uint8_t AdaptCoeff1[] = {
64, 128, 0, 48, 60, 115, 98
};
+/** Divided by 4 to fit in 8-bit integers */
static const int8_t AdaptCoeff2[] = {
0, -64, 0, 16, 0, -52, -58
};
@@ -152,6 +154,8 @@ typedef struct ADPCMContext {
#if CONFIG_ENCODERS
static av_cold int adpcm_encode_init(AVCodecContext *avctx)
{
+ uint8_t *extradata;
+ int i;
if (avctx->channels > 2)
return -1; /* only stereo or mono =) */
@@ -175,6 +179,16 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx)
avctx->frame_size = (BLKSIZE - 7 * avctx->channels) * 2 / avctx->channels + 2; /* each 16 bits sample gives one nibble */
/* and we have 7 bytes per channel overhead */
avctx->block_align = BLKSIZE;
+ avctx->extradata_size = 32;
+ extradata = avctx->extradata = av_malloc(avctx->extradata_size);
+ if (!extradata)
+ return AVERROR(ENOMEM);
+ bytestream_put_le16(&extradata, avctx->frame_size);
+ bytestream_put_le16(&extradata, 7); /* wNumCoef */
+ for (i = 0; i < 7; i++) {
+ bytestream_put_le16(&extradata, AdaptCoeff1[i] * 4);
+ bytestream_put_le16(&extradata, AdaptCoeff2[i] * 4);
+ }
break;
case CODEC_ID_ADPCM_YAMAHA:
avctx->frame_size = BLKSIZE * avctx->channels;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/alacenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/alacenc.c
index 7f3310bf2f..70b3b0f2b1 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/alacenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/alacenc.c
@@ -132,7 +132,16 @@ static void calc_predictor_params(AlacEncodeContext *s, int ch)
int shift[MAX_LPC_ORDER];
int opt_order;
- if (s->avctx->compression_level > 1) {
+ if (s->compression_level == 1) {
+ s->lpc[ch].lpc_order = 6;
+ s->lpc[ch].lpc_quant = 6;
+ s->lpc[ch].lpc_coeff[0] = 160;
+ s->lpc[ch].lpc_coeff[1] = -190;
+ s->lpc[ch].lpc_coeff[2] = 170;
+ s->lpc[ch].lpc_coeff[3] = -130;
+ s->lpc[ch].lpc_coeff[4] = 80;
+ s->lpc[ch].lpc_coeff[5] = -25;
+ } else {
opt_order = ff_lpc_calc_coefs(&s->dspctx, s->sample_buf[ch],
s->avctx->frame_size,
s->min_prediction_order,
@@ -143,15 +152,6 @@ static void calc_predictor_params(AlacEncodeContext *s, int ch)
s->lpc[ch].lpc_order = opt_order;
s->lpc[ch].lpc_quant = shift[opt_order-1];
memcpy(s->lpc[ch].lpc_coeff, coefs[opt_order-1], opt_order*sizeof(int));
- } else {
- s->lpc[ch].lpc_order = 6;
- s->lpc[ch].lpc_quant = 6;
- s->lpc[ch].lpc_coeff[0] = 160;
- s->lpc[ch].lpc_coeff[1] = -190;
- s->lpc[ch].lpc_coeff[2] = 170;
- s->lpc[ch].lpc_coeff[3] = -130;
- s->lpc[ch].lpc_coeff[4] = 80;
- s->lpc[ch].lpc_coeff[5] = -25;
}
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/allcodecs.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/allcodecs.c
index fd3f40e414..f5b1a9d7bf 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/allcodecs.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/allcodecs.c
@@ -71,6 +71,7 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (BMP, bmp);
REGISTER_DECODER (C93, c93);
REGISTER_DECODER (CAVS, cavs);
+ REGISTER_DECODER (CDGRAPHICS, cdgraphics);
REGISTER_DECODER (CINEPAK, cinepak);
REGISTER_DECODER (CLJR, cljr);
REGISTER_DECODER (CSCD, cscd);
@@ -96,6 +97,7 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (FLV, flv);
REGISTER_DECODER (FOURXM, fourxm);
REGISTER_DECODER (FRAPS, fraps);
+ REGISTER_DECODER (FRWU, frwu);
REGISTER_ENCDEC (GIF, gif);
REGISTER_ENCDEC (H261, h261);
REGISTER_ENCDEC (H263, h263);
@@ -122,6 +124,7 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (MPEG1VIDEO, mpeg1video);
REGISTER_ENCDEC (MPEG2VIDEO, mpeg2video);
REGISTER_ENCDEC (MPEG4, mpeg4);
+ REGISTER_DECODER (MPEG4_VDPAU, mpeg4_vdpau);
REGISTER_DECODER (MPEGVIDEO, mpegvideo);
REGISTER_DECODER (MPEG_VDPAU, mpeg_vdpau);
REGISTER_DECODER (MPEG1_VDPAU, mpeg1_vdpau);
@@ -143,6 +146,7 @@ void avcodec_register_all(void)
REGISTER_DECODER (QDRAW, qdraw);
REGISTER_DECODER (QPEG, qpeg);
REGISTER_ENCDEC (QTRLE, qtrle);
+ REGISTER_DECODER (R210, r210);
REGISTER_ENCDEC (RAWVIDEO, rawvideo);
REGISTER_DECODER (RL2, rl2);
REGISTER_ENCDEC (ROQ, roq);
@@ -198,6 +202,7 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (AAC, aac);
REGISTER_ENCDEC (AC3, ac3);
REGISTER_ENCDEC (ALAC, alac);
+ REGISTER_DECODER (ALS, als);
REGISTER_DECODER (APE, ape);
REGISTER_DECODER (ATRAC1, atrac1);
REGISTER_DECODER (ATRAC3, atrac3);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/alsdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/alsdec.c
new file mode 100644
index 0000000000..f9eea8d5ea
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/alsdec.c
@@ -0,0 +1,1260 @@
+/*
+ * MPEG-4 ALS decoder
+ * Copyright (c) 2009 Thilo Borgmann <thilo.borgmann _at_ googlemail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file libavcodec/alsdec.c
+ * MPEG-4 ALS decoder
+ * @author Thilo Borgmann <thilo.borgmann _at_ googlemail.com>
+ */
+
+
+//#define DEBUG
+
+
+#include "avcodec.h"
+#include "get_bits.h"
+#include "unary.h"
+#include "mpeg4audio.h"
+#include "bytestream.h"
+
+#include <stdint.h>
+
+/** Rice parameters and corresponding index offsets for decoding the
+ * indices of scaled PARCOR values. The table choosen is set globally
+ * by the encoder and stored in ALSSpecificConfig.
+ */
+static const int8_t parcor_rice_table[3][20][2] = {
+ { {-52, 4}, {-29, 5}, {-31, 4}, { 19, 4}, {-16, 4},
+ { 12, 3}, { -7, 3}, { 9, 3}, { -5, 3}, { 6, 3},
+ { -4, 3}, { 3, 3}, { -3, 2}, { 3, 2}, { -2, 2},
+ { 3, 2}, { -1, 2}, { 2, 2}, { -1, 2}, { 2, 2} },
+ { {-58, 3}, {-42, 4}, {-46, 4}, { 37, 5}, {-36, 4},
+ { 29, 4}, {-29, 4}, { 25, 4}, {-23, 4}, { 20, 4},
+ {-17, 4}, { 16, 4}, {-12, 4}, { 12, 3}, {-10, 4},
+ { 7, 3}, { -4, 4}, { 3, 3}, { -1, 3}, { 1, 3} },
+ { {-59, 3}, {-45, 5}, {-50, 4}, { 38, 4}, {-39, 4},
+ { 32, 4}, {-30, 4}, { 25, 3}, {-23, 3}, { 20, 3},
+ {-20, 3}, { 16, 3}, {-13, 3}, { 10, 3}, { -7, 3},
+ { 3, 3}, { 0, 3}, { -1, 3}, { 2, 3}, { -1, 2} }
+};
+
+
+/** Scaled PARCOR values used for the first two PARCOR coefficients.
+ * To be indexed by the Rice coded indices.
+ * Generated by: parcor_scaled_values[i] = 32 + ((i * (i+1)) << 7) - (1 << 20)
+ * Actual values are divided by 32 in order to be stored in 16 bits.
+ */
+static const int16_t parcor_scaled_values[] = {
+ -1048544 / 32, -1048288 / 32, -1047776 / 32, -1047008 / 32,
+ -1045984 / 32, -1044704 / 32, -1043168 / 32, -1041376 / 32,
+ -1039328 / 32, -1037024 / 32, -1034464 / 32, -1031648 / 32,
+ -1028576 / 32, -1025248 / 32, -1021664 / 32, -1017824 / 32,
+ -1013728 / 32, -1009376 / 32, -1004768 / 32, -999904 / 32,
+ -994784 / 32, -989408 / 32, -983776 / 32, -977888 / 32,
+ -971744 / 32, -965344 / 32, -958688 / 32, -951776 / 32,
+ -944608 / 32, -937184 / 32, -929504 / 32, -921568 / 32,
+ -913376 / 32, -904928 / 32, -896224 / 32, -887264 / 32,
+ -878048 / 32, -868576 / 32, -858848 / 32, -848864 / 32,
+ -838624 / 32, -828128 / 32, -817376 / 32, -806368 / 32,
+ -795104 / 32, -783584 / 32, -771808 / 32, -759776 / 32,
+ -747488 / 32, -734944 / 32, -722144 / 32, -709088 / 32,
+ -695776 / 32, -682208 / 32, -668384 / 32, -654304 / 32,
+ -639968 / 32, -625376 / 32, -610528 / 32, -595424 / 32,
+ -580064 / 32, -564448 / 32, -548576 / 32, -532448 / 32,
+ -516064 / 32, -499424 / 32, -482528 / 32, -465376 / 32,
+ -447968 / 32, -430304 / 32, -412384 / 32, -394208 / 32,
+ -375776 / 32, -357088 / 32, -338144 / 32, -318944 / 32,
+ -299488 / 32, -279776 / 32, -259808 / 32, -239584 / 32,
+ -219104 / 32, -198368 / 32, -177376 / 32, -156128 / 32,
+ -134624 / 32, -112864 / 32, -90848 / 32, -68576 / 32,
+ -46048 / 32, -23264 / 32, -224 / 32, 23072 / 32,
+ 46624 / 32, 70432 / 32, 94496 / 32, 118816 / 32,
+ 143392 / 32, 168224 / 32, 193312 / 32, 218656 / 32,
+ 244256 / 32, 270112 / 32, 296224 / 32, 322592 / 32,
+ 349216 / 32, 376096 / 32, 403232 / 32, 430624 / 32,
+ 458272 / 32, 486176 / 32, 514336 / 32, 542752 / 32,
+ 571424 / 32, 600352 / 32, 629536 / 32, 658976 / 32,
+ 688672 / 32, 718624 / 32, 748832 / 32, 779296 / 32,
+ 810016 / 32, 840992 / 32, 872224 / 32, 903712 / 32,
+ 935456 / 32, 967456 / 32, 999712 / 32, 1032224 / 32
+};
+
+
+/** Gain values of p(0) for long-term prediction.
+ * To be indexed by the Rice coded indices.
+ */
+static const uint8_t ltp_gain_values [4][4] = {
+ { 0, 8, 16, 24},
+ {32, 40, 48, 56},
+ {64, 70, 76, 82},
+ {88, 92, 96, 100}
+};
+
+
+enum RA_Flag {
+ RA_FLAG_NONE,
+ RA_FLAG_FRAMES,
+ RA_FLAG_HEADER
+};
+
+
+typedef struct {
+ uint32_t samples; ///< number of samples, 0xFFFFFFFF if unknown
+ int resolution; ///< 000 = 8-bit; 001 = 16-bit; 010 = 24-bit; 011 = 32-bit
+ int floating; ///< 1 = IEEE 32-bit floating-point, 0 = integer
+ int frame_length; ///< frame length for each frame (last frame may differ)
+ int ra_distance; ///< distance between RA frames (in frames, 0...255)
+ enum RA_Flag ra_flag; ///< indicates where the size of ra units is stored
+ int adapt_order; ///< adaptive order: 1 = on, 0 = off
+ int coef_table; ///< table index of Rice code parameters
+ int long_term_prediction; ///< long term prediction (LTP): 1 = on, 0 = off
+ int max_order; ///< maximum prediction order (0..1023)
+ int block_switching; ///< number of block switching levels
+ int bgmc; ///< "Block Gilbert-Moore Code": 1 = on, 0 = off (Rice coding only)
+ int sb_part; ///< sub-block partition
+ int joint_stereo; ///< joint stereo: 1 = on, 0 = off
+ int mc_coding; ///< extended inter-channel coding (multi channel coding): 1 = on, 0 = off
+ int chan_config; ///< indicates that a chan_config_info field is present
+ int chan_sort; ///< channel rearrangement: 1 = on, 0 = off
+ int rlslms; ///< use "Recursive Least Square-Least Mean Square" predictor: 1 = on, 0 = off
+ int chan_config_info; ///< mapping of channels to loudspeaker locations. Unused until setting channel configuration is implemented.
+ int *chan_pos; ///< original channel positions
+ uint32_t header_size; ///< header size of original audio file in bytes, provided for debugging
+ uint32_t trailer_size; ///< trailer size of original audio file in bytes, provided for debugging
+} ALSSpecificConfig;
+
+
+typedef struct {
+ AVCodecContext *avctx;
+ ALSSpecificConfig sconf;
+ GetBitContext gb;
+ unsigned int cur_frame_length; ///< length of the current frame to decode
+ unsigned int frame_id; ///< the frame ID / number of the current frame
+ unsigned int js_switch; ///< if true, joint-stereo decoding is enforced
+ unsigned int num_blocks; ///< number of blocks used in the current frame
+ int ltp_lag_length; ///< number of bits used for ltp lag value
+ int *use_ltp; ///< contains use_ltp flags for all channels
+ int *ltp_lag; ///< contains ltp lag values for all channels
+ int **ltp_gain; ///< gain values for ltp 5-tap filter for a channel
+ int *ltp_gain_buffer; ///< contains all gain values for ltp 5-tap filter
+ int32_t *quant_cof; ///< quantized parcor coefficients
+ int32_t *lpc_cof; ///< coefficients of the direct form prediction filter
+ int32_t *prev_raw_samples; ///< contains unshifted raw samples from the previous block
+ int32_t **raw_samples; ///< decoded raw samples for each channel
+ int32_t *raw_buffer; ///< contains all decoded raw samples including carryover samples
+} ALSDecContext;
+
+
+typedef struct {
+ unsigned int block_length; ///< number of samples within the block
+ unsigned int ra_block; ///< if true, this is a random access block
+ int const_block; ///< if true, this is a constant value block
+ int32_t const_val; ///< the sample value of a constant block
+ int js_blocks; ///< true if this block contains a difference signal
+ unsigned int shift_lsbs; ///< shift of values for this block
+ unsigned int opt_order; ///< prediction order of this block
+ int store_prev_samples;///< if true, carryover samples have to be stored
+ int *use_ltp; ///< if true, long-term prediction is used
+ int *ltp_lag; ///< lag value for long-term prediction
+ int *ltp_gain; ///< gain values for ltp 5-tap filter
+ int32_t *quant_cof; ///< quantized parcor coefficients
+ int32_t *lpc_cof; ///< coefficients of the direct form prediction
+ int32_t *raw_samples; ///< decoded raw samples / residuals for this block
+ int32_t *prev_raw_samples; ///< contains unshifted raw samples from the previous block
+ int32_t *raw_other; ///< decoded raw samples of the other channel of a channel pair
+} ALSBlockData;
+
+
+static av_cold void dprint_specific_config(ALSDecContext *ctx)
+{
+#ifdef DEBUG
+ AVCodecContext *avctx = ctx->avctx;
+ ALSSpecificConfig *sconf = &ctx->sconf;
+
+ dprintf(avctx, "resolution = %i\n", sconf->resolution);
+ dprintf(avctx, "floating = %i\n", sconf->floating);
+ dprintf(avctx, "frame_length = %i\n", sconf->frame_length);
+ dprintf(avctx, "ra_distance = %i\n", sconf->ra_distance);
+ dprintf(avctx, "ra_flag = %i\n", sconf->ra_flag);
+ dprintf(avctx, "adapt_order = %i\n", sconf->adapt_order);
+ dprintf(avctx, "coef_table = %i\n", sconf->coef_table);
+ dprintf(avctx, "long_term_prediction = %i\n", sconf->long_term_prediction);
+ dprintf(avctx, "max_order = %i\n", sconf->max_order);
+ dprintf(avctx, "block_switching = %i\n", sconf->block_switching);
+ dprintf(avctx, "bgmc = %i\n", sconf->bgmc);
+ dprintf(avctx, "sb_part = %i\n", sconf->sb_part);
+ dprintf(avctx, "joint_stereo = %i\n", sconf->joint_stereo);
+ dprintf(avctx, "mc_coding = %i\n", sconf->mc_coding);
+ dprintf(avctx, "chan_config = %i\n", sconf->chan_config);
+ dprintf(avctx, "chan_sort = %i\n", sconf->chan_sort);
+ dprintf(avctx, "RLSLMS = %i\n", sconf->rlslms);
+ dprintf(avctx, "chan_config_info = %i\n", sconf->chan_config_info);
+ dprintf(avctx, "header_size = %i\n", sconf->header_size);
+ dprintf(avctx, "trailer_size = %i\n", sconf->trailer_size);
+#endif
+}
+
+
+/** Reads an ALSSpecificConfig from a buffer into the output struct.
+ */
+static av_cold int read_specific_config(ALSDecContext *ctx)
+{
+ GetBitContext gb;
+ uint64_t ht_size;
+ int i, config_offset, crc_enabled;
+ MPEG4AudioConfig m4ac;
+ ALSSpecificConfig *sconf = &ctx->sconf;
+ AVCodecContext *avctx = ctx->avctx;
+ uint32_t als_id;
+
+ init_get_bits(&gb, avctx->extradata, avctx->extradata_size * 8);
+
+ config_offset = ff_mpeg4audio_get_config(&m4ac, avctx->extradata,
+ avctx->extradata_size);
+
+ if (config_offset < 0)
+ return -1;
+
+ skip_bits_long(&gb, config_offset);
+
+ if (get_bits_left(&gb) < (30 << 3))
+ return -1;
+
+ // read the fixed items
+ als_id = get_bits_long(&gb, 32);
+ avctx->sample_rate = m4ac.sample_rate;
+ skip_bits_long(&gb, 32); // sample rate already known
+ sconf->samples = get_bits_long(&gb, 32);
+ avctx->channels = m4ac.channels;
+ skip_bits(&gb, 16); // number of channels already knwon
+ skip_bits(&gb, 3); // skip file_type
+ sconf->resolution = get_bits(&gb, 3);
+ sconf->floating = get_bits1(&gb);
+ skip_bits1(&gb); // skip msb_first
+ sconf->frame_length = get_bits(&gb, 16) + 1;
+ sconf->ra_distance = get_bits(&gb, 8);
+ sconf->ra_flag = get_bits(&gb, 2);
+ sconf->adapt_order = get_bits1(&gb);
+ sconf->coef_table = get_bits(&gb, 2);
+ sconf->long_term_prediction = get_bits1(&gb);
+ sconf->max_order = get_bits(&gb, 10);
+ sconf->block_switching = get_bits(&gb, 2);
+ sconf->bgmc = get_bits1(&gb);
+ sconf->sb_part = get_bits1(&gb);
+ sconf->joint_stereo = get_bits1(&gb);
+ sconf->mc_coding = get_bits1(&gb);
+ sconf->chan_config = get_bits1(&gb);
+ sconf->chan_sort = get_bits1(&gb);
+ crc_enabled = get_bits1(&gb);
+ sconf->rlslms = get_bits1(&gb);
+ skip_bits(&gb, 5); // skip 5 reserved bits
+ skip_bits1(&gb); // skip aux_data_enabled
+
+
+ // check for ALSSpecificConfig struct
+ if (als_id != MKBETAG('A','L','S','\0'))
+ return -1;
+
+ ctx->cur_frame_length = sconf->frame_length;
+
+ // allocate quantized parcor coefficient buffer
+ if (!(ctx->quant_cof = av_malloc(sizeof(*ctx->quant_cof) * sconf->max_order)) ||
+ !(ctx->lpc_cof = av_malloc(sizeof(*ctx->lpc_cof) * sconf->max_order))) {
+ av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
+ return AVERROR(ENOMEM);
+ }
+
+ // read channel config
+ if (sconf->chan_config)
+ sconf->chan_config_info = get_bits(&gb, 16);
+ // TODO: use this to set avctx->channel_layout
+
+
+ // read channel sorting
+ if (sconf->chan_sort && avctx->channels > 1) {
+ int chan_pos_bits = av_ceil_log2(avctx->channels);
+ int bits_needed = avctx->channels * chan_pos_bits + 7;
+ if (get_bits_left(&gb) < bits_needed)
+ return -1;
+
+ if (!(sconf->chan_pos = av_malloc(avctx->channels * sizeof(*sconf->chan_pos))))
+ return AVERROR(ENOMEM);
+
+ for (i = 0; i < avctx->channels; i++)
+ sconf->chan_pos[i] = get_bits(&gb, chan_pos_bits);
+
+ align_get_bits(&gb);
+ // TODO: use this to actually do channel sorting
+ } else {
+ sconf->chan_sort = 0;
+ }
+
+
+ // read fixed header and trailer sizes,
+ // if size = 0xFFFFFFFF then there is no data field!
+ if (get_bits_left(&gb) < 64)
+ return -1;
+
+ sconf->header_size = get_bits_long(&gb, 32);
+ sconf->trailer_size = get_bits_long(&gb, 32);
+ if (sconf->header_size == 0xFFFFFFFF)
+ sconf->header_size = 0;
+ if (sconf->trailer_size == 0xFFFFFFFF)
+ sconf->trailer_size = 0;
+
+ ht_size = ((int64_t)(sconf->header_size) + (int64_t)(sconf->trailer_size)) << 3;
+
+
+ // skip the header and trailer data
+ if (get_bits_left(&gb) < ht_size)
+ return -1;
+
+ if (ht_size > INT32_MAX)
+ return -1;
+
+ skip_bits_long(&gb, ht_size);
+
+
+ // skip the crc data
+ if (crc_enabled) {
+ if (get_bits_left(&gb) < 32)
+ return -1;
+
+ skip_bits_long(&gb, 32);
+ }
+
+
+ // no need to read the rest of ALSSpecificConfig (ra_unit_size & aux data)
+
+ dprint_specific_config(ctx);
+
+ return 0;
+}
+
+
+/** Checks the ALSSpecificConfig for unsupported features.
+ */
+static int check_specific_config(ALSDecContext *ctx)
+{
+ ALSSpecificConfig *sconf = &ctx->sconf;
+ int error = 0;
+
+ // report unsupported feature and set error value
+ #define MISSING_ERR(cond, str, errval) \
+ { \
+ if (cond) { \
+ av_log_missing_feature(ctx->avctx, str, 0); \
+ error = errval; \
+ } \
+ }
+
+ MISSING_ERR(sconf->floating, "Floating point decoding", -1);
+ MISSING_ERR(sconf->bgmc, "BGMC entropy decoding", -1);
+ MISSING_ERR(sconf->mc_coding, "Multi-channel correlation", -1);
+ MISSING_ERR(sconf->rlslms, "Adaptive RLS-LMS prediction", -1);
+ MISSING_ERR(sconf->chan_sort, "Channel sorting", 0);
+
+ return error;
+}
+
+
+/** Parses the bs_info field to extract the block partitioning used in
+ * block switching mode, refer to ISO/IEC 14496-3, section 11.6.2.
+ */
+static void parse_bs_info(const uint32_t bs_info, unsigned int n,
+ unsigned int div, unsigned int **div_blocks,
+ unsigned int *num_blocks)
+{
+ if (n < 31 && ((bs_info << n) & 0x40000000)) {
+ // if the level is valid and the investigated bit n is set
+ // then recursively check both children at bits (2n+1) and (2n+2)
+ n *= 2;
+ div += 1;
+ parse_bs_info(bs_info, n + 1, div, div_blocks, num_blocks);
+ parse_bs_info(bs_info, n + 2, div, div_blocks, num_blocks);
+ } else {
+ // else the bit is not set or the last level has been reached
+ // (bit implicitly not set)
+ **div_blocks = div;
+ (*div_blocks)++;
+ (*num_blocks)++;
+ }
+}
+
+
+/** Reads and decodes a Rice codeword.
+ */
+static int32_t decode_rice(GetBitContext *gb, unsigned int k)
+{
+ int max = get_bits_left(gb) - k;
+ int q = get_unary(gb, 0, max);
+ int r = k ? get_bits1(gb) : !(q & 1);
+
+ if (k > 1) {
+ q <<= (k - 1);
+ q += get_bits_long(gb, k - 1);
+ } else if (!k) {
+ q >>= 1;
+ }
+ return r ? q : ~q;
+}
+
+
+/** Converts PARCOR coefficient k to direct filter coefficient.
+ */
+static void parcor_to_lpc(unsigned int k, const int32_t *par, int32_t *cof)
+{
+ int i, j;
+
+ for (i = 0, j = k - 1; i < j; i++, j--) {
+ int tmp1 = ((MUL64(par[k], cof[j]) + (1 << 19)) >> 20);
+ cof[j] += ((MUL64(par[k], cof[i]) + (1 << 19)) >> 20);
+ cof[i] += tmp1;
+ }
+ if (i == j)
+ cof[i] += ((MUL64(par[k], cof[j]) + (1 << 19)) >> 20);
+
+ cof[k] = par[k];
+}
+
+
+/** Reads block switching field if necessary and sets actual block sizes.
+ * Also assures that the block sizes of the last frame correspond to the
+ * actual number of samples.
+ */
+static void get_block_sizes(ALSDecContext *ctx, unsigned int *div_blocks,
+ uint32_t *bs_info)
+{
+ ALSSpecificConfig *sconf = &ctx->sconf;
+ GetBitContext *gb = &ctx->gb;
+ unsigned int *ptr_div_blocks = div_blocks;
+ unsigned int b;
+
+ if (sconf->block_switching) {
+ unsigned int bs_info_len = 1 << (sconf->block_switching + 2);
+ *bs_info = get_bits_long(gb, bs_info_len);
+ *bs_info <<= (32 - bs_info_len);
+ }
+
+ ctx->num_blocks = 0;
+ parse_bs_info(*bs_info, 0, 0, &ptr_div_blocks, &ctx->num_blocks);
+
+ // The last frame may have an overdetermined block structure given in
+ // the bitstream. In that case the defined block structure would need
+ // more samples than available to be consistent.
+ // The block structure is actually used but the block sizes are adapted
+ // to fit the actual number of available samples.
+ // Example: 5 samples, 2nd level block sizes: 2 2 2 2.
+ // This results in the actual block sizes: 2 2 1 0.
+ // This is not specified in 14496-3 but actually done by the reference
+ // codec RM22 revision 2.
+ // This appears to happen in case of an odd number of samples in the last
+ // frame which is actually not allowed by the block length switching part
+ // of 14496-3.
+ // The ALS conformance files feature an odd number of samples in the last
+ // frame.
+
+ for (b = 0; b < ctx->num_blocks; b++)
+ div_blocks[b] = ctx->sconf.frame_length >> div_blocks[b];
+
+ if (ctx->cur_frame_length != ctx->sconf.frame_length) {
+ unsigned int remaining = ctx->cur_frame_length;
+
+ for (b = 0; b < ctx->num_blocks; b++) {
+ if (remaining < div_blocks[b]) {
+ div_blocks[b] = remaining;
+ ctx->num_blocks = b + 1;
+ break;
+ }
+
+ remaining -= div_blocks[b];
+ }
+ }
+}
+
+
+/** Reads the block data for a constant block
+ */
+static void read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
+{
+ ALSSpecificConfig *sconf = &ctx->sconf;
+ AVCodecContext *avctx = ctx->avctx;
+ GetBitContext *gb = &ctx->gb;
+
+ bd->const_val = 0;
+ bd->const_block = get_bits1(gb); // 1 = constant value, 0 = zero block (silence)
+ bd->js_blocks = get_bits1(gb);
+
+ // skip 5 reserved bits
+ skip_bits(gb, 5);
+
+ if (bd->const_block) {
+ unsigned int const_val_bits = sconf->floating ? 24 : avctx->bits_per_raw_sample;
+ bd->const_val = get_sbits_long(gb, const_val_bits);
+ }
+
+ // ensure constant block decoding by reusing this field
+ bd->const_block = 1;
+}
+
+
+/** Decodes the block data for a constant block
+ */
+static void decode_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
+{
+ int smp = bd->block_length;
+ int32_t val = bd->const_val;
+ int32_t *dst = bd->raw_samples;
+
+ // write raw samples into buffer
+ for (; smp; smp--)
+ *dst++ = val;
+}
+
+
+/** Reads the block data for a non-constant block
+ */
+static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
+{
+ ALSSpecificConfig *sconf = &ctx->sconf;
+ AVCodecContext *avctx = ctx->avctx;
+ GetBitContext *gb = &ctx->gb;
+ unsigned int k;
+ unsigned int s[8];
+ unsigned int sub_blocks, log2_sub_blocks, sb_length;
+ unsigned int start = 0;
+ unsigned int opt_order;
+ int sb;
+ int32_t *quant_cof = bd->quant_cof;
+
+
+ // ensure variable block decoding by reusing this field
+ bd->const_block = 0;
+
+ bd->opt_order = 1;
+ bd->js_blocks = get_bits1(gb);
+
+ opt_order = bd->opt_order;
+
+ // determine the number of subblocks for entropy decoding
+ if (!sconf->bgmc && !sconf->sb_part) {
+ log2_sub_blocks = 0;
+ } else {
+ if (sconf->bgmc && sconf->sb_part)
+ log2_sub_blocks = get_bits(gb, 2);
+ else
+ log2_sub_blocks = 2 * get_bits1(gb);
+ }
+
+ sub_blocks = 1 << log2_sub_blocks;
+
+ // do not continue in case of a damaged stream since
+ // block_length must be evenly divisible by sub_blocks
+ if (bd->block_length & (sub_blocks - 1)) {
+ av_log(avctx, AV_LOG_WARNING,
+ "Block length is not evenly divisible by the number of subblocks.\n");
+ return -1;
+ }
+
+ sb_length = bd->block_length >> log2_sub_blocks;
+
+
+ if (sconf->bgmc) {
+ // TODO: BGMC mode
+ } else {
+ s[0] = get_bits(gb, 4 + (sconf->resolution > 1));
+ for (k = 1; k < sub_blocks; k++)
+ s[k] = s[k - 1] + decode_rice(gb, 0);
+ }
+
+ if (get_bits1(gb))
+ bd->shift_lsbs = get_bits(gb, 4) + 1;
+
+ bd->store_prev_samples = (bd->js_blocks && bd->raw_other) || bd->shift_lsbs;
+
+
+ if (!sconf->rlslms) {
+ if (sconf->adapt_order) {
+ int opt_order_length = av_ceil_log2(av_clip((bd->block_length >> 3) - 1,
+ 2, sconf->max_order + 1));
+ bd->opt_order = get_bits(gb, opt_order_length);
+ } else {
+ bd->opt_order = sconf->max_order;
+ }
+
+ opt_order = bd->opt_order;
+
+ if (opt_order) {
+ int add_base;
+
+ if (sconf->coef_table == 3) {
+ add_base = 0x7F;
+
+ // read coefficient 0
+ quant_cof[0] = 32 * parcor_scaled_values[get_bits(gb, 7)];
+
+ // read coefficient 1
+ if (opt_order > 1)
+ quant_cof[1] = -32 * parcor_scaled_values[get_bits(gb, 7)];
+
+ // read coefficients 2 to opt_order
+ for (k = 2; k < opt_order; k++)
+ quant_cof[k] = get_bits(gb, 7);
+ } else {
+ int k_max;
+ add_base = 1;
+
+ // read coefficient 0 to 19
+ k_max = FFMIN(opt_order, 20);
+ for (k = 0; k < k_max; k++) {
+ int rice_param = parcor_rice_table[sconf->coef_table][k][1];
+ int offset = parcor_rice_table[sconf->coef_table][k][0];
+ quant_cof[k] = decode_rice(gb, rice_param) + offset;
+ }
+
+ // read coefficients 20 to 126
+ k_max = FFMIN(opt_order, 127);
+ for (; k < k_max; k++)
+ quant_cof[k] = decode_rice(gb, 2) + (k & 1);
+
+ // read coefficients 127 to opt_order
+ for (; k < opt_order; k++)
+ quant_cof[k] = decode_rice(gb, 1);
+
+ quant_cof[0] = 32 * parcor_scaled_values[quant_cof[0] + 64];
+
+ if (opt_order > 1)
+ quant_cof[1] = -32 * parcor_scaled_values[quant_cof[1] + 64];
+ }
+
+ for (k = 2; k < opt_order; k++)
+ quant_cof[k] = (quant_cof[k] << 14) + (add_base << 13);
+ }
+ }
+
+ // read LTP gain and lag values
+ if (sconf->long_term_prediction) {
+ *bd->use_ltp = get_bits1(gb);
+
+ if (*bd->use_ltp) {
+ bd->ltp_gain[0] = decode_rice(gb, 1) << 3;
+ bd->ltp_gain[1] = decode_rice(gb, 2) << 3;
+
+ bd->ltp_gain[2] = ltp_gain_values[get_unary(gb, 0, 4)][get_bits(gb, 2)];
+
+ bd->ltp_gain[3] = decode_rice(gb, 2) << 3;
+ bd->ltp_gain[4] = decode_rice(gb, 1) << 3;
+
+ *bd->ltp_lag = get_bits(gb, ctx->ltp_lag_length);
+ *bd->ltp_lag += FFMAX(4, opt_order + 1);
+ }
+ }
+
+ // read first value and residuals in case of a random access block
+ if (bd->ra_block) {
+ if (opt_order)
+ bd->raw_samples[0] = decode_rice(gb, avctx->bits_per_raw_sample - 4);
+ if (opt_order > 1)
+ bd->raw_samples[1] = decode_rice(gb, s[0] + 3);
+ if (opt_order > 2)
+ bd->raw_samples[2] = decode_rice(gb, s[0] + 1);
+
+ start = FFMIN(opt_order, 3);
+ }
+
+ // read all residuals
+ if (sconf->bgmc) {
+ // TODO: BGMC mode
+ } else {
+ int32_t *current_res = bd->raw_samples + start;
+
+ for (sb = 0; sb < sub_blocks; sb++, start = 0)
+ for (; start < sb_length; start++)
+ *current_res++ = decode_rice(gb, s[sb]);
+ }
+
+ if (!sconf->mc_coding || ctx->js_switch)
+ align_get_bits(gb);
+
+ return 0;
+}
+
+
+/** Decodes the block data for a non-constant block
+ */
+static int decode_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
+{
+ ALSSpecificConfig *sconf = &ctx->sconf;
+ unsigned int block_length = bd->block_length;
+ unsigned int smp = 0;
+ unsigned int k;
+ unsigned int opt_order = bd->opt_order;
+ int sb;
+ int64_t y;
+ int32_t *quant_cof = bd->quant_cof;
+ int32_t *lpc_cof = bd->lpc_cof;
+ int32_t *raw_samples = bd->raw_samples;
+
+ // reverse long-term prediction
+ if (*bd->use_ltp) {
+ int ltp_smp;
+
+ for (ltp_smp = FFMAX(*bd->ltp_lag - 2, 0); ltp_smp < block_length; ltp_smp++) {
+ int center = ltp_smp - *bd->ltp_lag;
+ int begin = FFMAX(0, center - 2);
+ int end = center + 3;
+ int tab = 5 - (end - begin);
+ int base;
+
+ y = 1 << 6;
+
+ for (base = begin; base < end; base++, tab++)
+ y += MUL64(bd->ltp_gain[tab], raw_samples[base]);
+
+ raw_samples[ltp_smp] += y >> 7;
+ }
+ }
+
+ // reconstruct all samples from residuals
+ if (bd->ra_block) {
+ for (smp = 0; smp < opt_order; smp++) {
+ y = 1 << 19;
+
+ for (sb = 0; sb < smp; sb++)
+ y += MUL64(lpc_cof[sb],raw_samples[smp - (sb + 1)]);
+
+ raw_samples[smp] -= y >> 20;
+ parcor_to_lpc(smp, quant_cof, lpc_cof);
+ }
+ } else {
+ for (k = 0; k < opt_order; k++)
+ parcor_to_lpc(k, quant_cof, lpc_cof);
+
+ // store previous samples in case that they have to be altered
+ if (bd->store_prev_samples)
+ memcpy(bd->prev_raw_samples, raw_samples - sconf->max_order,
+ sizeof(*bd->prev_raw_samples) * sconf->max_order);
+
+ // reconstruct difference signal for prediction (joint-stereo)
+ if (bd->js_blocks && bd->raw_other) {
+ int32_t *left, *right;
+
+ if (bd->raw_other > raw_samples) { // D = R - L
+ left = raw_samples;
+ right = bd->raw_other;
+ } else { // D = R - L
+ left = bd->raw_other;
+ right = raw_samples;
+ }
+
+ for (sb = -1; sb >= -sconf->max_order; sb--)
+ raw_samples[sb] = right[sb] - left[sb];
+ }
+
+ // reconstruct shifted signal
+ if (bd->shift_lsbs)
+ for (sb = -1; sb >= -sconf->max_order; sb--)
+ raw_samples[sb] >>= bd->shift_lsbs;
+ }
+
+ // reconstruct raw samples
+ for (; smp < bd->block_length; smp++) {
+ y = 1 << 19;
+
+ for (sb = 0; sb < opt_order; sb++)
+ y += MUL64(bd->lpc_cof[sb],raw_samples[smp - (sb + 1)]);
+
+ raw_samples[smp] -= y >> 20;
+ }
+
+ // restore previous samples in case that they have been altered
+ if (bd->store_prev_samples)
+ memcpy(raw_samples - sconf->max_order, bd->prev_raw_samples,
+ sizeof(*raw_samples) * sconf->max_order);
+
+ return 0;
+}
+
+
+/** Reads the block data.
+ */
+static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
+{
+ GetBitContext *gb = &ctx->gb;
+
+ // read block type flag and read the samples accordingly
+ if (get_bits1(gb)) {
+ if (read_var_block_data(ctx, bd))
+ return -1;
+ } else {
+ read_const_block_data(ctx, bd);
+ }
+
+ return 0;
+}
+
+
+/** Decodes the block data.
+ */
+static int decode_block(ALSDecContext *ctx, ALSBlockData *bd)
+{
+ unsigned int smp;
+
+ // read block type flag and read the samples accordingly
+ if (bd->const_block)
+ decode_const_block_data(ctx, bd);
+ else if (decode_var_block_data(ctx, bd))
+ return -1;
+
+ // TODO: read RLSLMS extension data
+
+ if (bd->shift_lsbs)
+ for (smp = 0; smp < bd->block_length; smp++)
+ bd->raw_samples[smp] <<= bd->shift_lsbs;
+
+ return 0;
+}
+
+
+/** Reads and decodes block data successively.
+ */
+static int read_decode_block(ALSDecContext *ctx, ALSBlockData *bd)
+{
+ int ret;
+
+ ret = read_block(ctx, bd);
+
+ if (ret)
+ return ret;
+
+ ret = decode_block(ctx, bd);
+
+ return ret;
+}
+
+
+/** Computes the number of samples left to decode for the current frame and
+ * sets these samples to zero.
+ */
+static void zero_remaining(unsigned int b, unsigned int b_max,
+ const unsigned int *div_blocks, int32_t *buf)
+{
+ unsigned int count = 0;
+
+ while (b < b_max)
+ count += div_blocks[b];
+
+ if (count)
+ memset(buf, 0, sizeof(*buf) * count);
+}
+
+
+/** Decodes blocks independently.
+ */
+static int decode_blocks_ind(ALSDecContext *ctx, unsigned int ra_frame,
+ unsigned int c, const unsigned int *div_blocks,
+ unsigned int *js_blocks)
+{
+ unsigned int b;
+ ALSBlockData bd;
+
+ memset(&bd, 0, sizeof(ALSBlockData));
+
+ bd.ra_block = ra_frame;
+ bd.use_ltp = ctx->use_ltp;
+ bd.ltp_lag = ctx->ltp_lag;
+ bd.ltp_gain = ctx->ltp_gain[0];
+ bd.quant_cof = ctx->quant_cof;
+ bd.lpc_cof = ctx->lpc_cof;
+ bd.prev_raw_samples = ctx->prev_raw_samples;
+ bd.raw_samples = ctx->raw_samples[c];
+
+
+ for (b = 0; b < ctx->num_blocks; b++) {
+ bd.shift_lsbs = 0;
+ bd.block_length = div_blocks[b];
+
+ if (read_decode_block(ctx, &bd)) {
+ // damaged block, write zero for the rest of the frame
+ zero_remaining(b, ctx->num_blocks, div_blocks, bd.raw_samples);
+ return -1;
+ }
+ bd.raw_samples += div_blocks[b];
+ bd.ra_block = 0;
+ }
+
+ return 0;
+}
+
+
+/** Decodes blocks dependently.
+ */
+static int decode_blocks(ALSDecContext *ctx, unsigned int ra_frame,
+ unsigned int c, const unsigned int *div_blocks,
+ unsigned int *js_blocks)
+{
+ ALSSpecificConfig *sconf = &ctx->sconf;
+ unsigned int offset = 0;
+ unsigned int b;
+ ALSBlockData bd[2];
+
+ memset(bd, 0, 2 * sizeof(ALSBlockData));
+
+ bd[0].ra_block = ra_frame;
+ bd[0].use_ltp = ctx->use_ltp;
+ bd[0].ltp_lag = ctx->ltp_lag;
+ bd[0].ltp_gain = ctx->ltp_gain[0];
+ bd[0].quant_cof = ctx->quant_cof;
+ bd[0].lpc_cof = ctx->lpc_cof;
+ bd[0].prev_raw_samples = ctx->prev_raw_samples;
+ bd[0].js_blocks = *js_blocks;
+
+ bd[1].ra_block = ra_frame;
+ bd[1].use_ltp = ctx->use_ltp;
+ bd[1].ltp_lag = ctx->ltp_lag;
+ bd[1].ltp_gain = ctx->ltp_gain[0];
+ bd[1].quant_cof = ctx->quant_cof;
+ bd[1].lpc_cof = ctx->lpc_cof;
+ bd[1].prev_raw_samples = ctx->prev_raw_samples;
+ bd[1].js_blocks = *(js_blocks + 1);
+
+ // decode all blocks
+ for (b = 0; b < ctx->num_blocks; b++) {
+ unsigned int s;
+
+ bd[0].shift_lsbs = 0;
+ bd[1].shift_lsbs = 0;
+
+ bd[0].block_length = div_blocks[b];
+ bd[1].block_length = div_blocks[b];
+
+ bd[0].raw_samples = ctx->raw_samples[c ] + offset;
+ bd[1].raw_samples = ctx->raw_samples[c + 1] + offset;
+
+ bd[0].raw_other = bd[1].raw_samples;
+ bd[1].raw_other = bd[0].raw_samples;
+
+ if(read_decode_block(ctx, &bd[0]) || read_decode_block(ctx, &bd[1])) {
+ // damaged block, write zero for the rest of the frame
+ zero_remaining(b, ctx->num_blocks, div_blocks, bd[0].raw_samples);
+ zero_remaining(b, ctx->num_blocks, div_blocks, bd[1].raw_samples);
+ return -1;
+ }
+
+ // reconstruct joint-stereo blocks
+ if (bd[0].js_blocks) {
+ if (bd[1].js_blocks)
+ av_log(ctx->avctx, AV_LOG_WARNING, "Invalid channel pair!\n");
+
+ for (s = 0; s < div_blocks[b]; s++)
+ bd[0].raw_samples[s] = bd[1].raw_samples[s] - bd[0].raw_samples[s];
+ } else if (bd[1].js_blocks) {
+ for (s = 0; s < div_blocks[b]; s++)
+ bd[1].raw_samples[s] = bd[1].raw_samples[s] + bd[0].raw_samples[s];
+ }
+
+ offset += div_blocks[b];
+ bd[0].ra_block = 0;
+ bd[1].ra_block = 0;
+ }
+
+ // store carryover raw samples,
+ // the others channel raw samples are stored by the calling function.
+ memmove(ctx->raw_samples[c] - sconf->max_order,
+ ctx->raw_samples[c] - sconf->max_order + sconf->frame_length,
+ sizeof(*ctx->raw_samples[c]) * sconf->max_order);
+
+ return 0;
+}
+
+
+/** Reads the frame data.
+ */
+static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
+{
+ ALSSpecificConfig *sconf = &ctx->sconf;
+ AVCodecContext *avctx = ctx->avctx;
+ GetBitContext *gb = &ctx->gb;
+ unsigned int div_blocks[32]; ///< block sizes.
+ unsigned int c;
+ unsigned int js_blocks[2];
+
+ uint32_t bs_info = 0;
+
+ // skip the size of the ra unit if present in the frame
+ if (sconf->ra_flag == RA_FLAG_FRAMES && ra_frame)
+ skip_bits_long(gb, 32);
+
+ if (sconf->mc_coding && sconf->joint_stereo) {
+ ctx->js_switch = get_bits1(gb);
+ align_get_bits(gb);
+ }
+
+ if (!sconf->mc_coding || ctx->js_switch) {
+ int independent_bs = !sconf->joint_stereo;
+
+ for (c = 0; c < avctx->channels; c++) {
+ js_blocks[0] = 0;
+ js_blocks[1] = 0;
+
+ get_block_sizes(ctx, div_blocks, &bs_info);
+
+ // if joint_stereo and block_switching is set, independent decoding
+ // is signaled via the first bit of bs_info
+ if (sconf->joint_stereo && sconf->block_switching)
+ if (bs_info >> 31)
+ independent_bs = 2;
+
+ // if this is the last channel, it has to be decoded independently
+ if (c == avctx->channels - 1)
+ independent_bs = 1;
+
+ if (independent_bs) {
+ if (decode_blocks_ind(ctx, ra_frame, c, div_blocks, js_blocks))
+ return -1;
+
+ independent_bs--;
+ } else {
+ if (decode_blocks(ctx, ra_frame, c, div_blocks, js_blocks))
+ return -1;
+
+ c++;
+ }
+
+ // store carryover raw samples
+ memmove(ctx->raw_samples[c] - sconf->max_order,
+ ctx->raw_samples[c] - sconf->max_order + sconf->frame_length,
+ sizeof(*ctx->raw_samples[c]) * sconf->max_order);
+ }
+ } else { // multi-channel coding
+ get_block_sizes(ctx, div_blocks, &bs_info);
+
+ // TODO: multi channel coding might use a temporary buffer instead as
+ // the actual channel is not known when read_block-data is called
+ if (decode_blocks_ind(ctx, ra_frame, 0, div_blocks, js_blocks))
+ return -1;
+ // TODO: read_channel_data
+ }
+
+ // TODO: read_diff_float_data
+
+ return 0;
+}
+
+
+/** Decodes an ALS frame.
+ */
+static int decode_frame(AVCodecContext *avctx,
+ void *data, int *data_size,
+ AVPacket *avpkt)
+{
+ ALSDecContext *ctx = avctx->priv_data;
+ ALSSpecificConfig *sconf = &ctx->sconf;
+ const uint8_t *buffer = avpkt->data;
+ int buffer_size = avpkt->size;
+ int invalid_frame, size;
+ unsigned int c, sample, ra_frame, bytes_read, shift;
+
+ init_get_bits(&ctx->gb, buffer, buffer_size * 8);
+
+ // In the case that the distance between random access frames is set to zero
+ // (sconf->ra_distance == 0) no frame is treated as a random access frame.
+ // For the first frame, if prediction is used, all samples used from the
+ // previous frame are assumed to be zero.
+ ra_frame = sconf->ra_distance && !(ctx->frame_id % sconf->ra_distance);
+
+ // the last frame to decode might have a different length
+ if (sconf->samples != 0xFFFFFFFF)
+ ctx->cur_frame_length = FFMIN(sconf->samples - ctx->frame_id * (uint64_t) sconf->frame_length,
+ sconf->frame_length);
+ else
+ ctx->cur_frame_length = sconf->frame_length;
+
+ // decode the frame data
+ if ((invalid_frame = read_frame_data(ctx, ra_frame) < 0))
+ av_log(ctx->avctx, AV_LOG_WARNING,
+ "Reading frame data failed. Skipping RA unit.\n");
+
+ ctx->frame_id++;
+
+ // check for size of decoded data
+ size = ctx->cur_frame_length * avctx->channels *
+ (av_get_bits_per_sample_format(avctx->sample_fmt) >> 3);
+
+ if (size > *data_size) {
+ av_log(avctx, AV_LOG_ERROR, "Decoded data exceeds buffer size.\n");
+ return -1;
+ }
+
+ *data_size = size;
+
+ // transform decoded frame into output format
+ #define INTERLEAVE_OUTPUT(bps) \
+ { \
+ int##bps##_t *dest = (int##bps##_t*) data; \
+ shift = bps - ctx->avctx->bits_per_raw_sample; \
+ for (sample = 0; sample < ctx->cur_frame_length; sample++) \
+ for (c = 0; c < avctx->channels; c++) \
+ *dest++ = ctx->raw_samples[c][sample] << shift; \
+ }
+
+ if (ctx->avctx->bits_per_raw_sample <= 16) {
+ INTERLEAVE_OUTPUT(16)
+ } else {
+ INTERLEAVE_OUTPUT(32)
+ }
+
+ bytes_read = invalid_frame ? buffer_size :
+ (get_bits_count(&ctx->gb) + 7) >> 3;
+
+ return bytes_read;
+}
+
+
+/** Uninitializes the ALS decoder.
+ */
+static av_cold int decode_end(AVCodecContext *avctx)
+{
+ ALSDecContext *ctx = avctx->priv_data;
+
+ av_freep(&ctx->sconf.chan_pos);
+
+ av_freep(&ctx->use_ltp);
+ av_freep(&ctx->ltp_lag);
+ av_freep(&ctx->ltp_gain);
+ av_freep(&ctx->ltp_gain_buffer);
+ av_freep(&ctx->quant_cof);
+ av_freep(&ctx->lpc_cof);
+ av_freep(&ctx->prev_raw_samples);
+ av_freep(&ctx->raw_samples);
+ av_freep(&ctx->raw_buffer);
+
+ return 0;
+}
+
+
+/** Initializes the ALS decoder.
+ */
+static av_cold int decode_init(AVCodecContext *avctx)
+{
+ unsigned int c;
+ unsigned int channel_size;
+ int num_buffers;
+ ALSDecContext *ctx = avctx->priv_data;
+ ALSSpecificConfig *sconf = &ctx->sconf;
+ ctx->avctx = avctx;
+
+ if (!avctx->extradata) {
+ av_log(avctx, AV_LOG_ERROR, "Missing required ALS extradata.\n");
+ return -1;
+ }
+
+ if (read_specific_config(ctx)) {
+ av_log(avctx, AV_LOG_ERROR, "Reading ALSSpecificConfig failed.\n");
+ decode_end(avctx);
+ return -1;
+ }
+
+ if (check_specific_config(ctx)) {
+ decode_end(avctx);
+ return -1;
+ }
+
+ if (sconf->floating) {
+ avctx->sample_fmt = SAMPLE_FMT_FLT;
+ avctx->bits_per_raw_sample = 32;
+ } else {
+ avctx->sample_fmt = sconf->resolution > 1
+ ? SAMPLE_FMT_S32 : SAMPLE_FMT_S16;
+ avctx->bits_per_raw_sample = (sconf->resolution + 1) * 8;
+ }
+
+ // set lag value for long-term prediction
+ ctx->ltp_lag_length = 8 + (avctx->sample_rate >= 96000) +
+ (avctx->sample_rate >= 192000);
+
+ // allocate quantized parcor coefficient buffer
+ num_buffers = sconf->mc_coding ? avctx->channels : 1;
+
+ // allocate and assign lag and gain data buffer for ltp mode
+ ctx->use_ltp = av_mallocz(sizeof(*ctx->use_ltp) * num_buffers);
+ ctx->ltp_lag = av_malloc (sizeof(*ctx->ltp_lag) * num_buffers);
+ ctx->ltp_gain = av_malloc (sizeof(*ctx->ltp_gain) * num_buffers);
+ ctx->ltp_gain_buffer = av_malloc (sizeof(*ctx->ltp_gain_buffer) *
+ num_buffers * 5);
+
+ if (!ctx->use_ltp || !ctx->ltp_lag ||
+ !ctx->ltp_gain || !ctx->ltp_gain_buffer) {
+ av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
+ decode_end(avctx);
+ return AVERROR(ENOMEM);
+ }
+
+ for (c = 0; c < num_buffers; c++)
+ ctx->ltp_gain[c] = ctx->ltp_gain_buffer + c * 5;
+
+ avctx->frame_size = sconf->frame_length;
+ channel_size = sconf->frame_length + sconf->max_order;
+
+ ctx->prev_raw_samples = av_malloc (sizeof(*ctx->prev_raw_samples) * sconf->max_order);
+ ctx->raw_buffer = av_mallocz(sizeof(*ctx-> raw_buffer) * avctx->channels * channel_size);
+ ctx->raw_samples = av_malloc (sizeof(*ctx-> raw_samples) * avctx->channels);
+
+ // allocate previous raw sample buffer
+ if (!ctx->prev_raw_samples || !ctx->raw_buffer|| !ctx->raw_samples) {
+ av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
+ decode_end(avctx);
+ return AVERROR(ENOMEM);
+ }
+
+ // assign raw samples buffers
+ ctx->raw_samples[0] = ctx->raw_buffer + sconf->max_order;
+ for (c = 1; c < avctx->channels; c++)
+ ctx->raw_samples[c] = ctx->raw_samples[c - 1] + channel_size;
+
+ return 0;
+}
+
+
+/** Flushes (resets) the frame ID after seeking.
+ */
+static av_cold void flush(AVCodecContext *avctx)
+{
+ ALSDecContext *ctx = avctx->priv_data;
+
+ ctx->frame_id = 0;
+}
+
+
+AVCodec als_decoder = {
+ "als",
+ CODEC_TYPE_AUDIO,
+ CODEC_ID_MP4ALS,
+ sizeof(ALSDecContext),
+ decode_init,
+ NULL,
+ decode_end,
+ decode_frame,
+ .flush = flush,
+ .capabilities = CODEC_CAP_SUBFRAMES,
+ .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 Audio Lossless Coding (ALS)"),
+};
+
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/apedec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/apedec.c
index 1e21e6a401..c27d0863ef 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/apedec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/apedec.c
@@ -408,8 +408,24 @@ static inline int ape_decode_value(APEContext * ctx, APERice *rice)
overflow |= range_decode_bits(ctx, 16);
}
- base = range_decode_culfreq(ctx, pivot);
- range_decode_update(ctx, 1, base);
+ if (pivot < 0x10000) {
+ base = range_decode_culfreq(ctx, pivot);
+ range_decode_update(ctx, 1, base);
+ } else {
+ int base_hi = pivot, base_lo;
+ int bbits = 0;
+
+ while (base_hi & ~0xFFFF) {
+ base_hi >>= 1;
+ bbits++;
+ }
+ base_hi = range_decode_culfreq(ctx, base_hi + 1);
+ range_decode_update(ctx, 1, base_hi);
+ base_lo = range_decode_culfreq(ctx, 1 << bbits);
+ range_decode_update(ctx, 1, base_lo);
+
+ base = (base_hi << bbits) + base_lo;
+ }
x = base + overflow * pivot;
}
@@ -501,9 +517,9 @@ static inline int APESIGN(int32_t x) {
return (x < 0) - (x > 0);
}
-static int predictor_update_filter(APEPredictor *p, const int decoded, const int filter, const int delayA, const int delayB, const int adaptA, const int adaptB)
+static av_always_inline int predictor_update_filter(APEPredictor *p, const int decoded, const int filter, const int delayA, const int delayB, const int adaptA, const int adaptB)
{
- int32_t predictionA, predictionB;
+ int32_t predictionA, predictionB, sign;
p->buf[delayA] = p->lastA[filter];
p->buf[adaptA] = APESIGN(p->buf[delayA]);
@@ -531,48 +547,32 @@ static int predictor_update_filter(APEPredictor *p, const int decoded, const int
p->lastA[filter] = decoded + ((predictionA + (predictionB >> 1)) >> 10);
p->filterA[filter] = p->lastA[filter] + ((p->filterA[filter] * 31) >> 5);
- if (!decoded) // no need updating filter coefficients
- return p->filterA[filter];
-
- if (decoded > 0) {
- p->coeffsA[filter][0] -= p->buf[adaptA ];
- p->coeffsA[filter][1] -= p->buf[adaptA - 1];
- p->coeffsA[filter][2] -= p->buf[adaptA - 2];
- p->coeffsA[filter][3] -= p->buf[adaptA - 3];
+ sign = APESIGN(decoded);
+ p->coeffsA[filter][0] += p->buf[adaptA ] * sign;
+ p->coeffsA[filter][1] += p->buf[adaptA - 1] * sign;
+ p->coeffsA[filter][2] += p->buf[adaptA - 2] * sign;
+ p->coeffsA[filter][3] += p->buf[adaptA - 3] * sign;
+ p->coeffsB[filter][0] += p->buf[adaptB ] * sign;
+ p->coeffsB[filter][1] += p->buf[adaptB - 1] * sign;
+ p->coeffsB[filter][2] += p->buf[adaptB - 2] * sign;
+ p->coeffsB[filter][3] += p->buf[adaptB - 3] * sign;
+ p->coeffsB[filter][4] += p->buf[adaptB - 4] * sign;
- p->coeffsB[filter][0] -= p->buf[adaptB ];
- p->coeffsB[filter][1] -= p->buf[adaptB - 1];
- p->coeffsB[filter][2] -= p->buf[adaptB - 2];
- p->coeffsB[filter][3] -= p->buf[adaptB - 3];
- p->coeffsB[filter][4] -= p->buf[adaptB - 4];
- } else {
- p->coeffsA[filter][0] += p->buf[adaptA ];
- p->coeffsA[filter][1] += p->buf[adaptA - 1];
- p->coeffsA[filter][2] += p->buf[adaptA - 2];
- p->coeffsA[filter][3] += p->buf[adaptA - 3];
-
- p->coeffsB[filter][0] += p->buf[adaptB ];
- p->coeffsB[filter][1] += p->buf[adaptB - 1];
- p->coeffsB[filter][2] += p->buf[adaptB - 2];
- p->coeffsB[filter][3] += p->buf[adaptB - 3];
- p->coeffsB[filter][4] += p->buf[adaptB - 4];
- }
return p->filterA[filter];
}
static void predictor_decode_stereo(APEContext * ctx, int count)
{
- int32_t predictionA, predictionB;
APEPredictor *p = &ctx->predictor;
int32_t *decoded0 = ctx->decoded0;
int32_t *decoded1 = ctx->decoded1;
while (count--) {
/* Predictor Y */
- predictionA = predictor_update_filter(p, *decoded0, 0, YDELAYA, YDELAYB, YADAPTCOEFFSA, YADAPTCOEFFSB);
- predictionB = predictor_update_filter(p, *decoded1, 1, XDELAYA, XDELAYB, XADAPTCOEFFSA, XADAPTCOEFFSB);
- *(decoded0++) = predictionA;
- *(decoded1++) = predictionB;
+ *decoded0 = predictor_update_filter(p, *decoded0, 0, YDELAYA, YDELAYB, YADAPTCOEFFSA, YADAPTCOEFFSB);
+ decoded0++;
+ *decoded1 = predictor_update_filter(p, *decoded1, 1, XDELAYA, XDELAYB, XADAPTCOEFFSA, XADAPTCOEFFSB);
+ decoded1++;
/* Combined */
p->buf++;
@@ -589,7 +589,7 @@ static void predictor_decode_mono(APEContext * ctx, int count)
{
APEPredictor *p = &ctx->predictor;
int32_t *decoded0 = ctx->decoded0;
- int32_t predictionA, currentA, A;
+ int32_t predictionA, currentA, A, sign;
currentA = p->lastA[0];
@@ -609,17 +609,11 @@ static void predictor_decode_mono(APEContext * ctx, int count)
p->buf[YADAPTCOEFFSA] = APESIGN(p->buf[YDELAYA ]);
p->buf[YADAPTCOEFFSA - 1] = APESIGN(p->buf[YDELAYA - 1]);
- if (A > 0) {
- p->coeffsA[0][0] -= p->buf[YADAPTCOEFFSA ];
- p->coeffsA[0][1] -= p->buf[YADAPTCOEFFSA - 1];
- p->coeffsA[0][2] -= p->buf[YADAPTCOEFFSA - 2];
- p->coeffsA[0][3] -= p->buf[YADAPTCOEFFSA - 3];
- } else if (A < 0) {
- p->coeffsA[0][0] += p->buf[YADAPTCOEFFSA ];
- p->coeffsA[0][1] += p->buf[YADAPTCOEFFSA - 1];
- p->coeffsA[0][2] += p->buf[YADAPTCOEFFSA - 2];
- p->coeffsA[0][3] += p->buf[YADAPTCOEFFSA - 3];
- }
+ sign = APESIGN(A);
+ p->coeffsA[0][0] += p->buf[YADAPTCOEFFSA ] * sign;
+ p->coeffsA[0][1] += p->buf[YADAPTCOEFFSA - 1] * sign;
+ p->coeffsA[0][2] += p->buf[YADAPTCOEFFSA - 2] * sign;
+ p->coeffsA[0][3] += p->buf[YADAPTCOEFFSA - 3] * sign;
p->buf++;
@@ -654,22 +648,16 @@ static void init_filter(APEContext * ctx, APEFilter *f, int16_t * buf, int order
do_init_filter(&f[1], buf + order * 3 + HISTORY_SIZE, order);
}
-static inline void do_apply_filter(APEContext * ctx, int version, APEFilter *f, int32_t *data, int count, int order, int fracbits)
+static void do_apply_filter(APEContext * ctx, int version, APEFilter *f, int32_t *data, int count, int order, int fracbits)
{
int res;
int absres;
while (count--) {
/* round fixedpoint scalar product */
- res = (ctx->dsp.scalarproduct_int16(f->delay - order, f->coeffs, order, 0) + (1 << (fracbits - 1))) >> fracbits;
-
- if (*data < 0)
- ctx->dsp.add_int16(f->coeffs, f->adaptcoeffs - order, order);
- else if (*data > 0)
- ctx->dsp.sub_int16(f->coeffs, f->adaptcoeffs - order, order);
-
+ res = ctx->dsp.scalarproduct_and_madd_int16(f->coeffs, f->delay - order, f->adaptcoeffs - order, order, APESIGN(*data));
+ res = (res + (1 << (fracbits - 1))) >> fracbits;
res += *data;
-
*data++ = res;
/* Update the output history */
@@ -684,14 +672,9 @@ static inline void do_apply_filter(APEContext * ctx, int version, APEFilter *f,
/* Version 3.98 and later files */
/* Update the adaption coefficients */
- absres = (res < 0 ? -res : res);
-
- if (absres > (f->avg * 3))
- *f->adaptcoeffs = ((res >> 25) & 64) - 32;
- else if (absres > (f->avg * 4) / 3)
- *f->adaptcoeffs = ((res >> 26) & 32) - 16;
- else if (absres > 0)
- *f->adaptcoeffs = ((res >> 27) & 16) - 8;
+ absres = FFABS(res);
+ if (absres)
+ *f->adaptcoeffs = ((res & (1<<31)) - (1<<30)) >> (25 + (absres <= f->avg*3) + (absres <= f->avg*4/3));
else
*f->adaptcoeffs = 0;
@@ -871,6 +854,7 @@ static int ape_decode_frame(AVCodecContext * avctx,
ape_unpack_mono(s, blockstodecode);
else
ape_unpack_stereo(s, blockstodecode);
+ emms_c();
if(s->error || s->ptr > s->data_end){
s->samples=0;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/asm.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/asm.S
index 0fbd641dc3..1ee431d94e 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/asm.S
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/asm.S
@@ -45,7 +45,7 @@ ELF .type \name, %function
.endm
.macro movrel rd, val
-#if HAVE_ARMV6T2 && !CONFIG_SHARED && !CONFIG_PIC
+#if HAVE_ARMV6T2 && !CONFIG_PIC
movw \rd, #:lower16:\val
movt \rd, #:upper16:\val
#else
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_arm.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_arm.S
index a09098135f..6252d3cdfe 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_arm.S
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_arm.S
@@ -596,20 +596,13 @@ function ff_put_pixels8_xy2_arm, export=1
pld [r1]
push {r4-r11,lr} @ R14 is also called LR
JMP_ALIGN r5, r1
-1:
- RND_XY2_EXPAND 0, lsl
-
+1: RND_XY2_EXPAND 0, lsl
.align 5
-2:
- RND_XY2_EXPAND 1, lsl
-
+2: RND_XY2_EXPAND 1, lsl
.align 5
-3:
- RND_XY2_EXPAND 2, lsl
-
+3: RND_XY2_EXPAND 2, lsl
.align 5
-4:
- RND_XY2_EXPAND 3, lsl
+4: RND_XY2_EXPAND 3, lsl
.endfunc
.align 5
@@ -619,25 +612,18 @@ function ff_put_no_rnd_pixels8_xy2_arm, export=1
pld [r1]
push {r4-r11,lr}
JMP_ALIGN r5, r1
-1:
- RND_XY2_EXPAND 0, lsr
-
+1: RND_XY2_EXPAND 0, lsr
.align 5
-2:
- RND_XY2_EXPAND 1, lsr
-
+2: RND_XY2_EXPAND 1, lsr
.align 5
-3:
- RND_XY2_EXPAND 2, lsr
-
+3: RND_XY2_EXPAND 2, lsr
.align 5
-4:
- RND_XY2_EXPAND 3, lsr
+4: RND_XY2_EXPAND 3, lsr
.endfunc
.align 5
-@ void ff_add_pixels_clamped_ARM(int16_t *block, uint8_t *dest, int stride)
-function ff_add_pixels_clamped_ARM, export=1
+@ void ff_add_pixels_clamped_arm(int16_t *block, uint8_t *dest, int stride)
+function ff_add_pixels_clamped_arm, export=1
push {r4-r10}
mov r10, #8
1:
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_armv6.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_armv6.S
new file mode 100644
index 0000000000..c76d408809
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_armv6.S
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2009 Mans Rullgard <mans@mansr.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "asm.S"
+
+ .text
+
+function ff_add_pixels_clamped_armv6, export=1
+ push {r4-r8,lr}
+ mov r3, #8
+1:
+ ldm r0!, {r4,r5,r12,lr}
+ ldrd r6, r7, [r1]
+ pkhbt r8, r4, r5, lsl #16
+ pkhtb r5, r5, r4, asr #16
+ pkhbt r4, r12, lr, lsl #16
+ pkhtb lr, lr, r12, asr #16
+ pld [r1, r2]
+ uxtab16 r8, r8, r6
+ uxtab16 r5, r5, r6, ror #8
+ uxtab16 r4, r4, r7
+ uxtab16 lr, lr, r7, ror #8
+ usat16 r8, #8, r8
+ usat16 r5, #8, r5
+ usat16 r4, #8, r4
+ usat16 lr, #8, lr
+ orr r6, r8, r5, lsl #8
+ orr r7, r4, lr, lsl #8
+ subs r3, r3, #1
+ strd r6, r7, [r1], r2
+ bgt 1b
+ pop {r4-r8,pc}
+.endfunc
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_init_arm.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_init_arm.c
index c1aa9797d7..c9c335112d 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_init_arm.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_init_arm.c
@@ -22,8 +22,8 @@
#include "libavcodec/dsputil.h"
#include "dsputil_arm.h"
-void ff_j_rev_dct_ARM(DCTELEM *data);
-void ff_simple_idct_ARM(DCTELEM *data);
+void ff_j_rev_dct_arm(DCTELEM *data);
+void ff_simple_idct_arm(DCTELEM *data);
/* XXX: local hack */
static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
@@ -47,29 +47,29 @@ CALL_2X_PIXELS(ff_put_no_rnd_pixels16_x2_arm, ff_put_no_rnd_pixels8_x2_arm, 8)
CALL_2X_PIXELS(ff_put_no_rnd_pixels16_y2_arm, ff_put_no_rnd_pixels8_y2_arm, 8)
CALL_2X_PIXELS(ff_put_no_rnd_pixels16_xy2_arm, ff_put_no_rnd_pixels8_xy2_arm,8)
-void ff_add_pixels_clamped_ARM(short *block, unsigned char *dest,
- int line_size);
+void ff_add_pixels_clamped_arm(const DCTELEM *block, uint8_t *dest,
+ int line_size);
/* XXX: those functions should be suppressed ASAP when all IDCTs are
converted */
-static void j_rev_dct_ARM_put(uint8_t *dest, int line_size, DCTELEM *block)
+static void j_rev_dct_arm_put(uint8_t *dest, int line_size, DCTELEM *block)
{
- ff_j_rev_dct_ARM (block);
+ ff_j_rev_dct_arm (block);
ff_put_pixels_clamped(block, dest, line_size);
}
-static void j_rev_dct_ARM_add(uint8_t *dest, int line_size, DCTELEM *block)
+static void j_rev_dct_arm_add(uint8_t *dest, int line_size, DCTELEM *block)
{
- ff_j_rev_dct_ARM (block);
+ ff_j_rev_dct_arm (block);
ff_add_pixels_clamped(block, dest, line_size);
}
-static void simple_idct_ARM_put(uint8_t *dest, int line_size, DCTELEM *block)
+static void simple_idct_arm_put(uint8_t *dest, int line_size, DCTELEM *block)
{
- ff_simple_idct_ARM (block);
+ ff_simple_idct_arm (block);
ff_put_pixels_clamped(block, dest, line_size);
}
-static void simple_idct_ARM_add(uint8_t *dest, int line_size, DCTELEM *block)
+static void simple_idct_arm_add(uint8_t *dest, int line_size, DCTELEM *block)
{
- ff_simple_idct_ARM (block);
+ ff_simple_idct_arm (block);
ff_add_pixels_clamped(block, dest, line_size);
}
@@ -86,18 +86,20 @@ void dsputil_init_arm(DSPContext* c, AVCodecContext *avctx)
if (!avctx->lowres) {
if(avctx->idct_algo == FF_IDCT_AUTO ||
avctx->idct_algo == FF_IDCT_ARM){
- c->idct_put = j_rev_dct_ARM_put;
- c->idct_add = j_rev_dct_ARM_add;
- c->idct = ff_j_rev_dct_ARM;
+ c->idct_put = j_rev_dct_arm_put;
+ c->idct_add = j_rev_dct_arm_add;
+ c->idct = ff_j_rev_dct_arm;
c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM;
} else if (avctx->idct_algo == FF_IDCT_SIMPLEARM){
- c->idct_put = simple_idct_ARM_put;
- c->idct_add = simple_idct_ARM_add;
- c->idct = ff_simple_idct_ARM;
+ c->idct_put = simple_idct_arm_put;
+ c->idct_add = simple_idct_arm_add;
+ c->idct = ff_simple_idct_arm;
c->idct_permutation_type = FF_NO_IDCT_PERM;
}
}
+ c->add_pixels_clamped = ff_add_pixels_clamped_arm;
+
c->put_pixels_tab[0][0] = ff_put_pixels16_arm;
c->put_pixels_tab[0][1] = ff_put_pixels16_x2_arm;
c->put_pixels_tab[0][2] = ff_put_pixels16_y2_arm;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_init_armv6.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_init_armv6.c
index 6b03a67b80..76bde43f33 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_init_armv6.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_init_armv6.c
@@ -25,6 +25,10 @@ void ff_simple_idct_armv6(DCTELEM *data);
void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, DCTELEM *data);
void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, DCTELEM *data);
+void ff_add_pixels_clamped_armv6(const DCTELEM *block,
+ uint8_t *restrict pixels,
+ int line_size);
+
void av_cold ff_dsputil_init_armv6(DSPContext* c, AVCodecContext *avctx)
{
if (!avctx->lowres && (avctx->idct_algo == FF_IDCT_AUTO ||
@@ -34,4 +38,6 @@ void av_cold ff_dsputil_init_armv6(DSPContext* c, AVCodecContext *avctx)
c->idct = ff_simple_idct_armv6;
c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM;
}
+
+ c->add_pixels_clamped = ff_add_pixels_clamped_armv6;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_init_neon.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_init_neon.c
index a1d4980171..920b2e87c9 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_init_neon.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_init_neon.c
@@ -49,6 +49,7 @@ void ff_put_pixels8_y2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
void ff_put_pixels8_xy2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
void ff_avg_pixels16_neon(uint8_t *, const uint8_t *, int, int);
+void ff_avg_pixels8_neon(uint8_t *, const uint8_t *, int, int);
void ff_add_pixels_clamped_neon(const DCTELEM *, uint8_t *, int);
void ff_put_pixels_clamped_neon(const DCTELEM *, uint8_t *, int);
@@ -89,12 +90,46 @@ void ff_put_h264_qpel8_mc23_neon(uint8_t *, uint8_t *, int);
void ff_put_h264_qpel8_mc33_neon(uint8_t *, uint8_t *, int);
void ff_avg_h264_qpel16_mc00_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel16_mc10_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel16_mc20_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel16_mc30_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel16_mc01_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel16_mc11_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel16_mc21_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel16_mc31_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel16_mc02_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel16_mc12_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel16_mc22_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel16_mc32_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel16_mc03_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel16_mc13_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel16_mc23_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel16_mc33_neon(uint8_t *, uint8_t *, int);
+
+void ff_avg_h264_qpel8_mc00_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel8_mc10_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel8_mc20_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel8_mc30_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel8_mc01_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel8_mc11_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel8_mc21_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel8_mc31_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel8_mc02_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel8_mc12_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel8_mc22_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel8_mc32_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel8_mc03_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel8_mc13_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel8_mc23_neon(uint8_t *, uint8_t *, int);
+void ff_avg_h264_qpel8_mc33_neon(uint8_t *, uint8_t *, int);
void ff_put_h264_chroma_mc8_neon(uint8_t *, uint8_t *, int, int, int, int);
void ff_put_h264_chroma_mc4_neon(uint8_t *, uint8_t *, int, int, int, int);
+void ff_put_h264_chroma_mc2_neon(uint8_t *, uint8_t *, int, int, int, int);
void ff_avg_h264_chroma_mc8_neon(uint8_t *, uint8_t *, int, int, int, int);
void ff_avg_h264_chroma_mc4_neon(uint8_t *, uint8_t *, int, int, int, int);
+void ff_avg_h264_chroma_mc2_neon(uint8_t *, uint8_t *, int, int, int, int);
void ff_h264_v_loop_filter_luma_neon(uint8_t *pix, int stride, int alpha,
int beta, int8_t *tc0);
@@ -230,6 +265,7 @@ void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx)
c->put_no_rnd_pixels_tab[1][3] = ff_put_pixels8_xy2_no_rnd_neon;
c->avg_pixels_tab[0][0] = ff_avg_pixels16_neon;
+ c->avg_pixels_tab[1][0] = ff_avg_pixels8_neon;
c->add_pixels_clamped = ff_add_pixels_clamped_neon;
c->put_pixels_clamped = ff_put_pixels_clamped_neon;
@@ -238,9 +274,11 @@ void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx)
if (CONFIG_H264_DECODER) {
c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_neon;
c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_neon;
+ c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_neon;
c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_neon;
c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_neon;
+ c->avg_h264_chroma_pixels_tab[2] = ff_avg_h264_chroma_mc2_neon;
c->put_h264_qpel_pixels_tab[0][ 0] = ff_put_h264_qpel16_mc00_neon;
c->put_h264_qpel_pixels_tab[0][ 1] = ff_put_h264_qpel16_mc10_neon;
@@ -277,6 +315,38 @@ void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx)
c->put_h264_qpel_pixels_tab[1][15] = ff_put_h264_qpel8_mc33_neon;
c->avg_h264_qpel_pixels_tab[0][ 0] = ff_avg_h264_qpel16_mc00_neon;
+ c->avg_h264_qpel_pixels_tab[0][ 1] = ff_avg_h264_qpel16_mc10_neon;
+ c->avg_h264_qpel_pixels_tab[0][ 2] = ff_avg_h264_qpel16_mc20_neon;
+ c->avg_h264_qpel_pixels_tab[0][ 3] = ff_avg_h264_qpel16_mc30_neon;
+ c->avg_h264_qpel_pixels_tab[0][ 4] = ff_avg_h264_qpel16_mc01_neon;
+ c->avg_h264_qpel_pixels_tab[0][ 5] = ff_avg_h264_qpel16_mc11_neon;
+ c->avg_h264_qpel_pixels_tab[0][ 6] = ff_avg_h264_qpel16_mc21_neon;
+ c->avg_h264_qpel_pixels_tab[0][ 7] = ff_avg_h264_qpel16_mc31_neon;
+ c->avg_h264_qpel_pixels_tab[0][ 8] = ff_avg_h264_qpel16_mc02_neon;
+ c->avg_h264_qpel_pixels_tab[0][ 9] = ff_avg_h264_qpel16_mc12_neon;
+ c->avg_h264_qpel_pixels_tab[0][10] = ff_avg_h264_qpel16_mc22_neon;
+ c->avg_h264_qpel_pixels_tab[0][11] = ff_avg_h264_qpel16_mc32_neon;
+ c->avg_h264_qpel_pixels_tab[0][12] = ff_avg_h264_qpel16_mc03_neon;
+ c->avg_h264_qpel_pixels_tab[0][13] = ff_avg_h264_qpel16_mc13_neon;
+ c->avg_h264_qpel_pixels_tab[0][14] = ff_avg_h264_qpel16_mc23_neon;
+ c->avg_h264_qpel_pixels_tab[0][15] = ff_avg_h264_qpel16_mc33_neon;
+
+ c->avg_h264_qpel_pixels_tab[1][ 0] = ff_avg_h264_qpel8_mc00_neon;
+ c->avg_h264_qpel_pixels_tab[1][ 1] = ff_avg_h264_qpel8_mc10_neon;
+ c->avg_h264_qpel_pixels_tab[1][ 2] = ff_avg_h264_qpel8_mc20_neon;
+ c->avg_h264_qpel_pixels_tab[1][ 3] = ff_avg_h264_qpel8_mc30_neon;
+ c->avg_h264_qpel_pixels_tab[1][ 4] = ff_avg_h264_qpel8_mc01_neon;
+ c->avg_h264_qpel_pixels_tab[1][ 5] = ff_avg_h264_qpel8_mc11_neon;
+ c->avg_h264_qpel_pixels_tab[1][ 6] = ff_avg_h264_qpel8_mc21_neon;
+ c->avg_h264_qpel_pixels_tab[1][ 7] = ff_avg_h264_qpel8_mc31_neon;
+ c->avg_h264_qpel_pixels_tab[1][ 8] = ff_avg_h264_qpel8_mc02_neon;
+ c->avg_h264_qpel_pixels_tab[1][ 9] = ff_avg_h264_qpel8_mc12_neon;
+ c->avg_h264_qpel_pixels_tab[1][10] = ff_avg_h264_qpel8_mc22_neon;
+ c->avg_h264_qpel_pixels_tab[1][11] = ff_avg_h264_qpel8_mc32_neon;
+ c->avg_h264_qpel_pixels_tab[1][12] = ff_avg_h264_qpel8_mc03_neon;
+ c->avg_h264_qpel_pixels_tab[1][13] = ff_avg_h264_qpel8_mc13_neon;
+ c->avg_h264_qpel_pixels_tab[1][14] = ff_avg_h264_qpel8_mc23_neon;
+ c->avg_h264_qpel_pixels_tab[1][15] = ff_avg_h264_qpel8_mc33_neon;
c->h264_v_loop_filter_luma = ff_h264_v_loop_filter_luma_neon;
c->h264_h_loop_filter_luma = ff_h264_h_loop_filter_luma_neon;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_neon.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_neon.S
index 56e7cd3e96..f5267cb5e6 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_neon.S
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dsputil_neon.S
@@ -139,7 +139,7 @@
bx lr
.endm
- .macro pixels8
+ .macro pixels8 avg=0
1: vld1.64 {d0}, [r1], r2
vld1.64 {d1}, [r1], r2
vld1.64 {d2}, [r1], r2
@@ -148,6 +148,17 @@
pld [r1]
pld [r1, r2]
pld [r1, r2, lsl #1]
+.if \avg
+ vld1.64 {d4}, [r0,:64], r2
+ vrhadd.u8 d0, d0, d4
+ vld1.64 {d5}, [r0,:64], r2
+ vrhadd.u8 d1, d1, d5
+ vld1.64 {d6}, [r0,:64], r2
+ vrhadd.u8 d2, d2, d6
+ vld1.64 {d7}, [r0,:64], r2
+ vrhadd.u8 d3, d3, d7
+ sub r0, r0, r2, lsl #2
+.endif
subs r3, r3, #4
vst1.64 {d0}, [r0,:64], r2
vst1.64 {d1}, [r0,:64], r2
@@ -238,7 +249,7 @@ function ff_\pfx\name\suf\()_neon, export=1
.endm
function ff_put_h264_qpel16_mc00_neon, export=1
- mov r3, #16
+ mov r3, #16
.endfunc
pixfunc put_ pixels16
@@ -247,13 +258,13 @@ function ff_put_h264_qpel16_mc00_neon, export=1
pixfunc2 put_ pixels16_xy2, _no_rnd, vshrn.u16, 1
function ff_avg_h264_qpel16_mc00_neon, export=1
- mov r3, #16
+ mov r3, #16
.endfunc
pixfunc avg_ pixels16,, 1
function ff_put_h264_qpel8_mc00_neon, export=1
- mov r3, #8
+ mov r3, #8
.endfunc
pixfunc put_ pixels8
@@ -261,6 +272,12 @@ function ff_put_h264_qpel8_mc00_neon, export=1
pixfunc2 put_ pixels8_y2, _no_rnd, vhadd.u8
pixfunc2 put_ pixels8_xy2, _no_rnd, vshrn.u16, 1
+function ff_avg_h264_qpel8_mc00_neon, export=1
+ mov r3, #8
+ .endfunc
+
+ pixfunc avg_ pixels8,, 1
+
function ff_put_pixels_clamped_neon, export=1
vld1.64 {d16-d19}, [r0,:128]!
vqmovun.s16 d0, q8
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264dsp_neon.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264dsp_neon.S
index 78f312d758..08ff20702f 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264dsp_neon.S
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264dsp_neon.S
@@ -320,6 +320,74 @@ function ff_\type\()_h264_chroma_mc4_neon, export=1
.endfunc
.endm
+ .macro h264_chroma_mc2 type
+function ff_\type\()_h264_chroma_mc2_neon, export=1
+ push {r4-r6, lr}
+ ldr r4, [sp, #16]
+ ldr lr, [sp, #20]
+ pld [r1]
+ pld [r1, r2]
+ orrs r5, r4, lr
+ beq 2f
+
+ mul r5, r4, lr
+ rsb r6, r5, lr, lsl #3
+ rsb r12, r5, r4, lsl #3
+ sub r4, r5, r4, lsl #3
+ sub r4, r4, lr, lsl #3
+ add r4, r4, #64
+ vdup.8 d0, r4
+ vdup.8 d2, r12
+ vdup.8 d1, r6
+ vdup.8 d3, r5
+ vtrn.16 q0, q1
+1:
+ vld1.32 {d4[0]}, [r1], r2
+ vld1.32 {d4[1]}, [r1], r2
+ vrev64.32 d5, d4
+ vld1.32 {d5[1]}, [r1]
+ vext.8 q3, q2, q2, #1
+ vtrn.16 q2, q3
+ vmull.u8 q8, d4, d0
+ vmlal.u8 q8, d5, d1
+.ifc \type,avg
+ vld1.16 {d18[0]}, [r0,:16], r2
+ vld1.16 {d18[1]}, [r0,:16]
+ sub r0, r0, r2
+.endif
+ vtrn.32 d16, d17
+ vadd.i16 d16, d16, d17
+ vrshrn.u16 d16, q8, #6
+.ifc \type,avg
+ vrhadd.u8 d16, d16, d18
+.endif
+ vst1.16 {d16[0]}, [r0,:16], r2
+ vst1.16 {d16[1]}, [r0,:16], r2
+ subs r3, r3, #2
+ bgt 1b
+ pop {r4-r6, pc}
+2:
+.ifc \type,put
+ ldrh r5, [r1], r2
+ strh r5, [r0], r2
+ ldrh r6, [r1], r2
+ strh r6, [r0], r2
+.else
+ vld1.16 {d16[0]}, [r1], r2
+ vld1.16 {d16[1]}, [r1], r2
+ vld1.16 {d18[0]}, [r0,:16], r2
+ vld1.16 {d18[1]}, [r0,:16]
+ sub r0, r0, r2
+ vrhadd.u8 d16, d16, d18
+ vst1.16 {d16[0]}, [r0,:16], r2
+ vst1.16 {d16[1]}, [r0,:16], r2
+.endif
+ subs r3, r3, #2
+ bgt 2b
+ pop {r4-r6, pc}
+ .endfunc
+.endm
+
.text
.align
@@ -327,6 +395,8 @@ function ff_\type\()_h264_chroma_mc4_neon, export=1
h264_chroma_mc8 avg
h264_chroma_mc4 put
h264_chroma_mc4 avg
+ h264_chroma_mc2 put
+ h264_chroma_mc2 avg
/* H.264 loop filter */
@@ -706,10 +776,11 @@ function put_h264_qpel16_h_lowpass_neon_packed
b put_h264_qpel8_h_lowpass_neon
.endfunc
-function put_h264_qpel16_h_lowpass_neon
+ .macro h264_qpel_h_lowpass type
+function \type\()_h264_qpel16_h_lowpass_neon
push {lr}
mov ip, #16
- bl put_h264_qpel8_h_lowpass_neon
+ bl \type\()_h264_qpel8_h_lowpass_neon
sub r0, r0, r3, lsl #4
sub r1, r1, r2, lsl #4
add r0, r0, #8
@@ -718,21 +789,33 @@ function put_h264_qpel16_h_lowpass_neon
pop {lr}
.endfunc
-function put_h264_qpel8_h_lowpass_neon
+function \type\()_h264_qpel8_h_lowpass_neon
1: vld1.64 {d0, d1}, [r1], r2
vld1.64 {d16,d17}, [r1], r2
subs ip, ip, #2
lowpass_8 d0, d1, d16, d17, d0, d16
+.ifc \type,avg
+ vld1.8 {d2}, [r0,:64], r3
+ vrhadd.u8 d0, d0, d2
+ vld1.8 {d3}, [r0,:64]
+ vrhadd.u8 d16, d16, d3
+ sub r0, r0, r3
+.endif
vst1.64 {d0}, [r0,:64], r3
vst1.64 {d16}, [r0,:64], r3
bne 1b
bx lr
.endfunc
+ .endm
+
+ h264_qpel_h_lowpass put
+ h264_qpel_h_lowpass avg
-function put_h264_qpel16_h_lowpass_l2_neon
+ .macro h264_qpel_h_lowpass_l2 type
+function \type\()_h264_qpel16_h_lowpass_l2_neon
push {lr}
mov ip, #16
- bl put_h264_qpel8_h_lowpass_l2_neon
+ bl \type\()_h264_qpel8_h_lowpass_l2_neon
sub r0, r0, r2, lsl #4
sub r1, r1, r2, lsl #4
sub r3, r3, r2, lsl #4
@@ -743,7 +826,7 @@ function put_h264_qpel16_h_lowpass_l2_neon
pop {lr}
.endfunc
-function put_h264_qpel8_h_lowpass_l2_neon
+function \type\()_h264_qpel8_h_lowpass_l2_neon
1: vld1.64 {d0, d1}, [r1], r2
vld1.64 {d16,d17}, [r1], r2
vld1.64 {d28}, [r3], r2
@@ -751,11 +834,22 @@ function put_h264_qpel8_h_lowpass_l2_neon
subs ip, ip, #2
lowpass_8 d0, d1, d16, d17, d0, d1
vrhadd.u8 q0, q0, q14
+.ifc \type,avg
+ vld1.8 {d2}, [r0,:64], r2
+ vrhadd.u8 d0, d0, d2
+ vld1.8 {d3}, [r0,:64]
+ vrhadd.u8 d1, d1, d3
+ sub r0, r0, r2
+.endif
vst1.64 {d0}, [r0,:64], r2
vst1.64 {d1}, [r0,:64], r2
bne 1b
bx lr
.endfunc
+ .endm
+
+ h264_qpel_h_lowpass_l2 put
+ h264_qpel_h_lowpass_l2 avg
function put_h264_qpel16_v_lowpass_neon_packed
mov r4, lr
@@ -772,22 +866,23 @@ function put_h264_qpel16_v_lowpass_neon_packed
b put_h264_qpel8_v_lowpass_neon
.endfunc
-function put_h264_qpel16_v_lowpass_neon
+ .macro h264_qpel_v_lowpass type
+function \type\()_h264_qpel16_v_lowpass_neon
mov r4, lr
- bl put_h264_qpel8_v_lowpass_neon
+ bl \type\()_h264_qpel8_v_lowpass_neon
sub r1, r1, r3, lsl #2
- bl put_h264_qpel8_v_lowpass_neon
+ bl \type\()_h264_qpel8_v_lowpass_neon
sub r0, r0, r2, lsl #4
add r0, r0, #8
sub r1, r1, r3, lsl #4
sub r1, r1, r3, lsl #2
add r1, r1, #8
- bl put_h264_qpel8_v_lowpass_neon
+ bl \type\()_h264_qpel8_v_lowpass_neon
sub r1, r1, r3, lsl #2
mov lr, r4
.endfunc
-function put_h264_qpel8_v_lowpass_neon
+function \type\()_h264_qpel8_v_lowpass_neon
vld1.64 {d8}, [r1], r3
vld1.64 {d10}, [r1], r3
vld1.64 {d12}, [r1], r3
@@ -809,6 +904,26 @@ function put_h264_qpel8_v_lowpass_neon
lowpass_8 d26, d27, d28, d29, d26, d28
transpose_8x8 d8, d10, d12, d14, d22, d24, d26, d28
+.ifc \type,avg
+ vld1.8 {d9}, [r0,:64], r2
+ vrhadd.u8 d8, d8, d9
+ vld1.8 {d11}, [r0,:64], r2
+ vrhadd.u8 d10, d10, d11
+ vld1.8 {d13}, [r0,:64], r2
+ vrhadd.u8 d12, d12, d13
+ vld1.8 {d15}, [r0,:64], r2
+ vrhadd.u8 d14, d14, d15
+ vld1.8 {d23}, [r0,:64], r2
+ vrhadd.u8 d22, d22, d23
+ vld1.8 {d25}, [r0,:64], r2
+ vrhadd.u8 d24, d24, d25
+ vld1.8 {d27}, [r0,:64], r2
+ vrhadd.u8 d26, d26, d27
+ vld1.8 {d29}, [r0,:64], r2
+ vrhadd.u8 d28, d28, d29
+ sub r0, r0, r2, lsl #3
+.endif
+
vst1.64 {d8}, [r0,:64], r2
vst1.64 {d10}, [r0,:64], r2
vst1.64 {d12}, [r0,:64], r2
@@ -820,12 +935,17 @@ function put_h264_qpel8_v_lowpass_neon
bx lr
.endfunc
+ .endm
+
+ h264_qpel_v_lowpass put
+ h264_qpel_v_lowpass avg
-function put_h264_qpel16_v_lowpass_l2_neon
+ .macro h264_qpel_v_lowpass_l2 type
+function \type\()_h264_qpel16_v_lowpass_l2_neon
mov r4, lr
- bl put_h264_qpel8_v_lowpass_l2_neon
+ bl \type\()_h264_qpel8_v_lowpass_l2_neon
sub r1, r1, r3, lsl #2
- bl put_h264_qpel8_v_lowpass_l2_neon
+ bl \type\()_h264_qpel8_v_lowpass_l2_neon
sub r0, r0, r3, lsl #4
sub ip, ip, r2, lsl #4
add r0, r0, #8
@@ -833,12 +953,12 @@ function put_h264_qpel16_v_lowpass_l2_neon
sub r1, r1, r3, lsl #4
sub r1, r1, r3, lsl #2
add r1, r1, #8
- bl put_h264_qpel8_v_lowpass_l2_neon
+ bl \type\()_h264_qpel8_v_lowpass_l2_neon
sub r1, r1, r3, lsl #2
mov lr, r4
.endfunc
-function put_h264_qpel8_v_lowpass_l2_neon
+function \type\()_h264_qpel8_v_lowpass_l2_neon
vld1.64 {d8}, [r1], r3
vld1.64 {d10}, [r1], r3
vld1.64 {d12}, [r1], r3
@@ -871,10 +991,30 @@ function put_h264_qpel8_v_lowpass_l2_neon
vld1.64 {d10}, [ip], r2
vrhadd.u8 q2, q2, q11
vld1.64 {d11}, [ip], r2
+ vrhadd.u8 q5, q5, q13
+
+.ifc \type,avg
+ vld1.8 {d16}, [r0,:64], r3
+ vrhadd.u8 d0, d0, d16
+ vld1.8 {d17}, [r0,:64], r3
+ vrhadd.u8 d1, d1, d17
+ vld1.8 {d16}, [r0,:64], r3
+ vrhadd.u8 d2, d2, d16
+ vld1.8 {d17}, [r0,:64], r3
+ vrhadd.u8 d3, d3, d17
+ vld1.8 {d16}, [r0,:64], r3
+ vrhadd.u8 d4, d4, d16
+ vld1.8 {d17}, [r0,:64], r3
+ vrhadd.u8 d5, d5, d17
+ vld1.8 {d16}, [r0,:64], r3
+ vrhadd.u8 d10, d10, d16
+ vld1.8 {d17}, [r0,:64], r3
+ vrhadd.u8 d11, d11, d17
+ sub r0, r0, r3, lsl #3
+.endif
vst1.64 {d0}, [r0,:64], r3
vst1.64 {d1}, [r0,:64], r3
- vrhadd.u8 q5, q5, q13
vst1.64 {d2}, [r0,:64], r3
vst1.64 {d3}, [r0,:64], r3
vst1.64 {d4}, [r0,:64], r3
@@ -884,6 +1024,10 @@ function put_h264_qpel8_v_lowpass_l2_neon
bx lr
.endfunc
+ .endm
+
+ h264_qpel_v_lowpass_l2 put
+ h264_qpel_v_lowpass_l2 avg
function put_h264_qpel8_hv_lowpass_neon_top
lowpass_const ip
@@ -951,9 +1095,29 @@ function put_h264_qpel8_hv_lowpass_neon_top
bx lr
.endfunc
-function put_h264_qpel8_hv_lowpass_neon
+ .macro h264_qpel8_hv_lowpass type
+function \type\()_h264_qpel8_hv_lowpass_neon
mov r10, lr
bl put_h264_qpel8_hv_lowpass_neon_top
+.ifc \type,avg
+ vld1.8 {d0}, [r0,:64], r2
+ vrhadd.u8 d12, d12, d0
+ vld1.8 {d1}, [r0,:64], r2
+ vrhadd.u8 d13, d13, d1
+ vld1.8 {d2}, [r0,:64], r2
+ vrhadd.u8 d14, d14, d2
+ vld1.8 {d3}, [r0,:64], r2
+ vrhadd.u8 d15, d15, d3
+ vld1.8 {d4}, [r0,:64], r2
+ vrhadd.u8 d8, d8, d4
+ vld1.8 {d5}, [r0,:64], r2
+ vrhadd.u8 d9, d9, d5
+ vld1.8 {d6}, [r0,:64], r2
+ vrhadd.u8 d10, d10, d6
+ vld1.8 {d7}, [r0,:64], r2
+ vrhadd.u8 d11, d11, d7
+ sub r0, r0, r2, lsl #3
+.endif
vst1.64 {d12}, [r0,:64], r2
vst1.64 {d13}, [r0,:64], r2
vst1.64 {d14}, [r0,:64], r2
@@ -966,8 +1130,13 @@ function put_h264_qpel8_hv_lowpass_neon
mov lr, r10
bx lr
.endfunc
+ .endm
-function put_h264_qpel8_hv_lowpass_l2_neon
+ h264_qpel8_hv_lowpass put
+ h264_qpel8_hv_lowpass avg
+
+ .macro h264_qpel8_hv_lowpass_l2 type
+function \type\()_h264_qpel8_hv_lowpass_l2_neon
mov r10, lr
bl put_h264_qpel8_hv_lowpass_neon_top
@@ -978,9 +1147,27 @@ function put_h264_qpel8_hv_lowpass_l2_neon
vrhadd.u8 q1, q1, q7
vld1.64 {d6, d7}, [r2,:128]!
vrhadd.u8 q2, q2, q4
-
- vst1.64 {d0}, [r0,:64], r3
vrhadd.u8 q3, q3, q5
+.ifc \type,avg
+ vld1.8 {d16}, [r0,:64], r3
+ vrhadd.u8 d0, d0, d16
+ vld1.8 {d17}, [r0,:64], r3
+ vrhadd.u8 d1, d1, d17
+ vld1.8 {d18}, [r0,:64], r3
+ vrhadd.u8 d2, d2, d18
+ vld1.8 {d19}, [r0,:64], r3
+ vrhadd.u8 d3, d3, d19
+ vld1.8 {d20}, [r0,:64], r3
+ vrhadd.u8 d4, d4, d20
+ vld1.8 {d21}, [r0,:64], r3
+ vrhadd.u8 d5, d5, d21
+ vld1.8 {d22}, [r0,:64], r3
+ vrhadd.u8 d6, d6, d22
+ vld1.8 {d23}, [r0,:64], r3
+ vrhadd.u8 d7, d7, d23
+ sub r0, r0, r3, lsl #3
+.endif
+ vst1.64 {d0}, [r0,:64], r3
vst1.64 {d1}, [r0,:64], r3
vst1.64 {d2}, [r0,:64], r3
vst1.64 {d3}, [r0,:64], r3
@@ -992,81 +1179,93 @@ function put_h264_qpel8_hv_lowpass_l2_neon
mov lr, r10
bx lr
.endfunc
+ .endm
+
+ h264_qpel8_hv_lowpass_l2 put
+ h264_qpel8_hv_lowpass_l2 avg
-function put_h264_qpel16_hv_lowpass_neon
+ .macro h264_qpel16_hv type
+function \type\()_h264_qpel16_hv_lowpass_neon
mov r9, lr
- bl put_h264_qpel8_hv_lowpass_neon
+ bl \type\()_h264_qpel8_hv_lowpass_neon
sub r1, r1, r3, lsl #2
- bl put_h264_qpel8_hv_lowpass_neon
+ bl \type\()_h264_qpel8_hv_lowpass_neon
sub r1, r1, r3, lsl #4
sub r1, r1, r3, lsl #2
add r1, r1, #8
sub r0, r0, r2, lsl #4
add r0, r0, #8
- bl put_h264_qpel8_hv_lowpass_neon
+ bl \type\()_h264_qpel8_hv_lowpass_neon
sub r1, r1, r3, lsl #2
mov lr, r9
- b put_h264_qpel8_hv_lowpass_neon
+ b \type\()_h264_qpel8_hv_lowpass_neon
.endfunc
-function put_h264_qpel16_hv_lowpass_l2_neon
+function \type\()_h264_qpel16_hv_lowpass_l2_neon
mov r9, lr
sub r2, r4, #256
- bl put_h264_qpel8_hv_lowpass_l2_neon
+ bl \type\()_h264_qpel8_hv_lowpass_l2_neon
sub r1, r1, r3, lsl #2
- bl put_h264_qpel8_hv_lowpass_l2_neon
+ bl \type\()_h264_qpel8_hv_lowpass_l2_neon
sub r1, r1, r3, lsl #4
sub r1, r1, r3, lsl #2
add r1, r1, #8
sub r0, r0, r3, lsl #4
add r0, r0, #8
- bl put_h264_qpel8_hv_lowpass_l2_neon
+ bl \type\()_h264_qpel8_hv_lowpass_l2_neon
sub r1, r1, r3, lsl #2
mov lr, r9
- b put_h264_qpel8_hv_lowpass_l2_neon
+ b \type\()_h264_qpel8_hv_lowpass_l2_neon
.endfunc
+ .endm
-function ff_put_h264_qpel8_mc10_neon, export=1
+ h264_qpel16_hv put
+ h264_qpel16_hv avg
+
+ .macro h264_qpel8 type
+function ff_\type\()_h264_qpel8_mc10_neon, export=1
lowpass_const r3
mov r3, r1
sub r1, r1, #2
mov ip, #8
- b put_h264_qpel8_h_lowpass_l2_neon
+ b \type\()_h264_qpel8_h_lowpass_l2_neon
.endfunc
-function ff_put_h264_qpel8_mc20_neon, export=1
+function ff_\type\()_h264_qpel8_mc20_neon, export=1
lowpass_const r3
sub r1, r1, #2
mov r3, r2
mov ip, #8
- b put_h264_qpel8_h_lowpass_neon
+ b \type\()_h264_qpel8_h_lowpass_neon
.endfunc
-function ff_put_h264_qpel8_mc30_neon, export=1
+function ff_\type\()_h264_qpel8_mc30_neon, export=1
lowpass_const r3
add r3, r1, #1
sub r1, r1, #2
mov ip, #8
- b put_h264_qpel8_h_lowpass_l2_neon
+ b \type\()_h264_qpel8_h_lowpass_l2_neon
.endfunc
-function ff_put_h264_qpel8_mc01_neon, export=1
+function ff_\type\()_h264_qpel8_mc01_neon, export=1
push {lr}
mov ip, r1
-put_h264_qpel8_mc01:
+\type\()_h264_qpel8_mc01:
lowpass_const r3
mov r3, r2
sub r1, r1, r2, lsl #1
vpush {d8-d15}
- bl put_h264_qpel8_v_lowpass_l2_neon
+ bl \type\()_h264_qpel8_v_lowpass_l2_neon
vpop {d8-d15}
pop {pc}
.endfunc
-function ff_put_h264_qpel8_mc11_neon, export=1
- push {r0, r1, r2, lr}
-put_h264_qpel8_mc11:
+function ff_\type\()_h264_qpel8_mc11_neon, export=1
+ push {r0, r1, r11, lr}
+\type\()_h264_qpel8_mc11:
lowpass_const r3
+ mov r11, sp
+ bic sp, sp, #15
sub sp, sp, #64
mov r0, sp
sub r1, r1, #2
@@ -1074,20 +1273,20 @@ put_h264_qpel8_mc11:
mov ip, #8
vpush {d8-d15}
bl put_h264_qpel8_h_lowpass_neon
- ldrd r0, [sp, #128]
+ ldrd r0, [r11]
mov r3, r2
add ip, sp, #64
sub r1, r1, r2, lsl #1
mov r2, #8
- bl put_h264_qpel8_v_lowpass_l2_neon
+ bl \type\()_h264_qpel8_v_lowpass_l2_neon
vpop {d8-d15}
- add sp, sp, #76
- pop {pc}
+ add sp, r11, #8
+ pop {r11, pc}
.endfunc
-function ff_put_h264_qpel8_mc21_neon, export=1
+function ff_\type\()_h264_qpel8_mc21_neon, export=1
push {r0, r1, r4, r10, r11, lr}
-put_h264_qpel8_mc21:
+\type\()_h264_qpel8_mc21:
lowpass_const r3
mov r11, sp
bic sp, sp, #15
@@ -1104,33 +1303,33 @@ put_h264_qpel8_mc21:
sub r1, r1, #2
mov r3, r2
sub r2, r4, #64
- bl put_h264_qpel8_hv_lowpass_l2_neon
+ bl \type\()_h264_qpel8_hv_lowpass_l2_neon
vpop {d8-d15}
add sp, r11, #8
pop {r4, r10, r11, pc}
.endfunc
-function ff_put_h264_qpel8_mc31_neon, export=1
+function ff_\type\()_h264_qpel8_mc31_neon, export=1
add r1, r1, #1
- push {r0, r1, r2, lr}
+ push {r0, r1, r11, lr}
sub r1, r1, #1
- b put_h264_qpel8_mc11
+ b \type\()_h264_qpel8_mc11
.endfunc
-function ff_put_h264_qpel8_mc02_neon, export=1
+function ff_\type\()_h264_qpel8_mc02_neon, export=1
push {lr}
lowpass_const r3
sub r1, r1, r2, lsl #1
mov r3, r2
vpush {d8-d15}
- bl put_h264_qpel8_v_lowpass_neon
+ bl \type\()_h264_qpel8_v_lowpass_neon
vpop {d8-d15}
pop {pc}
.endfunc
-function ff_put_h264_qpel8_mc12_neon, export=1
+function ff_\type\()_h264_qpel8_mc12_neon, export=1
push {r0, r1, r4, r10, r11, lr}
-put_h264_qpel8_mc12:
+\type\()_h264_qpel8_mc12:
lowpass_const r3
mov r11, sp
bic sp, sp, #15
@@ -1146,13 +1345,13 @@ put_h264_qpel8_mc12:
sub r1, r1, r3, lsl #1
sub r1, r1, #2
sub r2, r4, #64
- bl put_h264_qpel8_hv_lowpass_l2_neon
+ bl \type\()_h264_qpel8_hv_lowpass_l2_neon
vpop {d8-d15}
add sp, r11, #8
pop {r4, r10, r11, pc}
.endfunc
-function ff_put_h264_qpel8_mc22_neon, export=1
+function ff_\type\()_h264_qpel8_mc22_neon, export=1
push {r4, r10, r11, lr}
mov r11, sp
bic sp, sp, #15
@@ -1162,103 +1361,109 @@ function ff_put_h264_qpel8_mc22_neon, export=1
sub sp, sp, #(16*12)
mov r4, sp
vpush {d8-d15}
- bl put_h264_qpel8_hv_lowpass_neon
+ bl \type\()_h264_qpel8_hv_lowpass_neon
vpop {d8-d15}
mov sp, r11
pop {r4, r10, r11, pc}
.endfunc
-function ff_put_h264_qpel8_mc32_neon, export=1
+function ff_\type\()_h264_qpel8_mc32_neon, export=1
push {r0, r1, r4, r10, r11, lr}
add r1, r1, #1
- b put_h264_qpel8_mc12
+ b \type\()_h264_qpel8_mc12
.endfunc
-function ff_put_h264_qpel8_mc03_neon, export=1
+function ff_\type\()_h264_qpel8_mc03_neon, export=1
push {lr}
add ip, r1, r2
- b put_h264_qpel8_mc01
+ b \type\()_h264_qpel8_mc01
.endfunc
-function ff_put_h264_qpel8_mc13_neon, export=1
- push {r0, r1, r2, lr}
+function ff_\type\()_h264_qpel8_mc13_neon, export=1
+ push {r0, r1, r11, lr}
add r1, r1, r2
- b put_h264_qpel8_mc11
+ b \type\()_h264_qpel8_mc11
.endfunc
-function ff_put_h264_qpel8_mc23_neon, export=1
+function ff_\type\()_h264_qpel8_mc23_neon, export=1
push {r0, r1, r4, r10, r11, lr}
add r1, r1, r2
- b put_h264_qpel8_mc21
+ b \type\()_h264_qpel8_mc21
.endfunc
-function ff_put_h264_qpel8_mc33_neon, export=1
+function ff_\type\()_h264_qpel8_mc33_neon, export=1
add r1, r1, #1
- push {r0, r1, r2, lr}
+ push {r0, r1, r11, lr}
add r1, r1, r2
sub r1, r1, #1
- b put_h264_qpel8_mc11
+ b \type\()_h264_qpel8_mc11
.endfunc
+ .endm
+
+ h264_qpel8 put
+ h264_qpel8 avg
-function ff_put_h264_qpel16_mc10_neon, export=1
+ .macro h264_qpel16 type
+function ff_\type\()_h264_qpel16_mc10_neon, export=1
lowpass_const r3
mov r3, r1
sub r1, r1, #2
- b put_h264_qpel16_h_lowpass_l2_neon
+ b \type\()_h264_qpel16_h_lowpass_l2_neon
.endfunc
-function ff_put_h264_qpel16_mc20_neon, export=1
+function ff_\type\()_h264_qpel16_mc20_neon, export=1
lowpass_const r3
sub r1, r1, #2
mov r3, r2
- b put_h264_qpel16_h_lowpass_neon
+ b \type\()_h264_qpel16_h_lowpass_neon
.endfunc
-function ff_put_h264_qpel16_mc30_neon, export=1
+function ff_\type\()_h264_qpel16_mc30_neon, export=1
lowpass_const r3
add r3, r1, #1
sub r1, r1, #2
- b put_h264_qpel16_h_lowpass_l2_neon
+ b \type\()_h264_qpel16_h_lowpass_l2_neon
.endfunc
-function ff_put_h264_qpel16_mc01_neon, export=1
+function ff_\type\()_h264_qpel16_mc01_neon, export=1
push {r4, lr}
mov ip, r1
-put_h264_qpel16_mc01:
+\type\()_h264_qpel16_mc01:
lowpass_const r3
mov r3, r2
sub r1, r1, r2, lsl #1
vpush {d8-d15}
- bl put_h264_qpel16_v_lowpass_l2_neon
+ bl \type\()_h264_qpel16_v_lowpass_l2_neon
vpop {d8-d15}
pop {r4, pc}
.endfunc
-function ff_put_h264_qpel16_mc11_neon, export=1
- push {r0, r1, r4, lr}
-put_h264_qpel16_mc11:
+function ff_\type\()_h264_qpel16_mc11_neon, export=1
+ push {r0, r1, r4, r11, lr}
+\type\()_h264_qpel16_mc11:
lowpass_const r3
+ mov r11, sp
+ bic sp, sp, #15
sub sp, sp, #256
mov r0, sp
sub r1, r1, #2
mov r3, #16
vpush {d8-d15}
bl put_h264_qpel16_h_lowpass_neon
- add r0, sp, #256
- ldrd r0, [r0, #64]
+ ldrd r0, [r11]
mov r3, r2
add ip, sp, #64
sub r1, r1, r2, lsl #1
mov r2, #16
- bl put_h264_qpel16_v_lowpass_l2_neon
+ bl \type\()_h264_qpel16_v_lowpass_l2_neon
vpop {d8-d15}
- add sp, sp, #(256+8)
- pop {r4, pc}
+ add sp, r11, #8
+ pop {r4, r11, pc}
.endfunc
-function ff_put_h264_qpel16_mc21_neon, export=1
+function ff_\type\()_h264_qpel16_mc21_neon, export=1
push {r0, r1, r4-r5, r9-r11, lr}
-put_h264_qpel16_mc21:
+\type\()_h264_qpel16_mc21:
lowpass_const r3
mov r11, sp
bic sp, sp, #15
@@ -1272,33 +1477,33 @@ put_h264_qpel16_mc21:
sub r1, r1, r2, lsl #1
sub r1, r1, #2
mov r3, r2
- bl put_h264_qpel16_hv_lowpass_l2_neon
+ bl \type\()_h264_qpel16_hv_lowpass_l2_neon
vpop {d8-d15}
add sp, r11, #8
pop {r4-r5, r9-r11, pc}
.endfunc
-function ff_put_h264_qpel16_mc31_neon, export=1
+function ff_\type\()_h264_qpel16_mc31_neon, export=1
add r1, r1, #1
- push {r0, r1, r4, lr}
+ push {r0, r1, r4, r11, lr}
sub r1, r1, #1
- b put_h264_qpel16_mc11
+ b \type\()_h264_qpel16_mc11
.endfunc
-function ff_put_h264_qpel16_mc02_neon, export=1
+function ff_\type\()_h264_qpel16_mc02_neon, export=1
push {r4, lr}
lowpass_const r3
sub r1, r1, r2, lsl #1
mov r3, r2
vpush {d8-d15}
- bl put_h264_qpel16_v_lowpass_neon
+ bl \type\()_h264_qpel16_v_lowpass_neon
vpop {d8-d15}
pop {r4, pc}
.endfunc
-function ff_put_h264_qpel16_mc12_neon, export=1
+function ff_\type\()_h264_qpel16_mc12_neon, export=1
push {r0, r1, r4-r5, r9-r11, lr}
-put_h264_qpel16_mc12:
+\type\()_h264_qpel16_mc12:
lowpass_const r3
mov r11, sp
bic sp, sp, #15
@@ -1313,13 +1518,13 @@ put_h264_qpel16_mc12:
sub r1, r1, r3, lsl #1
sub r1, r1, #2
mov r2, r3
- bl put_h264_qpel16_hv_lowpass_l2_neon
+ bl \type\()_h264_qpel16_hv_lowpass_l2_neon
vpop {d8-d15}
add sp, r11, #8
pop {r4-r5, r9-r11, pc}
.endfunc
-function ff_put_h264_qpel16_mc22_neon, export=1
+function ff_\type\()_h264_qpel16_mc22_neon, export=1
push {r4, r9-r11, lr}
lowpass_const r3
mov r11, sp
@@ -1330,43 +1535,47 @@ function ff_put_h264_qpel16_mc22_neon, export=1
sub sp, sp, #(16*12)
mov r4, sp
vpush {d8-d15}
- bl put_h264_qpel16_hv_lowpass_neon
+ bl \type\()_h264_qpel16_hv_lowpass_neon
vpop {d8-d15}
mov sp, r11
pop {r4, r9-r11, pc}
.endfunc
-function ff_put_h264_qpel16_mc32_neon, export=1
+function ff_\type\()_h264_qpel16_mc32_neon, export=1
push {r0, r1, r4-r5, r9-r11, lr}
add r1, r1, #1
- b put_h264_qpel16_mc12
+ b \type\()_h264_qpel16_mc12
.endfunc
-function ff_put_h264_qpel16_mc03_neon, export=1
+function ff_\type\()_h264_qpel16_mc03_neon, export=1
push {r4, lr}
add ip, r1, r2
- b put_h264_qpel16_mc01
+ b \type\()_h264_qpel16_mc01
.endfunc
-function ff_put_h264_qpel16_mc13_neon, export=1
- push {r0, r1, r4, lr}
+function ff_\type\()_h264_qpel16_mc13_neon, export=1
+ push {r0, r1, r4, r11, lr}
add r1, r1, r2
- b put_h264_qpel16_mc11
+ b \type\()_h264_qpel16_mc11
.endfunc
-function ff_put_h264_qpel16_mc23_neon, export=1
+function ff_\type\()_h264_qpel16_mc23_neon, export=1
push {r0, r1, r4-r5, r9-r11, lr}
add r1, r1, r2
- b put_h264_qpel16_mc21
+ b \type\()_h264_qpel16_mc21
.endfunc
-function ff_put_h264_qpel16_mc33_neon, export=1
+function ff_\type\()_h264_qpel16_mc33_neon, export=1
add r1, r1, #1
- push {r0, r1, r4, lr}
+ push {r0, r1, r4, r11, lr}
add r1, r1, r2
sub r1, r1, #1
- b put_h264_qpel16_mc11
+ b \type\()_h264_qpel16_mc11
.endfunc
+ .endm
+
+ h264_qpel16 put
+ h264_qpel16 avg
@ Biweighted prediction
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264idct_neon.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264idct_neon.S
index d30e703403..f38ec2edfa 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264idct_neon.S
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264idct_neon.S
@@ -24,11 +24,7 @@
.text
function ff_h264_idct_add_neon, export=1
- mov r3, #(1<<5)
- vmov.i16 d16, #0
- vmov.16 d16[0], r3
vld1.64 {d0-d3}, [r1,:128]
- vadd.i16 d0, d0, d16
vswp d1, d2
vadd.i16 d4, d0, d1
@@ -58,8 +54,8 @@ function ff_h264_idct_add_neon, export=1
vadd.i16 q0, q2, q3
vsub.i16 q1, q2, q3
- vshr.s16 q0, q0, #6
- vshr.s16 q1, q1, #6
+ vrshr.s16 q0, q0, #6
+ vrshr.s16 q1, q1, #6
vaddw.u8 q0, q0, d18
vaddw.u8 q1, q1, d19
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264pred_init_arm.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264pred_init_arm.c
new file mode 100644
index 0000000000..a7d9960129
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264pred_init_arm.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2009 Mans Rullgard <mans@mansr.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+#include "libavcodec/h264pred.h"
+
+void ff_pred16x16_vert_neon(uint8_t *src, int stride);
+void ff_pred16x16_hor_neon(uint8_t *src, int stride);
+void ff_pred16x16_plane_neon(uint8_t *src, int stride);
+void ff_pred16x16_dc_neon(uint8_t *src, int stride);
+void ff_pred16x16_128_dc_neon(uint8_t *src, int stride);
+void ff_pred16x16_left_dc_neon(uint8_t *src, int stride);
+void ff_pred16x16_top_dc_neon(uint8_t *src, int stride);
+
+void ff_pred8x8_vert_neon(uint8_t *src, int stride);
+void ff_pred8x8_hor_neon(uint8_t *src, int stride);
+void ff_pred8x8_plane_neon(uint8_t *src, int stride);
+void ff_pred8x8_dc_neon(uint8_t *src, int stride);
+void ff_pred8x8_128_dc_neon(uint8_t *src, int stride);
+void ff_pred8x8_left_dc_neon(uint8_t *src, int stride);
+void ff_pred8x8_top_dc_neon(uint8_t *src, int stride);
+void ff_pred8x8_l0t_dc_neon(uint8_t *src, int stride);
+void ff_pred8x8_0lt_dc_neon(uint8_t *src, int stride);
+void ff_pred8x8_l00_dc_neon(uint8_t *src, int stride);
+void ff_pred8x8_0l0_dc_neon(uint8_t *src, int stride);
+
+#if HAVE_NEON
+static void ff_h264_pred_init_neon(H264PredContext *h, int codec_id)
+{
+ h->pred8x8[VERT_PRED8x8 ] = ff_pred8x8_vert_neon;
+ h->pred8x8[HOR_PRED8x8 ] = ff_pred8x8_hor_neon;
+ h->pred8x8[PLANE_PRED8x8 ] = ff_pred8x8_plane_neon;
+ h->pred8x8[DC_128_PRED8x8 ] = ff_pred8x8_128_dc_neon;
+ if (codec_id != CODEC_ID_RV40) {
+ h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_neon;
+ h->pred8x8[LEFT_DC_PRED8x8] = ff_pred8x8_left_dc_neon;
+ h->pred8x8[TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_neon;
+ h->pred8x8[ALZHEIMER_DC_L0T_PRED8x8] = ff_pred8x8_l0t_dc_neon;
+ h->pred8x8[ALZHEIMER_DC_0LT_PRED8x8] = ff_pred8x8_0lt_dc_neon;
+ h->pred8x8[ALZHEIMER_DC_L00_PRED8x8] = ff_pred8x8_l00_dc_neon;
+ h->pred8x8[ALZHEIMER_DC_0L0_PRED8x8] = ff_pred8x8_0l0_dc_neon;
+ }
+
+ h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_neon;
+ h->pred16x16[VERT_PRED8x8 ] = ff_pred16x16_vert_neon;
+ h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_hor_neon;
+ h->pred16x16[LEFT_DC_PRED8x8] = ff_pred16x16_left_dc_neon;
+ h->pred16x16[TOP_DC_PRED8x8 ] = ff_pred16x16_top_dc_neon;
+ h->pred16x16[DC_128_PRED8x8 ] = ff_pred16x16_128_dc_neon;
+ if (codec_id != CODEC_ID_SVQ3 && codec_id != CODEC_ID_RV40)
+ h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_neon;
+}
+#endif
+
+void ff_h264_pred_init_arm(H264PredContext *h, int codec_id)
+{
+ if (HAVE_NEON) ff_h264_pred_init_neon(h, codec_id);
+}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264pred_neon.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264pred_neon.S
new file mode 100644
index 0000000000..a6062f9b8b
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264pred_neon.S
@@ -0,0 +1,362 @@
+/*
+ * Copyright (c) 2009 Mans Rullgard <mans@mansr.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "asm.S"
+
+ .macro ldcol.8 rd, rs, rt, n=8, hi=0
+.if \n == 8 || \hi == 0
+ vld1.8 {\rd[0]}, [\rs], \rt
+ vld1.8 {\rd[1]}, [\rs], \rt
+ vld1.8 {\rd[2]}, [\rs], \rt
+ vld1.8 {\rd[3]}, [\rs], \rt
+.endif
+.if \n == 8 || \hi == 1
+ vld1.8 {\rd[4]}, [\rs], \rt
+ vld1.8 {\rd[5]}, [\rs], \rt
+ vld1.8 {\rd[6]}, [\rs], \rt
+ vld1.8 {\rd[7]}, [\rs], \rt
+.endif
+ .endm
+
+ .macro add16x8 dq, dl, dh, rl, rh
+ vaddl.u8 \dq, \rl, \rh
+ vadd.u16 \dl, \dl, \dh
+ vpadd.u16 \dl, \dl, \dl
+ vpadd.u16 \dl, \dl, \dl
+ .endm
+
+function ff_pred16x16_128_dc_neon, export=1
+ vmov.i8 q0, #128
+ b .L_pred16x16_dc_end
+ .endfunc
+
+function ff_pred16x16_top_dc_neon, export=1
+ sub r2, r0, r1
+ vld1.8 {q0}, [r2,:128]
+ add16x8 q0, d0, d1, d0, d1
+ vrshrn.u16 d0, q0, #4
+ vdup.8 q0, d0[0]
+ b .L_pred16x16_dc_end
+ .endfunc
+
+function ff_pred16x16_left_dc_neon, export=1
+ sub r2, r0, #1
+ ldcol.8 d0, r2, r1
+ ldcol.8 d1, r2, r1
+ add16x8 q0, d0, d1, d0, d1
+ vrshrn.u16 d0, q0, #4
+ vdup.8 q0, d0[0]
+ b .L_pred16x16_dc_end
+ .endfunc
+
+function ff_pred16x16_dc_neon, export=1
+ sub r2, r0, r1
+ vld1.8 {q0}, [r2,:128]
+ sub r2, r0, #1
+ ldcol.8 d2, r2, r1
+ ldcol.8 d3, r2, r1
+ vaddl.u8 q0, d0, d1
+ vaddl.u8 q1, d2, d3
+ vadd.u16 q0, q0, q1
+ vadd.u16 d0, d0, d1
+ vpadd.u16 d0, d0, d0
+ vpadd.u16 d0, d0, d0
+ vrshrn.u16 d0, q0, #5
+ vdup.8 q0, d0[0]
+.L_pred16x16_dc_end:
+ mov r3, #8
+6: vst1.8 {q0}, [r0,:128], r1
+ vst1.8 {q0}, [r0,:128], r1
+ subs r3, r3, #1
+ bne 6b
+ bx lr
+ .endfunc
+
+function ff_pred16x16_hor_neon, export=1
+ sub r2, r0, #1
+ mov r3, #16
+1: vld1.8 {d0[],d1[]},[r2], r1
+ vst1.8 {q0}, [r0,:128], r1
+ subs r3, r3, #1
+ bne 1b
+ bx lr
+ .endfunc
+
+function ff_pred16x16_vert_neon, export=1
+ sub r0, r0, r1
+ vld1.8 {q0}, [r0,:128], r1
+ mov r3, #8
+1: vst1.8 {q0}, [r0,:128], r1
+ vst1.8 {q0}, [r0,:128], r1
+ subs r3, r3, #1
+ bne 1b
+ bx lr
+ .endfunc
+
+function ff_pred16x16_plane_neon, export=1
+ sub r3, r0, r1
+ add r2, r3, #8
+ sub r3, r3, #1
+ vld1.8 {d0}, [r3]
+ vld1.8 {d2}, [r2,:64], r1
+ ldcol.8 d1, r3, r1
+ add r3, r3, r1
+ ldcol.8 d3, r3, r1
+ vrev64.8 q0, q0
+ vaddl.u8 q8, d2, d3
+ vsubl.u8 q2, d2, d0
+ vsubl.u8 q3, d3, d1
+ movrel r3, p16weight
+ vld1.8 {q0}, [r3,:128]
+ vmul.s16 q2, q2, q0
+ vmul.s16 q3, q3, q0
+ vadd.i16 d4, d4, d5
+ vadd.i16 d5, d6, d7
+ vpadd.i16 d4, d4, d5
+ vpadd.i16 d4, d4, d4
+ vshl.i16 d5, d4, #2
+ vaddl.s16 q2, d4, d5
+ vrshrn.s32 d4, q2, #6
+ mov r3, #0
+ vtrn.16 d4, d5
+ vadd.i16 d2, d4, d5
+ vshl.i16 d3, d2, #3
+ vrev64.16 d16, d17
+ vsub.i16 d3, d3, d2
+ vadd.i16 d16, d16, d0
+ vshl.i16 d2, d16, #4
+ vsub.i16 d2, d2, d3
+ vshl.i16 d3, d4, #4
+ vext.16 q0, q0, q0, #7
+ vsub.i16 d6, d5, d3
+ vmov.16 d0[0], r3
+ vmul.i16 q0, q0, d4[0]
+ vdup.16 q1, d2[0]
+ vdup.16 q2, d4[0]
+ vdup.16 q3, d6[0]
+ vshl.i16 q2, q2, #3
+ vadd.i16 q1, q1, q0
+ vadd.i16 q3, q3, q2
+ mov r3, #16
+1:
+ vqshrun.s16 d0, q1, #5
+ vadd.i16 q1, q1, q2
+ vqshrun.s16 d1, q1, #5
+ vadd.i16 q1, q1, q3
+ vst1.8 {q0}, [r0,:128], r1
+ subs r3, r3, #1
+ bne 1b
+ bx lr
+ .endfunc
+
+ .section .rodata
+ .align 4
+p16weight:
+ .short 1,2,3,4,5,6,7,8
+
+ .text
+
+function ff_pred8x8_hor_neon, export=1
+ sub r2, r0, #1
+ mov r3, #8
+1: vld1.8 {d0[]}, [r2], r1
+ vst1.8 {d0}, [r0,:64], r1
+ subs r3, r3, #1
+ bne 1b
+ bx lr
+ .endfunc
+
+function ff_pred8x8_vert_neon, export=1
+ sub r0, r0, r1
+ vld1.8 {d0}, [r0,:64], r1
+ mov r3, #4
+1: vst1.8 {d0}, [r0,:64], r1
+ vst1.8 {d0}, [r0,:64], r1
+ subs r3, r3, #1
+ bne 1b
+ bx lr
+ .endfunc
+
+function ff_pred8x8_plane_neon, export=1
+ sub r3, r0, r1
+ add r2, r3, #4
+ sub r3, r3, #1
+ vld1.32 {d0[0]}, [r3]
+ vld1.32 {d2[0]}, [r2,:32], r1
+ ldcol.8 d0, r3, r1, 4, hi=1
+ add r3, r3, r1
+ ldcol.8 d3, r3, r1, 4
+ vaddl.u8 q8, d2, d3
+ vrev32.8 d0, d0
+ vtrn.32 d2, d3
+ vsubl.u8 q2, d2, d0
+ movrel r3, p16weight
+ vld1.16 {q0}, [r3,:128]
+ vmul.s16 d4, d4, d0
+ vmul.s16 d5, d5, d0
+ vpadd.i16 d4, d4, d5
+ vpaddl.s16 d4, d4
+ vshl.i32 d5, d4, #4
+ vadd.s32 d4, d4, d5
+ vrshrn.s32 d4, q2, #5
+ mov r3, #0
+ vtrn.16 d4, d5
+ vadd.i16 d2, d4, d5
+ vshl.i16 d3, d2, #2
+ vrev64.16 d16, d16
+ vsub.i16 d3, d3, d2
+ vadd.i16 d16, d16, d0
+ vshl.i16 d2, d16, #4
+ vsub.i16 d2, d2, d3
+ vshl.i16 d3, d4, #3
+ vext.16 q0, q0, q0, #7
+ vsub.i16 d6, d5, d3
+ vmov.16 d0[0], r3
+ vmul.i16 q0, q0, d4[0]
+ vdup.16 q1, d2[0]
+ vdup.16 q2, d4[0]
+ vdup.16 q3, d6[0]
+ vshl.i16 q2, q2, #3
+ vadd.i16 q1, q1, q0
+ vadd.i16 q3, q3, q2
+ mov r3, #8
+1:
+ vqshrun.s16 d0, q1, #5
+ vadd.i16 q1, q1, q3
+ vst1.8 {d0}, [r0,:64], r1
+ subs r3, r3, #1
+ bne 1b
+ bx lr
+ .endfunc
+
+function ff_pred8x8_128_dc_neon, export=1
+ vmov.i8 q0, #128
+ b .L_pred8x8_dc_end
+ .endfunc
+
+function ff_pred8x8_top_dc_neon, export=1
+ sub r2, r0, r1
+ vld1.8 {d0}, [r2,:64]
+ vpaddl.u8 d0, d0
+ vpadd.u16 d0, d0, d0
+ vrshrn.u16 d0, q0, #2
+ vdup.8 d1, d0[1]
+ vdup.8 d0, d0[0]
+ vtrn.32 d0, d1
+ b .L_pred8x8_dc_end
+ .endfunc
+
+function ff_pred8x8_left_dc_neon, export=1
+ sub r2, r0, #1
+ ldcol.8 d0, r2, r1
+ vpaddl.u8 d0, d0
+ vpadd.u16 d0, d0, d0
+ vrshrn.u16 d0, q0, #2
+ vdup.8 d1, d0[1]
+ vdup.8 d0, d0[0]
+ b .L_pred8x8_dc_end
+ .endfunc
+
+function ff_pred8x8_dc_neon, export=1
+ sub r2, r0, r1
+ vld1.8 {d0}, [r2,:64]
+ sub r2, r0, #1
+ ldcol.8 d1, r2, r1
+ vtrn.32 d0, d1
+ vpaddl.u8 q0, q0
+ vpadd.u16 d0, d0, d1
+ vpadd.u16 d1, d0, d0
+ vrshrn.u16 d2, q0, #3
+ vrshrn.u16 d3, q0, #2
+ vdup.8 d0, d2[4]
+ vdup.8 d1, d3[3]
+ vdup.8 d4, d3[2]
+ vdup.8 d5, d2[5]
+ vtrn.32 q0, q2
+.L_pred8x8_dc_end:
+ mov r3, #4
+ add r2, r0, r1, lsl #2
+6: vst1.8 {d0}, [r0,:64], r1
+ vst1.8 {d1}, [r2,:64], r1
+ subs r3, r3, #1
+ bne 6b
+ bx lr
+ .endfunc
+
+function ff_pred8x8_l0t_dc_neon, export=1
+ sub r2, r0, r1
+ vld1.8 {d0}, [r2,:64]
+ sub r2, r0, #1
+ ldcol.8 d1, r2, r1, 4
+ vtrn.32 d0, d1
+ vpaddl.u8 q0, q0
+ vpadd.u16 d0, d0, d1
+ vpadd.u16 d1, d0, d0
+ vrshrn.u16 d2, q0, #3
+ vrshrn.u16 d3, q0, #2
+ vdup.8 d0, d2[4]
+ vdup.8 d1, d3[0]
+ vdup.8 q2, d3[2]
+ vtrn.32 q0, q2
+ b .L_pred8x8_dc_end
+ .endfunc
+
+function ff_pred8x8_l00_dc_neon, export=1
+ sub r2, r0, #1
+ ldcol.8 d0, r2, r1, 4
+ vpaddl.u8 d0, d0
+ vpadd.u16 d0, d0, d0
+ vrshrn.u16 d0, q0, #2
+ vmov.i8 d1, #128
+ vdup.8 d0, d0[0]
+ b .L_pred8x8_dc_end
+ .endfunc
+
+function ff_pred8x8_0lt_dc_neon, export=1
+ sub r2, r0, r1
+ vld1.8 {d0}, [r2,:64]
+ add r2, r0, r1, lsl #2
+ sub r2, r2, #1
+ ldcol.8 d1, r2, r1, 4, hi=1
+ vtrn.32 d0, d1
+ vpaddl.u8 q0, q0
+ vpadd.u16 d0, d0, d1
+ vpadd.u16 d1, d0, d0
+ vrshrn.u16 d3, q0, #2
+ vrshrn.u16 d2, q0, #3
+ vdup.8 d0, d3[0]
+ vdup.8 d1, d3[3]
+ vdup.8 d4, d3[2]
+ vdup.8 d5, d2[5]
+ vtrn.32 q0, q2
+ b .L_pred8x8_dc_end
+ .endfunc
+
+function ff_pred8x8_0l0_dc_neon, export=1
+ add r2, r0, r1, lsl #2
+ sub r2, r2, #1
+ ldcol.8 d1, r2, r1, 4
+ vpaddl.u8 d2, d1
+ vpadd.u16 d2, d2, d2
+ vrshrn.u16 d1, q1, #2
+ vmov.i8 d0, #128
+ vdup.8 d1, d1[0]
+ b .L_pred8x8_dc_end
+ .endfunc
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/jrevdct_arm.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/jrevdct_arm.S
index 406070198b..4fcf35101d 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/jrevdct_arm.S
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/jrevdct_arm.S
@@ -1,6 +1,6 @@
/*
C-like prototype :
- void j_rev_dct_ARM(DCTBLOCK data)
+ void j_rev_dct_arm(DCTBLOCK data)
With DCTBLOCK being a pointer to an array of 64 'signed shorts'
@@ -57,7 +57,7 @@
.text
.align
-function ff_j_rev_dct_ARM, export=1
+function ff_j_rev_dct_arm, export=1
stmdb sp!, { r4 - r12, lr } @ all callee saved regs
sub sp, sp, #4 @ reserve some space on the stack
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/simple_idct_arm.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/simple_idct_arm.S
index a0927bf641..ecb83d23ad 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/simple_idct_arm.S
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/simple_idct_arm.S
@@ -56,8 +56,8 @@
.text
-function ff_simple_idct_ARM, export=1
- @@ void simple_idct_ARM(int16_t *block)
+function ff_simple_idct_arm, export=1
+ @@ void simple_idct_arm(int16_t *block)
@@ save stack for reg needed (take all of them),
@@ R0-R3 are scratch regs, so no need to save them, but R0 contains the pointer to block
@@ so it must not be overwritten, if it is not saved!!
@@ -458,7 +458,7 @@ __end_col_loop:
-__end_simple_idct_ARM:
+__end_simple_idct_arm:
@@ restore registers to previous status!
add sp, sp, #8 @@ the local variables!
ldmfd sp!, {r4-r11, r15} @@ update PC with LR content.
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/asv1.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/asv1.c
index 5f9d5232fd..2b85d0421d 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/asv1.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/asv1.c
@@ -25,7 +25,7 @@
*/
#include "avcodec.h"
-#include "get_bits.h"
+#include "libavutil/common.h"
#include "put_bits.h"
#include "dsputil.h"
#include "mpeg12data.h"
@@ -140,11 +140,11 @@ static av_cold void init_vlcs(ASV1Context *a){
//FIXME write a reversed bitstream reader to avoid the double reverse
static inline int asv2_get_bits(GetBitContext *gb, int n){
- return ff_reverse[ get_bits(gb, n) << (8-n) ];
+ return av_reverse[ get_bits(gb, n) << (8-n) ];
}
static inline void asv2_put_bits(PutBitContext *pb, int n, int v){
- put_bits(pb, n, ff_reverse[ v << (8-n) ]);
+ put_bits(pb, n, av_reverse[ v << (8-n) ]);
}
static inline int asv1_get_level(GetBitContext *gb){
@@ -394,7 +394,7 @@ static int decode_frame(AVCodecContext *avctx,
int buf_size = avpkt->size;
ASV1Context * const a = avctx->priv_data;
AVFrame *picture = data;
- AVFrame * const p= (AVFrame*)&a->picture;
+ AVFrame * const p= &a->picture;
int mb_x, mb_y;
if(p->data[0])
@@ -417,7 +417,7 @@ static int decode_frame(AVCodecContext *avctx,
else{
int i;
for(i=0; i<buf_size; i++)
- a->bitstream_buffer[i]= ff_reverse[ buf[i] ];
+ a->bitstream_buffer[i]= av_reverse[ buf[i] ];
}
init_get_bits(&a->gb, a->bitstream_buffer, buf_size*8);
@@ -474,7 +474,7 @@ for(i=0; i<s->avctx->extradata_size; i++){
static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
ASV1Context * const a = avctx->priv_data;
AVFrame *pict = data;
- AVFrame * const p= (AVFrame*)&a->picture;
+ AVFrame * const p= &a->picture;
int size;
int mb_x, mb_y;
@@ -519,7 +519,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
else{
int i;
for(i=0; i<4*size; i++)
- buf[i]= ff_reverse[ buf[i] ];
+ buf[i]= av_reverse[ buf[i] ];
}
return size*4;
@@ -536,13 +536,13 @@ static av_cold void common_init(AVCodecContext *avctx){
a->mb_width2 = (avctx->width + 0) / 16;
a->mb_height2 = (avctx->height + 0) / 16;
- avctx->coded_frame= (AVFrame*)&a->picture;
+ avctx->coded_frame= &a->picture;
a->avctx= avctx;
}
static av_cold int decode_init(AVCodecContext *avctx){
ASV1Context * const a = avctx->priv_data;
- AVFrame *p= (AVFrame*)&a->picture;
+ AVFrame *p= &a->picture;
int i;
const int scale= avctx->codec_id == CODEC_ID_ASV1 ? 1 : 2;
@@ -551,7 +551,7 @@ static av_cold int decode_init(AVCodecContext *avctx){
ff_init_scantable(a->dsp.idct_permutation, &a->scantable, scantab);
avctx->pix_fmt= PIX_FMT_YUV420P;
- a->inv_qscale= ((uint8_t*)avctx->extradata)[0];
+ a->inv_qscale= avctx->extradata[0];
if(a->inv_qscale == 0){
av_log(avctx, AV_LOG_ERROR, "illegal qscale 0\n");
if(avctx->codec_id == CODEC_ID_ASV1)
@@ -607,6 +607,9 @@ static av_cold int decode_end(AVCodecContext *avctx){
av_freep(&a->picture.qscale_table);
a->bitstream_buffer_size=0;
+ if(a->picture.data[0])
+ avctx->release_buffer(avctx, &a->picture);
+
return 0;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/avcodec.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/avcodec.h
index 7bfe6e2c4e..13d42544e3 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/avcodec.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/avcodec.h
@@ -30,7 +30,7 @@
#include "libavutil/avutil.h"
#define LIBAVCODEC_VERSION_MAJOR 52
-#define LIBAVCODEC_VERSION_MINOR 36
+#define LIBAVCODEC_VERSION_MINOR 43
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@@ -198,6 +198,10 @@ enum CodecID {
CODEC_ID_V210,
CODEC_ID_DPX,
CODEC_ID_MAD,
+ CODEC_ID_FRWU,
+ CODEC_ID_FLASHSV2,
+ CODEC_ID_CDGRAPHICS,
+ CODEC_ID_R210,
/* various PCM "codecs" */
CODEC_ID_PCM_S16LE= 0x10000,
@@ -331,6 +335,7 @@ enum CodecID {
CODEC_ID_SSA,
CODEC_ID_MOV_TEXT,
CODEC_ID_HDMV_PGS_SUBTITLE,
+ CODEC_ID_DVB_TELETEXT,
/* data codecs */
CODEC_ID_VBI_DATA= 0x17500,
@@ -391,6 +396,11 @@ enum SampleFormat {
#define CH_STEREO_LEFT 0x20000000 ///< Stereo downmix.
#define CH_STEREO_RIGHT 0x40000000 ///< See CH_STEREO_LEFT.
+/** Channel mask value used for AVCodecContext.request_channel_layout
+ to indicate that the user requests the channel order of the decoder output
+ to be the native codec channel order. */
+#define CH_LAYOUT_NATIVE 0x8000000000000000LL
+
/* Audio channel convenience macros */
#define CH_LAYOUT_MONO (CH_FRONT_CENTER)
#define CH_LAYOUT_STEREO (CH_FRONT_LEFT|CH_FRONT_RIGHT)
@@ -578,6 +588,7 @@ typedef struct RcOverride{
#define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
#define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer.
#define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible
+#define CODEC_FLAG2_MBTREE 0x00040000 ///< Use macroblock tree ratecontrol (x264 only)
/* Unsupported options :
* Syntax Arithmetic coding (SAC)
@@ -2532,6 +2543,36 @@ typedef struct AVCodecContext {
* - decoding: Set by libavcodec
*/
enum AVChromaLocation chroma_sample_location;
+
+ /**
+ * The codec may call this to execute several independent things.
+ * It will return only after finishing all tasks.
+ * The user may replace this with some multithreaded implementation,
+ * the default implementation will execute the parts serially.
+ * Also see avcodec_thread_init and e.g. the --enable-pthread configure option.
+ * @param c context passed also to func
+ * @param count the number of things to execute
+ * @param arg2 argument passed unchanged to func
+ * @param ret return values of executed functions, must have space for "count" values. May be NULL.
+ * @param func function that will be called count times, with jobnr from 0 to count-1.
+ * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no
+ * two instances of func executing at the same time will have the same threadnr.
+ * @return always 0 currently, but code should handle a future improvement where when any call to func
+ * returns < 0 no further calls to func may be done and < 0 is returned.
+ * - encoding: Set by libavcodec, user can override.
+ * - decoding: Set by libavcodec, user can override.
+ */
+ int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
+
+ /**
+ * explicit P-frame weighted prediction analysis method
+ * 0: off
+ * 1: fast blind weighting (one reference duplicate with -1 offset)
+ * 2: smart weighting (full fade detection analysis)
+ * - encoding: Set by user.
+ * - decoding: unused
+ */
+ int weighted_p_pred;
} AVCodecContext;
/**
@@ -3046,6 +3087,16 @@ AVCodec *av_codec_next(AVCodec *c);
unsigned avcodec_version(void);
/**
+ * Returns the libavcodec build-time configuration.
+ */
+const char * avcodec_configuration(void);
+
+/**
+ * Returns the libavcodec license.
+ */
+const char * avcodec_license(void);
+
+/**
* Initializes libavcodec.
*
* @warning This function must be called before any other libavcodec
@@ -3160,6 +3211,7 @@ int avcodec_thread_init(AVCodecContext *s, int thread_count);
void avcodec_thread_free(AVCodecContext *s);
int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
+int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
//FIXME func typedef
/**
@@ -3213,9 +3265,11 @@ attribute_deprecated int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *s
/**
* Decodes the audio frame of size avpkt->size from avpkt->data into samples.
* Some decoders may support multiple frames in a single AVPacket, such
- * decoders would then just decode the first frame.
+ * decoders would then just decode the first frame. In this case,
+ * avcodec_decode_audio3 has to be called again with an AVPacket that contains
+ * the remaining data in order to decode the second frame etc.
* If no frame
- * could be decompressed, frame_size_ptr is zero. Otherwise, it is the
+ * could be outputted, frame_size_ptr is zero. Otherwise, it is the
* decompressed frame size in bytes.
*
* @warning You must set frame_size_ptr to the allocated size of the
@@ -3245,7 +3299,7 @@ attribute_deprecated int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *s
* data and size, some decoders might in addition need other fields.
* All decoders are designed to use the least fields possible though.
* @return On error a negative value is returned, otherwise the number of bytes
- * used or zero if no frame could be decompressed.
+ * used or zero if no frame data was decompressed (used) from the input AVPacket.
*/
int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
int *frame_size_ptr,
@@ -3290,7 +3344,7 @@ attribute_deprecated int avcodec_decode_video(AVCodecContext *avctx, AVFrame *pi
* In practice, avpkt->data should have 4 byte alignment at minimum.
*
* @note Some codecs have a delay between input and output, these need to be
- * feeded with avpkt->data=NULL, avpkt->size=0 at the end to return the remaining frames.
+ * fed with avpkt->data=NULL, avpkt->size=0 at the end to return the remaining frames.
*
* @param avctx the codec context
* @param[out] picture The AVFrame in which the decoded video frame will be stored.
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/avpacket.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/avpacket.c
index 5bea639d66..c51260face 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/avpacket.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/avpacket.c
@@ -47,18 +47,20 @@ void av_init_packet(AVPacket *pkt)
int av_new_packet(AVPacket *pkt, int size)
{
- uint8_t *data;
- if((unsigned)size > (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
- return AVERROR(ENOMEM);
- data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
- if (!data)
- return AVERROR(ENOMEM);
- memset(data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ uint8_t *data= NULL;
+ if((unsigned)size < (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
+ data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (data){
+ memset(data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ }else
+ size=0;
av_init_packet(pkt);
pkt->data = data;
pkt->size = size;
pkt->destruct = av_destruct_packet;
+ if(!data)
+ return AVERROR(ENOMEM);
return 0;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/bitstream.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/bitstream.c
index d8d0f3c7be..9002830cec 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/bitstream.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/bitstream.c
@@ -47,14 +47,14 @@ void align_put_bits(PutBitContext *s)
#endif
}
-void ff_put_string(PutBitContext * pbc, const char *s, int terminate_string)
+void ff_put_string(PutBitContext *pb, const char *string, int terminate_string)
{
- while(*s){
- put_bits(pbc, 8, *s);
- s++;
+ while(*string){
+ put_bits(pb, 8, *string);
+ string++;
}
if(terminate_string)
- put_bits(pbc, 8, 0);
+ put_bits(pb, 8, 0);
}
void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length)
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cdgraphics.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cdgraphics.c
new file mode 100644
index 0000000000..fa835b9897
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cdgraphics.c
@@ -0,0 +1,380 @@
+/*
+ * CD Graphics Video Decoder
+ * Copyright (c) 2009 Michael Tison
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avcodec.h"
+#include "bytestream.h"
+
+/**
+ * @file libavcodec/cdgraphics.c
+ * @brief CD Graphics Video Decoder
+ * @author Michael Tison
+ * @sa http://wiki.multimedia.cx/index.php?title=CD_Graphics
+ * @sa http://www.ccs.neu.edu/home/bchafy/cdb/info/cdg
+ */
+
+/// default screen sizes
+#define CDG_FULL_WIDTH 300
+#define CDG_FULL_HEIGHT 216
+#define CDG_DISPLAY_WIDTH 294
+#define CDG_DISPLAY_HEIGHT 204
+#define CDG_BORDER_WIDTH 6
+#define CDG_BORDER_HEIGHT 12
+
+/// masks
+#define CDG_COMMAND 0x09
+#define CDG_MASK 0x3F
+
+/// instruction codes
+#define CDG_INST_MEMORY_PRESET 1
+#define CDG_INST_BORDER_PRESET 2
+#define CDG_INST_TILE_BLOCK 6
+#define CDG_INST_SCROLL_PRESET 20
+#define CDG_INST_SCROLL_COPY 24
+#define CDG_INST_LOAD_PAL_LO 30
+#define CDG_INST_LOAD_PAL_HIGH 31
+#define CDG_INST_TILE_BLOCK_XOR 38
+
+/// data sizes
+#define CDG_PACKET_SIZE 24
+#define CDG_DATA_SIZE 16
+#define CDG_TILE_HEIGHT 12
+#define CDG_TILE_WIDTH 6
+#define CDG_MINIMUM_PKT_SIZE 6
+#define CDG_MINIMUM_SCROLL_SIZE 3
+#define CDG_HEADER_SIZE 8
+#define CDG_PALETTE_SIZE 16
+
+typedef struct CDGraphicsContext {
+ AVFrame frame;
+ int hscroll;
+ int vscroll;
+} CDGraphicsContext;
+
+static void cdg_init_frame(AVFrame *frame)
+{
+ avcodec_get_frame_defaults(frame);
+ frame->reference = 1;
+ frame->buffer_hints = FF_BUFFER_HINTS_VALID |
+ FF_BUFFER_HINTS_PRESERVE |
+ FF_BUFFER_HINTS_REUSABLE;
+}
+
+static av_cold int cdg_decode_init(AVCodecContext *avctx)
+{
+ CDGraphicsContext *cc = avctx->priv_data;
+
+ cdg_init_frame(&cc->frame);
+
+ avctx->width = CDG_FULL_WIDTH;
+ avctx->height = CDG_FULL_HEIGHT;
+ avctx->pix_fmt = PIX_FMT_PAL8;
+
+ return 0;
+}
+
+static void cdg_border_preset(CDGraphicsContext *cc, uint8_t *data)
+{
+ int y;
+ int lsize = cc->frame.linesize[0];
+ uint8_t *buf = cc->frame.data[0];
+ int color = data[0] & 0x0F;
+
+ if (!(data[1] & 0x0F)) {
+ /// fill the top and bottom borders
+ memset(buf, color, CDG_BORDER_HEIGHT * lsize);
+ memset(buf + (CDG_FULL_HEIGHT - CDG_BORDER_HEIGHT) * lsize,
+ color, CDG_BORDER_HEIGHT * lsize);
+
+ /// fill the side borders
+ for (y = CDG_BORDER_HEIGHT; y < CDG_FULL_HEIGHT - CDG_BORDER_HEIGHT; y++) {
+ memset(buf + y * lsize, color, CDG_BORDER_WIDTH);
+ memset(buf + CDG_FULL_WIDTH - CDG_BORDER_WIDTH + y * lsize,
+ color, CDG_BORDER_WIDTH);
+ }
+ }
+}
+
+static void cdg_load_palette(CDGraphicsContext *cc, uint8_t *data, int low)
+{
+ uint8_t r, g, b;
+ uint16_t color;
+ int i;
+ int array_offset = low ? 0 : 8;
+ uint32_t *palette = (uint32_t *) cc->frame.data[1];
+
+ for (i = 0; i < 8; i++) {
+ color = (data[2 * i] << 6) + (data[2 * i + 1] & 0x3F);
+ r = ((color >> 8) & 0x000F) * 17;
+ g = ((color >> 4) & 0x000F) * 17;
+ b = ((color ) & 0x000F) * 17;
+ palette[i + array_offset] = r << 16 | g << 8 | b;
+ }
+ cc->frame.palette_has_changed = 1;
+}
+
+static int cdg_tile_block(CDGraphicsContext *cc, uint8_t *data, int b)
+{
+ unsigned ci, ri;
+ int color;
+ int x, y;
+ int ai;
+ int stride = cc->frame.linesize[0];
+ uint8_t *buf = cc->frame.data[0];
+
+ ri = (data[2] & 0x1F) * CDG_TILE_HEIGHT + cc->vscroll;
+ ci = (data[3] & 0x3F) * CDG_TILE_WIDTH + cc->hscroll;
+
+ if (ri > (CDG_FULL_HEIGHT - CDG_TILE_HEIGHT))
+ return AVERROR(EINVAL);
+ if (ci > (CDG_FULL_WIDTH - CDG_TILE_WIDTH))
+ return AVERROR(EINVAL);
+
+ for (y = 0; y < CDG_TILE_HEIGHT; y++) {
+ for (x = 0; x < CDG_TILE_WIDTH; x++) {
+ if (!((data[4 + y] >> (5 - x)) & 0x01))
+ color = data[0] & 0x0F;
+ else
+ color = data[1] & 0x0F;
+
+ ai = ci + x + (stride * (ri + y));
+ if (b)
+ color ^= buf[ai];
+ buf[ai] = color;
+ }
+ }
+
+ return 0;
+}
+
+#define UP 2
+#define DOWN 1
+#define LEFT 2
+#define RIGHT 1
+
+static void cdg_copy_rect_buf(int out_tl_x, int out_tl_y, uint8_t *out,
+ int in_tl_x, int in_tl_y, uint8_t *in,
+ int w, int h, int stride)
+{
+ int y;
+
+ in += in_tl_x + in_tl_y * stride;
+ out += out_tl_x + out_tl_y * stride;
+ for (y = 0; y < h; y++)
+ memcpy(out + y * stride, in + y * stride, w);
+}
+
+static void cdg_fill_rect_preset(int tl_x, int tl_y, uint8_t *out,
+ int color, int w, int h, int stride)
+{
+ int y;
+
+ for (y = tl_y; y < tl_y + h; y++)
+ memset(out + tl_x + y * stride, color, w);
+}
+
+static void cdg_fill_wrapper(int out_tl_x, int out_tl_y, uint8_t *out,
+ int in_tl_x, int in_tl_y, uint8_t *in,
+ int color, int w, int h, int stride, int roll)
+{
+ if (roll) {
+ cdg_copy_rect_buf(out_tl_x, out_tl_y, out, in_tl_x, in_tl_y,
+ in, w, h, stride);
+ } else {
+ cdg_fill_rect_preset(out_tl_x, out_tl_y, out, color, w, h, stride);
+ }
+}
+
+static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data,
+ AVFrame *new_frame, int roll_over)
+{
+ int color;
+ int hscmd, h_off, hinc, vscmd, v_off, vinc;
+ int y;
+ int stride = cc->frame.linesize[0];
+ uint8_t *in = cc->frame.data[0];
+ uint8_t *out = new_frame->data[0];
+
+ color = data[0] & 0x0F;
+ hscmd = (data[1] & 0x30) >> 4;
+ vscmd = (data[2] & 0x30) >> 4;
+
+ h_off = FFMIN(data[1] & 0x07, CDG_BORDER_WIDTH - 1);
+ v_off = FFMIN(data[2] & 0x07, CDG_BORDER_HEIGHT - 1);
+
+ /// find the difference and save the offset for cdg_tile_block usage
+ hinc = h_off - cc->hscroll;
+ vinc = v_off - cc->vscroll;
+ cc->hscroll = h_off;
+ cc->vscroll = v_off;
+
+ if (vscmd == UP)
+ vinc -= 12;
+ if (vscmd == DOWN)
+ vinc += 12;
+ if (hscmd == LEFT)
+ hinc -= 6;
+ if (hscmd == RIGHT)
+ hinc += 6;
+
+ if (!hinc && !vinc)
+ return;
+
+ memcpy(new_frame->data[1], cc->frame.data[1], CDG_PALETTE_SIZE * 4);
+
+ for (y = FFMAX(0, vinc); y < FFMIN(CDG_FULL_HEIGHT + vinc, CDG_FULL_HEIGHT); y++)
+ memcpy(out + FFMAX(0, hinc) + stride * y,
+ in + FFMAX(0, hinc) - hinc + (y - vinc) * stride,
+ FFMIN(stride + hinc, stride));
+
+ if (vinc > 0)
+ cdg_fill_wrapper(0, 0, out,
+ 0, CDG_FULL_HEIGHT - vinc, in, color,
+ stride, vinc, stride, roll_over);
+ else if (vinc < 0)
+ cdg_fill_wrapper(0, CDG_FULL_HEIGHT + vinc, out,
+ 0, 0, in, color,
+ stride, -1 * vinc, stride, roll_over);
+
+ if (hinc > 0)
+ cdg_fill_wrapper(0, 0, out,
+ CDG_FULL_WIDTH - hinc, 0, in, color,
+ hinc, CDG_FULL_HEIGHT, stride, roll_over);
+ else if (hinc < 0)
+ cdg_fill_wrapper(CDG_FULL_WIDTH + hinc, 0, out,
+ 0, 0, in, color,
+ -1 * hinc, CDG_FULL_HEIGHT, stride, roll_over);
+
+}
+
+static int cdg_decode_frame(AVCodecContext *avctx,
+ void *data, int *data_size, AVPacket *avpkt)
+{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
+ int ret;
+ uint8_t command, inst;
+ uint8_t cdg_data[CDG_DATA_SIZE];
+ AVFrame new_frame;
+ CDGraphicsContext *cc = avctx->priv_data;
+
+ if (buf_size < CDG_MINIMUM_PKT_SIZE) {
+ av_log(avctx, AV_LOG_ERROR, "buffer too small for decoder\n");
+ return AVERROR(EINVAL);
+ }
+
+ ret = avctx->reget_buffer(avctx, &cc->frame);
+ if (ret) {
+ av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+ return ret;
+ }
+
+ command = bytestream_get_byte(&buf);
+ inst = bytestream_get_byte(&buf);
+ inst &= CDG_MASK;
+ buf += 2; /// skipping 2 unneeded bytes
+ bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE);
+
+ if ((command & CDG_MASK) == CDG_COMMAND) {
+ switch (inst) {
+ case CDG_INST_MEMORY_PRESET:
+ if (!(cdg_data[1] & 0x0F))
+ memset(cc->frame.data[0], cdg_data[0] & 0x0F,
+ cc->frame.linesize[0] * CDG_FULL_HEIGHT);
+ break;
+ case CDG_INST_LOAD_PAL_LO:
+ case CDG_INST_LOAD_PAL_HIGH:
+ if (buf_size - CDG_HEADER_SIZE < CDG_DATA_SIZE) {
+ av_log(avctx, AV_LOG_ERROR, "buffer too small for loading palette\n");
+ return AVERROR(EINVAL);
+ }
+
+ cdg_load_palette(cc, cdg_data, inst == CDG_INST_LOAD_PAL_LO);
+ break;
+ case CDG_INST_BORDER_PRESET:
+ cdg_border_preset(cc, cdg_data);
+ break;
+ case CDG_INST_TILE_BLOCK_XOR:
+ case CDG_INST_TILE_BLOCK:
+ if (buf_size - CDG_HEADER_SIZE < CDG_DATA_SIZE) {
+ av_log(avctx, AV_LOG_ERROR, "buffer too small for drawing tile\n");
+ return AVERROR(EINVAL);
+ }
+
+ ret = cdg_tile_block(cc, cdg_data, inst == CDG_INST_TILE_BLOCK_XOR);
+ if (ret) {
+ av_log(avctx, AV_LOG_ERROR, "tile is out of range\n");
+ return ret;
+ }
+ break;
+ case CDG_INST_SCROLL_PRESET:
+ case CDG_INST_SCROLL_COPY:
+ if (buf_size - CDG_HEADER_SIZE < CDG_MINIMUM_SCROLL_SIZE) {
+ av_log(avctx, AV_LOG_ERROR, "buffer too small for scrolling\n");
+ return AVERROR(EINVAL);
+ }
+
+ cdg_init_frame(&new_frame);
+ ret = avctx->get_buffer(avctx, &new_frame);
+ if (ret) {
+ av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ return ret;
+ }
+
+ cdg_scroll(cc, cdg_data, &new_frame, inst == CDG_INST_SCROLL_COPY);
+ avctx->release_buffer(avctx, &cc->frame);
+ cc->frame = new_frame;
+ break;
+ default:
+ break;
+ }
+
+ *data_size = sizeof(AVFrame);
+ } else {
+ *data_size = 0;
+ buf_size = 0;
+ }
+
+ *(AVFrame *) data = cc->frame;
+ return buf_size;
+}
+
+static av_cold int cdg_decode_end(AVCodecContext *avctx)
+{
+ CDGraphicsContext *cc = avctx->priv_data;
+
+ if (cc->frame.data[0])
+ avctx->release_buffer(avctx, &cc->frame);
+
+ return 0;
+}
+
+AVCodec cdgraphics_decoder = {
+ "cdgraphics",
+ CODEC_TYPE_VIDEO,
+ CODEC_ID_CDGRAPHICS,
+ sizeof(CDGraphicsContext),
+ cdg_decode_init,
+ NULL,
+ cdg_decode_end,
+ cdg_decode_frame,
+ CODEC_CAP_DR1,
+ .long_name = NULL_IF_CONFIG_SMALL("CD Graphics video"),
+};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/celp_filters.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/celp_filters.c
index d54e2fa709..e828e0611c 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/celp_filters.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/celp_filters.c
@@ -25,10 +25,8 @@
#include "avcodec.h"
#include "celp_filters.h"
-void ff_celp_convolve_circ(int16_t* fc_out,
- const int16_t* fc_in,
- const int16_t* filter,
- int len)
+void ff_celp_convolve_circ(int16_t* fc_out, const int16_t* fc_in,
+ const int16_t* filter, int len)
{
int i, k;
@@ -57,22 +55,16 @@ void ff_celp_circ_addf(float *out, const float *in,
out[k] = in[k] + fac * lagged[ k - lag];
}
-int ff_celp_lp_synthesis_filter(int16_t *out,
- const int16_t* filter_coeffs,
- const int16_t* in,
- int buffer_length,
- int filter_length,
- int stop_on_overflow,
+int ff_celp_lp_synthesis_filter(int16_t *out, const int16_t *filter_coeffs,
+ const int16_t *in, int buffer_length,
+ int filter_length, int stop_on_overflow,
int rounder)
{
int i,n;
- // Avoids a +1 in the inner loop.
- filter_length++;
-
for (n = 0; n < buffer_length; n++) {
int sum = rounder;
- for (i = 1; i < filter_length; i++)
+ for (i = 1; i <= filter_length; i++)
sum -= filter_coeffs[i-1] * out[n-i];
sum = (sum >> 12) + in[n];
@@ -88,38 +80,123 @@ int ff_celp_lp_synthesis_filter(int16_t *out,
return 0;
}
-void ff_celp_lp_synthesis_filterf(float *out,
- const float* filter_coeffs,
- const float* in,
- int buffer_length,
+void ff_celp_lp_synthesis_filterf(float *out, const float *filter_coeffs,
+ const float* in, int buffer_length,
int filter_length)
{
int i,n;
- // Avoids a +1 in the inner loop.
- filter_length++;
+ float out0, out1, out2, out3;
+ float old_out0, old_out1, old_out2, old_out3;
+ float a,b,c;
- for (n = 0; n < buffer_length; n++) {
+ a = filter_coeffs[0];
+ b = filter_coeffs[1];
+ c = filter_coeffs[2];
+ b -= filter_coeffs[0] * filter_coeffs[0];
+ c -= filter_coeffs[1] * filter_coeffs[0];
+ c -= filter_coeffs[0] * b;
+
+ old_out0 = out[-4];
+ old_out1 = out[-3];
+ old_out2 = out[-2];
+ old_out3 = out[-1];
+ for (n = 0; n <= buffer_length - 4; n+=4) {
+ float tmp0,tmp1,tmp2,tmp3;
+ float val;
+
+ out0 = in[0];
+ out1 = in[1];
+ out2 = in[2];
+ out3 = in[3];
+
+ out0 -= filter_coeffs[2] * old_out1;
+ out1 -= filter_coeffs[2] * old_out2;
+ out2 -= filter_coeffs[2] * old_out3;
+
+ out0 -= filter_coeffs[1] * old_out2;
+ out1 -= filter_coeffs[1] * old_out3;
+
+ out0 -= filter_coeffs[0] * old_out3;
+
+ val = filter_coeffs[3];
+
+ out0 -= val * old_out0;
+ out1 -= val * old_out1;
+ out2 -= val * old_out2;
+ out3 -= val * old_out3;
+
+ old_out3 = out[-5];
+
+ for (i = 5; i <= filter_length; i += 2) {
+ val = filter_coeffs[i-1];
+
+ out0 -= val * old_out3;
+ out1 -= val * old_out0;
+ out2 -= val * old_out1;
+ out3 -= val * old_out2;
+
+ old_out2 = out[-i-1];
+
+ val = filter_coeffs[i];
+
+ out0 -= val * old_out2;
+ out1 -= val * old_out3;
+ out2 -= val * old_out0;
+ out3 -= val * old_out1;
+
+ FFSWAP(float, old_out0, old_out2);
+ old_out1 = old_out3;
+ old_out3 = out[-i-2];
+ }
+
+ tmp0 = out0;
+ tmp1 = out1;
+ tmp2 = out2;
+ tmp3 = out3;
+
+ out3 -= a * tmp2;
+ out2 -= a * tmp1;
+ out1 -= a * tmp0;
+
+ out3 -= b * tmp1;
+ out2 -= b * tmp0;
+
+ out3 -= c * tmp0;
+
+
+ out[0] = out0;
+ out[1] = out1;
+ out[2] = out2;
+ out[3] = out3;
+
+ old_out0 = out0;
+ old_out1 = out1;
+ old_out2 = out2;
+ old_out3 = out3;
+
+ out += 4;
+ in += 4;
+ }
+
+ out -= n;
+ in -= n;
+ for (; n < buffer_length; n++) {
out[n] = in[n];
- for (i = 1; i < filter_length; i++)
+ for (i = 1; i <= filter_length; i++)
out[n] -= filter_coeffs[i-1] * out[n-i];
}
}
-void ff_celp_lp_zero_synthesis_filterf(float *out,
- const float* filter_coeffs,
- const float* in,
- int buffer_length,
+void ff_celp_lp_zero_synthesis_filterf(float *out, const float *filter_coeffs,
+ const float *in, int buffer_length,
int filter_length)
{
int i,n;
- // Avoids a +1 in the inner loop.
- filter_length++;
-
for (n = 0; n < buffer_length; n++) {
out[n] = in[n];
- for (i = 1; i < filter_length; i++)
+ for (i = 1; i <= filter_length; i++)
out[n] += filter_coeffs[i-1] * in[n-i];
}
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/celp_filters.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/celp_filters.h
index d9db95d454..7b64fc0306 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/celp_filters.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/celp_filters.h
@@ -36,10 +36,8 @@
*
* \note fc_in and fc_out should not overlap!
*/
-void ff_celp_convolve_circ(int16_t* fc_out,
- const int16_t* fc_in,
- const int16_t* filter,
- int len);
+void ff_celp_convolve_circ(int16_t *fc_out, const int16_t *fc_in,
+ const int16_t *filter, int len);
/**
* Add an array to a rotated array.
@@ -74,12 +72,9 @@ void ff_celp_circ_addf(float *out, const float *in,
*
* Routine applies 1/A(z) filter to given speech data.
*/
-int ff_celp_lp_synthesis_filter(int16_t *out,
- const int16_t* filter_coeffs,
- const int16_t* in,
- int buffer_length,
- int filter_length,
- int stop_on_overflow,
+int ff_celp_lp_synthesis_filter(int16_t *out, const int16_t *filter_coeffs,
+ const int16_t *in, int buffer_length,
+ int filter_length, int stop_on_overflow,
int rounder);
/**
@@ -90,17 +85,16 @@ int ff_celp_lp_synthesis_filter(int16_t *out,
* @param filter_coeffs filter coefficients.
* @param in input signal
* @param buffer_length amount of data to process
- * @param filter_length filter length (10 for 10th order LP filter)
+ * @param filter_length filter length (10 for 10th order LP filter). Must be
+ * greater than 4 and even.
*
* @note Output buffer must contain filter_length samples of past
* speech data before pointer.
*
* Routine applies 1/A(z) filter to given speech data.
*/
-void ff_celp_lp_synthesis_filterf(float *out,
- const float* filter_coeffs,
- const float* in,
- int buffer_length,
+void ff_celp_lp_synthesis_filterf(float *out, const float *filter_coeffs,
+ const float *in, int buffer_length,
int filter_length);
/**
@@ -118,10 +112,8 @@ void ff_celp_lp_synthesis_filterf(float *out,
*
* Routine applies A(z) filter to given speech data.
*/
-void ff_celp_lp_zero_synthesis_filterf(float *out,
- const float* filter_coeffs,
- const float* in,
- int buffer_length,
+void ff_celp_lp_zero_synthesis_filterf(float *out, const float *filter_coeffs,
+ const float *in, int buffer_length,
int filter_length);
#endif /* AVCODEC_CELP_FILTERS_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cook.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cook.c
index 1f62af269e..6dec2566a7 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cook.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cook.c
@@ -1101,7 +1101,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
q->bit_rate = avctx->bit_rate;
/* Initialize RNG. */
- av_lfg_init(&q->random_state, ff_random_get_seed());
+ av_lfg_init(&q->random_state, 0);
while(edata_ptr < edata_ptr_end){
/* 8 for mono, 16 for stereo, ? for multichannel
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/costablegen.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/costablegen.c
new file mode 100644
index 0000000000..f82fb042fb
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/costablegen.c
@@ -0,0 +1,56 @@
+/*
+ * Generate a header file for hardcoded ff_cos_* tables
+ *
+ * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+#define BITS 16
+#define FLOATFMT "%.18e"
+
+int main(int argc, char *argv[])
+{
+ int i, j;
+ int do_sin = argc == 2 && !strcmp(argv[1], "sin");
+ double (*func)(double) = do_sin ? sin : cos;
+
+ printf("/* This file was generated by libavcodec/costablegen */\n");
+ printf("#include \"libavcodec/dsputil.h\"\n");
+ for (i = 4; i <= BITS; i++) {
+ int m = 1 << i;
+ double freq = 2*M_PI/m;
+ printf("%s(%i) = {\n ", do_sin ? "SINTABLE" : "COSTABLE", m);
+ for (j = 0; j < m/2 - 1; j++) {
+ int idx = j > m/4 ? m/2 - j : j;
+ if (do_sin && j >= m/4)
+ idx = m/4 - j;
+ printf(" "FLOATFMT",", func(idx*freq));
+ if ((j & 3) == 3)
+ printf("\n ");
+ }
+ printf(" "FLOATFMT"\n};\n", func(do_sin ? -(m/4 - 1)*freq : freq));
+ }
+ return 0;
+}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cscd.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cscd.c
index e58cf7861d..45edca382c 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cscd.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cscd.c
@@ -216,9 +216,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
static av_cold int decode_init(AVCodecContext *avctx) {
CamStudioContext *c = avctx->priv_data;
- if (avcodec_check_dimensions(avctx, avctx->height, avctx->width) < 0) {
- return 1;
- }
switch (avctx->bits_per_coded_sample) {
case 16: avctx->pix_fmt = PIX_FMT_RGB555; break;
case 24: avctx->pix_fmt = PIX_FMT_BGR24; break;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dca.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dca.c
index b68e547050..d71483fa28 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dca.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dca.c
@@ -37,6 +37,7 @@
#include "dcadata.h"
#include "dcahuff.h"
#include "dca.h"
+#include "synth_filter.h"
//#define TRACE
@@ -609,7 +610,7 @@ static int dca_subframe_header(DCAContext * s)
s->joint_scale_factor[j][k] = scale; /*joint_scale_table[scale]; */
}
- if (!s->debug_flag & 0x02) {
+ if (!(s->debug_flag & 0x02)) {
av_log(s->avctx, AV_LOG_DEBUG,
"Joint stereo coding not supported\n");
s->debug_flag |= 0x02;
@@ -751,10 +752,7 @@ static void qmf_32_subbands(DCAContext * s, int chans,
float scale, float bias)
{
const float *prCoeff;
- int i, j;
-
- int hist_index= s->hist_index[chans];
- float *subband_fir_hist2 = s->subband_fir_noidea[chans];
+ int i;
int subindex;
@@ -768,7 +766,6 @@ static void qmf_32_subbands(DCAContext * s, int chans,
/* Reconstructed channel sample index */
for (subindex = 0; subindex < 8; subindex++) {
- float *subband_fir_hist = s->subband_fir_hist[chans] + hist_index;
/* Load in one sample from each subband and clear inactive subbands */
for (i = 0; i < s->subband_activity[chans]; i++){
if((i-1)&2) s->raXin[i] = -samples_in[i][subindex];
@@ -777,36 +774,13 @@ static void qmf_32_subbands(DCAContext * s, int chans,
for (; i < 32; i++)
s->raXin[i] = 0.0;
- ff_imdct_half(&s->imdct, subband_fir_hist, s->raXin);
-
- /* Multiply by filter coefficients */
- for (i = 0; i < 16; i++){
- float a= subband_fir_hist2[i ];
- float b= subband_fir_hist2[i+16];
- float c= 0;
- float d= 0;
- for (j = 0; j < 512-hist_index; j += 64){
- a += prCoeff[i+j ]*(-subband_fir_hist[15-i+j]);
- b += prCoeff[i+j+16]*( subband_fir_hist[ i+j]);
- c += prCoeff[i+j+32]*( subband_fir_hist[16+i+j]);
- d += prCoeff[i+j+48]*( subband_fir_hist[31-i+j]);
- }
- for ( ; j < 512; j += 64){
- a += prCoeff[i+j ]*(-subband_fir_hist[15-i+j-512]);
- b += prCoeff[i+j+16]*( subband_fir_hist[ i+j-512]);
- c += prCoeff[i+j+32]*( subband_fir_hist[16+i+j-512]);
- d += prCoeff[i+j+48]*( subband_fir_hist[31-i+j-512]);
- }
- samples_out[i ] = a * scale + bias;
- samples_out[i+16] = b * scale + bias;
- subband_fir_hist2[i ] = c;
- subband_fir_hist2[i+16] = d;
- }
+ ff_synth_filter_float(&s->imdct,
+ s->subband_fir_hist[chans], &s->hist_index[chans],
+ s->subband_fir_noidea[chans], prCoeff,
+ samples_out, s->raXin, scale, bias);
samples_out+= 32;
- hist_index = (hist_index-32)&511;
}
- s->hist_index[chans]= hist_index;
}
static void lfe_interpolation_fir(int decimation_select,
@@ -1324,7 +1298,7 @@ static av_cold int dca_decode_init(AVCodecContext * avctx)
s->samples_chanptr[i] = s->samples + i * 256;
avctx->sample_fmt = SAMPLE_FMT_S16;
- if(s->dsp.float_to_int16 == ff_float_to_int16_c) {
+ if(s->dsp.float_to_int16_interleave == ff_float_to_int16_interleave_c) {
s->add_bias = 385.0f;
s->scale_bias = 1.0 / 32768.0;
} else {
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dnxhdenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dnxhdenc.c
index 29613a524a..a52fe8684e 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dnxhdenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dnxhdenc.c
@@ -204,6 +204,7 @@ static int dnxhd_encode_init(AVCodecContext *avctx)
return -1;
FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->slice_size, ctx->m.mb_height*sizeof(uint32_t), fail);
+ FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->slice_offs, ctx->m.mb_height*sizeof(uint32_t), fail);
FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_bits, ctx->m.mb_num *sizeof(uint16_t), fail);
FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_qscale, ctx->m.mb_num *sizeof(uint8_t) , fail);
@@ -211,7 +212,7 @@ static int dnxhd_encode_init(AVCodecContext *avctx)
ctx->frame.pict_type = FF_I_TYPE;
ctx->m.avctx->coded_frame = &ctx->frame;
- if (avctx->thread_count > MAX_THREADS || (avctx->thread_count > ctx->m.mb_height)) {
+ if (avctx->thread_count > MAX_THREADS) {
av_log(avctx, AV_LOG_ERROR, "too many threads\n");
return -1;
}
@@ -222,11 +223,6 @@ static int dnxhd_encode_init(AVCodecContext *avctx)
memcpy(ctx->thread[i], ctx, sizeof(DNXHDEncContext));
}
- for (i = 0; i < avctx->thread_count; i++) {
- ctx->thread[i]->m.start_mb_y = (ctx->m.mb_height*(i ) + avctx->thread_count/2) / avctx->thread_count;
- ctx->thread[i]->m.end_mb_y = (ctx->m.mb_height*(i+1) + avctx->thread_count/2) / avctx->thread_count;
- }
-
return 0;
fail: //for FF_ALLOCZ_OR_GOTO
return -1;
@@ -397,98 +393,97 @@ static av_always_inline int dnxhd_switch_matrix(DNXHDEncContext *ctx, int i)
}
}
-static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg)
+static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
{
- DNXHDEncContext *ctx = *(void**)arg;
- int mb_y, mb_x;
- int qscale = ctx->thread[0]->qscale;
-
- for (mb_y = ctx->m.start_mb_y; mb_y < ctx->m.end_mb_y; mb_y++) {
- ctx->m.last_dc[0] =
- ctx->m.last_dc[1] =
- ctx->m.last_dc[2] = 1024;
-
- for (mb_x = 0; mb_x < ctx->m.mb_width; mb_x++) {
- unsigned mb = mb_y * ctx->m.mb_width + mb_x;
- int ssd = 0;
- int ac_bits = 0;
- int dc_bits = 0;
- int i;
-
- dnxhd_get_blocks(ctx, mb_x, mb_y);
-
- for (i = 0; i < 8; i++) {
- DECLARE_ALIGNED_16(DCTELEM, block[64]);
- DCTELEM *src_block = ctx->blocks[i];
- int overflow, nbits, diff, last_index;
- int n = dnxhd_switch_matrix(ctx, i);
-
- memcpy(block, src_block, sizeof(block));
- last_index = ctx->m.dct_quantize((MpegEncContext*)ctx, block, i, qscale, &overflow);
- ac_bits += dnxhd_calc_ac_bits(ctx, block, last_index);
-
- diff = block[0] - ctx->m.last_dc[n];
- if (diff < 0) nbits = av_log2_16bit(-2*diff);
- else nbits = av_log2_16bit( 2*diff);
- dc_bits += ctx->cid_table->dc_bits[nbits] + nbits;
-
- ctx->m.last_dc[n] = block[0];
-
- if (avctx->mb_decision == FF_MB_DECISION_RD || !RC_VARIANCE) {
- dnxhd_unquantize_c(ctx, block, i, qscale, last_index);
- ctx->m.dsp.idct(block);
- ssd += dnxhd_ssd_block(block, src_block);
- }
+ DNXHDEncContext *ctx = avctx->priv_data;
+ int mb_y = jobnr, mb_x;
+ int qscale = ctx->qscale;
+ ctx = ctx->thread[threadnr];
+
+ ctx->m.last_dc[0] =
+ ctx->m.last_dc[1] =
+ ctx->m.last_dc[2] = 1024;
+
+ for (mb_x = 0; mb_x < ctx->m.mb_width; mb_x++) {
+ unsigned mb = mb_y * ctx->m.mb_width + mb_x;
+ int ssd = 0;
+ int ac_bits = 0;
+ int dc_bits = 0;
+ int i;
+
+ dnxhd_get_blocks(ctx, mb_x, mb_y);
+
+ for (i = 0; i < 8; i++) {
+ DECLARE_ALIGNED_16(DCTELEM, block[64]);
+ DCTELEM *src_block = ctx->blocks[i];
+ int overflow, nbits, diff, last_index;
+ int n = dnxhd_switch_matrix(ctx, i);
+
+ memcpy(block, src_block, sizeof(block));
+ last_index = ctx->m.dct_quantize((MpegEncContext*)ctx, block, i, qscale, &overflow);
+ ac_bits += dnxhd_calc_ac_bits(ctx, block, last_index);
+
+ diff = block[0] - ctx->m.last_dc[n];
+ if (diff < 0) nbits = av_log2_16bit(-2*diff);
+ else nbits = av_log2_16bit( 2*diff);
+ dc_bits += ctx->cid_table->dc_bits[nbits] + nbits;
+
+ ctx->m.last_dc[n] = block[0];
+
+ if (avctx->mb_decision == FF_MB_DECISION_RD || !RC_VARIANCE) {
+ dnxhd_unquantize_c(ctx, block, i, qscale, last_index);
+ ctx->m.dsp.idct(block);
+ ssd += dnxhd_ssd_block(block, src_block);
}
- ctx->mb_rc[qscale][mb].ssd = ssd;
- ctx->mb_rc[qscale][mb].bits = ac_bits+dc_bits+12+8*ctx->vlc_bits[0];
}
+ ctx->mb_rc[qscale][mb].ssd = ssd;
+ ctx->mb_rc[qscale][mb].bits = ac_bits+dc_bits+12+8*ctx->vlc_bits[0];
}
return 0;
}
-static int dnxhd_encode_thread(AVCodecContext *avctx, void *arg)
+static int dnxhd_encode_thread(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
{
- DNXHDEncContext *ctx = *(void**)arg;
- int mb_y, mb_x;
-
- for (mb_y = ctx->m.start_mb_y; mb_y < ctx->m.end_mb_y; mb_y++) {
- ctx->m.last_dc[0] =
- ctx->m.last_dc[1] =
- ctx->m.last_dc[2] = 1024;
- for (mb_x = 0; mb_x < ctx->m.mb_width; mb_x++) {
- unsigned mb = mb_y * ctx->m.mb_width + mb_x;
- int qscale = ctx->mb_qscale[mb];
- int i;
-
- put_bits(&ctx->m.pb, 12, qscale<<1);
-
- dnxhd_get_blocks(ctx, mb_x, mb_y);
-
- for (i = 0; i < 8; i++) {
- DCTELEM *block = ctx->blocks[i];
- int last_index, overflow;
- int n = dnxhd_switch_matrix(ctx, i);
- last_index = ctx->m.dct_quantize((MpegEncContext*)ctx, block, i, qscale, &overflow);
- //START_TIMER;
- dnxhd_encode_block(ctx, block, last_index, n);
- //STOP_TIMER("encode_block");
- }
+ DNXHDEncContext *ctx = avctx->priv_data;
+ int mb_y = jobnr, mb_x;
+ ctx = ctx->thread[threadnr];
+ init_put_bits(&ctx->m.pb, (uint8_t *)arg + 640 + ctx->slice_offs[jobnr], ctx->slice_size[jobnr]);
+
+ ctx->m.last_dc[0] =
+ ctx->m.last_dc[1] =
+ ctx->m.last_dc[2] = 1024;
+ for (mb_x = 0; mb_x < ctx->m.mb_width; mb_x++) {
+ unsigned mb = mb_y * ctx->m.mb_width + mb_x;
+ int qscale = ctx->mb_qscale[mb];
+ int i;
+
+ put_bits(&ctx->m.pb, 12, qscale<<1);
+
+ dnxhd_get_blocks(ctx, mb_x, mb_y);
+
+ for (i = 0; i < 8; i++) {
+ DCTELEM *block = ctx->blocks[i];
+ int last_index, overflow;
+ int n = dnxhd_switch_matrix(ctx, i);
+ last_index = ctx->m.dct_quantize((MpegEncContext*)ctx, block, i, qscale, &overflow);
+ //START_TIMER;
+ dnxhd_encode_block(ctx, block, last_index, n);
+ //STOP_TIMER("encode_block");
}
- if (put_bits_count(&ctx->m.pb)&31)
- put_bits(&ctx->m.pb, 32-(put_bits_count(&ctx->m.pb)&31), 0);
}
+ if (put_bits_count(&ctx->m.pb)&31)
+ put_bits(&ctx->m.pb, 32-(put_bits_count(&ctx->m.pb)&31), 0);
flush_put_bits(&ctx->m.pb);
return 0;
}
-static void dnxhd_setup_threads_slices(DNXHDEncContext *ctx, uint8_t *buf)
+static void dnxhd_setup_threads_slices(DNXHDEncContext *ctx)
{
int mb_y, mb_x;
- int i, offset = 0;
- for (i = 0; i < ctx->m.avctx->thread_count; i++) {
- int thread_size = 0;
- for (mb_y = ctx->thread[i]->m.start_mb_y; mb_y < ctx->thread[i]->m.end_mb_y; mb_y++) {
+ int offset = 0;
+ for (mb_y = 0; mb_y < ctx->m.mb_height; mb_y++) {
+ int thread_size;
+ ctx->slice_offs[mb_y] = offset;
ctx->slice_size[mb_y] = 0;
for (mb_x = 0; mb_x < ctx->m.mb_width; mb_x++) {
unsigned mb = mb_y * ctx->m.mb_width + mb_x;
@@ -496,26 +491,23 @@ static void dnxhd_setup_threads_slices(DNXHDEncContext *ctx, uint8_t *buf)
}
ctx->slice_size[mb_y] = (ctx->slice_size[mb_y]+31)&~31;
ctx->slice_size[mb_y] >>= 3;
- thread_size += ctx->slice_size[mb_y];
- }
- init_put_bits(&ctx->thread[i]->m.pb, buf + 640 + offset, thread_size);
+ thread_size = ctx->slice_size[mb_y];
offset += thread_size;
}
}
-static int dnxhd_mb_var_thread(AVCodecContext *avctx, void *arg)
+static int dnxhd_mb_var_thread(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
{
- DNXHDEncContext *ctx = *(void**)arg;
- int mb_y, mb_x;
- for (mb_y = ctx->m.start_mb_y; mb_y < ctx->m.end_mb_y; mb_y++) {
- for (mb_x = 0; mb_x < ctx->m.mb_width; mb_x++) {
- unsigned mb = mb_y * ctx->m.mb_width + mb_x;
- uint8_t *pix = ctx->thread[0]->src[0] + ((mb_y<<4) * ctx->m.linesize) + (mb_x<<4);
- int sum = ctx->m.dsp.pix_sum(pix, ctx->m.linesize);
- int varc = (ctx->m.dsp.pix_norm1(pix, ctx->m.linesize) - (((unsigned)(sum*sum))>>8)+128)>>8;
- ctx->mb_cmp[mb].value = varc;
- ctx->mb_cmp[mb].mb = mb;
- }
+ DNXHDEncContext *ctx = avctx->priv_data;
+ int mb_y = jobnr, mb_x;
+ ctx = ctx->thread[threadnr];
+ for (mb_x = 0; mb_x < ctx->m.mb_width; mb_x++) {
+ unsigned mb = mb_y * ctx->m.mb_width + mb_x;
+ uint8_t *pix = ctx->thread[0]->src[0] + ((mb_y<<4) * ctx->m.linesize) + (mb_x<<4);
+ int sum = ctx->m.dsp.pix_sum(pix, ctx->m.linesize);
+ int varc = (ctx->m.dsp.pix_norm1(pix, ctx->m.linesize) - (((unsigned)(sum*sum))>>8)+128)>>8;
+ ctx->mb_cmp[mb].value = varc;
+ ctx->mb_cmp[mb].mb = mb;
}
return 0;
}
@@ -528,7 +520,7 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
for (q = 1; q < avctx->qmax; q++) {
ctx->qscale = q;
- avctx->execute(avctx, dnxhd_calc_bits_thread, &ctx->thread[0], NULL, avctx->thread_count, sizeof(void*));
+ avctx->execute2(avctx, dnxhd_calc_bits_thread, NULL, NULL, ctx->m.mb_height);
}
up_step = down_step = 2<<LAMBDA_FRAC_BITS;
lambda = ctx->lambda;
@@ -582,9 +574,11 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
last_higher = FFMAX(lambda, last_higher);
if (last_lower != INT_MAX)
lambda = (lambda+last_lower)>>1;
+ else if ((int64_t)lambda + up_step > INT_MAX)
+ return -1;
else
lambda += up_step;
- up_step *= 5;
+ up_step = FFMIN((int64_t)up_step*5, INT_MAX);
down_step = 1<<LAMBDA_FRAC_BITS;
}
}
@@ -608,7 +602,7 @@ static int dnxhd_find_qscale(DNXHDEncContext *ctx)
bits = 0;
ctx->qscale = qscale;
// XXX avoid recalculating bits
- ctx->m.avctx->execute(ctx->m.avctx, dnxhd_calc_bits_thread, &ctx->thread[0], NULL, ctx->m.avctx->thread_count, sizeof(void*));
+ ctx->m.avctx->execute2(ctx->m.avctx, dnxhd_calc_bits_thread, NULL, NULL, ctx->m.mb_height);
for (y = 0; y < ctx->m.mb_height; y++) {
for (x = 0; x < ctx->m.mb_width; x++)
bits += ctx->mb_rc[qscale][y*ctx->m.mb_width+x].bits;
@@ -732,7 +726,7 @@ static int dnxhd_encode_fast(AVCodecContext *avctx, DNXHDEncContext *ctx)
}
if (!ret) {
if (RC_VARIANCE)
- avctx->execute(avctx, dnxhd_mb_var_thread, &ctx->thread[0], NULL, avctx->thread_count, sizeof(void*));
+ avctx->execute2(avctx, dnxhd_mb_var_thread, NULL, NULL, ctx->m.mb_height);
radix_sort(ctx->mb_cmp, ctx->m.mb_num);
for (x = 0; x < ctx->m.mb_num && max_bits > ctx->frame_bits; x++) {
int mb = ctx->mb_cmp[x].mb;
@@ -791,11 +785,12 @@ static int dnxhd_encode_picture(AVCodecContext *avctx, unsigned char *buf, int b
else
ret = dnxhd_encode_fast(avctx, ctx);
if (ret < 0) {
- av_log(avctx, AV_LOG_ERROR, "picture could not fit ratecontrol constraints\n");
+ av_log(avctx, AV_LOG_ERROR,
+ "picture could not fit ratecontrol constraints, increase qmax\n");
return -1;
}
- dnxhd_setup_threads_slices(ctx, buf);
+ dnxhd_setup_threads_slices(ctx);
offset = 0;
for (i = 0; i < ctx->m.mb_height; i++) {
@@ -804,7 +799,7 @@ static int dnxhd_encode_picture(AVCodecContext *avctx, unsigned char *buf, int b
assert(!(ctx->slice_size[i] & 3));
}
- avctx->execute(avctx, dnxhd_encode_thread, &ctx->thread[0], NULL, avctx->thread_count, sizeof(void*));
+ avctx->execute2(avctx, dnxhd_encode_thread, buf, NULL, ctx->m.mb_height);
assert(640 + offset + 4 <= ctx->cid_table->coding_unit_size);
memset(buf + 640 + offset, 0, ctx->cid_table->coding_unit_size - 4 - offset - 640);
@@ -840,6 +835,7 @@ static int dnxhd_encode_end(AVCodecContext *avctx)
av_freep(&ctx->mb_rc);
av_freep(&ctx->mb_cmp);
av_freep(&ctx->slice_size);
+ av_freep(&ctx->slice_offs);
av_freep(&ctx->qmatrix_c);
av_freep(&ctx->qmatrix_l);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dnxhdenc.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dnxhdenc.h
index 6f9f647ef0..971f9134f4 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dnxhdenc.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dnxhdenc.h
@@ -46,6 +46,7 @@ typedef struct DNXHDEncContext {
const CIDEntry *cid_table;
uint8_t *msip; ///< Macroblock Scan Indexes Payload
uint32_t *slice_size;
+ uint32_t *slice_offs;
struct DNXHDEncContext *thread[MAX_THREADS];
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dpx.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dpx.c
index fec12f94ca..ec0f435610 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dpx.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dpx.c
@@ -92,6 +92,7 @@ static int decode_frame(AVCodecContext *avctx,
// Need to end in 0x323 to read the bits per color
buf += 3;
+ avctx->bits_per_raw_sample =
bits_per_color = buf[0];
switch (descriptor) {
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dsputil.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dsputil.c
index 70110dfea9..ffa8cecd4a 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dsputil.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dsputil.c
@@ -45,8 +45,8 @@ void vorbis_inverse_coupling(float *mag, float *ang, int blocksize);
/* ac3dec.c */
void ff_ac3_downmix_c(float (*samples)[256], float (*matrix)[2], int out_ch, int in_ch, int len);
-/* flacenc.c */
-void ff_flac_compute_autocorr(const int32_t *data, int len, int lag, double *autoc);
+/* lpc.c */
+void ff_lpc_compute_autocorr(const int32_t *data, int len, int lag, double *autoc);
/* pngdec.c */
void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, int w, int bpp);
@@ -3573,7 +3573,7 @@ static void diff_bytes_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){
dst[i+0] = src1[i+0]-src2[i+0];
}
-static void add_hfyu_median_prediction_c(uint8_t *dst, uint8_t *src1, uint8_t *diff, int w, int *left, int *left_top){
+static void add_hfyu_median_prediction_c(uint8_t *dst, const uint8_t *src1, const uint8_t *diff, int w, int *left, int *left_top){
int i;
uint8_t l, lt;
@@ -3590,7 +3590,7 @@ static void add_hfyu_median_prediction_c(uint8_t *dst, uint8_t *src1, uint8_t *d
*left_top= lt;
}
-static void sub_hfyu_median_prediction_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top){
+static void sub_hfyu_median_prediction_c(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w, int *left, int *left_top){
int i;
uint8_t l, lt;
@@ -3608,7 +3608,7 @@ static void sub_hfyu_median_prediction_c(uint8_t *dst, uint8_t *src1, uint8_t *s
*left_top= lt;
}
-static int add_hfyu_left_prediction_c(uint8_t *dst, uint8_t *src, int w, int acc){
+static int add_hfyu_left_prediction_c(uint8_t *dst, const uint8_t *src, int w, int acc){
int i;
for(i=0; i<w-1; i++){
@@ -3636,7 +3636,7 @@ static int add_hfyu_left_prediction_c(uint8_t *dst, uint8_t *src, int w, int acc
#define G 1
#define R 2
#endif
-static inline void add_hfyu_left_prediction_bgr32_c(uint8_t *dst, uint8_t *src, int w, int *red, int *green, int *blue){
+static void add_hfyu_left_prediction_bgr32_c(uint8_t *dst, const uint8_t *src, int w, int *red, int *green, int *blue){
int i;
int r,g,b;
r= *red;
@@ -4298,18 +4298,6 @@ void ff_float_to_int16_interleave_c(int16_t *dst, const float **src, long len, i
}
}
-static void add_int16_c(int16_t * v1, int16_t * v2, int order)
-{
- while (order--)
- *v1++ += *v2++;
-}
-
-static void sub_int16_c(int16_t * v1, int16_t * v2, int order)
-{
- while (order--)
- *v1++ -= *v2++;
-}
-
static int32_t scalarproduct_int16_c(int16_t * v1, int16_t * v2, int order, int shift)
{
int res = 0;
@@ -4320,6 +4308,16 @@ static int32_t scalarproduct_int16_c(int16_t * v1, int16_t * v2, int order, int
return res;
}
+static int32_t scalarproduct_and_madd_int16_c(int16_t *v1, int16_t *v2, int16_t *v3, int order, int mul)
+{
+ int res = 0;
+ while (order--) {
+ res += *v1 * *v2++;
+ *v1++ += mul * *v3++;
+ }
+ return res;
+}
+
#define W0 2048
#define W1 2841 /* 2048*sqrt (2)*cos (1*pi/16) */
#define W2 2676 /* 2048*sqrt (2)*cos (2*pi/16) */
@@ -4837,8 +4835,8 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx)
#if CONFIG_AC3_DECODER
c->ac3_downmix = ff_ac3_downmix_c;
#endif
-#if CONFIG_FLAC_ENCODER
- c->flac_compute_autocorr = ff_flac_compute_autocorr;
+#if CONFIG_LPC
+ c->lpc_compute_autocorr = ff_lpc_compute_autocorr;
#endif
c->vector_fmul = vector_fmul_c;
c->vector_fmul_reverse = vector_fmul_reverse_c;
@@ -4848,9 +4846,8 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx)
c->vector_clipf = vector_clipf_c;
c->float_to_int16 = ff_float_to_int16_c;
c->float_to_int16_interleave = ff_float_to_int16_interleave_c;
- c->add_int16 = add_int16_c;
- c->sub_int16 = sub_int16_c;
c->scalarproduct_int16 = scalarproduct_int16_c;
+ c->scalarproduct_and_madd_int16 = scalarproduct_and_madd_int16_c;
c->scalarproduct_float = scalarproduct_float_c;
c->butterflies_float = butterflies_float_c;
c->vector_fmul_scalar = vector_fmul_scalar_c;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dsputil.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dsputil.h
index b7dc9e1ee3..e483276070 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dsputil.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dsputil.h
@@ -347,10 +347,10 @@ typedef struct DSPContext {
* subtract huffyuv's variant of median prediction
* note, this might read from src1[-1], src2[-1]
*/
- void (*sub_hfyu_median_prediction)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top);
- void (*add_hfyu_median_prediction)(uint8_t *dst, uint8_t *top, uint8_t *diff, int w, int *left, int *left_top);
- int (*add_hfyu_left_prediction)(uint8_t *dst, uint8_t *src, int w, int acc);
- void (*add_hfyu_left_prediction_bgr32)(uint8_t *dst, uint8_t *src, int w, int *red, int *green, int *blue);
+ void (*sub_hfyu_median_prediction)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w, int *left, int *left_top);
+ void (*add_hfyu_median_prediction)(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top);
+ int (*add_hfyu_left_prediction)(uint8_t *dst, const uint8_t *src, int w, int left);
+ void (*add_hfyu_left_prediction_bgr32)(uint8_t *dst, const uint8_t *src, int w, int *red, int *green, int *blue);
/* this might write to dst[w] */
void (*add_png_paeth_prediction)(uint8_t *dst, uint8_t *src, uint8_t *top, int w, int bpp);
void (*bswap_buf)(uint32_t *dst, const uint32_t *src, int w);
@@ -386,7 +386,7 @@ typedef struct DSPContext {
void (*vorbis_inverse_coupling)(float *mag, float *ang, int blocksize);
void (*ac3_downmix)(float (*samples)[256], float (*matrix)[2], int out_ch, int in_ch, int len);
/* no alignment needed */
- void (*flac_compute_autocorr)(const int32_t *data, int len, int lag, double *autoc);
+ void (*lpc_compute_autocorr)(const int32_t *data, int len, int lag, double *autoc);
/* assume len is a multiple of 8, and arrays are 16-byte aligned */
void (*vector_fmul)(float *dst, const float *src, int len);
void (*vector_fmul_reverse)(float *dst, const float *src0, const float *src1, int len);
@@ -560,23 +560,19 @@ typedef struct DSPContext {
void (*x8_setup_spatial_compensation)(uint8_t *src, uint8_t *dst, int linesize,
int * range, int * sum, int edges);
- /* ape functions */
- /**
- * Add contents of the second vector to the first one.
- * @param len length of vectors, should be multiple of 16
- */
- void (*add_int16)(int16_t *v1/*align 16*/, int16_t *v2, int len);
- /**
- * Add contents of the second vector to the first one.
- * @param len length of vectors, should be multiple of 16
- */
- void (*sub_int16)(int16_t *v1/*align 16*/, int16_t *v2, int len);
/**
* Calculate scalar product of two vectors.
* @param len length of vectors, should be multiple of 16
* @param shift number of bits to discard from product
*/
int32_t (*scalarproduct_int16)(int16_t *v1, int16_t *v2/*align 16*/, int len, int shift);
+ /* ape functions */
+ /**
+ * Calculate scalar product of v1 and v2,
+ * and v1[i] += v3[i] * mul
+ * @param len length of vectors, should be multiple of 16
+ */
+ int32_t (*scalarproduct_and_madd_int16)(int16_t *v1/*align 16*/, int16_t *v2, int16_t *v3, int len, int mul);
/* rv30 functions */
qpel_mc_func put_rv30_tpel_pixels_tab[4][16];
@@ -742,7 +738,52 @@ typedef struct FFTContext {
#define FF_MDCT_PERM_INTERLEAVE 1
} FFTContext;
-extern FFTSample* const ff_cos_tabs[13];
+#if CONFIG_HARDCODED_TABLES
+#define COSTABLE_CONST const
+#define SINTABLE_CONST const
+#else
+#define COSTABLE_CONST
+#define SINTABLE_CONST
+#endif
+
+#define COSTABLE(size) \
+ COSTABLE_CONST DECLARE_ALIGNED_16(FFTSample, ff_cos_##size[size/2])
+#define SINTABLE(size) \
+ SINTABLE_CONST DECLARE_ALIGNED_16(FFTSample, ff_sin_##size[size/2])
+extern COSTABLE(16);
+extern COSTABLE(32);
+extern COSTABLE(64);
+extern COSTABLE(128);
+extern COSTABLE(256);
+extern COSTABLE(512);
+extern COSTABLE(1024);
+extern COSTABLE(2048);
+extern COSTABLE(4096);
+extern COSTABLE(8192);
+extern COSTABLE(16384);
+extern COSTABLE(32768);
+extern COSTABLE(65536);
+extern COSTABLE_CONST FFTSample* const ff_cos_tabs[17];
+
+/**
+ * Initializes the cosine table in ff_cos_tabs[index]
+ * \param index index in ff_cos_tabs array of the table to initialize
+ */
+void ff_init_ff_cos_tabs(int index);
+
+extern SINTABLE(16);
+extern SINTABLE(32);
+extern SINTABLE(64);
+extern SINTABLE(128);
+extern SINTABLE(256);
+extern SINTABLE(512);
+extern SINTABLE(1024);
+extern SINTABLE(2048);
+extern SINTABLE(4096);
+extern SINTABLE(8192);
+extern SINTABLE(16384);
+extern SINTABLE(32768);
+extern SINTABLE(65536);
/**
* Sets up a complex FFT.
@@ -836,8 +877,8 @@ typedef struct {
int sign_convention;
/* pre/post rotation tables */
- FFTSample *tcos;
- FFTSample *tsin;
+ const FFTSample *tcos;
+ SINTABLE_CONST FFTSample *tsin;
FFTContext fft;
} RDFTContext;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dv.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dv.c
index 9b56977345..1219bf1070 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dv.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dv.c
@@ -398,6 +398,17 @@ static av_cold int dvvideo_init(AVCodecContext *avctx)
return 0;
}
+static av_cold int dvvideo_init_encoder(AVCodecContext *avctx)
+{
+ if (!ff_dv_codec_profile(avctx)) {
+ av_log(avctx, AV_LOG_ERROR, "Found no DV profile for %ix%i %s video\n",
+ avctx->width, avctx->height, avcodec_get_pix_fmt_name(avctx->pix_fmt));
+ return -1;
+ }
+
+ return dvvideo_init(avctx);
+}
+
// #define VLC_DEBUG
// #define printf(...) av_log(NULL, AV_LOG_ERROR, __VA_ARGS__)
@@ -416,11 +427,6 @@ static const int vs_total_ac_bits = (100 * 4 + 68*2) * 5;
/* see dv_88_areas and dv_248_areas for details */
static const int mb_area_start[5] = { 1, 6, 21, 43, 64 };
-static inline int get_bits_left(GetBitContext *s)
-{
- return s->size_in_bits - get_bits_count(s);
-}
-
static inline int put_bits_left(PutBitContext* s)
{
return (s->buf_end - s->buf) * 8 - put_bits_count(s);
@@ -1128,7 +1134,7 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
int buf_size = avpkt->size;
DVVideoContext *s = avctx->priv_data;
- s->sys = dv_frame_profile(s->sys, buf, buf_size);
+ s->sys = ff_dv_frame_profile(s->sys, buf, buf_size);
if (!s->sys || buf_size < s->sys->frame_size || dv_init_dynamic_tables(s->sys)) {
av_log(avctx, AV_LOG_ERROR, "could not find dv frame profile\n");
return -1; /* NOTE: we only accept several full frames */
@@ -1293,7 +1299,7 @@ static int dvvideo_encode_frame(AVCodecContext *c, uint8_t *buf, int buf_size,
{
DVVideoContext *s = c->priv_data;
- s->sys = dv_codec_profile(c);
+ s->sys = ff_dv_codec_profile(c);
if (!s->sys || buf_size < s->sys->frame_size || dv_init_dynamic_tables(s->sys))
return -1;
@@ -1331,7 +1337,7 @@ AVCodec dvvideo_encoder = {
CODEC_TYPE_VIDEO,
CODEC_ID_DVVIDEO,
sizeof(DVVideoContext),
- dvvideo_init,
+ dvvideo_init_encoder,
dvvideo_encode_frame,
.pix_fmts = (const enum PixelFormat[]) {PIX_FMT_YUV411P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, PIX_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dvdata.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dvdata.c
new file mode 100644
index 0000000000..1045afd006
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dvdata.c
@@ -0,0 +1,285 @@
+/*
+ * Constants for DV codec
+ * Copyright (c) 2002 Fabrice Bellard
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file libavcodec/dvdata.c
+ * Constants for DV codec.
+ */
+
+#include "libavutil/rational.h"
+#include "avcodec.h"
+#include "dvdata.h"
+
+static DVwork_chunk work_chunks_dv25pal [1*12*27];
+static DVwork_chunk work_chunks_dv25pal411[1*12*27];
+static DVwork_chunk work_chunks_dv25ntsc [1*10*27];
+static DVwork_chunk work_chunks_dv50pal [2*12*27];
+static DVwork_chunk work_chunks_dv50ntsc [2*10*27];
+static DVwork_chunk work_chunks_dv100palp [2*12*27];
+static DVwork_chunk work_chunks_dv100ntscp[2*10*27];
+static DVwork_chunk work_chunks_dv100pali [4*12*27];
+static DVwork_chunk work_chunks_dv100ntsci[4*10*27];
+
+static uint32_t dv_idct_factor_sd [2*2*22*64];
+static uint32_t dv_idct_factor_hd1080[2*4*16*64];
+static uint32_t dv_idct_factor_hd720 [2*4*16*64];
+
+static const DVprofile dv_profiles[] = {
+ { .dsf = 0,
+ .video_stype = 0x0,
+ .frame_size = 120000, /* IEC 61834, SMPTE-314M - 525/60 (NTSC) */
+ .difseg_size = 10,
+ .n_difchan = 1,
+ .time_base = { 1001, 30000 },
+ .ltc_divisor = 30,
+ .height = 480,
+ .width = 720,
+ .sar = {{10, 11}, {40, 33}},
+ .work_chunks = &work_chunks_dv25ntsc[0],
+ .idct_factor = &dv_idct_factor_sd[0],
+ .pix_fmt = PIX_FMT_YUV411P,
+ .bpm = 6,
+ .block_sizes = block_sizes_dv2550,
+ .audio_stride = 90,
+ .audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */
+ .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
+ .audio_shuffle = dv_audio_shuffle525,
+ },
+ { .dsf = 1,
+ .video_stype = 0x0,
+ .frame_size = 144000, /* IEC 61834 - 625/50 (PAL) */
+ .difseg_size = 12,
+ .n_difchan = 1,
+ .time_base = { 1, 25 },
+ .ltc_divisor = 25,
+ .height = 576,
+ .width = 720,
+ .sar = {{59, 54}, {118, 81}},
+ .work_chunks = &work_chunks_dv25pal[0],
+ .idct_factor = &dv_idct_factor_sd[0],
+ .pix_fmt = PIX_FMT_YUV420P,
+ .bpm = 6,
+ .block_sizes = block_sizes_dv2550,
+ .audio_stride = 108,
+ .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
+ .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
+ .audio_shuffle = dv_audio_shuffle625,
+ },
+ { .dsf = 1,
+ .video_stype = 0x0,
+ .frame_size = 144000, /* SMPTE-314M - 625/50 (PAL) */
+ .difseg_size = 12,
+ .n_difchan = 1,
+ .time_base = { 1, 25 },
+ .ltc_divisor = 25,
+ .height = 576,
+ .width = 720,
+ .sar = {{59, 54}, {118, 81}},
+ .work_chunks = &work_chunks_dv25pal411[0],
+ .idct_factor = &dv_idct_factor_sd[0],
+ .pix_fmt = PIX_FMT_YUV411P,
+ .bpm = 6,
+ .block_sizes = block_sizes_dv2550,
+ .audio_stride = 108,
+ .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
+ .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
+ .audio_shuffle = dv_audio_shuffle625,
+ },
+ { .dsf = 0,
+ .video_stype = 0x4,
+ .frame_size = 240000, /* SMPTE-314M - 525/60 (NTSC) 50 Mbps */
+ .difseg_size = 10, /* also known as "DVCPRO50" */
+ .n_difchan = 2,
+ .time_base = { 1001, 30000 },
+ .ltc_divisor = 30,
+ .height = 480,
+ .width = 720,
+ .sar = {{10, 11}, {40, 33}},
+ .work_chunks = &work_chunks_dv50ntsc[0],
+ .idct_factor = &dv_idct_factor_sd[0],
+ .pix_fmt = PIX_FMT_YUV422P,
+ .bpm = 6,
+ .block_sizes = block_sizes_dv2550,
+ .audio_stride = 90,
+ .audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */
+ .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
+ .audio_shuffle = dv_audio_shuffle525,
+ },
+ { .dsf = 1,
+ .video_stype = 0x4,
+ .frame_size = 288000, /* SMPTE-314M - 625/50 (PAL) 50 Mbps */
+ .difseg_size = 12, /* also known as "DVCPRO50" */
+ .n_difchan = 2,
+ .time_base = { 1, 25 },
+ .ltc_divisor = 25,
+ .height = 576,
+ .width = 720,
+ .sar = {{59, 54}, {118, 81}},
+ .work_chunks = &work_chunks_dv50pal[0],
+ .idct_factor = &dv_idct_factor_sd[0],
+ .pix_fmt = PIX_FMT_YUV422P,
+ .bpm = 6,
+ .block_sizes = block_sizes_dv2550,
+ .audio_stride = 108,
+ .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
+ .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
+ .audio_shuffle = dv_audio_shuffle625,
+ },
+ { .dsf = 0,
+ .video_stype = 0x14,
+ .frame_size = 480000, /* SMPTE-370M - 1080i60 100 Mbps */
+ .difseg_size = 10, /* also known as "DVCPRO HD" */
+ .n_difchan = 4,
+ .time_base = { 1001, 30000 },
+ .ltc_divisor = 30,
+ .height = 1080,
+ .width = 1280,
+ .sar = {{1, 1}, {3, 2}},
+ .work_chunks = &work_chunks_dv100ntsci[0],
+ .idct_factor = &dv_idct_factor_hd1080[0],
+ .pix_fmt = PIX_FMT_YUV422P,
+ .bpm = 8,
+ .block_sizes = block_sizes_dv100,
+ .audio_stride = 90,
+ .audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */
+ .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
+ .audio_shuffle = dv_audio_shuffle525,
+ },
+ { .dsf = 1,
+ .video_stype = 0x14,
+ .frame_size = 576000, /* SMPTE-370M - 1080i50 100 Mbps */
+ .difseg_size = 12, /* also known as "DVCPRO HD" */
+ .n_difchan = 4,
+ .time_base = { 1, 25 },
+ .ltc_divisor = 25,
+ .height = 1080,
+ .width = 1440,
+ .sar = {{1, 1}, {4, 3}},
+ .work_chunks = &work_chunks_dv100pali[0],
+ .idct_factor = &dv_idct_factor_hd1080[0],
+ .pix_fmt = PIX_FMT_YUV422P,
+ .bpm = 8,
+ .block_sizes = block_sizes_dv100,
+ .audio_stride = 108,
+ .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
+ .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
+ .audio_shuffle = dv_audio_shuffle625,
+ },
+ { .dsf = 0,
+ .video_stype = 0x18,
+ .frame_size = 240000, /* SMPTE-370M - 720p60 100 Mbps */
+ .difseg_size = 10, /* also known as "DVCPRO HD" */
+ .n_difchan = 2,
+ .time_base = { 1001, 60000 },
+ .ltc_divisor = 60,
+ .height = 720,
+ .width = 960,
+ .sar = {{1, 1}, {4, 3}},
+ .work_chunks = &work_chunks_dv100ntscp[0],
+ .idct_factor = &dv_idct_factor_hd720[0],
+ .pix_fmt = PIX_FMT_YUV422P,
+ .bpm = 8,
+ .block_sizes = block_sizes_dv100,
+ .audio_stride = 90,
+ .audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */
+ .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
+ .audio_shuffle = dv_audio_shuffle525,
+ },
+ { .dsf = 1,
+ .video_stype = 0x18,
+ .frame_size = 288000, /* SMPTE-370M - 720p50 100 Mbps */
+ .difseg_size = 12, /* also known as "DVCPRO HD" */
+ .n_difchan = 2,
+ .time_base = { 1, 50 },
+ .ltc_divisor = 50,
+ .height = 720,
+ .width = 960,
+ .sar = {{1, 1}, {4, 3}},
+ .work_chunks = &work_chunks_dv100palp[0],
+ .idct_factor = &dv_idct_factor_hd720[0],
+ .pix_fmt = PIX_FMT_YUV422P,
+ .bpm = 8,
+ .block_sizes = block_sizes_dv100,
+ .audio_stride = 90,
+ .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
+ .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
+ .audio_shuffle = dv_audio_shuffle625,
+ },
+ { .dsf = 1,
+ .video_stype = 0x1,
+ .frame_size = 144000, /* IEC 61883-5 - 625/50 (PAL) */
+ .difseg_size = 12,
+ .n_difchan = 1,
+ .time_base = { 1, 25 },
+ .ltc_divisor = 25,
+ .height = 576,
+ .width = 720,
+ .sar = {{59, 54}, {118, 81}},
+ .work_chunks = &work_chunks_dv25pal[0],
+ .idct_factor = &dv_idct_factor_sd[0],
+ .pix_fmt = PIX_FMT_YUV420P,
+ .bpm = 6,
+ .block_sizes = block_sizes_dv2550,
+ .audio_stride = 108,
+ .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
+ .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
+ .audio_shuffle = dv_audio_shuffle625,
+ }
+};
+
+const DVprofile* ff_dv_frame_profile(const DVprofile *sys,
+ const uint8_t* frame, unsigned buf_size)
+{
+ int i;
+
+ int dsf = (frame[3] & 0x80) >> 7;
+
+ int stype = frame[80*5 + 48 + 3] & 0x1f;
+
+ /* 576i50 25Mbps 4:1:1 is a special case */
+ if (dsf == 1 && stype == 0 && frame[5] & 0x07) {
+ return &dv_profiles[2];
+ }
+
+ for (i=0; i<FF_ARRAY_ELEMS(dv_profiles); i++)
+ if (dsf == dv_profiles[i].dsf && stype == dv_profiles[i].video_stype)
+ return &dv_profiles[i];
+
+ /* check if old sys matches and assumes corrupted input */
+ if (sys && buf_size == sys->frame_size)
+ return sys;
+
+ return NULL;
+}
+
+const DVprofile* ff_dv_codec_profile(AVCodecContext* codec)
+{
+ int i;
+
+ for (i=0; i<FF_ARRAY_ELEMS(dv_profiles); i++)
+ if (codec->height == dv_profiles[i].height &&
+ codec->pix_fmt == dv_profiles[i].pix_fmt &&
+ codec->width == dv_profiles[i].width)
+ return &dv_profiles[i];
+
+ return NULL;
+}
+
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dvdata.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dvdata.h
index 9202ed2c7f..f0103590ef 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dvdata.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dvdata.h
@@ -460,223 +460,6 @@ static const uint8_t block_sizes_dv100[8] = {
80, 80, 80, 80, 80, 80, 64, 64,
};
-static DVwork_chunk work_chunks_dv25pal [1*12*27];
-static DVwork_chunk work_chunks_dv25pal411[1*12*27];
-static DVwork_chunk work_chunks_dv25ntsc [1*10*27];
-static DVwork_chunk work_chunks_dv50pal [2*12*27];
-static DVwork_chunk work_chunks_dv50ntsc [2*10*27];
-static DVwork_chunk work_chunks_dv100palp [2*12*27];
-static DVwork_chunk work_chunks_dv100ntscp[2*10*27];
-static DVwork_chunk work_chunks_dv100pali [4*12*27];
-static DVwork_chunk work_chunks_dv100ntsci[4*10*27];
-
-static uint32_t dv_idct_factor_sd [2*2*22*64];
-static uint32_t dv_idct_factor_hd1080[2*4*16*64];
-static uint32_t dv_idct_factor_hd720 [2*4*16*64];
-
-static const DVprofile dv_profiles[] = {
- { .dsf = 0,
- .video_stype = 0x0,
- .frame_size = 120000, /* IEC 61834, SMPTE-314M - 525/60 (NTSC) */
- .difseg_size = 10,
- .n_difchan = 1,
- .time_base = { 1001, 30000 },
- .ltc_divisor = 30,
- .height = 480,
- .width = 720,
- .sar = {{10, 11}, {40, 33}},
- .work_chunks = &work_chunks_dv25ntsc[0],
- .idct_factor = &dv_idct_factor_sd[0],
- .pix_fmt = PIX_FMT_YUV411P,
- .bpm = 6,
- .block_sizes = block_sizes_dv2550,
- .audio_stride = 90,
- .audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */
- .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
- .audio_shuffle = dv_audio_shuffle525,
- },
- { .dsf = 1,
- .video_stype = 0x0,
- .frame_size = 144000, /* IEC 61834 - 625/50 (PAL) */
- .difseg_size = 12,
- .n_difchan = 1,
- .time_base = { 1, 25 },
- .ltc_divisor = 25,
- .height = 576,
- .width = 720,
- .sar = {{59, 54}, {118, 81}},
- .work_chunks = &work_chunks_dv25pal[0],
- .idct_factor = &dv_idct_factor_sd[0],
- .pix_fmt = PIX_FMT_YUV420P,
- .bpm = 6,
- .block_sizes = block_sizes_dv2550,
- .audio_stride = 108,
- .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
- .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
- .audio_shuffle = dv_audio_shuffle625,
- },
- { .dsf = 1,
- .video_stype = 0x0,
- .frame_size = 144000, /* SMPTE-314M - 625/50 (PAL) */
- .difseg_size = 12,
- .n_difchan = 1,
- .time_base = { 1, 25 },
- .ltc_divisor = 25,
- .height = 576,
- .width = 720,
- .sar = {{59, 54}, {118, 81}},
- .work_chunks = &work_chunks_dv25pal411[0],
- .idct_factor = &dv_idct_factor_sd[0],
- .pix_fmt = PIX_FMT_YUV411P,
- .bpm = 6,
- .block_sizes = block_sizes_dv2550,
- .audio_stride = 108,
- .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
- .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
- .audio_shuffle = dv_audio_shuffle625,
- },
- { .dsf = 0,
- .video_stype = 0x4,
- .frame_size = 240000, /* SMPTE-314M - 525/60 (NTSC) 50 Mbps */
- .difseg_size = 10, /* also known as "DVCPRO50" */
- .n_difchan = 2,
- .time_base = { 1001, 30000 },
- .ltc_divisor = 30,
- .height = 480,
- .width = 720,
- .sar = {{10, 11}, {40, 33}},
- .work_chunks = &work_chunks_dv50ntsc[0],
- .idct_factor = &dv_idct_factor_sd[0],
- .pix_fmt = PIX_FMT_YUV422P,
- .bpm = 6,
- .block_sizes = block_sizes_dv2550,
- .audio_stride = 90,
- .audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */
- .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
- .audio_shuffle = dv_audio_shuffle525,
- },
- { .dsf = 1,
- .video_stype = 0x4,
- .frame_size = 288000, /* SMPTE-314M - 625/50 (PAL) 50 Mbps */
- .difseg_size = 12, /* also known as "DVCPRO50" */
- .n_difchan = 2,
- .time_base = { 1, 25 },
- .ltc_divisor = 25,
- .height = 576,
- .width = 720,
- .sar = {{59, 54}, {118, 81}},
- .work_chunks = &work_chunks_dv50pal[0],
- .idct_factor = &dv_idct_factor_sd[0],
- .pix_fmt = PIX_FMT_YUV422P,
- .bpm = 6,
- .block_sizes = block_sizes_dv2550,
- .audio_stride = 108,
- .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
- .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
- .audio_shuffle = dv_audio_shuffle625,
- },
- { .dsf = 0,
- .video_stype = 0x14,
- .frame_size = 480000, /* SMPTE-370M - 1080i60 100 Mbps */
- .difseg_size = 10, /* also known as "DVCPRO HD" */
- .n_difchan = 4,
- .time_base = { 1001, 30000 },
- .ltc_divisor = 30,
- .height = 1080,
- .width = 1280,
- .sar = {{1, 1}, {1, 1}},
- .work_chunks = &work_chunks_dv100ntsci[0],
- .idct_factor = &dv_idct_factor_hd1080[0],
- .pix_fmt = PIX_FMT_YUV422P,
- .bpm = 8,
- .block_sizes = block_sizes_dv100,
- .audio_stride = 90,
- .audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */
- .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
- .audio_shuffle = dv_audio_shuffle525,
- },
- { .dsf = 1,
- .video_stype = 0x14,
- .frame_size = 576000, /* SMPTE-370M - 1080i50 100 Mbps */
- .difseg_size = 12, /* also known as "DVCPRO HD" */
- .n_difchan = 4,
- .time_base = { 1, 25 },
- .ltc_divisor = 25,
- .height = 1080,
- .width = 1440,
- .sar = {{1, 1}, {1, 1}},
- .work_chunks = &work_chunks_dv100pali[0],
- .idct_factor = &dv_idct_factor_hd1080[0],
- .pix_fmt = PIX_FMT_YUV422P,
- .bpm = 8,
- .block_sizes = block_sizes_dv100,
- .audio_stride = 108,
- .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
- .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
- .audio_shuffle = dv_audio_shuffle625,
- },
- { .dsf = 0,
- .video_stype = 0x18,
- .frame_size = 240000, /* SMPTE-370M - 720p60 100 Mbps */
- .difseg_size = 10, /* also known as "DVCPRO HD" */
- .n_difchan = 2,
- .time_base = { 1001, 60000 },
- .ltc_divisor = 60,
- .height = 720,
- .width = 960,
- .sar = {{1, 1}, {1, 1}},
- .work_chunks = &work_chunks_dv100ntscp[0],
- .idct_factor = &dv_idct_factor_hd720[0],
- .pix_fmt = PIX_FMT_YUV422P,
- .bpm = 8,
- .block_sizes = block_sizes_dv100,
- .audio_stride = 90,
- .audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */
- .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
- .audio_shuffle = dv_audio_shuffle525,
- },
- { .dsf = 1,
- .video_stype = 0x18,
- .frame_size = 288000, /* SMPTE-370M - 720p50 100 Mbps */
- .difseg_size = 12, /* also known as "DVCPRO HD" */
- .n_difchan = 2,
- .time_base = { 1, 50 },
- .ltc_divisor = 50,
- .height = 720,
- .width = 960,
- .sar = {{1, 1}, {1, 1}},
- .work_chunks = &work_chunks_dv100palp[0],
- .idct_factor = &dv_idct_factor_hd720[0],
- .pix_fmt = PIX_FMT_YUV422P,
- .bpm = 8,
- .block_sizes = block_sizes_dv100,
- .audio_stride = 90,
- .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
- .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
- .audio_shuffle = dv_audio_shuffle625,
- },
- { .dsf = 1,
- .video_stype = 0x1,
- .frame_size = 144000, /* IEC 61883-5 - 625/50 (PAL) */
- .difseg_size = 12,
- .n_difchan = 1,
- .time_base = { 1, 25 },
- .ltc_divisor = 25,
- .height = 576,
- .width = 720,
- .sar = {{59, 54}, {118, 81}},
- .work_chunks = &work_chunks_dv25pal[0],
- .idct_factor = &dv_idct_factor_sd[0],
- .pix_fmt = PIX_FMT_YUV420P,
- .bpm = 6,
- .block_sizes = block_sizes_dv2550,
- .audio_stride = 108,
- .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
- .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
- .audio_shuffle = dv_audio_shuffle625,
- }
-};
-
enum dv_section_type {
dv_sect_header = 0x1f,
dv_sect_subcode = 0x3f,
@@ -718,44 +501,9 @@ enum dv_pack_type {
*/
#define DV_MAX_BPM 8
-static inline
-const DVprofile* dv_frame_profile(const DVprofile *sys,
- const uint8_t* frame, unsigned buf_size)
-{
- int i;
-
- int dsf = (frame[3] & 0x80) >> 7;
-
- int stype = frame[80*5 + 48 + 3] & 0x1f;
-
- /* 576i50 25Mbps 4:1:1 is a special case */
- if (dsf == 1 && stype == 0 && frame[5] & 0x07) {
- return &dv_profiles[2];
- }
-
- for (i=0; i<FF_ARRAY_ELEMS(dv_profiles); i++)
- if (dsf == dv_profiles[i].dsf && stype == dv_profiles[i].video_stype)
- return &dv_profiles[i];
-
- /* check if old sys matches and assumes corrupted input */
- if (sys && buf_size == sys->frame_size)
- return sys;
-
- return NULL;
-}
-
-static const DVprofile* dv_codec_profile(AVCodecContext* codec)
-{
- int i;
-
- for (i=0; i<FF_ARRAY_ELEMS(dv_profiles); i++)
- if (codec->height == dv_profiles[i].height &&
- codec->pix_fmt == dv_profiles[i].pix_fmt &&
- codec->width == dv_profiles[i].width)
- return &dv_profiles[i];
-
- return NULL;
-}
+const DVprofile* ff_dv_frame_profile(const DVprofile *sys,
+ const uint8_t* frame, unsigned buf_size);
+const DVprofile* ff_dv_codec_profile(AVCodecContext* codec);
static inline int dv_write_dif_id(enum dv_section_type t, uint8_t chan_num,
uint8_t seq_num, uint8_t dif_num,
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxa.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxa.c
index 69aed3c89e..c06ab85cc7 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxa.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxa.c
@@ -295,10 +295,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
c->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8;
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return -1;
- }
-
c->dsize = avctx->width * avctx->height * 2;
if((c->decomp_buf = av_malloc(c->dsize)) == NULL) {
av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/error_resilience.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/error_resilience.c
index a5cf9ad8a8..8c6ac9d8a3 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/error_resilience.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/error_resilience.c
@@ -33,8 +33,8 @@
static void decode_mb(MpegEncContext *s){
s->dest[0] = s->current_picture.data[0] + (s->mb_y * 16* s->linesize ) + s->mb_x * 16;
- s->dest[1] = s->current_picture.data[1] + (s->mb_y * 8 * s->uvlinesize) + s->mb_x * 8;
- s->dest[2] = s->current_picture.data[2] + (s->mb_y * 8 * s->uvlinesize) + s->mb_x * 8;
+ s->dest[1] = s->current_picture.data[1] + (s->mb_y * (16>>s->chroma_y_shift) * s->uvlinesize) + s->mb_x * (16>>s->chroma_x_shift);
+ s->dest[2] = s->current_picture.data[2] + (s->mb_y * (16>>s->chroma_y_shift) * s->uvlinesize) + s->mb_x * (16>>s->chroma_x_shift);
MPV_decode_mb(s, s->block);
}
@@ -685,6 +685,7 @@ void ff_er_frame_end(MpegEncContext *s){
if(!s->error_recognition || s->error_count==0 || s->avctx->lowres ||
s->avctx->hwaccel ||
s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU ||
+ s->picture_structure != PICT_FRAME || // we dont support ER of field pictures yet, though it should not crash if enabled
s->error_count==3*s->mb_width*(s->avctx->skip_top + s->avctx->skip_bottom)) return;
if(s->current_picture.motion_val[0] == NULL){
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/fft.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/fft.c
index c827139faf..b46e72a6d8 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/fft.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/fft.c
@@ -29,20 +29,23 @@
#include "dsputil.h"
/* cos(2*pi*x/n) for 0<=x<=n/4, followed by its reverse */
-DECLARE_ALIGNED_16(FFTSample, ff_cos_16[8]);
-DECLARE_ALIGNED_16(FFTSample, ff_cos_32[16]);
-DECLARE_ALIGNED_16(FFTSample, ff_cos_64[32]);
-DECLARE_ALIGNED_16(FFTSample, ff_cos_128[64]);
-DECLARE_ALIGNED_16(FFTSample, ff_cos_256[128]);
-DECLARE_ALIGNED_16(FFTSample, ff_cos_512[256]);
-DECLARE_ALIGNED_16(FFTSample, ff_cos_1024[512]);
-DECLARE_ALIGNED_16(FFTSample, ff_cos_2048[1024]);
-DECLARE_ALIGNED_16(FFTSample, ff_cos_4096[2048]);
-DECLARE_ALIGNED_16(FFTSample, ff_cos_8192[4096]);
-DECLARE_ALIGNED_16(FFTSample, ff_cos_16384[8192]);
-DECLARE_ALIGNED_16(FFTSample, ff_cos_32768[16384]);
-DECLARE_ALIGNED_16(FFTSample, ff_cos_65536[32768]);
-FFTSample * const ff_cos_tabs[] = {
+#if !CONFIG_HARDCODED_TABLES
+COSTABLE(16);
+COSTABLE(32);
+COSTABLE(64);
+COSTABLE(128);
+COSTABLE(256);
+COSTABLE(512);
+COSTABLE(1024);
+COSTABLE(2048);
+COSTABLE(4096);
+COSTABLE(8192);
+COSTABLE(16384);
+COSTABLE(32768);
+COSTABLE(65536);
+#endif
+COSTABLE_CONST FFTSample * const ff_cos_tabs[] = {
+ NULL, NULL, NULL, NULL,
ff_cos_16, ff_cos_32, ff_cos_64, ff_cos_128, ff_cos_256, ff_cos_512, ff_cos_1024,
ff_cos_2048, ff_cos_4096, ff_cos_8192, ff_cos_16384, ff_cos_32768, ff_cos_65536,
};
@@ -58,6 +61,20 @@ static int split_radix_permutation(int i, int n, int inverse)
else return split_radix_permutation(i, m, inverse)*4 - 1;
}
+av_cold void ff_init_ff_cos_tabs(int index)
+{
+#if !CONFIG_HARDCODED_TABLES
+ int i;
+ int m = 1<<index;
+ double freq = 2*M_PI/m;
+ FFTSample *tab = ff_cos_tabs[index];
+ for(i=0; i<=m/4; i++)
+ tab[i] = cos(i*freq);
+ for(i=1; i<m/4; i++)
+ tab[m/2-i] = tab[i];
+#endif
+}
+
av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse)
{
int i, j, m, n;
@@ -94,13 +111,7 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse)
if (s->split_radix) {
for(j=4; j<=nbits; j++) {
- int m = 1<<j;
- double freq = 2*M_PI/m;
- FFTSample *tab = ff_cos_tabs[j-4];
- for(i=0; i<=m/4; i++)
- tab[i] = cos(i*freq);
- for(i=1; i<m/4; i++)
- tab[m/2-i] = tab[i];
+ ff_init_ff_cos_tabs(j);
}
for(i=0; i<n; i++)
s->revtab[-split_radix_permutation(i, n, s->inverse) & (n-1)] = i;
@@ -340,7 +351,7 @@ DECL_FFT(16384,8192,4096)
DECL_FFT(32768,16384,8192)
DECL_FFT(65536,32768,16384)
-static void (*fft_dispatch[])(FFTComplex*) = {
+static void (* const fft_dispatch[])(FFTComplex*) = {
fft4, fft8, fft16, fft32, fft64, fft128, fft256, fft512, fft1024,
fft2048, fft4096, fft8192, fft16384, fft32768, fft65536,
};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flacdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flacdec.c
index 781b4fadf1..0ebc23d6cf 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flacdec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flacdec.c
@@ -125,6 +125,10 @@ static av_cold int flac_decode_init(AVCodecContext *avctx)
/* initialize based on the demuxer-supplied streamdata header */
ff_flac_parse_streaminfo(avctx, (FLACStreaminfo *)s, streaminfo);
+ if (s->bps > 16)
+ avctx->sample_fmt = SAMPLE_FMT_S32;
+ else
+ avctx->sample_fmt = SAMPLE_FMT_S16;
allocate_buffers(s);
s->got_streaminfo = 1;
@@ -186,10 +190,6 @@ void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
avctx->channels = s->channels;
avctx->sample_rate = s->samplerate;
avctx->bits_per_raw_sample = s->bps;
- if (s->bps > 16)
- avctx->sample_fmt = SAMPLE_FMT_S32;
- else
- avctx->sample_fmt = SAMPLE_FMT_S16;
s->samples = get_bits_long(&gb, 32) << 4;
s->samples |= get_bits(&gb, 4);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flacenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flacenc.c
index 81a35a0d54..c1f862a684 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flacenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flacenc.c
@@ -552,69 +552,6 @@ static uint32_t calc_rice_params_lpc(RiceContext *rc, int pmin, int pmax,
return bits;
}
-/**
- * Apply Welch window function to audio block
- */
-static void apply_welch_window(const int32_t *data, int len, double *w_data)
-{
- int i, n2;
- double w;
- double c;
-
- assert(!(len&1)); //the optimization in r11881 does not support odd len
- //if someone wants odd len extend the change in r11881
-
- n2 = (len >> 1);
- c = 2.0 / (len - 1.0);
-
- w_data+=n2;
- data+=n2;
- for(i=0; i<n2; i++) {
- w = c - n2 + i;
- w = 1.0 - (w * w);
- w_data[-i-1] = data[-i-1] * w;
- w_data[+i ] = data[+i ] * w;
- }
-}
-
-/**
- * Calculates autocorrelation data from audio samples
- * A Welch window function is applied before calculation.
- */
-void ff_flac_compute_autocorr(const int32_t *data, int len, int lag,
- double *autoc)
-{
- int i, j;
- double tmp[len + lag + 1];
- double *data1= tmp + lag;
-
- apply_welch_window(data, len, data1);
-
- for(j=0; j<lag; j++)
- data1[j-lag]= 0.0;
- data1[len] = 0.0;
-
- for(j=0; j<lag; j+=2){
- double sum0 = 1.0, sum1 = 1.0;
- for(i=j; i<len; i++){
- sum0 += data1[i] * data1[i-j];
- sum1 += data1[i] * data1[i-j-1];
- }
- autoc[j ] = sum0;
- autoc[j+1] = sum1;
- }
-
- if(j==lag){
- double sum = 1.0;
- for(i=j-1; i<len; i+=2){
- sum += data1[i ] * data1[i-j ]
- + data1[i+1] * data1[i-j+1];
- }
- autoc[j] = sum;
- }
-}
-
-
static void encode_residual_verbatim(int32_t *res, int32_t *smp, int n)
{
assert(n > 0);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flashsvenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flashsvenc.c
index 3512b02698..4d2b47979f 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flashsvenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flashsvenc.c
@@ -108,10 +108,6 @@ static av_cold int flashsv_encode_init(AVCodecContext *avctx)
return -1;
}
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return -1;
- }
-
// Needed if zlib unused or init aborted before deflateInit
memset(&(s->zstream), 0, sizeof(z_stream));
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/frwu.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/frwu.c
new file mode 100644
index 0000000000..28ed612df0
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/frwu.c
@@ -0,0 +1,123 @@
+/*
+ * Forward Uncompressed
+ *
+ * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avcodec.h"
+#include "bytestream.h"
+#include "libavutil/intreadwrite.h"
+
+static av_cold int decode_init(AVCodecContext *avctx)
+{
+ if (avctx->width & 1) {
+ av_log(avctx, AV_LOG_ERROR, "FRWU needs even width\n");
+ return -1;
+ }
+ avctx->pix_fmt = PIX_FMT_UYVY422;
+
+ avctx->coded_frame = avcodec_alloc_frame();
+
+ return 0;
+}
+
+static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
+ AVPacket *avpkt)
+{
+ int field;
+ AVFrame *pic = avctx->coded_frame;
+ const uint8_t *buf = avpkt->data;
+ const uint8_t *buf_end = buf + avpkt->size;
+
+ if (pic->data[0])
+ avctx->release_buffer(avctx, pic);
+
+ if (avpkt->size < avctx->width * 2 * avctx->height + 4 + 2*8) {
+ av_log(avctx, AV_LOG_ERROR, "Packet is too small.\n");
+ return -1;
+ }
+ if (bytestream_get_le32(&buf) != AV_RL32("FRW1")) {
+ av_log(avctx, AV_LOG_ERROR, "incorrect marker\n");
+ return -1;
+ }
+
+ pic->reference = 0;
+ if (avctx->get_buffer(avctx, pic) < 0)
+ return -1;
+
+ pic->pict_type = FF_I_TYPE;
+ pic->key_frame = 1;
+ pic->interlaced_frame = 1;
+ pic->top_field_first = 1;
+
+ for (field = 0; field < 2; field++) {
+ int i;
+ int field_h = (avctx->height + !field) >> 1;
+ int field_size, min_field_size = avctx->width * 2 * field_h;
+ uint8_t *dst = pic->data[0];
+ if (buf_end - buf < 8)
+ return -1;
+ buf += 4; // flags? 0x80 == bottom field maybe?
+ field_size = bytestream_get_le32(&buf);
+ if (field_size < min_field_size) {
+ av_log(avctx, AV_LOG_ERROR, "Field size %i is too small (required %i)\n", field_size, min_field_size);
+ return -1;
+ }
+ if (buf_end - buf < field_size) {
+ av_log(avctx, AV_LOG_ERROR, "Packet is too small, need %i, have %i\n", field_size, (int)(buf_end - buf));
+ return -1;
+ }
+ if (field)
+ dst += pic->linesize[0];
+ for (i = 0; i < field_h; i++) {
+ memcpy(dst, buf, avctx->width * 2);
+ buf += avctx->width * 2;
+ dst += pic->linesize[0] << 1;
+ }
+ buf += field_size - min_field_size;
+ }
+
+ *data_size = sizeof(AVFrame);
+ *(AVFrame*)data = *pic;
+
+ return avpkt->size;
+}
+
+static av_cold int decode_close(AVCodecContext *avctx)
+{
+ AVFrame *pic = avctx->coded_frame;
+ if (pic->data[0])
+ avctx->release_buffer(avctx, pic);
+ av_freep(&avctx->coded_frame);
+
+ return 0;
+}
+
+AVCodec frwu_decoder = {
+ "FRWU",
+ CODEC_TYPE_VIDEO,
+ CODEC_ID_FRWU,
+ 0,
+ decode_init,
+ NULL,
+ decode_close,
+ decode_frame,
+ CODEC_CAP_DR1,
+ .long_name = NULL_IF_CONFIG_SMALL("Forward Uncompressed"),
+};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/get_bits.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/get_bits.h
index 0a3ffae25f..1863e7de4a 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/get_bits.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/get_bits.h
@@ -49,8 +49,6 @@
# endif
#endif
-extern const uint8_t ff_reverse[256];
-
#if ARCH_X86
// avoid +32 for shift optimization (gcc should do that ...)
static inline int32_t NEG_SSR32( int32_t a, int8_t s){
@@ -704,4 +702,9 @@ static inline int decode210(GetBitContext *gb){
return 2 - get_bits1(gb);
}
+static inline int get_bits_left(GetBitContext *gb)
+{
+ return gb->size_in_bits - get_bits_count(gb);
+}
+
#endif /* AVCODEC_GET_BITS_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/gif.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/gif.c
index c3ec3a9838..8c7f72ba80 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/gif.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/gif.c
@@ -43,6 +43,7 @@
#include "avcodec.h"
#include "bytestream.h"
+#include "lzw.h"
/* The GIF format uses reversed order for bitstreams... */
/* at least they don't use PDP_ENDIAN :) */
@@ -50,21 +51,23 @@
#include "put_bits.h"
-/* bitstream minipacket size */
-#define GIF_CHUNKS 100
+typedef struct {
+ AVFrame picture;
+ LZWState *lzw;
+ uint8_t *buf;
+} GIFContext;
/* GIF header */
-static int gif_image_write_header(uint8_t **bytestream,
- int width, int height,
- uint32_t *palette)
+static int gif_image_write_header(AVCodecContext *avctx,
+ uint8_t **bytestream, uint32_t *palette)
{
int i;
unsigned int v;
bytestream_put_buffer(bytestream, "GIF", 3);
bytestream_put_buffer(bytestream, "89a", 3);
- bytestream_put_le16(bytestream, width);
- bytestream_put_le16(bytestream, height);
+ bytestream_put_le16(bytestream, avctx->width);
+ bytestream_put_le16(bytestream, avctx->height);
bytestream_put_byte(bytestream, 0xf7); /* flags: global clut, 256 entries */
bytestream_put_byte(bytestream, 0x1f); /* background color index */
@@ -79,74 +82,61 @@ static int gif_image_write_header(uint8_t **bytestream,
return 0;
}
-static int gif_image_write_image(uint8_t **bytestream,
- int x1, int y1, int width, int height,
- const uint8_t *buf, int linesize, int pix_fmt)
+static int gif_image_write_image(AVCodecContext *avctx,
+ uint8_t **bytestream, uint8_t *end,
+ const uint8_t *buf, int linesize)
{
- PutBitContext p;
- uint8_t buffer[200]; /* 100 * 9 / 8 = 113 */
- int i, left, w;
+ GIFContext *s = avctx->priv_data;
+ int len, height;
const uint8_t *ptr;
/* image block */
bytestream_put_byte(bytestream, 0x2c);
- bytestream_put_le16(bytestream, x1);
- bytestream_put_le16(bytestream, y1);
- bytestream_put_le16(bytestream, width);
- bytestream_put_le16(bytestream, height);
+ bytestream_put_le16(bytestream, 0);
+ bytestream_put_le16(bytestream, 0);
+ bytestream_put_le16(bytestream, avctx->width);
+ bytestream_put_le16(bytestream, avctx->height);
bytestream_put_byte(bytestream, 0x00); /* flags */
/* no local clut */
bytestream_put_byte(bytestream, 0x08);
- left= width * height;
-
- init_put_bits(&p, buffer, 130);
+ ff_lzw_encode_init(s->lzw, s->buf, avctx->width*avctx->height,
+ 12, FF_LZW_GIF, put_bits);
-/*
- * the thing here is the bitstream is written as little packets, with a size byte before
- * but it's still the same bitstream between packets (no flush !)
- */
ptr = buf;
- w = width;
- while(left>0) {
-
- put_bits(&p, 9, 0x0100); /* clear code */
-
- for(i=(left<GIF_CHUNKS)?left:GIF_CHUNKS;i;i--) {
- put_bits(&p, 9, *ptr++);
- if (--w == 0) {
- w = width;
- buf += linesize;
- ptr = buf;
- }
- }
-
- if(left<=GIF_CHUNKS) {
- put_bits(&p, 9, 0x101); /* end of stream */
- flush_put_bits(&p);
- }
- if(put_bits_ptr(&p) - p.buf > 0) {
- bytestream_put_byte(bytestream, put_bits_ptr(&p) - p.buf); /* byte count of the packet */
- bytestream_put_buffer(bytestream, p.buf, put_bits_ptr(&p) - p.buf); /* the actual buffer */
- p.buf_ptr = p.buf; /* dequeue the bytes off the bitstream */
- }
- left-=GIF_CHUNKS;
+ for (height = avctx->height; height--;) {
+ len += ff_lzw_encode(s->lzw, ptr, avctx->width);
+ ptr += linesize;
+ }
+ len += ff_lzw_encode_flush(s->lzw, flush_put_bits);
+
+ ptr = s->buf;
+ while (len > 0) {
+ int size = FFMIN(255, len);
+ bytestream_put_byte(bytestream, size);
+ if (end - *bytestream < size)
+ return -1;
+ bytestream_put_buffer(bytestream, ptr, size);
+ ptr += size;
+ len -= size;
}
bytestream_put_byte(bytestream, 0x00); /* end of image block */
bytestream_put_byte(bytestream, 0x3b);
return 0;
}
-typedef struct {
- AVFrame picture;
-} GIFContext;
-
static av_cold int gif_encode_init(AVCodecContext *avctx)
{
GIFContext *s = avctx->priv_data;
avctx->coded_frame = &s->picture;
+ s->lzw = av_mallocz(ff_lzw_encode_state_size);
+ if (!s->lzw)
+ return AVERROR_NOMEM;
+ s->buf = av_malloc(avctx->width*avctx->height*2);
+ if (!s->buf)
+ return AVERROR_NOMEM;
return 0;
}
@@ -157,15 +147,25 @@ static int gif_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int bu
AVFrame *pict = data;
AVFrame *const p = (AVFrame *)&s->picture;
uint8_t *outbuf_ptr = outbuf;
+ uint8_t *end = outbuf + buf_size;
*p = *pict;
p->pict_type = FF_I_TYPE;
p->key_frame = 1;
- gif_image_write_header(&outbuf_ptr, avctx->width, avctx->height, (uint32_t *)pict->data[1]);
- gif_image_write_image(&outbuf_ptr, 0, 0, avctx->width, avctx->height, pict->data[0], pict->linesize[0], PIX_FMT_PAL8);
+ gif_image_write_header(avctx, &outbuf_ptr, (uint32_t *)pict->data[1]);
+ gif_image_write_image(avctx, &outbuf_ptr, end, pict->data[0], pict->linesize[0]);
return outbuf_ptr - outbuf;
}
+static int gif_encode_close(AVCodecContext *avctx)
+{
+ GIFContext *s = avctx->priv_data;
+
+ av_freep(&s->lzw);
+ av_freep(&s->buf);
+ return 0;
+}
+
AVCodec gif_encoder = {
"gif",
CODEC_TYPE_VIDEO,
@@ -173,7 +173,7 @@ AVCodec gif_encoder = {
sizeof(GIFContext),
gif_encode_init,
gif_encode_frame,
- NULL, //encode_end,
+ gif_encode_close,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_RGB8, PIX_FMT_BGR8, PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE, PIX_FMT_GRAY8, PIX_FMT_PAL8, PIX_FMT_NONE},
.long_name= NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"),
};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h261dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h261dec.c
index d5dcc0b2c4..9c2db71bff 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h261dec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h261dec.c
@@ -170,7 +170,7 @@ static int ff_h261_resync(H261Context *h){
//OK, it is not where it is supposed to be ...
s->gb= s->last_resync_gb;
align_get_bits(&s->gb);
- left= s->gb.size_in_bits - get_bits_count(&s->gb);
+ left= get_bits_left(&s->gb);
for(;left>15+1+4+5; left-=8){
if(show_bits(&s->gb, 15)==0){
@@ -444,7 +444,7 @@ static int h261_decode_picture_header(H261Context *h){
int format, i;
uint32_t startcode= 0;
- for(i= s->gb.size_in_bits - get_bits_count(&s->gb); i>24; i-=1){
+ for(i= get_bits_left(&s->gb); i>24; i-=1){
startcode = ((startcode << 1) | get_bits(&s->gb, 1)) & 0x000FFFFF;
if(startcode == 0x10)
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h263.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h263.c
index a8c03339e6..de76792139 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h263.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h263.c
@@ -504,20 +504,6 @@ static inline void restore_ac_coeffs(MpegEncContext * s, DCTELEM block[6][64], i
}
/**
- * init s->current_picture.qscale_table from s->lambda_table
- */
-static void ff_init_qscale_tab(MpegEncContext *s){
- int8_t * const qscale_table= s->current_picture.qscale_table;
- int i;
-
- for(i=0; i<s->mb_num; i++){
- unsigned int lam= s->lambda_table[ s->mb_index2xy[i] ];
- int qp= (lam*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7);
- qscale_table[ s->mb_index2xy[i] ]= av_clip(qp, s->avctx->qmin, s->avctx->qmax);
- }
-}
-
-/**
* modify qscale so that encoding is acually possible in h263 (limit difference to -2..2)
*/
void ff_clean_h263_qscales(MpegEncContext *s){
@@ -2994,7 +2980,7 @@ static int h263_decode_gob_header(MpegEncContext *s)
/* We have a GBSC probably with GSTUFF */
skip_bits(&s->gb, 16); /* Drop the zeros */
- left= s->gb.size_in_bits - get_bits_count(&s->gb);
+ left= get_bits_left(&s->gb);
//MN: we must check the bits left or we might end in a infinite loop (or segfault)
for(;left>13; left--){
if(get_bits1(&s->gb)) break; /* Seek the '1' bit */
@@ -3329,7 +3315,7 @@ int ff_h263_resync(MpegEncContext *s){
//OK, it's not where it is supposed to be ...
s->gb= s->last_resync_gb;
align_get_bits(&s->gb);
- left= s->gb.size_in_bits - get_bits_count(&s->gb);
+ left= get_bits_left(&s->gb);
for(;left>16+1+5+5; left-=8){
if(show_bits(&s->gb, 16)==0){
@@ -3774,7 +3760,7 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM block[6][64])
/* per-MB end of slice check */
if(--s->mb_num_left <= 0){
-//printf("%06X %d\n", show_bits(&s->gb, 24), s->gb.size_in_bits - get_bits_count(&s->gb));
+//printf("%06X %d\n", show_bits(&s->gb, 24), get_bits_left(&s->gb));
if(mpeg4_is_resync(s))
return SLICE_END;
else
@@ -5034,7 +5020,7 @@ int h263_decode_picture_header(MpegEncContext *s)
startcode= get_bits(&s->gb, 22-8);
- for(i= s->gb.size_in_bits - get_bits_count(&s->gb); i>24; i-=8) {
+ for(i= get_bits_left(&s->gb); i>24; i-=8) {
startcode = ((startcode << 8) | get_bits(&s->gb, 8)) & 0x003FFFFF;
if(startcode == 0x20)
@@ -5917,7 +5903,11 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
av_log(s->avctx, AV_LOG_ERROR, "hmm, seems the headers are not complete, trying to guess time_increment_bits\n");
for(s->time_increment_bits=1 ;s->time_increment_bits<16; s->time_increment_bits++){
- if(show_bits(gb, s->time_increment_bits+1)&1) break;
+ if ( s->pict_type == FF_P_TYPE
+ || (s->pict_type == FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE)) {
+ if((show_bits(gb, s->time_increment_bits+6)&0x37) == 0x30) break;
+ }else
+ if((show_bits(gb, s->time_increment_bits+5)&0x1F) == 0x18) break;
}
av_log(s->avctx, AV_LOG_ERROR, "my guess is %d bits ;)\n",s->time_increment_bits);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h263dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h263dec.c
index 719d9a43b1..d75904cec4 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h263dec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h263dec.c
@@ -32,6 +32,7 @@
#include "h263_parser.h"
#include "mpeg4video_parser.h"
#include "msmpeg4.h"
+#include "vdpau_internal.h"
//#define DEBUG
//#define PRINT_FRAME_TIME
@@ -267,8 +268,8 @@ static int decode_slice(MpegEncContext *s){
/* try to detect the padding bug */
if( s->codec_id==CODEC_ID_MPEG4
&& (s->workaround_bugs&FF_BUG_AUTODETECT)
- && s->gb.size_in_bits - get_bits_count(&s->gb) >=0
- && s->gb.size_in_bits - get_bits_count(&s->gb) < 48
+ && get_bits_left(&s->gb) >=0
+ && get_bits_left(&s->gb) < 48
// && !s->resync_marker
&& !s->data_partitioning){
@@ -299,7 +300,7 @@ static int decode_slice(MpegEncContext *s){
// handle formats which don't have unique end markers
if(s->msmpeg4_version || (s->workaround_bugs&FF_BUG_NO_PADDING)){ //FIXME perhaps solve this more cleanly
- int left= s->gb.size_in_bits - get_bits_count(&s->gb);
+ int left= get_bits_left(&s->gb);
int max_extra=7;
/* no markers in M$ crap */
@@ -324,7 +325,7 @@ static int decode_slice(MpegEncContext *s){
}
av_log(s->avctx, AV_LOG_ERROR, "slice end not reached but screenspace end (%d left %06X, score= %d)\n",
- s->gb.size_in_bits - get_bits_count(&s->gb),
+ get_bits_left(&s->gb),
show_bits(&s->gb, 24), s->padding_bug_score);
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
@@ -621,6 +622,11 @@ retry:
if(MPV_frame_start(s, avctx) < 0)
return -1;
+ if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)) {
+ ff_vdpau_mpeg4_decode_picture(s, buf, buf_size);
+ goto frame_end;
+ }
+
if (avctx->hwaccel) {
if (avctx->hwaccel->start_frame(avctx, buf, buf_size) < 0)
return -1;
@@ -695,6 +701,7 @@ retry:
intrax8_decoded:
ff_er_frame_end(s);
+frame_end:
if (avctx->hwaccel) {
if (avctx->hwaccel->end_frame(avctx) < 0)
return -1;
@@ -832,6 +839,22 @@ AVCodec flv_decoder = {
ff_h263_decode_end,
ff_h263_decode_frame,
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
- .long_name= NULL_IF_CONFIG_SMALL("Flash Video (FLV)"),
+ .long_name= NULL_IF_CONFIG_SMALL("Flash Video (FLV) / Sorenson Spark / Sorenson H.263"),
.pix_fmts= ff_pixfmt_list_420,
};
+
+#if CONFIG_MPEG4_VDPAU_DECODER
+AVCodec mpeg4_vdpau_decoder = {
+ "mpeg4_vdpau",
+ CODEC_TYPE_VIDEO,
+ CODEC_ID_MPEG4,
+ sizeof(MpegEncContext),
+ ff_h263_decode_init,
+ NULL,
+ ff_h263_decode_end,
+ ff_h263_decode_frame,
+ CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU,
+ .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2 (VDPAU)"),
+ .pix_fmts= (const enum PixelFormat[]){PIX_FMT_VDPAU_MPEG4, PIX_FMT_NONE},
+};
+#endif
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264.c
index e250581fe9..525f125fb4 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264.c
@@ -1999,6 +1999,8 @@ static void free_tables(H264Context *h){
av_freep(&hx->s.obmc_scratchpad);
av_freep(&hx->rbsp_buffer[1]);
av_freep(&hx->rbsp_buffer[0]);
+ hx->rbsp_buffer_size[0] = 0;
+ hx->rbsp_buffer_size[1] = 0;
if (i) av_freep(&h->thread_context[i]);
}
}
@@ -2196,11 +2198,6 @@ static av_cold int decode_init(AVCodecContext *avctx){
if(!avctx->has_b_frames)
s->low_delay= 1;
- if(s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
- avctx->pix_fmt= PIX_FMT_VDPAU_H264;
- else
- avctx->pix_fmt= avctx->get_format(avctx, avctx->codec->pix_fmts);
- avctx->hwaccel = ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt);
avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
decode_init_vlc();
@@ -3851,6 +3848,22 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
if (!s->context_initialized) {
if(h != h0)
return -1; // we cant (re-)initialize context during parallel decoding
+
+ avcodec_set_dimensions(s->avctx, s->width, s->height);
+ s->avctx->sample_aspect_ratio= h->sps.sar;
+ if(!s->avctx->sample_aspect_ratio.den)
+ s->avctx->sample_aspect_ratio.den = 1;
+
+ if(h->sps.timing_info_present_flag){
+ s->avctx->time_base= (AVRational){h->sps.num_units_in_tick, h->sps.time_scale};
+ if(h->x264_build > 0 && h->x264_build < 44)
+ s->avctx->time_base.den *= 2;
+ av_reduce(&s->avctx->time_base.num, &s->avctx->time_base.den,
+ s->avctx->time_base.num, s->avctx->time_base.den, 1<<30);
+ }
+ s->avctx->pix_fmt = s->avctx->get_format(s->avctx, s->avctx->codec->pix_fmts);
+ s->avctx->hwaccel = ff_find_hwaccel(s->avctx->codec->id, s->avctx->pix_fmt);
+
if (MPV_common_init(s) < 0)
return -1;
s->first_field = 0;
@@ -3873,20 +3886,6 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
for(i = 0; i < s->avctx->thread_count; i++)
if(context_init(h->thread_context[i]) < 0)
return -1;
-
- s->avctx->width = s->width;
- s->avctx->height = s->height;
- s->avctx->sample_aspect_ratio= h->sps.sar;
- if(!s->avctx->sample_aspect_ratio.den)
- s->avctx->sample_aspect_ratio.den = 1;
-
- if(h->sps.timing_info_present_flag){
- s->avctx->time_base= (AVRational){h->sps.num_units_in_tick, h->sps.time_scale};
- if(h->x264_build > 0 && h->x264_build < 44)
- s->avctx->time_base.den *= 2;
- av_reduce(&s->avctx->time_base.num, &s->avctx->time_base.den,
- s->avctx->time_base.num, s->avctx->time_base.den, 1<<30);
- }
}
h->frame_num= get_bits(&s->gb, h->sps.log2_max_frame_num);
@@ -6736,7 +6735,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg){
ff_init_cabac_states( &h->cabac);
ff_init_cabac_decoder( &h->cabac,
s->gb.buffer + get_bits_count(&s->gb)/8,
- ( s->gb.size_in_bits - get_bits_count(&s->gb) + 7)/8);
+ (get_bits_left(&s->gb) + 7)/8);
/* calculate pre-state */
for( i= 0; i < 460; i++ ) {
int pre;
@@ -7748,7 +7747,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
next_avc= buf_index + nalsize;
} else {
// start code prefix search
- for(; buf_index + 3 < buf_size; buf_index++){
+ for(; buf_index + 3 < next_avc; buf_index++){
// This should always succeed in the first iteration.
if(buf[buf_index] == 0 && buf[buf_index+1] == 0 && buf[buf_index+2] == 1)
break;
@@ -7757,6 +7756,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
if(buf_index+3 >= buf_size) break;
buf_index+=3;
+ if(buf_index >= next_avc) continue;
}
hx = h->thread_context[context_count];
@@ -7774,11 +7774,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
}
if (h->is_avc && (nalsize != consumed) && nalsize){
- int i, debug_level = AV_LOG_DEBUG;
- for (i = consumed; i < nalsize; i++)
- if (buf[buf_index+i])
- debug_level = AV_LOG_ERROR;
- av_log(h->s.avctx, debug_level, "AVC: Consumed only %d bytes instead of %d\n", consumed, nalsize);
+ av_log(h->s.avctx, AV_LOG_DEBUG, "AVC: Consumed only %d bytes instead of %d\n", consumed, nalsize);
}
buf_index += consumed;
@@ -8021,7 +8017,7 @@ static int decode_frame(AVCodecContext *avctx,
if(!(s->flags2 & CODEC_FLAG2_CHUNKS) || (s->mb_y >= s->mb_height && s->mb_height)){
Picture *out = s->current_picture_ptr;
Picture *cur = s->current_picture_ptr;
- int i, pics, cross_idr, out_of_order, out_idx;
+ int i, pics, out_of_order, out_idx;
field_end(h);
@@ -8125,15 +8121,15 @@ static int decode_frame(AVCodecContext *avctx,
out = h->delayed_pic[i];
out_idx = i;
}
- cross_idr = !!h->delayed_pic[i] || h->delayed_pic[0]->key_frame || h->delayed_pic[0]->mmco_reset;
-
- out_of_order = !cross_idr && out->poc < h->outputed_poc;
+ if(s->avctx->has_b_frames == 0 && (h->delayed_pic[0]->key_frame || h->delayed_pic[0]->mmco_reset))
+ h->outputed_poc= INT_MIN;
+ out_of_order = out->poc < h->outputed_poc;
if(h->sps.bitstream_restriction_flag && s->avctx->has_b_frames >= h->sps.num_reorder_frames)
{ }
else if((out_of_order && pics-1 == s->avctx->has_b_frames && s->avctx->has_b_frames < MAX_DELAYED_PIC_COUNT)
|| (s->low_delay &&
- ((!cross_idr && out->poc > h->outputed_poc + 2)
+ ((h->outputed_poc != INT_MIN && out->poc > h->outputed_poc + 2)
|| cur->pict_type == FF_B_TYPE)))
{
s->low_delay = 0;
@@ -8148,7 +8144,10 @@ static int decode_frame(AVCodecContext *avctx,
if(!out_of_order && pics > s->avctx->has_b_frames){
*data_size = sizeof(AVFrame);
- h->outputed_poc = out->poc;
+ if(out_idx==0 && h->delayed_pic[0] && (h->delayed_pic[0]->key_frame || h->delayed_pic[0]->mmco_reset)) {
+ h->outputed_poc = INT_MIN;
+ } else
+ h->outputed_poc = out->poc;
*pict= *(AVFrame*)out;
}else{
av_log(avctx, AV_LOG_DEBUG, "no picture\n");
@@ -8414,6 +8413,7 @@ AVCodec h264_vdpau_decoder = {
CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU,
.flush= flush_dpb,
.long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)"),
+ .pix_fmts = (const enum PixelFormat[]){PIX_FMT_VDPAU_H264, PIX_FMT_NONE},
};
#endif
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264pred.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264pred.c
index 23db23f09a..74085b929c 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264pred.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264pred.c
@@ -1172,4 +1172,6 @@ void ff_h264_pred_init(H264PredContext *h, int codec_id){
h->pred8x8_add [ HOR_PRED8x8]= pred8x8_horizontal_add_c;
h->pred16x16_add[VERT_PRED8x8]= pred16x16_vertical_add_c;
h->pred16x16_add[ HOR_PRED8x8]= pred16x16_horizontal_add_c;
+
+ if (ARCH_ARM) ff_h264_pred_init_arm(h, codec_id);
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264pred.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264pred.h
index 32e9fb1531..6d00685a68 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264pred.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264pred.h
@@ -84,5 +84,6 @@ typedef struct H264PredContext{
}H264PredContext;
void ff_h264_pred_init(H264PredContext *h, int codec_id);
+void ff_h264_pred_init_arm(H264PredContext *h, int codec_id);
#endif /* AVCODEC_H264PRED_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/huffyuv.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/huffyuv.c
index 32a6c0b296..4fa6ddf7f8 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/huffyuv.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/huffyuv.c
@@ -406,9 +406,7 @@ static av_cold void alloc_temp(HYuvContext *s){
s->temp[i]= av_malloc(s->width + 16);
}
}else{
- for(i=0; i<2; i++){
- s->temp[i]= av_malloc(4*s->width + 16);
- }
+ s->temp[0]= av_malloc(4*s->width + 16);
}
}
@@ -695,7 +693,7 @@ static void decode_422_bitstream(HYuvContext *s, int count){
count/=2;
- if(count >= (s->gb.size_in_bits - get_bits_count(&s->gb))/(31*4)){
+ if(count >= (get_bits_left(&s->gb))/(31*4)){
for(i=0; i<count && get_bits_count(&s->gb) < s->gb.size_in_bits; i++){
READ_2PIX(s->temp[0][2*i ], s->temp[1][i], 1);
READ_2PIX(s->temp[0][2*i+1], s->temp[2][i], 2);
@@ -713,7 +711,7 @@ static void decode_gray_bitstream(HYuvContext *s, int count){
count/=2;
- if(count >= (s->gb.size_in_bits - get_bits_count(&s->gb))/(31*2)){
+ if(count >= (get_bits_left(&s->gb))/(31*2)){
for(i=0; i<count && get_bits_count(&s->gb) < s->gb.size_in_bits; i++){
READ_2PIX(s->temp[0][2*i ], s->temp[0][2*i+1], 0);
}
@@ -942,6 +940,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
if (!s->bitstream_buffer)
return AVERROR(ENOMEM);
+ memset(s->bitstream_buffer + buf_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
s->dsp.bswap_buf((uint32_t*)s->bitstream_buffer, (const uint32_t*)buf, buf_size/4);
if(p->data[0])
@@ -1185,6 +1184,9 @@ static av_cold int decode_end(AVCodecContext *avctx)
HYuvContext *s = avctx->priv_data;
int i;
+ if (s->picture.data[0])
+ avctx->release_buffer(avctx, &s->picture);
+
common_end(s);
av_freep(&s->bitstream_buffer);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/imgconvert.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/imgconvert.c
index 4698fcf82e..5dc7b92ee0 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/imgconvert.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/imgconvert.c
@@ -33,6 +33,7 @@
#include "avcodec.h"
#include "dsputil.h"
#include "colorspace.h"
+#include "libavutil/pixdesc.h"
#if HAVE_MMX
#include "x86/mmx.h"
@@ -52,14 +53,10 @@
#define FF_PIXEL_PALETTE 2 /**< one components containing indexes for a palette */
typedef struct PixFmtInfo {
- const char *name;
uint8_t nb_channels; /**< number of channels (including alpha) */
uint8_t color_type; /**< color type (see FF_COLOR_xxx constants) */
uint8_t pixel_type; /**< pixel storage type (see FF_PIXEL_xxx constants) */
uint8_t is_alpha : 1; /**< true if alpha can be specified */
- uint8_t is_hwaccel : 1; /**< true if this is an HW accelerated format */
- uint8_t x_chroma_shift; /**< X chroma subsampling factor is 2 ^ shift */
- uint8_t y_chroma_shift; /**< Y chroma subsampling factor is 2 ^ shift */
uint8_t depth; /**< bit depth of the color components */
} PixFmtInfo;
@@ -67,268 +64,207 @@ typedef struct PixFmtInfo {
static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = {
/* YUV formats */
[PIX_FMT_YUV420P] = {
- .name = "yuv420p",
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
},
[PIX_FMT_YUV422P] = {
- .name = "yuv422p",
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 0,
},
[PIX_FMT_YUV444P] = {
- .name = "yuv444p",
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_YUYV422] = {
- .name = "yuyv422",
.nb_channels = 1,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 0,
},
[PIX_FMT_UYVY422] = {
- .name = "uyvy422",
.nb_channels = 1,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 0,
},
[PIX_FMT_YUV410P] = {
- .name = "yuv410p",
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 2, .y_chroma_shift = 2,
},
[PIX_FMT_YUV411P] = {
- .name = "yuv411p",
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 2, .y_chroma_shift = 0,
},
[PIX_FMT_YUV440P] = {
- .name = "yuv440p",
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 1,
},
[PIX_FMT_YUV420P16LE] = {
- .name = "yuv420p16le",
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 16,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
},
[PIX_FMT_YUV422P16LE] = {
- .name = "yuv422p16le",
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 16,
- .x_chroma_shift = 1, .y_chroma_shift = 0,
},
[PIX_FMT_YUV444P16LE] = {
- .name = "yuv444p16le",
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 16,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_YUV420P16BE] = {
- .name = "yuv420p16be",
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 16,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
},
[PIX_FMT_YUV422P16BE] = {
- .name = "yuv422p16be",
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 16,
- .x_chroma_shift = 1, .y_chroma_shift = 0,
},
[PIX_FMT_YUV444P16BE] = {
- .name = "yuv444p16be",
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 16,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
/* YUV formats with alpha plane */
[PIX_FMT_YUVA420P] = {
- .name = "yuva420p",
.nb_channels = 4,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
},
/* JPEG YUV */
[PIX_FMT_YUVJ420P] = {
- .name = "yuvj420p",
.nb_channels = 3,
.color_type = FF_COLOR_YUV_JPEG,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
},
[PIX_FMT_YUVJ422P] = {
- .name = "yuvj422p",
.nb_channels = 3,
.color_type = FF_COLOR_YUV_JPEG,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 0,
},
[PIX_FMT_YUVJ444P] = {
- .name = "yuvj444p",
.nb_channels = 3,
.color_type = FF_COLOR_YUV_JPEG,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_YUVJ440P] = {
- .name = "yuvj440p",
.nb_channels = 3,
.color_type = FF_COLOR_YUV_JPEG,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 1,
},
/* RGB formats */
[PIX_FMT_RGB24] = {
- .name = "rgb24",
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_BGR24] = {
- .name = "bgr24",
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_ARGB] = {
- .name = "argb",
.nb_channels = 4, .is_alpha = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_RGB48BE] = {
- .name = "rgb48be",
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 16,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_RGB48LE] = {
- .name = "rgb48le",
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 16,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_RGB565BE] = {
- .name = "rgb565be",
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 5,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_RGB565LE] = {
- .name = "rgb565le",
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 5,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_RGB555BE] = {
- .name = "rgb555be",
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 5,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_RGB555LE] = {
- .name = "rgb555le",
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 5,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
/* gray / mono formats */
[PIX_FMT_GRAY16BE] = {
- .name = "gray16be",
.nb_channels = 1,
.color_type = FF_COLOR_GRAY,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 16,
},
[PIX_FMT_GRAY16LE] = {
- .name = "gray16le",
.nb_channels = 1,
.color_type = FF_COLOR_GRAY,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 16,
},
[PIX_FMT_GRAY8] = {
- .name = "gray",
.nb_channels = 1,
.color_type = FF_COLOR_GRAY,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
},
[PIX_FMT_MONOWHITE] = {
- .name = "monow",
.nb_channels = 1,
.color_type = FF_COLOR_GRAY,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 1,
},
[PIX_FMT_MONOBLACK] = {
- .name = "monob",
.nb_channels = 1,
.color_type = FF_COLOR_GRAY,
.pixel_type = FF_PIXEL_PLANAR,
@@ -337,197 +273,114 @@ static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = {
/* paletted formats */
[PIX_FMT_PAL8] = {
- .name = "pal8",
.nb_channels = 4, .is_alpha = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PALETTE,
.depth = 8,
},
- [PIX_FMT_XVMC_MPEG2_MC] = {
- .name = "xvmcmc",
- .is_hwaccel = 1,
- },
- [PIX_FMT_XVMC_MPEG2_IDCT] = {
- .name = "xvmcidct",
- .is_hwaccel = 1,
- },
- [PIX_FMT_VDPAU_MPEG1] = {
- .name = "vdpau_mpeg1",
- .is_hwaccel = 1,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
- },
- [PIX_FMT_VDPAU_MPEG2] = {
- .name = "vdpau_mpeg2",
- .is_hwaccel = 1,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
- },
- [PIX_FMT_VDPAU_H264] = {
- .name = "vdpau_h264",
- .is_hwaccel = 1,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
- },
- [PIX_FMT_VDPAU_WMV3] = {
- .name = "vdpau_wmv3",
- .is_hwaccel = 1,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
- },
- [PIX_FMT_VDPAU_VC1] = {
- .name = "vdpau_vc1",
- .is_hwaccel = 1,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
- },
[PIX_FMT_UYYVYY411] = {
- .name = "uyyvyy411",
.nb_channels = 1,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
- .x_chroma_shift = 2, .y_chroma_shift = 0,
},
[PIX_FMT_ABGR] = {
- .name = "abgr",
.nb_channels = 4, .is_alpha = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_BGR565BE] = {
- .name = "bgr565be",
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 5,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_BGR565LE] = {
- .name = "bgr565le",
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 5,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_BGR555BE] = {
- .name = "bgr555be",
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 5,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_BGR555LE] = {
- .name = "bgr555le",
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 5,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_RGB8] = {
- .name = "rgb8",
.nb_channels = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_RGB4] = {
- .name = "rgb4",
.nb_channels = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 4,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_RGB4_BYTE] = {
- .name = "rgb4_byte",
.nb_channels = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_BGR8] = {
- .name = "bgr8",
.nb_channels = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_BGR4] = {
- .name = "bgr4",
.nb_channels = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 4,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_BGR4_BYTE] = {
- .name = "bgr4_byte",
.nb_channels = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_NV12] = {
- .name = "nv12",
.nb_channels = 2,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
},
[PIX_FMT_NV21] = {
- .name = "nv12",
.nb_channels = 2,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
},
[PIX_FMT_BGRA] = {
- .name = "bgra",
.nb_channels = 4, .is_alpha = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_RGBA] = {
- .name = "rgba",
.nb_channels = 4, .is_alpha = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
-
- /* VA API formats */
- [PIX_FMT_VAAPI_MOCO] = {
- .name = "vaapi_moco",
- .is_hwaccel = 1,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
- },
- [PIX_FMT_VAAPI_IDCT] = {
- .name = "vaapi_idct",
- .is_hwaccel = 1,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
- },
- [PIX_FMT_VAAPI_VLD] = {
- .name = "vaapi_vld",
- .is_hwaccel = 1,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
},
};
void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift)
{
- *h_shift = pix_fmt_info[pix_fmt].x_chroma_shift;
- *v_shift = pix_fmt_info[pix_fmt].y_chroma_shift;
+ *h_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_w;
+ *v_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_h;
}
const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt)
@@ -535,7 +388,7 @@ const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt)
if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB)
return NULL;
else
- return pix_fmt_info[pix_fmt].name;
+ return av_pix_fmt_descriptors[pix_fmt].name;
}
static enum PixelFormat avcodec_get_pix_fmt_internal(const char *name)
@@ -543,7 +396,7 @@ static enum PixelFormat avcodec_get_pix_fmt_internal(const char *name)
int i;
for (i=0; i < PIX_FMT_NB; i++)
- if (pix_fmt_info[i].name && !strcmp(pix_fmt_info[i].name, name))
+ if (av_pix_fmt_descriptors[i].name && !strcmp(av_pix_fmt_descriptors[i].name, name))
return i;
return PIX_FMT_NONE;
}
@@ -586,7 +439,7 @@ void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt)
snprintf (buf, buf_size,
"%-11s %5d %9d %6c",
- info.name,
+ av_pix_fmt_descriptors[pix_fmt].name,
info.nb_channels,
info.depth,
is_alpha_char
@@ -596,7 +449,7 @@ void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt)
int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt)
{
- return pix_fmt_info[pix_fmt].is_hwaccel;
+ return av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_HWACCEL;
}
int ff_set_systematic_pal(uint32_t pal[256], enum PixelFormat pix_fmt){
@@ -641,11 +494,10 @@ int ff_set_systematic_pal(uint32_t pal[256], enum PixelFormat pix_fmt){
int ff_fill_linesize(AVPicture *picture, enum PixelFormat pix_fmt, int width)
{
int w2;
- const PixFmtInfo *pinfo;
+ const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
memset(picture->linesize, 0, sizeof(picture->linesize));
- pinfo = &pix_fmt_info[pix_fmt];
switch(pix_fmt) {
case PIX_FMT_YUV420P:
case PIX_FMT_YUV422P:
@@ -657,7 +509,7 @@ int ff_fill_linesize(AVPicture *picture, enum PixelFormat pix_fmt, int width)
case PIX_FMT_YUVJ422P:
case PIX_FMT_YUVJ444P:
case PIX_FMT_YUVJ440P:
- w2 = (width + (1 << pinfo->x_chroma_shift) - 1) >> pinfo->x_chroma_shift;
+ w2 = (width + (1 << desc->log2_chroma_w) - 1) >> desc->log2_chroma_w;
picture->linesize[0] = width;
picture->linesize[1] = w2;
picture->linesize[2] = w2;
@@ -668,13 +520,13 @@ int ff_fill_linesize(AVPicture *picture, enum PixelFormat pix_fmt, int width)
case PIX_FMT_YUV420P16BE:
case PIX_FMT_YUV422P16BE:
case PIX_FMT_YUV444P16BE:
- w2 = (width + (1 << pinfo->x_chroma_shift) - 1) >> pinfo->x_chroma_shift;
+ w2 = (width + (1 << desc->log2_chroma_w) - 1) >> desc->log2_chroma_w;
picture->linesize[0] = 2*width;
picture->linesize[1] = 2*w2;
picture->linesize[2] = 2*w2;
break;
case PIX_FMT_YUVA420P:
- w2 = (width + (1 << pinfo->x_chroma_shift) - 1) >> pinfo->x_chroma_shift;
+ w2 = (width + (1 << desc->log2_chroma_w) - 1) >> desc->log2_chroma_w;
picture->linesize[0] = width;
picture->linesize[1] = w2;
picture->linesize[2] = w2;
@@ -682,9 +534,9 @@ int ff_fill_linesize(AVPicture *picture, enum PixelFormat pix_fmt, int width)
break;
case PIX_FMT_NV12:
case PIX_FMT_NV21:
- w2 = (width + (1 << pinfo->x_chroma_shift) - 1) >> pinfo->x_chroma_shift;
+ w2 = (width + (1 << desc->log2_chroma_w) - 1) >> desc->log2_chroma_w;
picture->linesize[0] = width;
- picture->linesize[1] = w2;
+ picture->linesize[1] = 2 * w2;
break;
case PIX_FMT_RGB24:
case PIX_FMT_BGR24:
@@ -745,9 +597,8 @@ int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt,
int height)
{
int size, h2, size2;
- const PixFmtInfo *pinfo;
+ const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
- pinfo = &pix_fmt_info[pix_fmt];
size = picture->linesize[0] * height;
switch(pix_fmt) {
case PIX_FMT_YUV420P:
@@ -766,7 +617,7 @@ int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt,
case PIX_FMT_YUV420P16BE:
case PIX_FMT_YUV422P16BE:
case PIX_FMT_YUV444P16BE:
- h2 = (height + (1 << pinfo->y_chroma_shift) - 1) >> pinfo->y_chroma_shift;
+ h2 = (height + (1 << desc->log2_chroma_h) - 1) >> desc->log2_chroma_h;
size2 = picture->linesize[1] * h2;
picture->data[0] = ptr;
picture->data[1] = picture->data[0] + size;
@@ -774,7 +625,7 @@ int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt,
picture->data[3] = NULL;
return size + 2 * size2;
case PIX_FMT_YUVA420P:
- h2 = (height + (1 << pinfo->y_chroma_shift) - 1) >> pinfo->y_chroma_shift;
+ h2 = (height + (1 << desc->log2_chroma_h) - 1) >> desc->log2_chroma_h;
size2 = picture->linesize[1] * h2;
picture->data[0] = ptr;
picture->data[1] = picture->data[0] + size;
@@ -783,13 +634,13 @@ int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt,
return 2 * size + 2 * size2;
case PIX_FMT_NV12:
case PIX_FMT_NV21:
- h2 = (height + (1 << pinfo->y_chroma_shift) - 1) >> pinfo->y_chroma_shift;
- size2 = picture->linesize[1] * h2 * 2;
+ h2 = (height + (1 << desc->log2_chroma_h) - 1) >> desc->log2_chroma_h;
+ size2 = picture->linesize[1] * h2;
picture->data[0] = ptr;
picture->data[1] = picture->data[0] + size;
picture->data[2] = NULL;
picture->data[3] = NULL;
- return size + 2 * size2;
+ return size + size2;
case PIX_FMT_RGB24:
case PIX_FMT_BGR24:
case PIX_FMT_ARGB:
@@ -858,6 +709,7 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width,
unsigned char *dest, int dest_size)
{
const PixFmtInfo* pf = &pix_fmt_info[pix_fmt];
+ const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
int i, j, w, ow, h, oh, data_planes;
const unsigned char* s;
int size = avpicture_get_size(pix_fmt, width, height);
@@ -878,11 +730,11 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width,
pix_fmt == PIX_FMT_RGB555LE)
w = width * 2;
else if (pix_fmt == PIX_FMT_UYYVYY411)
- w = width + width/2;
+ w = width + width/2;
else if (pix_fmt == PIX_FMT_PAL8)
- w = width;
+ w = width;
else
- w = width * (pf->depth * pf->nb_channels / 8);
+ w = width * (pf->depth * pf->nb_channels / 8);
data_planes = 1;
h = height;
@@ -896,19 +748,21 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width,
oh = h;
for (i=0; i<data_planes; i++) {
- if (i == 1) {
- w = width >> pf->x_chroma_shift;
- h = height >> pf->y_chroma_shift;
- } else if (i == 3) {
- w = ow;
- h = oh;
- }
- s = src->data[i];
- for(j=0; j<h; j++) {
- memcpy(dest, s, w);
- dest += w;
- s += src->linesize[i];
- }
+ if (i == 1) {
+ w = ((width >> desc->log2_chroma_w) * pf->depth + 7) / 8;
+ h = height >> desc->log2_chroma_h;
+ if (pix_fmt == PIX_FMT_NV12 || pix_fmt == PIX_FMT_NV21)
+ w <<= 1;
+ } else if (i == 3) {
+ w = ow;
+ h = oh;
+ }
+ s = src->data[i];
+ for(j=0; j<h; j++) {
+ memcpy(dest, s, w);
+ dest += w;
+ s += src->linesize[i];
+ }
}
if (pf->pixel_type == FF_PIXEL_PALETTE)
@@ -938,6 +792,8 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_
int has_alpha)
{
const PixFmtInfo *pf, *ps;
+ const AVPixFmtDescriptor *src_desc = &av_pix_fmt_descriptors[src_pix_fmt];
+ const AVPixFmtDescriptor *dst_desc = &av_pix_fmt_descriptors[dst_pix_fmt];
int loss;
ps = &pix_fmt_info[src_pix_fmt];
@@ -949,8 +805,8 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_
((dst_pix_fmt == PIX_FMT_RGB555BE || dst_pix_fmt == PIX_FMT_RGB555LE) &&
(src_pix_fmt == PIX_FMT_RGB565BE || src_pix_fmt == PIX_FMT_RGB565LE)))
loss |= FF_LOSS_DEPTH;
- if (pf->x_chroma_shift > ps->x_chroma_shift ||
- pf->y_chroma_shift > ps->y_chroma_shift)
+ if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w ||
+ dst_desc->log2_chroma_h > src_desc->log2_chroma_h)
loss |= FF_LOSS_RESOLUTION;
switch(pf->color_type) {
case FF_COLOR_RGB:
@@ -993,6 +849,7 @@ static int avg_bits_per_pixel(enum PixelFormat pix_fmt)
{
int bits;
const PixFmtInfo *pf;
+ const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
pf = &pix_fmt_info[pix_fmt];
switch(pf->pixel_type) {
@@ -1019,11 +876,11 @@ static int avg_bits_per_pixel(enum PixelFormat pix_fmt)
}
break;
case FF_PIXEL_PLANAR:
- if (pf->x_chroma_shift == 0 && pf->y_chroma_shift == 0) {
+ if (desc->log2_chroma_w == 0 && desc->log2_chroma_h == 0) {
bits = pf->depth * pf->nb_channels;
} else {
bits = pf->depth + ((2 * pf->depth) >>
- (pf->x_chroma_shift + pf->y_chroma_shift));
+ (desc->log2_chroma_w + desc->log2_chroma_h));
}
break;
case FF_PIXEL_PALETTE:
@@ -1045,7 +902,7 @@ static enum PixelFormat avcodec_find_best_pix_fmt1(int64_t pix_fmt_mask,
enum PixelFormat dst_pix_fmt;
/* find exact color match with smallest size */
- dst_pix_fmt = -1;
+ dst_pix_fmt = PIX_FMT_NONE;
min_dist = 0x7fffffff;
for(i = 0;i < PIX_FMT_NB; i++) {
if (pix_fmt_mask & (1ULL << i)) {
@@ -1088,7 +945,7 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma
if (loss_mask == 0)
break;
}
- return -1;
+ return PIX_FMT_NONE;
found:
if (loss_ptr)
*loss_ptr = avcodec_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
@@ -1112,6 +969,7 @@ int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane)
{
int bits;
const PixFmtInfo *pf = &pix_fmt_info[pix_fmt];
+ const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
pf = &pix_fmt_info[pix_fmt];
switch(pf->pixel_type) {
@@ -1140,7 +998,7 @@ int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane)
break;
case FF_PIXEL_PLANAR:
if (plane == 1 || plane == 2)
- width= -((-width)>>pf->x_chroma_shift);
+ width= -((-width)>>desc->log2_chroma_w);
return (width * pf->depth + 7) >> 3;
break;
@@ -1158,6 +1016,7 @@ void av_picture_copy(AVPicture *dst, const AVPicture *src,
{
int i;
const PixFmtInfo *pf = &pix_fmt_info[pix_fmt];
+ const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
switch(pf->pixel_type) {
case FF_PIXEL_PACKED:
@@ -1167,7 +1026,7 @@ void av_picture_copy(AVPicture *dst, const AVPicture *src,
int bwidth = ff_get_plane_bytewidth(pix_fmt, width, i);
h = height;
if (i == 1 || i == 2) {
- h= -((-height)>>pf->y_chroma_shift);
+ h= -((-height)>>desc->log2_chroma_h);
}
ff_img_copy_plane(dst->data[i], dst->linesize[i],
src->data[i], src->linesize[i],
@@ -1179,9 +1038,7 @@ void av_picture_copy(AVPicture *dst, const AVPicture *src,
src->data[0], src->linesize[0],
width, height);
/* copy the palette */
- ff_img_copy_plane(dst->data[1], dst->linesize[1],
- src->data[1], src->linesize[1],
- 4, 256);
+ memcpy(dst->data[1], src->data[1], 4*256);
break;
}
}
@@ -1317,8 +1174,8 @@ int av_picture_crop(AVPicture *dst, const AVPicture *src,
if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB || !is_yuv_planar(&pix_fmt_info[pix_fmt]))
return -1;
- y_shift = pix_fmt_info[pix_fmt].y_chroma_shift;
- x_shift = pix_fmt_info[pix_fmt].x_chroma_shift;
+ y_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_h;
+ x_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_w;
dst->data[0] = src->data[0] + (top_band * src->linesize[0]) + left_band;
dst->data[1] = src->data[1] + ((top_band >> y_shift) * src->linesize[1]) + (left_band >> x_shift);
@@ -1344,8 +1201,8 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width,
!is_yuv_planar(&pix_fmt_info[pix_fmt])) return -1;
for (i = 0; i < 3; i++) {
- x_shift = i ? pix_fmt_info[pix_fmt].x_chroma_shift : 0;
- y_shift = i ? pix_fmt_info[pix_fmt].y_chroma_shift : 0;
+ x_shift = i ? av_pix_fmt_descriptors[pix_fmt].log2_chroma_w : 0;
+ y_shift = i ? av_pix_fmt_descriptors[pix_fmt].log2_chroma_h : 0;
if (padtop || padleft) {
memset(dst->data[i], color[i],
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/indeo2.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/indeo2.c
index 53624a1078..6755014110 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/indeo2.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/indeo2.c
@@ -27,6 +27,7 @@
#include "avcodec.h"
#include "get_bits.h"
#include "indeo2data.h"
+#include "libavutil/common.h"
typedef struct Ir2Context{
AVCodecContext *avctx;
@@ -160,7 +161,7 @@ static int ir2_decode_frame(AVCodecContext *avctx,
/* decide whether frame uses deltas or not */
#ifndef ALT_BITSTREAM_READER_LE
for (i = 0; i < buf_size; i++)
- buf[i] = ff_reverse[buf[i]];
+ buf[i] = av_reverse[buf[i]];
#endif
start = 48; /* hardcoded for now */
@@ -213,6 +214,16 @@ static av_cold int ir2_decode_init(AVCodecContext *avctx){
return 0;
}
+static av_cold int ir2_decode_end(AVCodecContext *avctx){
+ Ir2Context * const ic = avctx->priv_data;
+ AVFrame *pic = &ic->picture;
+
+ if (pic->data[0])
+ avctx->release_buffer(avctx, pic);
+
+ return 0;
+}
+
AVCodec indeo2_decoder = {
"indeo2",
CODEC_TYPE_VIDEO,
@@ -220,7 +231,7 @@ AVCodec indeo2_decoder = {
sizeof(Ir2Context),
ir2_decode_init,
NULL,
- NULL,
+ ir2_decode_end,
ir2_decode_frame,
CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Intel Indeo 2"),
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/jfdctfst.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/jfdctfst.c
index dcbe19e69d..9d0595586b 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/jfdctfst.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/jfdctfst.c
@@ -76,7 +76,6 @@
#define DCTSIZE 8
#define GLOBAL(x) x
#define RIGHT_SHIFT(x, n) ((x) >> (n))
-#define SHIFT_TEMPS
/*
* This module is specialized to the case DCTSIZE = 8.
@@ -151,7 +150,6 @@ static av_always_inline void row_fdct(DCTELEM * data){
int_fast16_t z1, z2, z3, z4, z5, z11, z13;
DCTELEM *dataptr;
int ctr;
- SHIFT_TEMPS
/* Pass 1: process rows. */
@@ -216,7 +214,6 @@ fdct_ifast (DCTELEM * data)
int_fast16_t z1, z2, z3, z4, z5, z11, z13;
DCTELEM *dataptr;
int ctr;
- SHIFT_TEMPS
row_fdct(data);
@@ -283,7 +280,6 @@ fdct_ifast248 (DCTELEM * data)
int_fast16_t z1;
DCTELEM *dataptr;
int ctr;
- SHIFT_TEMPS
row_fdct(data);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/jfdctint.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/jfdctint.c
index b27657b0df..1d2c0ca391 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/jfdctint.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/jfdctint.c
@@ -66,7 +66,6 @@
#include "libavutil/common.h"
#include "dsputil.h"
-#define SHIFT_TEMPS
#define DCTSIZE 8
#define BITS_IN_JSAMPLE 8
#define GLOBAL(x) x
@@ -187,7 +186,6 @@ static av_always_inline void row_fdct(DCTELEM * data){
int_fast32_t z1, z2, z3, z4, z5;
DCTELEM *dataptr;
int ctr;
- SHIFT_TEMPS
/* Pass 1: process rows. */
/* Note results are scaled up by sqrt(8) compared to a true DCT; */
@@ -266,7 +264,6 @@ ff_jpeg_fdct_islow (DCTELEM * data)
int_fast32_t z1, z2, z3, z4, z5;
DCTELEM *dataptr;
int ctr;
- SHIFT_TEMPS
row_fdct(data);
@@ -353,7 +350,6 @@ ff_fdct248_islow (DCTELEM * data)
int_fast32_t z1;
DCTELEM *dataptr;
int ctr;
- SHIFT_TEMPS
row_fdct(data);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lcldec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lcldec.c
index 15c686e0a9..d4fe65cceb 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lcldec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lcldec.c
@@ -458,10 +458,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
return 1;
}
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return 1;
- }
-
/* Check codec type */
if ((avctx->codec_id == CODEC_ID_MSZH && avctx->extradata[7] != CODEC_MSZH) ||
(avctx->codec_id == CODEC_ID_ZLIB && avctx->extradata[7] != CODEC_ZLIB)) {
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libfaad.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libfaad.c
index 953c2a1ed2..e417467d01 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libfaad.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libfaad.c
@@ -183,7 +183,7 @@ static int faac_decode_frame(AVCodecContext *avctx,
unsigned char channels;
int r = s->faacDecInit(s->faac_handle, buf, buf_size, &srate, &channels);
if(r < 0){
- av_log(avctx, AV_LOG_ERROR, "faac: codec init failed.\n");
+ av_log(avctx, AV_LOG_ERROR, "libfaad: codec init failed.\n");
return -1;
}
avctx->sample_rate = srate;
@@ -195,7 +195,7 @@ static int faac_decode_frame(AVCodecContext *avctx,
out = s->faacDecDecode(s->faac_handle, &frame_info, (unsigned char*)buf, (unsigned long)buf_size);
if (frame_info.error > 0) {
- av_log(avctx, AV_LOG_ERROR, "faac: frame decoding failed: %s\n",
+ av_log(avctx, AV_LOG_ERROR, "libfaad: frame decoding failed: %s\n",
s->faacDecGetErrorMessage(frame_info.error));
return -1;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libopenjpeg.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libopenjpeg.c
index 8717f67048..f1e047437c 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libopenjpeg.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libopenjpeg.c
@@ -39,12 +39,12 @@ typedef struct {
static int check_image_attributes(opj_image_t *image)
{
- return(image->comps[0].dx == image->comps[1].dx &&
+ return image->comps[0].dx == image->comps[1].dx &&
image->comps[1].dx == image->comps[2].dx &&
image->comps[0].dy == image->comps[1].dy &&
image->comps[1].dy == image->comps[2].dy &&
image->comps[0].prec == image->comps[1].prec &&
- image->comps[1].prec == image->comps[2].prec);
+ image->comps[1].prec == image->comps[2].prec;
}
static av_cold int libopenjpeg_decode_init(AVCodecContext *avctx)
@@ -78,9 +78,13 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
if((AV_RB32(buf) == 12) &&
(AV_RB32(buf + 4) == JP2_SIG_TYPE) &&
(AV_RB32(buf + 8) == JP2_SIG_VALUE)) {
- dec = opj_create_decompress(CODEC_JP2);
+ dec = opj_create_decompress(CODEC_JP2);
} else {
- dec = opj_create_decompress(CODEC_J2K);
+ // If the AVPacket contains a jp2c box, then skip to
+ // the starting byte of the codestream.
+ if (AV_RB32(buf + 4) == AV_RB32("jp2c"))
+ buf += 8;
+ dec = opj_create_decompress(CODEC_J2K);
}
if(!dec) {
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libtheoraenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libtheoraenc.c
index f0285956da..ac015ff200 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libtheoraenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libtheoraenc.c
@@ -33,22 +33,31 @@
/* FFmpeg includes */
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
+#include "libavutil/base64.h"
#include "avcodec.h"
/* libtheora includes */
-#include <theora/theora.h>
-
-typedef struct TheoraContext{
- theora_state t_state;
+#include <theora/theoraenc.h>
+
+typedef struct TheoraContext {
+ th_enc_ctx *t_state;
+ uint8_t *stats;
+ int stats_size;
+ int stats_offset;
+ int uv_hshift;
+ int uv_vshift;
+ int keyframe_mask;
} TheoraContext;
/*!
Concatenates an ogg_packet into the extradata.
*/
-static int concatenate_packet(unsigned int* offset, AVCodecContext* avc_context, const ogg_packet* packet)
+static int concatenate_packet(unsigned int* offset,
+ AVCodecContext* avc_context,
+ const ogg_packet* packet)
{
const char* message = NULL;
- uint8_t* newdata = NULL;
+ uint8_t* newdata = NULL;
int newsize = avc_context->extradata_size + 2 + packet->bytes;
if (packet->bytes < 0) {
@@ -59,64 +68,136 @@ static int concatenate_packet(unsigned int* offset, AVCodecContext* avc_context,
message = "extradata_size would overflow";
} else {
newdata = av_realloc(avc_context->extradata, newsize);
- if (newdata == NULL) {
+ if (!newdata)
message = "av_realloc failed";
- }
}
- if (message != NULL) {
+ if (message) {
av_log(avc_context, AV_LOG_ERROR, "concatenate_packet failed: %s\n", message);
return -1;
}
- avc_context->extradata = newdata;
+ avc_context->extradata = newdata;
avc_context->extradata_size = newsize;
AV_WB16(avc_context->extradata + (*offset), packet->bytes);
*offset += 2;
- memcpy( avc_context->extradata + (*offset), packet->packet, packet->bytes );
+ memcpy(avc_context->extradata + (*offset), packet->packet, packet->bytes);
(*offset) += packet->bytes;
return 0;
}
+static int get_stats(AVCodecContext *avctx, int eos)
+{
+#ifdef TH_ENCCTL_2PASS_OUT
+ TheoraContext *h = avctx->priv_data;
+ uint8_t *buf;
+ int bytes;
+
+ bytes = th_encode_ctl(h->t_state, TH_ENCCTL_2PASS_OUT, &buf, sizeof(buf));
+ if (bytes < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Error getting first pass stats\n");
+ return -1;
+ }
+ if (!eos) {
+ h->stats = av_fast_realloc(h->stats, &h->stats_size,
+ h->stats_offset + bytes);
+ memcpy(h->stats + h->stats_offset, buf, bytes);
+ h->stats_offset += bytes;
+ } else {
+ int b64_size = ((h->stats_offset + 2) / 3) * 4 + 1;
+ // libtheora generates a summary header at the end
+ memcpy(h->stats, buf, bytes);
+ avctx->stats_out = av_malloc(b64_size);
+ av_base64_encode(avctx->stats_out, b64_size, h->stats, h->stats_offset);
+ }
+ return 0;
+#else
+ av_log(avctx, AV_LOG_ERROR, "libtheora too old to support 2pass\n");
+ return -1;
+#endif
+}
+
+// libtheora won't read the entire buffer we give it at once, so we have to
+// repeatedly submit it...
+static int submit_stats(AVCodecContext *avctx)
+{
+#ifdef TH_ENCCTL_2PASS_IN
+ TheoraContext *h = avctx->priv_data;
+ int bytes;
+ if (!h->stats) {
+ if (!avctx->stats_in) {
+ av_log(avctx, AV_LOG_ERROR, "No statsfile for second pass\n");
+ return -1;
+ }
+ h->stats_size = strlen(avctx->stats_in) * 3/4;
+ h->stats = av_malloc(h->stats_size);
+ h->stats_size = av_base64_decode(h->stats, avctx->stats_in, h->stats_size);
+ }
+ while (h->stats_size - h->stats_offset > 0) {
+ bytes = th_encode_ctl(h->t_state, TH_ENCCTL_2PASS_IN,
+ h->stats + h->stats_offset,
+ h->stats_size - h->stats_offset);
+ if (bytes < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Error submitting stats\n");
+ return -1;
+ }
+ if (!bytes)
+ return 0;
+ h->stats_offset += bytes;
+ }
+ return 0;
+#else
+ av_log(avctx, AV_LOG_ERROR, "libtheora too old to support 2pass\n");
+ return -1;
+#endif
+}
+
static av_cold int encode_init(AVCodecContext* avc_context)
{
- theora_info t_info;
- theora_comment t_comment;
+ th_info t_info;
+ th_comment t_comment;
ogg_packet o_packet;
unsigned int offset;
TheoraContext *h = avc_context->priv_data;
+ uint32_t gop_size = avc_context->gop_size;
/* Set up the theora_info struct */
- theora_info_init( &t_info );
- t_info.width = FFALIGN(avc_context->width, 16);
- t_info.height = FFALIGN(avc_context->height, 16);
- t_info.frame_width = avc_context->width;
- t_info.frame_height = avc_context->height;
- t_info.offset_x = 0;
- t_info.offset_y = avc_context->height & 0xf;
+ th_info_init(&t_info);
+ t_info.frame_width = FFALIGN(avc_context->width, 16);
+ t_info.frame_height = FFALIGN(avc_context->height, 16);
+ t_info.pic_width = avc_context->width;
+ t_info.pic_height = avc_context->height;
+ t_info.pic_x = 0;
+ t_info.pic_y = 0;
/* Swap numerator and denominator as time_base in AVCodecContext gives the
* time period between frames, but theora_info needs the framerate. */
- t_info.fps_numerator = avc_context->time_base.den;
+ t_info.fps_numerator = avc_context->time_base.den;
t_info.fps_denominator = avc_context->time_base.num;
- if (avc_context->sample_aspect_ratio.num != 0) {
- t_info.aspect_numerator = avc_context->sample_aspect_ratio.num;
+ if (avc_context->sample_aspect_ratio.num) {
+ t_info.aspect_numerator = avc_context->sample_aspect_ratio.num;
t_info.aspect_denominator = avc_context->sample_aspect_ratio.den;
} else {
- t_info.aspect_numerator = 1;
+ t_info.aspect_numerator = 1;
t_info.aspect_denominator = 1;
}
- t_info.colorspace = OC_CS_UNSPECIFIED;
- t_info.pixelformat = OC_PF_420;
- t_info.keyframe_frequency = avc_context->gop_size;
- t_info.keyframe_frequency_force = avc_context->gop_size;
- t_info.keyframe_mindistance = avc_context->keyint_min;
-
- t_info.quick_p = 1;
- t_info.dropframes_p = 0;
- t_info.keyframe_auto_p = 1;
- t_info.keyframe_data_target_bitrate = t_info.target_bitrate * 1.5;
- t_info.keyframe_auto_threshold = 80;
- t_info.noise_sensitivity = 1;
- t_info.sharpness = 0;
+
+ if (avc_context->color_primaries == AVCOL_PRI_BT470M)
+ t_info.colorspace = TH_CS_ITU_REC_470M;
+ else if (avc_context->color_primaries == AVCOL_PRI_BT470BG)
+ t_info.colorspace = TH_CS_ITU_REC_470BG;
+ else
+ t_info.colorspace = TH_CS_UNSPECIFIED;
+
+ if (avc_context->pix_fmt == PIX_FMT_YUV420P)
+ t_info.pixel_fmt = TH_PF_420;
+ else if (avc_context->pix_fmt == PIX_FMT_YUV422P)
+ t_info.pixel_fmt = TH_PF_422;
+ else if (avc_context->pix_fmt == PIX_FMT_YUV444P)
+ t_info.pixel_fmt = TH_PF_444;
+ else {
+ av_log(avc_context, AV_LOG_ERROR, "Unsupported pix_fmt\n");
+ return -1;
+ }
+ avcodec_get_chroma_sub_sample(avc_context->pix_fmt, &h->uv_hshift, &h->uv_vshift);
if (avc_context->flags & CODEC_FLAG_QSCALE) {
/* to be constant with the libvorbis implementation, clip global_quality to 0 - 10
@@ -124,21 +205,38 @@ static av_cold int encode_init(AVCodecContext* avc_context)
* 0 <= p <=63
* an int value
*/
- t_info.quality = av_clip(avc_context->global_quality / (float)FF_QP2LAMBDA, 0, 10) * 6.3;
+ t_info.quality = av_clip(avc_context->global_quality / (float)FF_QP2LAMBDA, 0, 10) * 6.3;
t_info.target_bitrate = 0;
} else {
t_info.target_bitrate = avc_context->bit_rate;
- t_info.quality = 0;
+ t_info.quality = 0;
}
/* Now initialise libtheora */
- if (theora_encode_init( &(h->t_state), &t_info ) != 0) {
+ h->t_state = th_encode_alloc(&t_info);
+ if (!h->t_state) {
av_log(avc_context, AV_LOG_ERROR, "theora_encode_init failed\n");
return -1;
}
+ h->keyframe_mask = (1 << t_info.keyframe_granule_shift) - 1;
/* Clear up theora_info struct */
- theora_info_clear( &t_info );
+ th_info_clear(&t_info);
+
+ if (th_encode_ctl(h->t_state, TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE,
+ &gop_size, sizeof(gop_size))) {
+ av_log(avc_context, AV_LOG_ERROR, "Error setting GOP size\n");
+ return -1;
+ }
+
+ // need to enable 2 pass (via TH_ENCCTL_2PASS_) before encoding headers
+ if (avc_context->flags & CODEC_FLAG_PASS1) {
+ if (get_stats(avc_context, 0))
+ return -1;
+ } else if (avc_context->flags & CODEC_FLAG_PASS2) {
+ if (submit_stats(avc_context))
+ return -1;
+ }
/*
Output first header packet consisting of theora
@@ -149,29 +247,14 @@ static av_cold int encode_init(AVCodecContext* avc_context)
*/
offset = 0;
- /* Header */
- theora_encode_header( &(h->t_state), &o_packet );
- if (concatenate_packet( &offset, avc_context, &o_packet ) != 0) {
- return -1;
- }
+ /* Headers */
+ th_comment_init(&t_comment);
- /* Comment */
- theora_comment_init( &t_comment );
- theora_encode_comment( &t_comment, &o_packet );
- if (concatenate_packet( &offset, avc_context, &o_packet ) != 0) {
- return -1;
- }
- /* Clear up theora_comment struct before we reset the packet */
- theora_comment_clear( &t_comment );
- /* And despite documentation to the contrary, theora_comment_clear
- * does not release the packet */
- ogg_packet_clear(&o_packet);
-
- /* Tables */
- theora_encode_tables( &(h->t_state), &o_packet );
- if (concatenate_packet( &offset, avc_context, &o_packet ) != 0) {
- return -1;
- }
+ while (th_encode_flushheader(h->t_state, &t_comment, &o_packet))
+ if (concatenate_packet(&offset, avc_context, &o_packet))
+ return -1;
+
+ th_comment_clear(&t_comment);
/* Set up the output AVFrame */
avc_context->coded_frame= avcodec_alloc_frame();
@@ -179,68 +262,71 @@ static av_cold int encode_init(AVCodecContext* avc_context)
return 0;
}
-static int encode_frame(
- AVCodecContext* avc_context,
- uint8_t *outbuf,
- int buf_size,
- void *data)
+static int encode_frame(AVCodecContext* avc_context, uint8_t *outbuf,
+ int buf_size, void *data)
{
- yuv_buffer t_yuv_buffer;
+ th_ycbcr_buffer t_yuv_buffer;
TheoraContext *h = avc_context->priv_data;
AVFrame *frame = data;
ogg_packet o_packet;
- int result;
-
- assert(avc_context->pix_fmt == PIX_FMT_YUV420P);
+ int result, i;
+
+ // EOS, finish and get 1st pass stats if applicable
+ if (!frame) {
+ th_encode_packetout(h->t_state, 1, &o_packet);
+ if (avc_context->flags & CODEC_FLAG_PASS1)
+ if (get_stats(avc_context, 1))
+ return -1;
+ return 0;
+ }
/* Copy planes to the theora yuv_buffer */
- if (frame->linesize[1] != frame->linesize[2]) {
- av_log(avc_context, AV_LOG_ERROR, "U and V stride differ\n");
- return -1;
+ for (i = 0; i < 3; i++) {
+ t_yuv_buffer[i].width = FFALIGN(avc_context->width, 16) >> (i && h->uv_hshift);
+ t_yuv_buffer[i].height = FFALIGN(avc_context->height, 16) >> (i && h->uv_vshift);
+ t_yuv_buffer[i].stride = frame->linesize[i];
+ t_yuv_buffer[i].data = frame->data[i];
}
- t_yuv_buffer.y_width = FFALIGN(avc_context->width, 16);
- t_yuv_buffer.y_height = FFALIGN(avc_context->height, 16);
- t_yuv_buffer.y_stride = frame->linesize[0];
- t_yuv_buffer.uv_width = t_yuv_buffer.y_width / 2;
- t_yuv_buffer.uv_height = t_yuv_buffer.y_height / 2;
- t_yuv_buffer.uv_stride = frame->linesize[1];
-
- t_yuv_buffer.y = frame->data[0];
- t_yuv_buffer.u = frame->data[1];
- t_yuv_buffer.v = frame->data[2];
+ if (avc_context->flags & CODEC_FLAG_PASS2)
+ if (submit_stats(avc_context))
+ return -1;
/* Now call into theora_encode_YUVin */
- result = theora_encode_YUVin( &(h->t_state), &t_yuv_buffer );
- if (result != 0) {
+ result = th_encode_ycbcr_in(h->t_state, t_yuv_buffer);
+ if (result) {
const char* message;
switch (result) {
- case -1:
- message = "differing frame sizes";
- break;
- case OC_EINVAL:
- message = "encoder is not ready or is finished";
- break;
- default:
- message = "unknown reason";
- break;
+ case -1:
+ message = "differing frame sizes";
+ break;
+ case TH_EINVAL:
+ message = "encoder is not ready or is finished";
+ break;
+ default:
+ message = "unknown reason";
+ break;
}
av_log(avc_context, AV_LOG_ERROR, "theora_encode_YUVin failed (%s) [%d]\n", message, result);
return -1;
}
+ if (avc_context->flags & CODEC_FLAG_PASS1)
+ if (get_stats(avc_context, 0))
+ return -1;
+
/* Pick up returned ogg_packet */
- result = theora_encode_packetout( &(h->t_state), 0, &o_packet );
+ result = th_encode_packetout(h->t_state, 0, &o_packet);
switch (result) {
- case 0:
- /* No packet is ready */
- return 0;
- case 1:
- /* Success, we have a packet */
- break;
- default:
- av_log(avc_context, AV_LOG_ERROR, "theora_encode_packetout failed [%d]\n", result);
- return -1;
+ case 0:
+ /* No packet is ready */
+ return 0;
+ case 1:
+ /* Success, we have a packet */
+ break;
+ default:
+ av_log(avc_context, AV_LOG_ERROR, "theora_encode_packetout failed [%d]\n", result);
+ return -1;
}
/* Copy ogg_packet content out to buffer */
@@ -250,43 +336,30 @@ static int encode_frame(
}
memcpy(outbuf, o_packet.packet, o_packet.bytes);
+ // HACK: assumes no encoder delay, this is true until libtheora becomes
+ // multithreaded (which will be disabled unless explictly requested)
+ avc_context->coded_frame->pts = frame->pts;
+ avc_context->coded_frame->key_frame = !(o_packet.granulepos & h->keyframe_mask);
+
return o_packet.bytes;
}
static av_cold int encode_close(AVCodecContext* avc_context)
{
- ogg_packet o_packet;
TheoraContext *h = avc_context->priv_data;
- int result;
- const char* message;
- result = theora_encode_packetout( &(h->t_state), 1, &o_packet );
- theora_clear( &(h->t_state) );
+ th_encode_free(h->t_state);
+ av_freep(&h->stats);
av_freep(&avc_context->coded_frame);
+ av_freep(&avc_context->stats_out);
av_freep(&avc_context->extradata);
avc_context->extradata_size = 0;
- switch (result) {
- case 0:/* No packet is ready */
- case -1:/* Encoding finished */
- return 0;
- case 1:
- /* We have a packet */
- message = "gave us a packet";
- break;
- default:
- message = "unknown reason";
- break;
- }
- av_log(avc_context, AV_LOG_ERROR, "theora_encode_packetout failed (%s) [%d]\n", message, result);
- return -1;
+ return 0;
}
-static const enum PixelFormat supported_pixel_formats[] = { PIX_FMT_YUV420P, PIX_FMT_NONE };
-
/*! AVCodec struct exposed to libavcodec */
-AVCodec libtheora_encoder =
-{
+AVCodec libtheora_encoder = {
.name = "libtheora",
.type = CODEC_TYPE_VIDEO,
.id = CODEC_ID_THEORA,
@@ -294,6 +367,7 @@ AVCodec libtheora_encoder =
.init = encode_init,
.close = encode_close,
.encode = encode_frame,
- .pix_fmts = supported_pixel_formats,
+ .capabilities = CODEC_CAP_DELAY, // needed to get the statsfile summary
+ .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("libtheora Theora"),
};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libx264.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libx264.c
index 5039b6db3f..1fec3eded1 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libx264.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libx264.c
@@ -181,7 +181,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.b_cabac = avctx->coder_type == FF_CODER_TYPE_AC;
x4->params.i_bframe_adaptive = avctx->b_frame_strategy;
x4->params.i_bframe_bias = avctx->bframebias;
- x4->params.b_bframe_pyramid = avctx->flags2 & CODEC_FLAG2_BPYRAMID;
+ x4->params.i_bframe_pyramid = avctx->flags2 & CODEC_FLAG2_BPYRAMID ? X264_B_PYRAMID_NORMAL : X264_B_PYRAMID_NONE;
avctx->has_b_frames = avctx->flags2 & CODEC_FLAG2_BPYRAMID ? 2 : !!avctx->max_b_frames;
x4->params.i_keyint_min = avctx->keyint_min;
@@ -228,6 +228,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.analyse.i_direct_mv_pred = avctx->directpred;
x4->params.analyse.b_weighted_bipred = avctx->flags2 & CODEC_FLAG2_WPRED;
+ x4->params.analyse.i_weighted_pred = avctx->weighted_p_pred;
if (avctx->me_method == ME_EPZS)
x4->params.analyse.i_me_method = X264_ME_DIA;
@@ -265,6 +266,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
} else
x4->params.rc.f_vbv_buffer_init = 0.9;
+ x4->params.rc.b_mb_tree = !!(avctx->flags2 & CODEC_FLAG2_MBTREE);
x4->params.rc.f_ip_factor = 1 / fabs(avctx->i_quant_factor);
x4->params.rc.f_pb_factor = avctx->b_quant_factor;
x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ljpegenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ljpegenc.c
index 6c9f058dce..566723dbc0 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ljpegenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ljpegenc.c
@@ -56,7 +56,7 @@ static int encode_picture_lossless(AVCodecContext *avctx, unsigned char *buf, in
s->header_bits= put_bits_count(&s->pb);
- if(avctx->pix_fmt == PIX_FMT_RGB32){
+ if(avctx->pix_fmt == PIX_FMT_BGRA){
int x, y, i;
const int linesize= p->linesize[0];
uint16_t (*buffer)[4]= (void *) s->rd_scratchpad;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/loco.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/loco.c
index 4fd64f4bda..57fba82cf0 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/loco.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/loco.c
@@ -275,6 +275,16 @@ static av_cold int decode_init(AVCodecContext *avctx){
return 0;
}
+static av_cold int decode_end(AVCodecContext *avctx){
+ LOCOContext * const l = avctx->priv_data;
+ AVFrame *pic = &l->pic;
+
+ if (pic->data[0])
+ avctx->release_buffer(avctx, pic);
+
+ return 0;
+}
+
AVCodec loco_decoder = {
"loco",
CODEC_TYPE_VIDEO,
@@ -282,7 +292,7 @@ AVCodec loco_decoder = {
sizeof(LOCOContext),
decode_init,
NULL,
- NULL,
+ decode_end,
decode_frame,
CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("LOCO"),
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lpc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lpc.c
index 896db51759..49e41d8c34 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lpc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lpc.c
@@ -27,6 +27,68 @@
/**
+ * Apply Welch window function to audio block
+ */
+static void apply_welch_window(const int32_t *data, int len, double *w_data)
+{
+ int i, n2;
+ double w;
+ double c;
+
+ assert(!(len&1)); //the optimization in r11881 does not support odd len
+ //if someone wants odd len extend the change in r11881
+
+ n2 = (len >> 1);
+ c = 2.0 / (len - 1.0);
+
+ w_data+=n2;
+ data+=n2;
+ for(i=0; i<n2; i++) {
+ w = c - n2 + i;
+ w = 1.0 - (w * w);
+ w_data[-i-1] = data[-i-1] * w;
+ w_data[+i ] = data[+i ] * w;
+ }
+}
+
+/**
+ * Calculates autocorrelation data from audio samples
+ * A Welch window function is applied before calculation.
+ */
+void ff_lpc_compute_autocorr(const int32_t *data, int len, int lag,
+ double *autoc)
+{
+ int i, j;
+ double tmp[len + lag + 1];
+ double *data1= tmp + lag;
+
+ apply_welch_window(data, len, data1);
+
+ for(j=0; j<lag; j++)
+ data1[j-lag]= 0.0;
+ data1[len] = 0.0;
+
+ for(j=0; j<lag; j+=2){
+ double sum0 = 1.0, sum1 = 1.0;
+ for(i=j; i<len; i++){
+ sum0 += data1[i] * data1[i-j];
+ sum1 += data1[i] * data1[i-j-1];
+ }
+ autoc[j ] = sum0;
+ autoc[j+1] = sum1;
+ }
+
+ if(j==lag){
+ double sum = 1.0;
+ for(i=j-1; i<len; i+=2){
+ sum += data1[i ] * data1[i-j ]
+ + data1[i+1] * data1[i-j+1];
+ }
+ autoc[j] = sum;
+ }
+}
+
+/**
* Quantize LPC coefficients
*/
static void quantize_lpc_coefs(double *lpc_in, int order, int precision,
@@ -115,7 +177,7 @@ int ff_lpc_calc_coefs(DSPContext *s,
assert(max_order >= MIN_LPC_ORDER && max_order <= MAX_LPC_ORDER && use_lpc > 0);
if(use_lpc == 1){
- s->flac_compute_autocorr(samples, blocksize, max_order, autoc);
+ s->lpc_compute_autocorr(samples, blocksize, max_order, autoc);
compute_lpc_coefs(autoc, max_order, &lpc[0][0], MAX_LPC_ORDER, 0, 1);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lsp.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lsp.c
index 5b5fc1c50e..003ffbc634 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lsp.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lsp.c
@@ -47,6 +47,14 @@ void ff_acelp_reorder_lsf(int16_t* lsfq, int lsfq_min_distance, int lsfq_min, in
lsfq[lp_order-1] = FFMIN(lsfq[lp_order-1], lsfq_max);//Is warning required ?
}
+void ff_set_min_dist_lsf(float *lsf, double min_spacing, int size)
+{
+ int i;
+ float prev = 0.0;
+ for (i = 0; i < size; i++)
+ prev = lsf[i] = FFMAX(lsf[i], prev + min_spacing);
+}
+
void ff_acelp_lsf2lsp(int16_t *lsp, const int16_t *lsf, int lp_order)
{
int i;
@@ -120,17 +128,7 @@ void ff_acelp_lp_decode(int16_t* lp_1st, int16_t* lp_2nd, const int16_t* lsp_2nd
ff_acelp_lsp2lpc(lp_2nd, lsp_2nd, lp_order >> 1);
}
-/**
- * Computes the Pa / (1 + z(-1)) or Qa / (1 - z(-1)) coefficients
- * needed for LSP to LPC conversion.
- * We only need to calculate the 6 first elements of the polynomial.
- *
- * @param lsp line spectral pairs in cosine domain
- * @param f [out] polynomial input/output as a vector
- *
- * TIA/EIA/IS-733 2.4.3.3.5-1/2
- */
-static void lsp2polyf(const double *lsp, double *f, int lp_half_order)
+void ff_lsp2polyf(const double *lsp, double *f, int lp_half_order)
{
int i, j;
@@ -147,20 +145,30 @@ static void lsp2polyf(const double *lsp, double *f, int lp_half_order)
}
}
-void ff_acelp_lspd2lpc(const double *lsp, float *lpc)
+void ff_acelp_lspd2lpc(const double *lsp, float *lpc, int lp_half_order)
{
- double pa[6], qa[6];
- int i;
+ double pa[MAX_LP_HALF_ORDER+1], qa[MAX_LP_HALF_ORDER+1];
+ float *lpc2 = lpc + (lp_half_order << 1) - 1;
- lsp2polyf(lsp, pa, 5);
- lsp2polyf(lsp + 1, qa, 5);
+ assert(lp_half_order <= MAX_LP_HALF_ORDER);
- for (i=4; i>=0; i--)
- {
- double paf = pa[i+1] + pa[i];
- double qaf = qa[i+1] - qa[i];
+ ff_lsp2polyf(lsp, pa, lp_half_order);
+ ff_lsp2polyf(lsp + 1, qa, lp_half_order);
- lpc[i ] = 0.5*(paf+qaf);
- lpc[9-i] = 0.5*(paf-qaf);
+ while (lp_half_order--) {
+ double paf = pa[lp_half_order+1] + pa[lp_half_order];
+ double qaf = qa[lp_half_order+1] - qa[lp_half_order];
+
+ lpc [ lp_half_order] = 0.5*(paf+qaf);
+ lpc2[-lp_half_order] = 0.5*(paf-qaf);
}
}
+
+void ff_sort_nearly_sorted_floats(float *vals, int len)
+{
+ int i,j;
+
+ for (i = 0; i < len - 1; i++)
+ for (j = i; j >= 0 && vals[j] > vals[j+1]; j--)
+ FFSWAP(float, vals[j], vals[j+1]);
+}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lsp.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lsp.h
index 0fa585016a..c3aee7b7dc 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lsp.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lsp.h
@@ -40,6 +40,19 @@
void ff_acelp_reorder_lsf(int16_t* lsfq, int lsfq_min_distance, int lsfq_min, int lsfq_max, int lp_order);
/**
+ * Adjust the quantized LSFs so they are increasing and not too close.
+ *
+ * This step is not mentioned in the AMR spec but is in the reference C decoder.
+ * Omitting this step creates audible distortion on the sinusoidal sweep
+ * test vectors in 3GPP TS 26.074.
+ *
+ * @param[in,out] lsf LSFs in Hertz
+ * @param min_spacing minimum distance between two consecutive lsf values
+ * @param size size of the lsf vector
+ */
+void ff_set_min_dist_lsf(float *lsf, double min_spacing, int order);
+
+/**
* \brief Convert LSF to LSP
* \param lsp [out] LSP coefficients (-0x8000 <= (0.15) < 0x8000)
* \param lsf normalized LSF coefficients (0 <= (2.13) < 0x2000 * PI)
@@ -67,14 +80,40 @@ void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_half_order);
*/
void ff_acelp_lp_decode(int16_t* lp_1st, int16_t* lp_2nd, const int16_t* lsp_2nd, const int16_t* lsp_prev, int lp_order);
+
+#define MAX_LP_HALF_ORDER 8
+
/**
* Reconstructs LPC coefficients from the line spectral pair frequencies.
*
* @param lsp line spectral pairs in cosine domain
* @param lpc linear predictive coding coefficients
+ * @param lp_half_order half the number of the amount of LPCs to be
+ * reconstructed, need to be smaller or equal to MAX_LP_HALF_ORDER
+ *
+ * @note buffers should have a minimux size of 2*lp_half_order elements.
*
* TIA/EIA/IS-733 2.4.3.3.5
*/
-void ff_acelp_lspd2lpc(const double *lsp, float *lpc);
+void ff_acelp_lspd2lpc(const double *lsp, float *lpc, int lp_half_order);
+
+/**
+ * Sort values in ascending order.
+ *
+ * @note O(n) if data already sorted, O(n^2) - otherwise
+ */
+void ff_sort_nearly_sorted_floats(float *vals, int len);
+
+/**
+ * Computes the Pa / (1 + z(-1)) or Qa / (1 - z(-1)) coefficients
+ * needed for LSP to LPC conversion.
+ * We only need to calculate the 6 first elements of the polynomial.
+ *
+ * @param lsp line spectral pairs in cosine domain
+ * @param f [out] polynomial input/output as a vector
+ *
+ * TIA/EIA/IS-733 2.4.3.3.5-1/2
+ */
+void ff_lsp2polyf(const double *lsp, double *f, int lp_half_order);
#endif /* AVCODEC_LSP_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lzw.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lzw.h
index 601d01fd67..304ba2d1dd 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lzw.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lzw.h
@@ -30,7 +30,7 @@
#ifndef AVCODEC_LZW_H
#define AVCODEC_LZW_H
-#include "get_bits.h"
+struct PutBitContext;
enum FF_LZW_MODES{
FF_LZW_GIF,
@@ -52,8 +52,11 @@ void ff_lzw_decode_tail(LZWState *lzw);
struct LZWEncodeState;
extern const int ff_lzw_encode_state_size;
-void ff_lzw_encode_init(struct LZWEncodeState * s, uint8_t * outbuf, int outsize, int maxbits);
+void ff_lzw_encode_init(struct LZWEncodeState *s, uint8_t *outbuf, int outsize,
+ int maxbits, enum FF_LZW_MODES mode,
+ void (*lzw_put_bits)(struct PutBitContext *, int, unsigned int));
int ff_lzw_encode(struct LZWEncodeState * s, const uint8_t * inbuf, int insize);
-int ff_lzw_encode_flush(struct LZWEncodeState * s);
+int ff_lzw_encode_flush(struct LZWEncodeState *s,
+ void (*lzw_flush_put_bits)(struct PutBitContext *));
#endif /* AVCODEC_LZW_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lzwenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lzwenc.c
index f3f66833a1..f8cf4911b6 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lzwenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lzwenc.c
@@ -58,6 +58,8 @@ typedef struct LZWEncodeState {
int maxcode; ///< Max value of code
int output_bytes; ///< Number of written bytes
int last_code; ///< Value of last output code or LZW_PREFIX_EMPTY
+ enum FF_LZW_MODES mode; ///< TIFF or GIF
+ void (*put_bits)(PutBitContext *, int, unsigned); ///< GIF is LE while TIFF is BE
}LZWEncodeState;
@@ -110,7 +112,7 @@ static inline int hashOffset(const int head)
static inline void writeCode(LZWEncodeState * s, int c)
{
assert(0 <= c && c < 1 << s->bits);
- put_bits(&s->pb, s->bits, c);
+ s->put_bits(&s->pb, s->bits, c);
}
@@ -151,7 +153,7 @@ static inline void addCode(LZWEncodeState * s, uint8_t c, int hash_prefix, int h
s->tabsize++;
- if (s->tabsize >= 1 << s->bits)
+ if (s->tabsize >= (1 << s->bits) + (s->mode == FF_LZW_GIF))
s->bits++;
}
@@ -196,7 +198,9 @@ static int writtenBytes(LZWEncodeState *s){
* @param outsize Size of output buffer
* @param maxbits Maximum length of code
*/
-void ff_lzw_encode_init(LZWEncodeState * s, uint8_t * outbuf, int outsize, int maxbits)
+void ff_lzw_encode_init(LZWEncodeState *s, uint8_t *outbuf, int outsize,
+ int maxbits, enum FF_LZW_MODES mode,
+ void (*lzw_put_bits)(PutBitContext *, int, unsigned))
{
s->clear_code = 256;
s->end_code = 257;
@@ -208,6 +212,8 @@ void ff_lzw_encode_init(LZWEncodeState * s, uint8_t * outbuf, int outsize, int m
s->output_bytes = 0;
s->last_code = LZW_PREFIX_EMPTY;
s->bits = 9;
+ s->mode = mode;
+ s->put_bits = lzw_put_bits;
}
/**
@@ -250,12 +256,13 @@ int ff_lzw_encode(LZWEncodeState * s, const uint8_t * inbuf, int insize)
* @param s LZW state
* @return Number of bytes written or -1 on error
*/
-int ff_lzw_encode_flush(LZWEncodeState * s)
+int ff_lzw_encode_flush(LZWEncodeState *s,
+ void (*lzw_flush_put_bits)(PutBitContext *))
{
if (s->last_code != -1)
writeCode(s, s->last_code);
writeCode(s, s->end_code);
- flush_put_bits(&s->pb);
+ lzw_flush_put_bits(&s->pb);
s->last_code = -1;
return writtenBytes(s);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mjpegdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mjpegdec.c
index e8f0dd6032..86862dbd40 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mjpegdec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mjpegdec.c
@@ -105,6 +105,8 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_DEBUG, "mjpeg bottom field first\n");
}
}
+ if (avctx->codec->id == CODEC_ID_AMV)
+ s->flipped = 1;
return 0;
}
@@ -290,15 +292,16 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
(s->h_count[2] << 12) | (s->v_count[2] << 8) |
(s->h_count[3] << 4) | s->v_count[3];
av_log(s->avctx, AV_LOG_DEBUG, "pix fmt id %x\n", pix_fmt_id);
- if(!(pix_fmt_id & 0x10101010))
+ //NOTE we do not allocate pictures large enough for the possible padding of h/v_count being 4
+ if(!(pix_fmt_id & 0xD0D0D0D0))
pix_fmt_id-= (pix_fmt_id & 0xF0F0F0F0)>>1;
- if(!(pix_fmt_id & 0x01010101))
+ if(!(pix_fmt_id & 0x0D0D0D0D))
pix_fmt_id-= (pix_fmt_id & 0x0F0F0F0F)>>1;
switch(pix_fmt_id){
case 0x11111100:
if(s->rgb){
- s->avctx->pix_fmt = PIX_FMT_RGB32;
+ s->avctx->pix_fmt = PIX_FMT_BGRA;
}else
s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV444P : PIX_FMT_YUVJ444P;
assert(s->nb_components==3);
@@ -614,13 +617,13 @@ static int decode_block_refinement(MJpegDecodeContext *s, DCTELEM *block, uint8_
static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int predictor, int point_transform){
int i, mb_x, mb_y;
- uint16_t buffer[32768][4];
+ uint16_t (*buffer)[4];
int left[3], top[3], topleft[3];
const int linesize= s->linesize[0];
const int mask= (1<<s->bits)-1;
- if((unsigned)s->mb_width > 32768) //dynamic alloc
- return -1;
+ av_fast_malloc(&s->ljpeg_buffer, &s->ljpeg_buffer_size, (unsigned)s->mb_width * 4 * sizeof(s->ljpeg_buffer[0][0]));
+ buffer= s->ljpeg_buffer;
for(i=0; i<3; i++){
buffer[0][i]= 1 << (s->bits + point_transform - 1);
@@ -671,9 +674,9 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int predictor, int point
}
}else{
for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
- ptr[4*mb_x+0] = buffer[mb_x][0];
+ ptr[4*mb_x+0] = buffer[mb_x][2];
ptr[4*mb_x+1] = buffer[mb_x][1];
- ptr[4*mb_x+2] = buffer[mb_x][2];
+ ptr[4*mb_x+2] = buffer[mb_x][0];
}
}
}
@@ -768,14 +771,17 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah, i
uint8_t* data[MAX_COMPONENTS];
int linesize[MAX_COMPONENTS];
+ if(s->flipped && s->avctx->flags & CODEC_FLAG_EMU_EDGE) {
+ av_log(s->avctx, AV_LOG_ERROR, "Can not flip image with CODEC_FLAG_EMU_EDGE set!\n");
+ s->flipped = 0;
+ }
for(i=0; i < nb_components; i++) {
int c = s->comp_index[i];
data[c] = s->picture.data[c];
linesize[c]=s->linesize[c];
s->coefs_finished[c] |= 1;
- if(s->avctx->codec->id==CODEC_ID_AMV) {
+ if(s->flipped) {
//picture should be flipped upside-down for this codec
- assert(!(s->avctx->flags & CODEC_FLAG_EMU_EDGE));
data[c] += (linesize[c] * (s->v_scount[i] * (8 * s->mb_height -((s->height/s->v_max)&7)) - 1 ));
linesize[c] *= -1;
}
@@ -1176,6 +1182,10 @@ static int mjpeg_decode_com(MJpegDecodeContext *s)
else if(!strcmp(cbuf, "CS=ITU601")){
s->cs_itu601= 1;
}
+ else if((len > 20 && !strncmp(cbuf, "Intel(R) JPEG Library", 21)) ||
+ (len > 19 && !strncmp(cbuf, "Metasoft MJPEG Codec", 20))){
+ s->flipped = 1;
+ }
av_free(cbuf);
}
@@ -1494,8 +1504,13 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx)
MJpegDecodeContext *s = avctx->priv_data;
int i, j;
+ if (s->picture.data[0])
+ avctx->release_buffer(avctx, &s->picture);
+
av_free(s->buffer);
av_free(s->qscale_table);
+ av_freep(&s->ljpeg_buffer);
+ s->ljpeg_buffer_size=0;
for(i=0;i<2;i++) {
for(j=0;j<4;j++)
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mjpegdec.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mjpegdec.h
index 9ef8987db3..71773fb32e 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mjpegdec.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mjpegdec.h
@@ -101,6 +101,10 @@ typedef struct MJpegDecodeContext {
int mjpb_skiptosod;
int cur_scan; /* current scan, used by JPEG-LS */
+ int flipped; /* true if picture is flipped */
+
+ uint16_t (*ljpeg_buffer)[4];
+ unsigned int ljpeg_buffer_size;
} MJpegDecodeContext;
int ff_mjpeg_decode_init(AVCodecContext *avctx);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mjpegenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mjpegenc.c
index d7a85ee96c..129a257d70 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mjpegenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mjpegenc.c
@@ -211,7 +211,7 @@ void ff_mjpeg_encode_picture_header(MpegEncContext *s)
}
put_bits(&s->pb, 16, 17);
- if(lossless && s->avctx->pix_fmt == PIX_FMT_RGB32)
+ if(lossless && s->avctx->pix_fmt == PIX_FMT_BGRA)
put_bits(&s->pb, 8, 9); /* 9 bits/component RCT */
else
put_bits(&s->pb, 8, 8); /* 8 bits/component */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mlp.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mlp.c
index a290e465e5..87f7c77139 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mlp.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mlp.c
@@ -42,9 +42,14 @@ const uint8_t ff_mlp_huffman_tables[3][18][2] = {
};
static int crc_init = 0;
-static AVCRC crc_63[1024];
-static AVCRC crc_1D[1024];
-static AVCRC crc_2D[1024];
+#if CONFIG_SMALL
+#define CRC_TABLE_SIZE 257
+#else
+#define CRC_TABLE_SIZE 1024
+#endif
+static AVCRC crc_63[CRC_TABLE_SIZE];
+static AVCRC crc_1D[CRC_TABLE_SIZE];
+static AVCRC crc_2D[CRC_TABLE_SIZE];
av_cold void ff_mlp_init_crc(void)
{
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mlpdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mlpdec.c
index 88803959bf..d211ebd3ac 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mlpdec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mlpdec.c
@@ -155,15 +155,17 @@ static VLC huff_vlc[3];
static av_cold void init_static(void)
{
- INIT_VLC_STATIC(&huff_vlc[0], VLC_BITS, 18,
- &ff_mlp_huffman_tables[0][0][1], 2, 1,
- &ff_mlp_huffman_tables[0][0][0], 2, 1, 512);
- INIT_VLC_STATIC(&huff_vlc[1], VLC_BITS, 16,
- &ff_mlp_huffman_tables[1][0][1], 2, 1,
- &ff_mlp_huffman_tables[1][0][0], 2, 1, 512);
- INIT_VLC_STATIC(&huff_vlc[2], VLC_BITS, 15,
- &ff_mlp_huffman_tables[2][0][1], 2, 1,
- &ff_mlp_huffman_tables[2][0][0], 2, 1, 512);
+ if (!huff_vlc[0].bits) {
+ INIT_VLC_STATIC(&huff_vlc[0], VLC_BITS, 18,
+ &ff_mlp_huffman_tables[0][0][1], 2, 1,
+ &ff_mlp_huffman_tables[0][0][0], 2, 1, 512);
+ INIT_VLC_STATIC(&huff_vlc[1], VLC_BITS, 16,
+ &ff_mlp_huffman_tables[1][0][1], 2, 1,
+ &ff_mlp_huffman_tables[1][0][0], 2, 1, 512);
+ INIT_VLC_STATIC(&huff_vlc[2], VLC_BITS, 15,
+ &ff_mlp_huffman_tables[2][0][1], 2, 1,
+ &ff_mlp_huffman_tables[2][0][0], 2, 1, 512);
+ }
ff_mlp_init_crc();
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mmvideo.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mmvideo.c
index 6dc95589c6..596ca7aec4 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mmvideo.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mmvideo.c
@@ -58,9 +58,6 @@ static av_cold int mm_decode_init(AVCodecContext *avctx)
avctx->pix_fmt = PIX_FMT_PAL8;
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height))
- return -1;
-
s->frame.reference = 1;
if (avctx->get_buffer(avctx, &s->frame)) {
av_log(s->avctx, AV_LOG_ERROR, "mmvideo: get_buffer() failed\n");
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels.c
index 227b178135..ac9c6ecf81 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels.c
@@ -25,9 +25,7 @@
#define MAX_HUFF_CODES 16
-typedef struct YuvPixel {
- int8_t y, v, u;
-} YuvPixel;
+#include "motionpixels_tablegen.h"
typedef struct HuffCode {
int code;
@@ -51,67 +49,18 @@ typedef struct MotionPixelsContext {
int bswapbuf_size;
} MotionPixelsContext;
-static YuvPixel mp_rgb_yuv_table[1 << 15];
-
-static int mp_yuv_to_rgb(int y, int v, int u, int clip_rgb) {
- static const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
- int r, g, b;
-
- r = (1000 * y + 701 * v) / 1000;
- g = (1000 * y - 357 * v - 172 * u) / 1000;
- b = (1000 * y + 886 * u) / 1000;
- if (clip_rgb)
- return ((cm[r * 8] & 0xF8) << 7) | ((cm[g * 8] & 0xF8) << 2) | (cm[b * 8] >> 3);
- if ((unsigned)r < 32 && (unsigned)g < 32 && (unsigned)b < 32)
- return (r << 10) | (g << 5) | b;
- return 1 << 15;
-}
-
-static void mp_set_zero_yuv(YuvPixel *p)
-{
- int i, j;
-
- for (i = 0; i < 31; ++i) {
- for (j = 31; j > i; --j)
- if (!(p[j].u | p[j].v | p[j].y))
- p[j] = p[j - 1];
- for (j = 0; j < 31 - i; ++j)
- if (!(p[j].u | p[j].v | p[j].y))
- p[j] = p[j + 1];
- }
-}
-
-static void mp_build_rgb_yuv_table(YuvPixel *p)
-{
- int y, v, u, i;
-
- for (y = 0; y <= 31; ++y)
- for (v = -31; v <= 31; ++v)
- for (u = -31; u <= 31; ++u) {
- i = mp_yuv_to_rgb(y, v, u, 0);
- if (i < (1 << 15) && !(p[i].u | p[i].v | p[i].y)) {
- p[i].y = y;
- p[i].v = v;
- p[i].u = u;
- }
- }
- for (i = 0; i < 1024; ++i)
- mp_set_zero_yuv(p + i * 32);
-}
-
static av_cold int mp_decode_init(AVCodecContext *avctx)
{
MotionPixelsContext *mp = avctx->priv_data;
- if (!mp_rgb_yuv_table[0].u) {
- mp_build_rgb_yuv_table(mp_rgb_yuv_table);
- }
+ motionpixels_tableinit();
mp->avctx = avctx;
dsputil_init(&mp->dsp, avctx);
mp->changes_map = av_mallocz(avctx->width * avctx->height);
mp->offset_bits_len = av_log2(avctx->width * avctx->height) + 1;
mp->vpt = av_mallocz(avctx->height * sizeof(YuvPixel));
mp->hpt = av_mallocz(avctx->height * avctx->width / 16 * sizeof(YuvPixel));
+ avctx->pix_fmt = PIX_FMT_RGB555;
return 0;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels_tablegen.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels_tablegen.c
new file mode 100644
index 0000000000..188384b5a3
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels_tablegen.c
@@ -0,0 +1,44 @@
+/*
+ * Generate a header file for hardcoded motionpixels RGB to YUV table
+ *
+ * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdlib.h>
+#define CONFIG_HARDCODED_TABLES 0
+#define MAX_NEG_CROP 0
+#define ff_cropTbl ((uint8_t *)NULL)
+#include "motionpixels_tablegen.h"
+#include "tableprint.h"
+
+void tableinit(void)
+{
+ motionpixels_tableinit();
+}
+
+const struct tabledef tables[] = {
+ {
+ "static const YuvPixel mp_rgb_yuv_table[1 << 15]",
+ write_int8_2d_array,
+ mp_rgb_yuv_table,
+ 1 << 15,
+ 3
+ },
+ { NULL }
+};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels_tablegen.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels_tablegen.h
new file mode 100644
index 0000000000..5d6df52af1
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels_tablegen.h
@@ -0,0 +1,91 @@
+/*
+ * Header file for hardcoded motionpixels RGB to YUV table
+ *
+ * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef MOTIONPIXELS_TABLEGEN_H
+#define MOTIONPIXELS_TABLEGEN_H
+
+#include <stdint.h>
+
+typedef struct YuvPixel {
+ int8_t y, v, u;
+} YuvPixel;
+
+static int mp_yuv_to_rgb(int y, int v, int u, int clip_rgb) {
+ static const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ int r, g, b;
+
+ r = (1000 * y + 701 * v) / 1000;
+ g = (1000 * y - 357 * v - 172 * u) / 1000;
+ b = (1000 * y + 886 * u) / 1000;
+ if (clip_rgb)
+ return ((cm[r * 8] & 0xF8) << 7) | ((cm[g * 8] & 0xF8) << 2) | (cm[b * 8] >> 3);
+ if ((unsigned)r < 32 && (unsigned)g < 32 && (unsigned)b < 32)
+ return (r << 10) | (g << 5) | b;
+ return 1 << 15;
+}
+
+#if CONFIG_HARDCODED_TABLES
+#define motionpixels_tableinit()
+#include "libavcodec/motionpixels_tables.h"
+#else
+static YuvPixel mp_rgb_yuv_table[1 << 15];
+
+static void mp_set_zero_yuv(YuvPixel *p)
+{
+ int i, j;
+
+ for (i = 0; i < 31; ++i) {
+ for (j = 31; j > i; --j)
+ if (!(p[j].u | p[j].v | p[j].y))
+ p[j] = p[j - 1];
+ for (j = 0; j < 31 - i; ++j)
+ if (!(p[j].u | p[j].v | p[j].y))
+ p[j] = p[j + 1];
+ }
+}
+
+static void mp_build_rgb_yuv_table(YuvPixel *p)
+{
+ int y, v, u, i;
+
+ for (y = 0; y <= 31; ++y)
+ for (v = -31; v <= 31; ++v)
+ for (u = -31; u <= 31; ++u) {
+ i = mp_yuv_to_rgb(y, v, u, 0);
+ if (i < (1 << 15) && !(p[i].u | p[i].v | p[i].y)) {
+ p[i].y = y;
+ p[i].v = v;
+ p[i].u = u;
+ }
+ }
+ for (i = 0; i < 1024; ++i)
+ mp_set_zero_yuv(p + i * 32);
+}
+
+static void motionpixels_tableinit(void)
+{
+ if (!mp_rgb_yuv_table[0].u)
+ mp_build_rgb_yuv_table(mp_rgb_yuv_table);
+}
+#endif /* CONFIG_HARDCODED_TABLES */
+
+#endif /* MOTIONPIXELS_TABLEGEN_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpc.c
index f8fe4c4bc3..dc37df6095 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpc.c
@@ -33,11 +33,9 @@
#include "mpc.h"
#include "mpcdata.h"
-static DECLARE_ALIGNED_16(MPA_INT, mpa_window[512]);
-
void ff_mpc_init(void)
{
- ff_mpa_synth_init(mpa_window);
+ ff_mpa_synth_init(ff_mpa_synth_window);
}
/**
@@ -53,7 +51,7 @@ static void mpc_synth(MPCContext *c, int16_t *out)
samples_ptr = samples + ch;
for(i = 0; i < SAMPLES_PER_BAND; i++) {
ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]),
- mpa_window, &dither_state,
+ ff_mpa_synth_window, &dither_state,
samples_ptr, 2,
c->sb_samples[ch][i]);
samples_ptr += 64;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpc7.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpc7.c
index 614a418684..e80b8927f2 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpc7.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpc7.c
@@ -85,6 +85,9 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx)
c->IS, c->MSS, c->gapless, c->lastframelen, c->maxbands);
c->frames_to_skip = 0;
+ avctx->sample_fmt = SAMPLE_FMT_S16;
+ avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
+
if(vlc_initialized) return 0;
av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n");
scfi_vlc.table = scfi_table;
@@ -124,8 +127,6 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx)
}
}
vlc_initialized = 1;
- avctx->sample_fmt = SAMPLE_FMT_S16;
- avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
return 0;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpc8.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpc8.c
index e1b3866b0b..379528e9bd 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpc8.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpc8.c
@@ -129,6 +129,9 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
c->MSS = get_bits1(&gb);
c->frames = 1 << (get_bits(&gb, 3) * 2);
+ avctx->sample_fmt = SAMPLE_FMT_S16;
+ avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
+
if(vlc_initialized) return 0;
av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n");
@@ -219,8 +222,6 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
&mpc8_q8_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
}
vlc_initialized = 1;
- avctx->sample_fmt = SAMPLE_FMT_S16;
- avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
return 0;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg12.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg12.c
index 08dea404b4..636ae067c8 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg12.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg12.c
@@ -448,18 +448,20 @@ static int mpeg_decode_mb(MpegEncContext *s,
for(i=0;i<2;i++) {
if (USES_LIST(mb_type, i)) {
int dmx, dmy, mx, my, m;
+ const int my_shift= s->picture_structure == PICT_FRAME;
+
mx = mpeg_decode_motion(s, s->mpeg_f_code[i][0],
s->last_mv[i][0][0]);
s->last_mv[i][0][0] = mx;
s->last_mv[i][1][0] = mx;
dmx = get_dmv(s);
my = mpeg_decode_motion(s, s->mpeg_f_code[i][1],
- s->last_mv[i][0][1] >> 1);
+ s->last_mv[i][0][1] >> my_shift);
dmy = get_dmv(s);
- s->last_mv[i][0][1] = my<<1;
- s->last_mv[i][1][1] = my<<1;
+ s->last_mv[i][0][1] = my<<my_shift;
+ s->last_mv[i][1][1] = my<<my_shift;
s->mv[i][0][0] = mx;
s->mv[i][0][1] = my;
@@ -1172,7 +1174,7 @@ typedef struct Mpeg1Context {
int save_aspect_info;
int save_width, save_height, save_progressive_seq;
AVRational frame_rate_ext; ///< MPEG-2 specific framerate modificator
-
+ int sync; ///< Did we reach a sync point like a GOP/SEQ/KEYFrame?
} Mpeg1Context;
static av_cold int mpeg_decode_init(AVCodecContext *avctx)
@@ -1352,9 +1354,6 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
MpegEncContext *s = &s1->mpeg_enc_ctx;
int ref, f_code, vbv_delay;
- if(mpeg_decode_postinit(s->avctx) < 0)
- return -2;
-
init_get_bits(&s->gb, buf, buf_size*8);
ref = get_bits(&s->gb, 10); /* temporal ref */
@@ -1387,7 +1386,6 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
s->y_dc_scale = 8;
s->c_dc_scale = 8;
- s->first_slice = 1;
return 0;
}
@@ -1536,7 +1534,6 @@ static void mpeg_decode_picture_coding_extension(Mpeg1Context *s1)
s->pict_type= FF_B_TYPE;
s->current_picture.pict_type= s->pict_type;
s->current_picture.key_frame= s->pict_type == FF_I_TYPE;
- s->first_slice= 1;
}
s->intra_dc_precision = get_bits(&s->gb, 2);
s->picture_structure = get_bits(&s->gb, 2);
@@ -1550,6 +1547,21 @@ static void mpeg_decode_picture_coding_extension(Mpeg1Context *s1)
s->chroma_420_type = get_bits1(&s->gb);
s->progressive_frame = get_bits1(&s->gb);
+ if(s->progressive_sequence && !s->progressive_frame){
+ s->progressive_frame= 1;
+ av_log(s->avctx, AV_LOG_ERROR, "interlaced frame in progressive sequence, ignoring\n");
+ }
+
+ if(s->picture_structure==0 || (s->progressive_frame && s->picture_structure!=PICT_FRAME)){
+ av_log(s->avctx, AV_LOG_ERROR, "picture_structure %d invalid, ignoring\n", s->picture_structure);
+ s->picture_structure= PICT_FRAME;
+ }
+
+ if(s->progressive_sequence && !s->frame_pred_frame_dct){
+ av_log(s->avctx, AV_LOG_ERROR, "invalid frame_pred_frame_dct\n");
+ s->frame_pred_frame_dct= 1;
+ }
+
if(s->picture_structure == PICT_FRAME){
s->first_field=0;
s->v_edge_pos= 16*s->mb_height;
@@ -1579,35 +1591,6 @@ static void mpeg_decode_picture_coding_extension(Mpeg1Context *s1)
dprintf(s->avctx, "progressive_frame=%d\n", s->progressive_frame);
}
-static void mpeg_decode_extension(AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
-{
- Mpeg1Context *s1 = avctx->priv_data;
- MpegEncContext *s = &s1->mpeg_enc_ctx;
- int ext_type;
-
- init_get_bits(&s->gb, buf, buf_size*8);
-
- ext_type = get_bits(&s->gb, 4);
- switch(ext_type) {
- case 0x1:
- mpeg_decode_sequence_extension(s1);
- break;
- case 0x2:
- mpeg_decode_sequence_display_extension(s1);
- break;
- case 0x3:
- mpeg_decode_quant_matrix_extension(s);
- break;
- case 0x7:
- mpeg_decode_picture_display_extension(s1);
- break;
- case 0x8:
- mpeg_decode_picture_coding_extension(s1);
- break;
- }
-}
-
static void exchange_uv(MpegEncContext *s){
DCTELEM (*tmp)[64];
@@ -1690,10 +1673,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
s->resync_mb_x=
s->resync_mb_y= -1;
- if (mb_y<<field_pic >= s->mb_height){
- av_log(s->avctx, AV_LOG_ERROR, "slice below image (%d >= %d)\n", mb_y, s->mb_height);
- return -1;
- }
+ assert(mb_y < s->mb_height);
init_get_bits(&s->gb, *buf, buf_size*8);
@@ -1714,22 +1694,27 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
s->mb_x=0;
- for(;;) {
- int code = get_vlc2(&s->gb, mbincr_vlc.table, MBINCR_VLC_BITS, 2);
- if (code < 0){
- av_log(s->avctx, AV_LOG_ERROR, "first mb_incr damaged\n");
- return -1;
- }
- if (code >= 33) {
- if (code == 33) {
- s->mb_x += 33;
+ if(mb_y==0 && s->codec_tag == AV_RL32("SLIF")){
+ skip_bits1(&s->gb);
+ }else{
+ for(;;) {
+ int code = get_vlc2(&s->gb, mbincr_vlc.table, MBINCR_VLC_BITS, 2);
+ if (code < 0){
+ av_log(s->avctx, AV_LOG_ERROR, "first mb_incr damaged\n");
+ return -1;
+ }
+ if (code >= 33) {
+ if (code == 33) {
+ s->mb_x += 33;
+ }
+ /* otherwise, stuffing, nothing to do */
+ } else {
+ s->mb_x += code;
+ break;
}
- /* otherwise, stuffing, nothing to do */
- } else {
- s->mb_x += code;
- break;
}
}
+
if(s->mb_x >= (unsigned)s->mb_width){
av_log(s->avctx, AV_LOG_ERROR, "initial skip overflow\n");
return -1;
@@ -1773,11 +1758,9 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
return -1;
if(s->current_picture.motion_val[0] && !s->encoding){ //note motion_val is normally NULL unless we want to extract the MVs
- const int wrap = field_pic ? 2*s->b8_stride : s->b8_stride;
+ const int wrap = s->b8_stride;
int xy = s->mb_x*2 + s->mb_y*2*wrap;
int motion_x, motion_y, dir, i;
- if(field_pic && !s->first_field)
- xy += wrap/2;
for(i=0; i<2; i++){
for(dir=0; dir<2; dir++){
@@ -1812,13 +1795,13 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
if (++s->mb_x >= s->mb_width) {
const int mb_size= 16>>s->avctx->lowres;
- ff_draw_horiz_band(s, mb_size*s->mb_y, mb_size);
+ ff_draw_horiz_band(s, mb_size*(s->mb_y>>field_pic), mb_size);
s->mb_x = 0;
- s->mb_y++;
+ s->mb_y += 1<<field_pic;
- if(s->mb_y<<field_pic >= s->mb_height){
- int left= s->gb.size_in_bits - get_bits_count(&s->gb);
+ if(s->mb_y >= s->mb_height){
+ int left= get_bits_left(&s->gb);
int is_d10= s->chroma_format==2 && s->pict_type==FF_I_TYPE && avctx->profile==0 && avctx->level==5
&& s->intra_dc_precision == 2 && s->q_scale_type == 1 && s->alternate_scan == 0
&& s->progressive_frame == 0 /* vbv_delay == 0xBBB || 0xE10*/;
@@ -1881,7 +1864,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
s->mv[0][0][0] = s->mv[0][0][1] = 0;
s->last_mv[0][0][0] = s->last_mv[0][0][1] = 0;
s->last_mv[0][1][0] = s->last_mv[0][1][1] = 0;
- s->field_select[0][0]= s->picture_structure - 1;
+ s->field_select[0][0]= (s->picture_structure - 1) & 1;
} else {
/* if B type, reuse previous vectors and directions */
s->mv[0][0][0] = s->last_mv[0][0][0];
@@ -1902,8 +1885,9 @@ static int slice_decode_thread(AVCodecContext *c, void *arg){
MpegEncContext *s= *(void**)arg;
const uint8_t *buf= s->gb.buffer;
int mb_y= s->start_mb_y;
+ const int field_pic= s->picture_structure != PICT_FRAME;
- s->error_count= 3*(s->end_mb_y - s->start_mb_y)*s->mb_width;
+ s->error_count= (3*(s->end_mb_y - s->start_mb_y)*s->mb_width) >> field_pic;
for(;;){
uint32_t start_code;
@@ -2113,28 +2097,21 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
static void mpeg_decode_user_data(AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
+ const uint8_t *p, int buf_size)
{
- const uint8_t *p;
- int len, flags;
- p = buf;
- len = buf_size;
+ const uint8_t *buf_end = p+buf_size;
/* we parse the DTG active format information */
- if (len >= 5 &&
+ if (buf_end - p >= 5 &&
p[0] == 'D' && p[1] == 'T' && p[2] == 'G' && p[3] == '1') {
- flags = p[4];
+ int flags = p[4];
p += 5;
- len -= 5;
if (flags & 0x80) {
/* skip event id */
- if (len < 2)
- return;
p += 2;
- len -= 2;
}
if (flags & 0x40) {
- if (len < 1)
+ if (buf_end - p < 1)
return;
avctx->dtg_active_format = p[0] & 0x0f;
}
@@ -2299,6 +2276,7 @@ static int decode_chunks(AVCodecContext *avctx,
const uint8_t *buf_ptr = buf;
const uint8_t *buf_end = buf + buf_size;
int ret, input_size;
+ int last_code= 0;
for(;;) {
/* find next start code */
@@ -2335,50 +2313,102 @@ static int decode_chunks(AVCodecContext *avctx,
/* prepare data for next start code */
switch(start_code) {
case SEQ_START_CODE:
+ if(last_code == 0){
mpeg1_decode_sequence(avctx, buf_ptr,
input_size);
+ s->sync=1;
+ }else{
+ av_log(avctx, AV_LOG_ERROR, "ignoring SEQ_START_CODE after %X\n", last_code);
+ }
break;
case PICTURE_START_CODE:
+ if(last_code == 0 || last_code == SLICE_MIN_START_CODE){
+ if(mpeg_decode_postinit(avctx) < 0){
+ av_log(avctx, AV_LOG_ERROR, "mpeg_decode_postinit() failure\n");
+ return -1;
+ }
+
/* we have a complete image: we try to decompress it */
if(mpeg1_decode_picture(avctx,
buf_ptr, input_size) < 0)
s2->pict_type=0;
+ s2->first_slice = 1;
+ last_code= PICTURE_START_CODE;
+ }else{
+ av_log(avctx, AV_LOG_ERROR, "ignoring pic after %X\n", last_code);
+ }
break;
case EXT_START_CODE:
- mpeg_decode_extension(avctx,
- buf_ptr, input_size);
+ init_get_bits(&s2->gb, buf_ptr, input_size*8);
+
+ switch(get_bits(&s2->gb, 4)) {
+ case 0x1:
+ if(last_code == 0){
+ mpeg_decode_sequence_extension(s);
+ }else{
+ av_log(avctx, AV_LOG_ERROR, "ignoring seq ext after %X\n", last_code);
+ }
+ break;
+ case 0x2:
+ mpeg_decode_sequence_display_extension(s);
+ break;
+ case 0x3:
+ mpeg_decode_quant_matrix_extension(s2);
+ break;
+ case 0x7:
+ mpeg_decode_picture_display_extension(s);
+ break;
+ case 0x8:
+ if(last_code == PICTURE_START_CODE){
+ mpeg_decode_picture_coding_extension(s);
+ }else{
+ av_log(avctx, AV_LOG_ERROR, "ignoring pic cod ext after %X\n", last_code);
+ }
+ break;
+ }
break;
case USER_START_CODE:
mpeg_decode_user_data(avctx,
buf_ptr, input_size);
break;
case GOP_START_CODE:
+ if(last_code == 0){
s2->first_field=0;
mpeg_decode_gop(avctx,
buf_ptr, input_size);
+ s->sync=1;
+ }else{
+ av_log(avctx, AV_LOG_ERROR, "ignoring GOP_START_CODE after %X\n", last_code);
+ }
break;
default:
if (start_code >= SLICE_MIN_START_CODE &&
- start_code <= SLICE_MAX_START_CODE) {
- int mb_y= start_code - SLICE_MIN_START_CODE;
+ start_code <= SLICE_MAX_START_CODE && last_code!=0) {
+ const int field_pic= s2->picture_structure != PICT_FRAME;
+ int mb_y= (start_code - SLICE_MIN_START_CODE) << field_pic;
+ last_code= SLICE_MIN_START_CODE;
+
+ if(s2->picture_structure == PICT_BOTTOM_FIELD)
+ mb_y++;
+
+ if (mb_y >= s2->mb_height){
+ av_log(s2->avctx, AV_LOG_ERROR, "slice below image (%d >= %d)\n", mb_y, s2->mb_height);
+ return -1;
+ }
if(s2->last_picture_ptr==NULL){
/* Skip B-frames if we do not have reference frames and gop is not closed */
if(s2->pict_type==FF_B_TYPE){
- int i;
if(!s2->closed_gop)
break;
- /* Allocate a dummy frame */
- i= ff_find_unused_picture(s2, 0);
- s2->last_picture_ptr= &s2->picture[i];
- if(ff_alloc_picture(s2, s2->last_picture_ptr, 0) < 0)
- return -1;
}
}
+ if(s2->pict_type==FF_I_TYPE)
+ s->sync=1;
if(s2->next_picture_ptr==NULL){
/* Skip P-frames if we do not have a reference frame or we have an invalid header. */
- if(s2->pict_type==FF_P_TYPE && (s2->first_field || s2->picture_structure==PICT_FRAME)) break;
+ if(s2->pict_type==FF_P_TYPE && !s->sync) break;
}
/* Skip B-frames if we are in a hurry. */
if(avctx->hurry_up && s2->pict_type==FF_B_TYPE) break;
@@ -2448,6 +2478,14 @@ static int decode_chunks(AVCodecContext *avctx,
}
}
+static void flush(AVCodecContext *avctx){
+ Mpeg1Context *s = avctx->priv_data;
+
+ s->sync=0;
+
+ ff_mpeg_flush(avctx);
+}
+
static int mpeg_decode_end(AVCodecContext *avctx)
{
Mpeg1Context *s = avctx->priv_data;
@@ -2467,7 +2505,7 @@ AVCodec mpeg1video_decoder = {
mpeg_decode_end,
mpeg_decode_frame,
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
- .flush= ff_mpeg_flush,
+ .flush= flush,
.long_name= NULL_IF_CONFIG_SMALL("MPEG-1 video"),
};
@@ -2481,7 +2519,7 @@ AVCodec mpeg2video_decoder = {
mpeg_decode_end,
mpeg_decode_frame,
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
- .flush= ff_mpeg_flush,
+ .flush= flush,
.long_name= NULL_IF_CONFIG_SMALL("MPEG-2 video"),
};
@@ -2496,7 +2534,7 @@ AVCodec mpegvideo_decoder = {
mpeg_decode_end,
mpeg_decode_frame,
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
- .flush= ff_mpeg_flush,
+ .flush= flush,
.long_name= NULL_IF_CONFIG_SMALL("MPEG-1 video"),
};
@@ -2527,7 +2565,7 @@ AVCodec mpeg_xvmc_decoder = {
mpeg_decode_end,
mpeg_decode_frame,
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED| CODEC_CAP_HWACCEL | CODEC_CAP_DELAY,
- .flush= ff_mpeg_flush,
+ .flush= flush,
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1/2 video XvMC (X-Video Motion Compensation)"),
};
@@ -2544,7 +2582,7 @@ AVCodec mpeg_vdpau_decoder = {
mpeg_decode_end,
mpeg_decode_frame,
CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_HWACCEL_VDPAU | CODEC_CAP_DELAY,
- .flush= ff_mpeg_flush,
+ .flush= flush,
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1/2 video (VDPAU acceleration)"),
};
#endif
@@ -2560,7 +2598,7 @@ AVCodec mpeg1_vdpau_decoder = {
mpeg_decode_end,
mpeg_decode_frame,
CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_HWACCEL_VDPAU | CODEC_CAP_DELAY,
- .flush= ff_mpeg_flush,
+ .flush= flush,
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video (VDPAU acceleration)"),
};
#endif
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4audio.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4audio.c
index 6c0bc7d76a..7fe25bd3d6 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4audio.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4audio.c
@@ -24,6 +24,34 @@
#include "put_bits.h"
#include "mpeg4audio.h"
+/**
+ * Parse MPEG-4 audio configuration for ALS object type.
+ * @param[in] gb bit reader context
+ * @param[in] c MPEG4AudioConfig structure to fill
+ * @return on success 0 is returned, otherwise a value < 0
+ */
+static int parse_config_ALS(GetBitContext *gb, MPEG4AudioConfig *c)
+{
+ if (get_bits_left(gb) < 112)
+ return -1;
+
+ if (get_bits_long(gb, 32) != MKBETAG('A','L','S','\0'))
+ return -1;
+
+ // override AudioSpecificConfig channel configuration and sample rate
+ // which are buggy in old ALS conformance files
+ c->sample_rate = get_bits_long(gb, 32);
+
+ // skip number of samples
+ skip_bits_long(gb, 32);
+
+ // read number of channels
+ c->chan_config = 0;
+ c->channels = get_bits(gb, 16) + 1;
+
+ return 0;
+}
+
const int ff_mpeg4audio_sample_rates[16] = {
96000, 88200, 64000, 48000, 44100, 32000,
24000, 22050, 16000, 12000, 11025, 8000, 7350
@@ -57,6 +85,8 @@ int ff_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf, int buf_si
c->object_type = get_object_type(&gb);
c->sample_rate = get_sample_rate(&gb, &c->sampling_index);
c->chan_config = get_bits(&gb, 4);
+ if (c->chan_config < FF_ARRAY_ELEMS(ff_mpeg4audio_channels))
+ c->channels = ff_mpeg4audio_channels[c->chan_config];
c->sbr = -1;
if (c->object_type == AOT_SBR) {
c->ext_object_type = c->object_type;
@@ -71,8 +101,19 @@ int ff_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf, int buf_si
}
specific_config_bitindex = get_bits_count(&gb);
+ if (c->object_type == AOT_ALS) {
+ skip_bits(&gb, 5);
+ if (show_bits_long(&gb, 24) != MKBETAG('\0','A','L','S'))
+ skip_bits_long(&gb, 24);
+
+ specific_config_bitindex = get_bits_count(&gb);
+
+ if (parse_config_ALS(&gb, c))
+ return -1;
+ }
+
if (c->ext_object_type != AOT_SBR) {
- int bits_left = buf_size*8 - specific_config_bitindex;
+ int bits_left = buf_size*8 - get_bits_count(&gb);
for (; bits_left > 15; bits_left--) {
if (show_bits(&gb, 11) == 0x2b7) { // sync extension
get_bits(&gb, 11);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4audio.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4audio.h
index 98cddad2b1..59e8f1135b 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4audio.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4audio.h
@@ -36,6 +36,7 @@ typedef struct {
int ext_sampling_index;
int ext_sample_rate;
int ext_chan_config;
+ int channels;
} MPEG4AudioConfig;
extern const int ff_mpeg4audio_sample_rates[16];
@@ -84,7 +85,7 @@ enum AudioObjectType {
AOT_L2, ///< Y Layer 2
AOT_L3, ///< Y Layer 3
AOT_DST, ///< N Direct Stream Transfer
- AOT_ALS, ///< N Audio LosslesS
+ AOT_ALS, ///< Y Audio LosslesS
AOT_SLS, ///< N Scalable LosslesS
AOT_SLS_NON_CORE, ///< N Scalable LosslesS (non core)
AOT_ER_AAC_ELD, ///< N Error Resilient Enhanced Low Delay
@@ -92,7 +93,8 @@ enum AudioObjectType {
AOT_SMR_MAIN, ///< N Symbolic Music Representation Main
AOT_USAC_NOSBR, ///< N Unified Speech and Audio Coding (no SBR)
AOT_SAOC, ///< N Spatial Audio Object Coding
- AOT_USAC = 45, ///< N Unified Speech and Audio Coding
+ AOT_LD_SURROUND, ///< N Low Delay MPEG Surround
+ AOT_USAC, ///< N Unified Speech and Audio Coding
};
#define MAX_PCE_SIZE 304 ///<Maximum size of a PCE including the 3-bit ID_PCE
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4video_parser.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4video_parser.c
index 06094c6f54..cb20af4250 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4video_parser.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4video_parser.c
@@ -82,7 +82,7 @@ static int av_mpeg4_decode_header(AVCodecParserContext *s1,
init_get_bits(gb, buf, 8 * buf_size);
ret = ff_mpeg4_decode_picture_header(s, gb);
- if (s->width) {
+ if (s->width && (!avctx->width || !avctx->height || !avctx->coded_width || !avctx->coded_height)) {
avcodec_set_dimensions(avctx, s->width, s->height);
}
s1->pict_type= s->pict_type;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio.h
index cd10dbcfc0..d3bf1539b2 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio.h
@@ -88,7 +88,25 @@ typedef int32_t MPA_INT;
#define BACKSTEP_SIZE 512
#define EXTRABYTES 24
-struct GranuleDef;
+/* layer 3 "granule" */
+typedef struct GranuleDef {
+ uint8_t scfsi;
+ int part2_3_length;
+ int big_values;
+ int global_gain;
+ int scalefac_compress;
+ uint8_t block_type;
+ uint8_t switch_point;
+ int table_select[3];
+ int subblock_gain[3];
+ uint8_t scalefac_scale;
+ uint8_t count1table_select;
+ int region_size[3]; /* number of huffman codes in each region */
+ int preflag;
+ int short_start, long_end; /* long/short band indexes */
+ uint8_t scale_factors[40];
+ int32_t sb_hybrid[SBLIMIT * 18]; /* 576 samples */
+} GranuleDef;
#define MPA_DECODE_HEADER \
int frame_size; \
@@ -118,6 +136,7 @@ typedef struct MPADecodeContext {
int synth_buf_offset[MPA_MAX_CHANNELS];
DECLARE_ALIGNED_16(int32_t, sb_samples[MPA_MAX_CHANNELS][36][SBLIMIT]);
int32_t mdct_buf[MPA_MAX_CHANNELS][SBLIMIT * 18]; /* previous samples, for layer 3 MDCT */
+ GranuleDef granules[2][2]; /* Used in Layer 3 */
#ifdef DEBUG
int frame_count;
#endif
@@ -137,6 +156,7 @@ typedef struct HuffTable {
int ff_mpa_l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
int ff_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bitrate);
+extern MPA_INT ff_mpa_synth_window[];
void ff_mpa_synth_init(MPA_INT *window);
void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
MPA_INT *window, int *dither_state,
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio_tablegen.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio_tablegen.c
new file mode 100644
index 0000000000..9f832a3b0e
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio_tablegen.c
@@ -0,0 +1,60 @@
+/*
+ * Generate a header file for hardcoded mpegaudiodec tables
+ *
+ * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdlib.h>
+#define CONFIG_HARDCODED_TABLES 0
+#include "mpegaudio_tablegen.h"
+#include "tableprint.h"
+
+void tableinit(void)
+{
+ mpegaudio_tableinit();
+}
+
+const struct tabledef tables[] = {
+ {
+ "static const int8_t table_4_3_exp[TABLE_4_3_SIZE]",
+ write_int8_array,
+ table_4_3_exp,
+ TABLE_4_3_SIZE
+ },
+ {
+ "static const uint32_t table_4_3_value[TABLE_4_3_SIZE]",
+ write_uint32_array,
+ table_4_3_value,
+ TABLE_4_3_SIZE
+ },
+ {
+ "static const uint32_t exp_table[512]",
+ write_uint32_array,
+ exp_table,
+ 512
+ },
+ {
+ "static const uint32_t expval_table[512][16]",
+ write_uint32_2d_array,
+ expval_table,
+ 512,
+ 16
+ },
+ { NULL }
+};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio_tablegen.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio_tablegen.h
new file mode 100644
index 0000000000..9d056cb253
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio_tablegen.h
@@ -0,0 +1,67 @@
+/*
+ * Header file for hardcoded mpegaudiodec tables
+ *
+ * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef MPEGAUDIO_TABLEGEN_H
+#define MPEGAUDIO_TABLEGEN_H
+
+#include <stdint.h>
+// do not use libavutil/mathematics.h since this is compiled both
+// for the host and the target and config.h is only valid for the target
+#include <math.h>
+
+#define TABLE_4_3_SIZE (8191 + 16)*4
+#if CONFIG_HARDCODED_TABLES
+#define mpegaudio_tableinit()
+#include "libavcodec/mpegaudio_tables.h"
+#else
+static int8_t table_4_3_exp[TABLE_4_3_SIZE];
+static uint32_t table_4_3_value[TABLE_4_3_SIZE];
+static uint32_t exp_table[512];
+static uint32_t expval_table[512][16];
+
+static void mpegaudio_tableinit(void)
+{
+ int i, value, exponent;
+ for (i = 1; i < TABLE_4_3_SIZE; i++) {
+ double value = i / 4;
+ double f, fm;
+ int e, m;
+ f = value * cbrtf(value) * pow(2, (i & 3) * 0.25);
+ fm = frexp(f, &e);
+ m = (uint32_t)(fm * (1LL << 31) + 0.5);
+ e += FRAC_BITS - 31 + 5 - 100;
+
+ /* normalized to FRAC_BITS */
+ table_4_3_value[i] = m;
+ table_4_3_exp[i] = -e;
+ }
+ for (exponent = 0; exponent < 512; exponent++) {
+ for (value = 0; value < 16; value++) {
+ double f = (double)value * cbrtf(value) * pow(2, (exponent - 400) * 0.25 + FRAC_BITS + 5);
+ expval_table[exponent][value] = llrint(f);
+ }
+ exp_table[exponent] = expval_table[exponent][1];
+ }
+}
+#endif /* CONFIG_HARDCODED_TABLES */
+
+#endif /* MPEGAUDIO_TABLEGEN_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudiodec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudiodec.c
index dd986bd859..c3efd8657a 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudiodec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudiodec.c
@@ -49,26 +49,6 @@
#define HEADER_SIZE 4
-/* layer 3 "granule" */
-typedef struct GranuleDef {
- uint8_t scfsi;
- int part2_3_length;
- int big_values;
- int global_gain;
- int scalefac_compress;
- uint8_t block_type;
- uint8_t switch_point;
- int table_select[3];
- int subblock_gain[3];
- uint8_t scalefac_scale;
- uint8_t count1table_select;
- int region_size[3]; /* number of huffman codes in each region */
- int preflag;
- int short_start, long_end; /* long/short band indexes */
- uint8_t scale_factors[40];
- int32_t sb_hybrid[SBLIMIT * 18]; /* 576 samples */
-} GranuleDef;
-
#include "mpegaudiodata.h"
#include "mpegaudiodectab.h"
@@ -92,12 +72,7 @@ static const int huff_quad_vlc_tables_sizes[2] = {
};
/* computed from band_size_long */
static uint16_t band_index_long[9][23];
-/* XXX: free when all decoders are closed */
-#define TABLE_4_3_SIZE (8191 + 16)*4
-static int8_t table_4_3_exp[TABLE_4_3_SIZE];
-static uint32_t table_4_3_value[TABLE_4_3_SIZE];
-static uint32_t exp_table[512];
-static uint32_t expval_table[512][16];
+#include "mpegaudio_tablegen.h"
/* intensity stereo coef table */
static int32_t is_table[2][16];
static int32_t is_table_lsf[2][2][16];
@@ -120,7 +95,7 @@ static const int32_t scale_factor_mult2[3][3] = {
SCALE_GEN(4.0 / 9.0), /* 9 steps */
};
-static DECLARE_ALIGNED_16(MPA_INT, window[512]);
+DECLARE_ALIGNED_16(MPA_INT, ff_mpa_synth_window[512]);
/**
* Convert region offsets to region sizes and truncate
@@ -351,7 +326,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
scale_factor_mult[i][2]);
}
- ff_mpa_synth_init(window);
+ ff_mpa_synth_init(ff_mpa_synth_window);
/* huffman decode tables */
offset = 0;
@@ -407,25 +382,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
/* compute n ^ (4/3) and store it in mantissa/exp format */
int_pow_init();
- for(i=1;i<TABLE_4_3_SIZE;i++) {
- double f, fm;
- int e, m;
- f = pow((double)(i/4), 4.0 / 3.0) * pow(2, (i&3)*0.25);
- fm = frexp(f, &e);
- m = (uint32_t)(fm*(1LL<<31) + 0.5);
- e+= FRAC_BITS - 31 + 5 - 100;
-
- /* normalized to FRAC_BITS */
- table_4_3_value[i] = m;
- table_4_3_exp[i] = -e;
- }
- for(i=0; i<512*16; i++){
- int exponent= (i>>4);
- double f= pow(i&15, 4.0 / 3.0) * pow(2, (exponent-400)*0.25 + FRAC_BITS + 5);
- expval_table[exponent][i&15]= llrint(f);
- if((i&15)==1)
- exp_table[exponent]= llrint(f);
- }
+ mpegaudio_tableinit();
for(i=0;i<7;i++) {
float f;
@@ -1935,7 +1892,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
{
int nb_granules, main_data_begin, private_bits;
int gr, ch, blocksplit_flag, i, j, k, n, bits_pos;
- GranuleDef granules[2][2], *g;
+ GranuleDef *g;
int16_t exponents[576];
/* read side info */
@@ -1951,15 +1908,15 @@ static int mp_decode_layer3(MPADecodeContext *s)
private_bits = get_bits(&s->gb, 5);
nb_granules = 2;
for(ch=0;ch<s->nb_channels;ch++) {
- granules[ch][0].scfsi = 0; /* all scale factors are transmitted */
- granules[ch][1].scfsi = get_bits(&s->gb, 4);
+ s->granules[ch][0].scfsi = 0;/* all scale factors are transmitted */
+ s->granules[ch][1].scfsi = get_bits(&s->gb, 4);
}
}
for(gr=0;gr<nb_granules;gr++) {
for(ch=0;ch<s->nb_channels;ch++) {
dprintf(s->avctx, "gr=%d ch=%d: side_info\n", gr, ch);
- g = &granules[ch][gr];
+ g = &s->granules[ch][gr];
g->part2_3_length = get_bits(&s->gb, 12);
g->big_values = get_bits(&s->gb, 9);
if(g->big_values > 288){
@@ -2031,7 +1988,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
for(gr=0;gr<nb_granules;gr++) {
for(ch=0;ch<s->nb_channels;ch++) {
- g = &granules[ch][gr];
+ g = &s->granules[ch][gr];
if(get_bits_count(&s->gb)<0){
av_log(s->avctx, AV_LOG_DEBUG, "mdb:%d, lastbuf:%d skipping granule %d\n",
main_data_begin, s->last_buf_size, gr);
@@ -2075,7 +2032,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
g->scale_factors[j++] = 0;
}
} else {
- sc = granules[ch][0].scale_factors;
+ sc = s->granules[ch][0].scale_factors;
j = 0;
for(k=0;k<4;k++) {
n = (k == 0 ? 6 : 5);
@@ -2160,10 +2117,10 @@ static int mp_decode_layer3(MPADecodeContext *s)
} /* ch */
if (s->nb_channels == 2)
- compute_stereo(s, &granules[0][gr], &granules[1][gr]);
+ compute_stereo(s, &s->granules[0][gr], &s->granules[1][gr]);
for(ch=0;ch<s->nb_channels;ch++) {
- g = &granules[ch][gr];
+ g = &s->granules[ch][gr];
reorder_block(s, g);
s->compute_antialias(s, g);
@@ -2205,7 +2162,7 @@ static int mp_decode_frame(MPADecodeContext *s,
s->last_buf_size=0;
if(s->in_gb.buffer){
align_get_bits(&s->gb);
- i= (s->gb.size_in_bits - get_bits_count(&s->gb))>>3;
+ i= get_bits_left(&s->gb)>>3;
if(i >= 0 && i <= BACKSTEP_SIZE){
memmove(s->last_buf, s->gb.buffer + (get_bits_count(&s->gb)>>3), i);
s->last_buf_size=i;
@@ -2217,7 +2174,7 @@ static int mp_decode_frame(MPADecodeContext *s,
align_get_bits(&s->gb);
assert((get_bits_count(&s->gb) & 7) == 0);
- i= (s->gb.size_in_bits - get_bits_count(&s->gb))>>3;
+ i= get_bits_left(&s->gb)>>3;
if(i<0 || i > BACKSTEP_SIZE || nb_frames<0){
if(i<0)
@@ -2236,7 +2193,7 @@ static int mp_decode_frame(MPADecodeContext *s,
samples_ptr = samples + ch;
for(i=0;i<nb_frames;i++) {
ff_mpa_synth_filter(s->synth_buf[ch], &(s->synth_buf_offset[ch]),
- window, &s->dither_state,
+ ff_mpa_synth_window, &s->dither_state,
samples_ptr, s->nb_channels,
s->sb_samples[ch][i]);
samples_ptr += 32 * s->nb_channels;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo.c
index 08ad85073c..65f900eb9c 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo.c
@@ -894,7 +894,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
}
}
}
-alloc:
+
if(!s->encoding){
/* release non reference frames */
for(i=0; i<MAX_PICTURE_COUNT; i++){
@@ -946,15 +946,27 @@ alloc:
s->current_picture_ptr ? s->current_picture_ptr->data[0] : NULL,
s->pict_type, s->dropable);*/
+ if(s->codec_id != CODEC_ID_H264){
+ if((s->last_picture_ptr==NULL || s->last_picture_ptr->data[0]==NULL) && s->pict_type!=FF_I_TYPE){
+ av_log(avctx, AV_LOG_ERROR, "warning: first frame is no keyframe\n");
+ /* Allocate a dummy frame */
+ i= ff_find_unused_picture(s, 0);
+ s->last_picture_ptr= &s->picture[i];
+ if(ff_alloc_picture(s, s->last_picture_ptr, 0) < 0)
+ return -1;
+ }
+ if((s->next_picture_ptr==NULL || s->next_picture_ptr->data[0]==NULL) && s->pict_type==FF_B_TYPE){
+ /* Allocate a dummy frame */
+ i= ff_find_unused_picture(s, 0);
+ s->next_picture_ptr= &s->picture[i];
+ if(ff_alloc_picture(s, s->next_picture_ptr, 0) < 0)
+ return -1;
+ }
+ }
+
if(s->last_picture_ptr) ff_copy_picture(&s->last_picture, s->last_picture_ptr);
if(s->next_picture_ptr) ff_copy_picture(&s->next_picture, s->next_picture_ptr);
- if(s->pict_type != FF_I_TYPE && (s->last_picture_ptr==NULL || s->last_picture_ptr->data[0]==NULL) && !s->dropable && s->codec_id != CODEC_ID_H264){
- av_log(avctx, AV_LOG_ERROR, "warning: first frame is no keyframe\n");
- assert(s->pict_type != FF_B_TYPE); //these should have been dropped if we don't have a reference
- goto alloc;
- }
-
assert(s->pict_type == FF_I_TYPE || (s->last_picture_ptr && s->last_picture_ptr->data[0]));
if(s->picture_structure!=PICT_FRAME && s->out_format != FMT_H264){
@@ -1441,7 +1453,7 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
int field_based, int bottom_field, int field_select,
uint8_t **ref_picture, h264_chroma_mc_func *pix_op,
- int motion_x, int motion_y, int h)
+ int motion_x, int motion_y, int h, int mb_y)
{
uint8_t *ptr_y, *ptr_cb, *ptr_cr;
int mx, my, src_x, src_y, uvsrc_x, uvsrc_y, uvlinesize, linesize, sx, sy, uvsx, uvsy;
@@ -1465,7 +1477,7 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
sx= motion_x & s_mask;
sy= motion_y & s_mask;
src_x = s->mb_x*2*block_s + (motion_x >> (lowres+1));
- src_y =(s->mb_y*2*block_s>>field_based) + (motion_y >> (lowres+1));
+ src_y =( mb_y*2*block_s>>field_based) + (motion_y >> (lowres+1));
if (s->out_format == FMT_H263) {
uvsx = ((motion_x>>1) & s_mask) | (sx&1);
@@ -1478,14 +1490,14 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
uvsx = (2*mx) & s_mask;
uvsy = (2*my) & s_mask;
uvsrc_x = s->mb_x*block_s + (mx >> lowres);
- uvsrc_y = s->mb_y*block_s + (my >> lowres);
+ uvsrc_y = mb_y*block_s + (my >> lowres);
} else {
mx = motion_x / 2;
my = motion_y / 2;
uvsx = mx & s_mask;
uvsy = my & s_mask;
uvsrc_x = s->mb_x*block_s + (mx >> (lowres+1));
- uvsrc_y =(s->mb_y*block_s>>field_based) + (my >> (lowres+1));
+ uvsrc_y =( mb_y*block_s>>field_based) + (my >> (lowres+1));
}
ptr_y = ref_picture[0] + src_y * linesize + src_x;
@@ -1612,7 +1624,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s,
mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
0, 0, 0,
ref_picture, pix_op,
- s->mv[dir][0][0], s->mv[dir][0][1], 2*block_s);
+ s->mv[dir][0][0], s->mv[dir][0][1], 2*block_s, mb_y);
break;
case MV_TYPE_8X8:
mx = 0;
@@ -1639,12 +1651,12 @@ static inline void MPV_motion_lowres(MpegEncContext *s,
mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
1, 0, s->field_select[dir][0],
ref_picture, pix_op,
- s->mv[dir][0][0], s->mv[dir][0][1], block_s);
+ s->mv[dir][0][0], s->mv[dir][0][1], block_s, mb_y);
/* bottom field */
mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
1, 1, s->field_select[dir][1],
ref_picture, pix_op,
- s->mv[dir][1][0], s->mv[dir][1][1], block_s);
+ s->mv[dir][1][0], s->mv[dir][1][1], block_s, mb_y);
} else {
if(s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != FF_B_TYPE && !s->first_field){
ref_picture= s->current_picture_ptr->data;
@@ -1653,7 +1665,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s,
mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
0, 0, s->field_select[dir][0],
ref_picture, pix_op,
- s->mv[dir][0][0], s->mv[dir][0][1], 2*block_s);
+ s->mv[dir][0][0], s->mv[dir][0][1], 2*block_s, mb_y>>1);
}
break;
case MV_TYPE_16X8:
@@ -1669,7 +1681,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s,
mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
0, 0, s->field_select[dir][i],
ref2picture, pix_op,
- s->mv[dir][i][0], s->mv[dir][i][1] + 2*block_s*i, block_s);
+ s->mv[dir][i][0], s->mv[dir][i][1] + 2*block_s*i, block_s, mb_y>>1);
dest_y += 2*block_s*s->linesize;
dest_cb+= (2*block_s>>s->chroma_y_shift)*s->uvlinesize;
@@ -1684,7 +1696,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s,
mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
1, j, j^i,
ref_picture, pix_op,
- s->mv[dir][2*i + j][0], s->mv[dir][2*i + j][1], block_s);
+ s->mv[dir][2*i + j][0], s->mv[dir][2*i + j][1], block_s, mb_y);
}
pix_op = s->dsp.avg_h264_chroma_pixels_tab;
}
@@ -1693,7 +1705,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s,
mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
0, 0, s->picture_structure != i+1,
ref_picture, pix_op,
- s->mv[dir][2*i][0],s->mv[dir][2*i][1],2*block_s);
+ s->mv[dir][2*i][0],s->mv[dir][2*i][1],2*block_s, mb_y>>1);
// after put we make avg of the same block
pix_op = s->dsp.avg_h264_chroma_pixels_tab;
@@ -2034,16 +2046,17 @@ void MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]){
void ff_draw_horiz_band(MpegEncContext *s, int y, int h){
if (s->avctx->draw_horiz_band) {
AVFrame *src;
+ const int field_pic= s->picture_structure != PICT_FRAME;
int offset[4];
- if(s->picture_structure != PICT_FRAME){
+ h= FFMIN(h, (s->avctx->height>>field_pic) - y);
+
+ if(field_pic && !(s->avctx->slice_flags&SLICE_FLAG_ALLOW_FIELD)){
h <<= 1;
y <<= 1;
- if(s->first_field && !(s->avctx->slice_flags&SLICE_FLAG_ALLOW_FIELD)) return;
+ if(s->first_field) return;
}
- h= FFMIN(h, s->avctx->height - y);
-
if(s->pict_type==FF_B_TYPE || s->low_delay || (s->avctx->slice_flags&SLICE_FLAG_CODED_ORDER))
src= (AVFrame*)s->current_picture_ptr;
else if(s->last_picture_ptr)
@@ -2089,9 +2102,16 @@ void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename
if(!(s->pict_type==FF_B_TYPE && s->avctx->draw_horiz_band && s->picture_structure==PICT_FRAME))
{
+ if(s->picture_structure==PICT_FRAME){
s->dest[0] += s->mb_y * linesize << mb_size;
s->dest[1] += s->mb_y * uvlinesize << (mb_size - s->chroma_y_shift);
s->dest[2] += s->mb_y * uvlinesize << (mb_size - s->chroma_y_shift);
+ }else{
+ s->dest[0] += (s->mb_y>>1) * linesize << mb_size;
+ s->dest[1] += (s->mb_y>>1) * uvlinesize << (mb_size - s->chroma_y_shift);
+ s->dest[2] += (s->mb_y>>1) * uvlinesize << (mb_size - s->chroma_y_shift);
+ assert((s->mb_y&1) == (s->picture_structure == PICT_BOTTOM_FIELD));
+ }
}
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo.h
index 9b19841a11..4a37ada5c9 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo.h
@@ -54,7 +54,7 @@ enum OutputFormat {
#define MAX_FCODE 7
#define MAX_MV 2048
-#define MAX_THREADS 8
+#define MAX_THREADS 16
#define MAX_PICTURE_COUNT 32
@@ -571,6 +571,7 @@ typedef struct MpegEncContext {
/* RV10 specific */
int rv10_version; ///< RV10 version: 0 or 3
int rv10_first_dc_coded[3];
+ int orig_width, orig_height;
/* MJPEG specific */
struct MJpegContext *mjpeg_ctx;
@@ -854,6 +855,7 @@ int ff_h263_get_gob_height(MpegEncContext *s);
void ff_mpeg4_init_direct_mv(MpegEncContext *s);
int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my);
void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code);
+void ff_init_qscale_tab(MpegEncContext *s);
/* rv10.c */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_common.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_common.h
index 5ce60dc64c..dc817fd600 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_common.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_common.h
@@ -242,7 +242,7 @@ void mpeg_motion_internal(MpegEncContext *s,
uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
int field_based, int bottom_field, int field_select,
uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
- int motion_x, int motion_y, int h, int is_mpeg12)
+ int motion_x, int motion_y, int h, int is_mpeg12, int mb_y)
{
uint8_t *ptr_y, *ptr_cb, *ptr_cr;
int dxy, uvdxy, mx, my, src_x, src_y,
@@ -262,7 +262,7 @@ if(s->quarter_sample)
dxy = ((motion_y & 1) << 1) | (motion_x & 1);
src_x = s->mb_x* 16 + (motion_x >> 1);
- src_y =(s->mb_y<<(4-field_based)) + (motion_y >> 1);
+ src_y =( mb_y<<(4-field_based)) + (motion_y >> 1);
if (!is_mpeg12 && s->out_format == FMT_H263) {
if((s->workaround_bugs & FF_BUG_HPEL_CHROMA) && field_based){
@@ -270,7 +270,7 @@ if(s->quarter_sample)
my = motion_y >>1;
uvdxy = ((my & 1) << 1) | (mx & 1);
uvsrc_x = s->mb_x* 8 + (mx >> 1);
- uvsrc_y = (s->mb_y<<(3-field_based)) + (my >> 1);
+ uvsrc_y =( mb_y<<(3-field_based))+ (my >> 1);
}else{
uvdxy = dxy | (motion_y & 2) | ((motion_x & 2) >> 1);
uvsrc_x = src_x>>1;
@@ -281,14 +281,14 @@ if(s->quarter_sample)
my = motion_y / 4;
uvdxy = 0;
uvsrc_x = s->mb_x*8 + mx;
- uvsrc_y = s->mb_y*8 + my;
+ uvsrc_y = mb_y*8 + my;
} else {
if(s->chroma_y_shift){
mx = motion_x / 2;
my = motion_y / 2;
uvdxy = ((my & 1) << 1) | (mx & 1);
uvsrc_x = s->mb_x* 8 + (mx >> 1);
- uvsrc_y = (s->mb_y<<(3-field_based)) + (my >> 1);
+ uvsrc_y =( mb_y<<(3-field_based))+ (my >> 1);
} else {
if(s->chroma_x_shift){
//Chroma422
@@ -314,7 +314,7 @@ if(s->quarter_sample)
if(is_mpeg12 || s->codec_id == CODEC_ID_MPEG2VIDEO ||
s->codec_id == CODEC_ID_MPEG1VIDEO){
av_log(s->avctx,AV_LOG_DEBUG,
- "MPEG motion vector out of boundary\n");
+ "MPEG motion vector out of boundary (%d %d)\n", src_x, src_y);
return;
}
ff_emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize,
@@ -370,18 +370,18 @@ void mpeg_motion(MpegEncContext *s,
uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
int field_based, int bottom_field, int field_select,
uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
- int motion_x, int motion_y, int h)
+ int motion_x, int motion_y, int h, int mb_y)
{
#if !CONFIG_SMALL
if(s->out_format == FMT_MPEG1)
mpeg_motion_internal(s, dest_y, dest_cb, dest_cr, field_based,
bottom_field, field_select, ref_picture, pix_op,
- motion_x, motion_y, h, 1);
+ motion_x, motion_y, h, 1, mb_y);
else
#endif
mpeg_motion_internal(s, dest_y, dest_cb, dest_cr, field_based,
bottom_field, field_select, ref_picture, pix_op,
- motion_x, motion_y, h, 0);
+ motion_x, motion_y, h, 0, mb_y);
}
//FIXME move to dsputil, avg variant, 16x16 version
@@ -736,7 +736,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
mpeg_motion(s, dest_y, dest_cb, dest_cr,
0, 0, 0,
ref_picture, pix_op,
- s->mv[dir][0][0], s->mv[dir][0][1], 16);
+ s->mv[dir][0][0], s->mv[dir][0][1], 16, mb_y);
}
break;
case MV_TYPE_8X8:
@@ -810,12 +810,12 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
mpeg_motion(s, dest_y, dest_cb, dest_cr,
1, 0, s->field_select[dir][0],
ref_picture, pix_op,
- s->mv[dir][0][0], s->mv[dir][0][1], 8);
+ s->mv[dir][0][0], s->mv[dir][0][1], 8, mb_y);
/* bottom field */
mpeg_motion(s, dest_y, dest_cb, dest_cr,
1, 1, s->field_select[dir][1],
ref_picture, pix_op,
- s->mv[dir][1][0], s->mv[dir][1][1], 8);
+ s->mv[dir][1][0], s->mv[dir][1][1], 8, mb_y);
}
} else {
if(s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != FF_B_TYPE && !s->first_field){
@@ -825,7 +825,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
mpeg_motion(s, dest_y, dest_cb, dest_cr,
0, 0, s->field_select[dir][0],
ref_picture, pix_op,
- s->mv[dir][0][0], s->mv[dir][0][1], 16);
+ s->mv[dir][0][0], s->mv[dir][0][1], 16, mb_y>>1);
}
break;
case MV_TYPE_16X8:
@@ -842,7 +842,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
mpeg_motion(s, dest_y, dest_cb, dest_cr,
0, 0, s->field_select[dir][i],
ref2picture, pix_op,
- s->mv[dir][i][0], s->mv[dir][i][1] + 16*i, 8);
+ s->mv[dir][i][0], s->mv[dir][i][1] + 16*i, 8, mb_y>>1);
dest_y += 16*s->linesize;
dest_cb+= (16>>s->chroma_y_shift)*s->uvlinesize;
@@ -857,7 +857,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
mpeg_motion(s, dest_y, dest_cb, dest_cr,
1, j, j^i,
ref_picture, pix_op,
- s->mv[dir][2*i + j][0], s->mv[dir][2*i + j][1], 8);
+ s->mv[dir][2*i + j][0], s->mv[dir][2*i + j][1], 8, mb_y);
}
pix_op = s->dsp.avg_pixels_tab;
}
@@ -866,7 +866,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
mpeg_motion(s, dest_y, dest_cb, dest_cr,
0, 0, s->picture_structure != i+1,
ref_picture, pix_op,
- s->mv[dir][2*i][0],s->mv[dir][2*i][1],16);
+ s->mv[dir][2*i][0],s->mv[dir][2*i][1],16, mb_y>>1);
// after put we make avg of the same block
pix_op=s->dsp.avg_pixels_tab;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_enc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_enc.c
index 0b21574521..d7e7c4c726 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_enc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_enc.c
@@ -146,6 +146,20 @@ void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix){
put_bits(pb, 1, 0);
}
+/**
+ * init s->current_picture.qscale_table from s->lambda_table
+ */
+void ff_init_qscale_tab(MpegEncContext *s){
+ int8_t * const qscale_table= s->current_picture.qscale_table;
+ int i;
+
+ for(i=0; i<s->mb_num; i++){
+ unsigned int lam= s->lambda_table[ s->mb_index2xy[i] ];
+ int qp= (lam*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7);
+ qscale_table[ s->mb_index2xy[i] ]= av_clip(qp, s->avctx->qmin, s->avctx->qmax);
+ }
+}
+
static void copy_picture_attributes(MpegEncContext *s, AVFrame *dst, AVFrame *src){
int i;
@@ -381,6 +395,14 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
return -1;
}
+ if ((s->codec_id == CODEC_ID_MPEG4 || s->codec_id == CODEC_ID_H263 ||
+ s->codec_id == CODEC_ID_H263P) &&
+ (avctx->sample_aspect_ratio.num > 255 || avctx->sample_aspect_ratio.den > 255)) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid pixel aspect ratio %i/%i, limit is 255/255\n",
+ avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den);
+ return -1;
+ }
+
if((s->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME|CODEC_FLAG_ALT_SCAN))
&& s->codec_id != CODEC_ID_MPEG4 && s->codec_id != CODEC_ID_MPEG2VIDEO){
av_log(avctx, AV_LOG_ERROR, "interlacing not supported by codec\n");
@@ -517,12 +539,18 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
case CODEC_ID_MJPEG:
s->out_format = FMT_MJPEG;
s->intra_only = 1; /* force intra only for jpeg */
- s->mjpeg_vsample[0] = 2;
- s->mjpeg_vsample[1] = 2>>chroma_v_shift;
- s->mjpeg_vsample[2] = 2>>chroma_v_shift;
- s->mjpeg_hsample[0] = 2;
- s->mjpeg_hsample[1] = 2>>chroma_h_shift;
- s->mjpeg_hsample[2] = 2>>chroma_h_shift;
+ if(avctx->codec->id == CODEC_ID_LJPEG && avctx->pix_fmt == PIX_FMT_BGRA){
+ s->mjpeg_vsample[0] = s->mjpeg_hsample[0] =
+ s->mjpeg_vsample[1] = s->mjpeg_hsample[1] =
+ s->mjpeg_vsample[2] = s->mjpeg_hsample[2] = 1;
+ }else{
+ s->mjpeg_vsample[0] = 2;
+ s->mjpeg_vsample[1] = 2>>chroma_v_shift;
+ s->mjpeg_vsample[2] = 2>>chroma_v_shift;
+ s->mjpeg_hsample[0] = 2;
+ s->mjpeg_hsample[1] = 2>>chroma_h_shift;
+ s->mjpeg_hsample[2] = 2>>chroma_h_shift;
+ }
if (!(CONFIG_MJPEG_ENCODER || CONFIG_LJPEG_ENCODER)
|| ff_mjpeg_encode_init(s) < 0)
return -1;
@@ -2690,6 +2718,8 @@ static int estimate_qp(MpegEncContext *s, int dry_run){
if (CONFIG_H263_ENCODER)
ff_clean_h263_qscales(s);
break;
+ default:
+ ff_init_qscale_tab(s);
}
s->lambda= s->lambda_table[0];
@@ -3760,7 +3790,7 @@ AVCodec flv_encoder = {
MPV_encode_picture,
MPV_encode_end,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
- .long_name= NULL_IF_CONFIG_SMALL("Flash Video (FLV)"),
+ .long_name= NULL_IF_CONFIG_SMALL("Flash Video (FLV) / Sorenson Spark / Sorenson H.263"),
};
AVCodec mpeg4_encoder = {
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_parser.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_parser.c
index 215c86c400..28ed590320 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_parser.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_parser.c
@@ -28,15 +28,16 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
const uint8_t *buf, int buf_size)
{
ParseContext1 *pc = s->priv_data;
- const uint8_t *buf_end;
+ const uint8_t *buf_end = buf + buf_size;
uint32_t start_code;
int frame_rate_index, ext_type, bytes_left;
int frame_rate_ext_n, frame_rate_ext_d;
int picture_structure, top_field_first, repeat_first_field, progressive_frame;
int horiz_size_ext, vert_size_ext, bit_rate_ext;
+ int did_set_size=0;
//FIXME replace the crap with get_bits()
s->repeat_pict = 0;
- buf_end = buf + buf_size;
+
while (buf < buf_end) {
start_code= -1;
buf= ff_find_start_code(buf, buf_end, &start_code);
@@ -51,7 +52,10 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
if (bytes_left >= 7) {
pc->width = (buf[0] << 4) | (buf[1] >> 4);
pc->height = ((buf[1] & 0x0f) << 8) | buf[2];
- avcodec_set_dimensions(avctx, pc->width, pc->height);
+ if(!avctx->width || !avctx->height || !avctx->coded_width || !avctx->coded_height){
+ avcodec_set_dimensions(avctx, pc->width, pc->height);
+ did_set_size=1;
+ }
frame_rate_index = buf[3] & 0xf;
pc->frame_rate.den = avctx->time_base.den = ff_frame_rate_tab[frame_rate_index].num;
pc->frame_rate.num = avctx->time_base.num = ff_frame_rate_tab[frame_rate_index].den;
@@ -77,7 +81,8 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
pc->width |=(horiz_size_ext << 12);
pc->height |=( vert_size_ext << 12);
avctx->bit_rate += (bit_rate_ext << 18) * 400;
- avcodec_set_dimensions(avctx, pc->width, pc->height);
+ if(did_set_size)
+ avcodec_set_dimensions(avctx, pc->width, pc->height);
avctx->time_base.den = pc->frame_rate.den * (frame_rate_ext_n + 1) * 2;
avctx->time_base.num = pc->frame_rate.num * (frame_rate_ext_d + 1);
avctx->codec_id = CODEC_ID_MPEG2VIDEO;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_xvmc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_xvmc.c
index b73a399b9e..df81e5da68 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_xvmc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegvideo_xvmc.c
@@ -48,7 +48,7 @@ void ff_xvmc_init_block(MpegEncContext *s)
}
/**
- * Fill individual block pointers, so there are no gaps in the data_block array
+ * Fills individual block pointers, so there are no gaps in the data_block array
* in case not all blocks in the macroblock are coded.
*/
void ff_xvmc_pack_pblocks(MpegEncContext *s, int cbp)
@@ -67,7 +67,7 @@ void ff_xvmc_pack_pblocks(MpegEncContext *s, int cbp)
}
/**
- * Find and store the surfaces that are used as reference frames.
+ * Finds and stores the surfaces that are used as reference frames.
* This function should be called for every new field and/or frame.
* It should be safe to call the function a few times for the same field.
*/
@@ -134,7 +134,7 @@ return -1;
}
/**
- * Complete frame/field rendering by passing any remaining blocks.
+ * Completes frame/field rendering by passing any remaining blocks.
* Normally ff_draw_horiz_band() is called for each slice, however,
* some leftover blocks, for example from error_resilience(), may remain.
* It should be safe to call the function a few times for the same field.
@@ -149,8 +149,8 @@ void ff_xvmc_field_end(MpegEncContext *s)
}
/**
- * Synthesize the data needed by XvMC to render one macroblock of data.
- * Fill all relevant fields, if necessary do IDCT.
+ * Synthesizes the data needed by XvMC to render one macroblock of data.
+ * Fills all relevant fields, if necessary do IDCT.
*/
void ff_xvmc_decode_mb(MpegEncContext *s)
{
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/msmpeg4.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/msmpeg4.c
index 8c0da0ae10..c94d2a2639 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/msmpeg4.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/msmpeg4.c
@@ -1823,7 +1823,7 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
if (i > 62){
i-= 192;
if(i&(~63)){
- const int left= s->gb.size_in_bits - get_bits_count(&s->gb);
+ const int left= get_bits_left(&s->gb);
if(((i+192 == 64 && level/qmul==-1) || s->error_recognition<=1) && left>=0){
av_log(s->avctx, AV_LOG_ERROR, "ignoring overflow at %d %d\n", s->mb_x, s->mb_y);
break;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/nellymoserdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/nellymoserdec.c
index 1de47086bd..8ed4298fc2 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/nellymoserdec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/nellymoserdec.c
@@ -129,7 +129,7 @@ static av_cold int decode_init(AVCodecContext * avctx) {
NellyMoserDecodeContext *s = avctx->priv_data;
s->avctx = avctx;
- av_lfg_init(&s->random_state, ff_random_get_seed());
+ av_lfg_init(&s->random_state, 0);
ff_mdct_init(&s->imdct_ctx, 8, 1, 1.0);
dsputil_init(&s->dsp, avctx);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/nellymoserenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/nellymoserenc.c
index 52dd46e304..3c50cb4c56 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/nellymoserenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/nellymoserenc.c
@@ -110,7 +110,7 @@ static const float quant_lut_mul[7] = { 0.0, 0.0, 2.0, 2.0, 5.0, 12.0, 36.6
static const float quant_lut_add[7] = { 0.0, 0.0, 2.0, 7.0, 21.0, 56.0, 157.0 };
static const uint8_t quant_lut_offset[8] = { 0, 0, 1, 4, 11, 32, 81, 230 };
-void apply_mdct(NellyMoserEncodeContext *s)
+static void apply_mdct(NellyMoserEncodeContext *s)
{
memcpy(s->in_buff, s->buf[s->bufsel], NELLY_BUF_LEN * sizeof(float));
s->dsp.vector_fmul(s->in_buff, ff_sine_128, NELLY_BUF_LEN);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/opt.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/opt.h
index 84511e0c06..cb1d7d78a2 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/opt.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/opt.h
@@ -85,6 +85,58 @@ typedef struct AVOption {
const char *unit;
} AVOption;
+/**
+ * AVOption2.
+ * THIS IS NOT PART OF THE API/ABI YET!
+ * This is identical to AVOption except that default_val was replaced by
+ * an union, it should be compatible with AVOption on normal platforms.
+ */
+typedef struct AVOption2 {
+ const char *name;
+
+ /**
+ * short English help text
+ * @todo What about other languages?
+ */
+ const char *help;
+
+ /**
+ * The offset relative to the context structure where the option
+ * value is stored. It should be 0 for named constants.
+ */
+ int offset;
+ enum AVOptionType type;
+
+ /**
+ * the default value for scalar options
+ */
+ union {
+ double dbl;
+ const char *str;
+ } default_val;
+
+ double min; ///< minimum valid value for the option
+ double max; ///< maximum valid value for the option
+
+ int flags;
+/*
+#define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding
+#define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding
+#define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ...
+#define AV_OPT_FLAG_AUDIO_PARAM 8
+#define AV_OPT_FLAG_VIDEO_PARAM 16
+#define AV_OPT_FLAG_SUBTITLE_PARAM 32
+*/
+//FIXME think about enc-audio, ... style flags
+
+ /**
+ * The logical unit to which the option belongs. Non-constant
+ * options and corresponding named constants share the same
+ * unit. May be NULL.
+ */
+ const char *unit;
+} AVOption2;
+
/**
* Looks for an option in obj. Looks only for the options which
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/options.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/options.c
index d3a4916fc6..d224c41618 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/options.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/options.c
@@ -124,6 +124,7 @@ static const AVOption options[]={
{"b_qfactor", "qp factor between p and b frames", OFFSET(b_quant_factor), FF_OPT_TYPE_FLOAT, 1.25, -FLT_MAX, FLT_MAX, V|E},
{"rc_strategy", "ratecontrol method", OFFSET(rc_strategy), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
{"b_strategy", "strategy to choose between I/P/B-frames", OFFSET(b_frame_strategy), FF_OPT_TYPE_INT, 0, INT_MIN, INT_MAX, V|E},
+{"wpredp", "weighted prediction analysis method", OFFSET(weighted_p_pred), FF_OPT_TYPE_INT, 0, INT_MIN, INT_MAX, V|E},
{"hurry_up", NULL, OFFSET(hurry_up), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|D},
{"ps", "rtp payload size in bytes", OFFSET(rtp_payload_size), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
{"mv_bits", NULL, OFFSET(mv_bits), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
@@ -390,6 +391,7 @@ static const AVOption options[]={
{"request_channels", "set desired number of audio channels", OFFSET(request_channels), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, A|D},
{"drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), FF_OPT_TYPE_FLOAT, 1.0, 0.0, 1.0, A|D},
{"reservoir", "use bit reservoir", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_BIT_RESERVOIR, INT_MIN, INT_MAX, A|E, "flags2"},
+{"mbtree", "use macroblock tree ratecontrol (x264 only)", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_MBTREE, INT_MIN, INT_MAX, V|E, "flags2"},
{"bits_per_raw_sample", NULL, OFFSET(bits_per_raw_sample), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
{"channel_layout", NULL, OFFSET(channel_layout), FF_OPT_TYPE_INT64, DEFAULT, 0, INT64_MAX, A|E|D, "channel_layout"},
{"request_channel_layout", NULL, OFFSET(request_channel_layout), FF_OPT_TYPE_INT64, DEFAULT, 0, INT64_MAX, A|D, "request_channel_layout"},
@@ -433,9 +435,10 @@ void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType codec_type)
s->release_buffer= avcodec_default_release_buffer;
s->get_format= avcodec_default_get_format;
s->execute= avcodec_default_execute;
+ s->execute2= avcodec_default_execute2;
s->sample_aspect_ratio= (AVRational){0,1};
s->pix_fmt= PIX_FMT_NONE;
- s->sample_fmt= SAMPLE_FMT_S16; // FIXME: set to NONE
+ s->sample_fmt= SAMPLE_FMT_NONE;
s->palctrl = NULL;
s->reget_buffer= avcodec_default_reget_buffer;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pamenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pamenc.c
new file mode 100644
index 0000000000..1239521a7a
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pamenc.c
@@ -0,0 +1,120 @@
+/*
+ * PAM image format
+ * Copyright (c) 2002, 2003 Fabrice Bellard
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avcodec.h"
+#include "bytestream.h"
+#include "pnm.h"
+
+
+static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf,
+ int buf_size, void *data)
+{
+ PNMContext *s = avctx->priv_data;
+ AVFrame *pict = data;
+ AVFrame * const p = (AVFrame*)&s->picture;
+ int i, h, w, n, linesize, depth, maxval;
+ const char *tuple_type;
+ uint8_t *ptr;
+
+ if (buf_size < avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height) + 200) {
+ av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n");
+ return -1;
+ }
+
+ *p = *pict;
+ p->pict_type = FF_I_TYPE;
+ p->key_frame = 1;
+
+ s->bytestream_start =
+ s->bytestream = outbuf;
+ s->bytestream_end = outbuf+buf_size;
+
+ h = avctx->height;
+ w = avctx->width;
+ switch (avctx->pix_fmt) {
+ case PIX_FMT_MONOWHITE:
+ n = (w + 7) >> 3;
+ depth = 1;
+ maxval = 1;
+ tuple_type = "BLACKANDWHITE";
+ break;
+ case PIX_FMT_GRAY8:
+ n = w;
+ depth = 1;
+ maxval = 255;
+ tuple_type = "GRAYSCALE";
+ break;
+ case PIX_FMT_RGB24:
+ n = w * 3;
+ depth = 3;
+ maxval = 255;
+ tuple_type = "RGB";
+ break;
+ case PIX_FMT_RGB32:
+ n = w * 4;
+ depth = 4;
+ maxval = 255;
+ tuple_type = "RGB_ALPHA";
+ break;
+ default:
+ return -1;
+ }
+ snprintf(s->bytestream, s->bytestream_end - s->bytestream,
+ "P7\nWIDTH %d\nHEIGHT %d\nDEPTH %d\nMAXVAL %d\nTUPLETYPE %s\nENDHDR\n",
+ w, h, depth, maxval, tuple_type);
+ s->bytestream += strlen(s->bytestream);
+
+ ptr = p->data[0];
+ linesize = p->linesize[0];
+
+ if (avctx->pix_fmt == PIX_FMT_RGB32) {
+ int j;
+ unsigned int v;
+
+ for (i = 0; i < h; i++) {
+ for (j = 0; j < w; j++) {
+ v = ((uint32_t *)ptr)[j];
+ bytestream_put_be24(&s->bytestream, v);
+ *s->bytestream++ = v >> 24;
+ }
+ ptr += linesize;
+ }
+ } else {
+ for (i = 0; i < h; i++) {
+ memcpy(s->bytestream, ptr, n);
+ s->bytestream += n;
+ ptr += linesize;
+ }
+ }
+ return s->bytestream - s->bytestream_start;
+}
+
+
+AVCodec pam_encoder = {
+ "pam",
+ CODEC_TYPE_VIDEO,
+ CODEC_ID_PAM,
+ sizeof(PNMContext),
+ ff_pnm_init,
+ pam_encode_frame,
+ .pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_GRAY8, PIX_FMT_MONOWHITE, PIX_FMT_NONE},
+ .long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
+};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pcm.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pcm.c
index a0ce9f5783..572ee947e5 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pcm.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pcm.c
@@ -25,7 +25,7 @@
*/
#include "avcodec.h"
-#include "get_bits.h" // for ff_reverse
+#include "libavutil/common.h" /* for av_reverse */
#include "bytestream.h"
#define MAX_CHANNELS 64
@@ -194,8 +194,8 @@ static int pcm_encode_frame(AVCodecContext *avctx,
break;
case CODEC_ID_PCM_S24DAUD:
for(;n>0;n--) {
- uint32_t tmp = ff_reverse[(*samples >> 8) & 0xff] +
- (ff_reverse[*samples & 0xff] << 8);
+ uint32_t tmp = av_reverse[(*samples >> 8) & 0xff] +
+ (av_reverse[*samples & 0xff] << 8);
tmp <<= 4; // sync flags would go here
bytestream_put_be24(&dst, tmp);
samples++;
@@ -396,8 +396,8 @@ static int pcm_decode_frame(AVCodecContext *avctx,
for(;n>0;n--) {
uint32_t v = bytestream_get_be24(&src);
v >>= 4; // sync flags are here
- *samples++ = ff_reverse[(v >> 8) & 0xff] +
- (ff_reverse[v & 0xff] << 8);
+ *samples++ = av_reverse[(v >> 8) & 0xff] +
+ (av_reverse[v & 0xff] << 8);
}
break;
case CODEC_ID_PCM_S16LE_PLANAR:
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pcx.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pcx.c
index df6a8aa74a..bbca8bce7a 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pcx.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pcx.c
@@ -71,7 +71,8 @@ static void pcx_palette(const uint8_t **src, uint32_t *dst, unsigned int pallen)
for (i=0; i<pallen; i++)
*dst++ = bytestream_get_be24(src);
- memset(dst, 0, (256 - pallen) * sizeof(*dst));
+ if (pallen < 256)
+ memset(dst, 0, (256 - pallen) * sizeof(*dst));
}
static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pngdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pngdec.c
index 29644f5095..6cce626fd3 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pngdec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pngdec.c
@@ -642,6 +642,18 @@ static av_cold int png_dec_init(AVCodecContext *avctx){
return 0;
}
+static av_cold int png_dec_end(AVCodecContext *avctx)
+{
+ PNGDecContext *s = avctx->priv_data;
+
+ if (s->picture1.data[0])
+ avctx->release_buffer(avctx, &s->picture1);
+ if (s->picture2.data[0])
+ avctx->release_buffer(avctx, &s->picture2);
+
+ return 0;
+}
+
AVCodec png_decoder = {
"png",
CODEC_TYPE_VIDEO,
@@ -649,7 +661,7 @@ AVCodec png_decoder = {
sizeof(PNGDecContext),
png_dec_init,
NULL,
- NULL, //decode_end,
+ png_dec_end,
decode_frame,
CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/,
NULL,
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnm.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnm.c
index 134e9f6065..cb6a7139f2 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnm.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnm.c
@@ -18,6 +18,7 @@
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
#include "avcodec.h"
#include "pnm.h"
@@ -32,10 +33,10 @@ static void pnm_get(PNMContext *sc, char *str, int buf_size)
int c;
/* skip spaces and comments */
- for(;;) {
+ for (;;) {
c = *sc->bytestream++;
if (c == '#') {
- do {
+ do {
c = *sc->bytestream++;
} while (c != '\n' && sc->bytestream < sc->bytestream_end);
} else if (!pnm_space(c)) {
@@ -52,27 +53,32 @@ static void pnm_get(PNMContext *sc, char *str, int buf_size)
*s = '\0';
}
-int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s){
+int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
+{
char buf1[32], tuple_type[32];
int h, w, depth, maxval;
pnm_get(s, buf1, sizeof(buf1));
- if (!strcmp(buf1, "P4")) {
+ s->type= buf1[1]-'0';
+ if(buf1[0] != 'P')
+ return -1;
+
+ if (s->type==1 || s->type==4) {
avctx->pix_fmt = PIX_FMT_MONOWHITE;
- } else if (!strcmp(buf1, "P5")) {
+ } else if (s->type==2 || s->type==5) {
if (avctx->codec_id == CODEC_ID_PGMYUV)
avctx->pix_fmt = PIX_FMT_YUV420P;
else
avctx->pix_fmt = PIX_FMT_GRAY8;
- } else if (!strcmp(buf1, "P6")) {
+ } else if (s->type==3 || s->type==6) {
avctx->pix_fmt = PIX_FMT_RGB24;
- } else if (!strcmp(buf1, "P7")) {
- w = -1;
- h = -1;
+ } else if (s->type==7) {
+ w = -1;
+ h = -1;
maxval = -1;
- depth = -1;
+ depth = -1;
tuple_type[0] = '\0';
- for(;;) {
+ for (;;) {
pnm_get(s, buf1, sizeof(buf1));
if (!strcmp(buf1, "WIDTH")) {
pnm_get(s, buf1, sizeof(buf1));
@@ -98,7 +104,7 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s){
if (w <= 0 || h <= 0 || maxval <= 0 || depth <= 0 || tuple_type[0] == '\0' || avcodec_check_dimensions(avctx, w, h))
return -1;
- avctx->width = w;
+ avctx->width = w;
avctx->height = h;
if (depth == 1) {
if (maxval == 1)
@@ -147,7 +153,8 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s){
return -1;
}
}
- }
+ }else
+ s->maxval=1;
/* more check if YUV420 */
if (avctx->pix_fmt == PIX_FMT_YUV420P) {
if ((avctx->width & 1) != 0)
@@ -160,3 +167,23 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s){
}
return 0;
}
+
+av_cold int ff_pnm_end(AVCodecContext *avctx)
+{
+ PNMContext *s = avctx->priv_data;
+
+ if (s->picture.data[0])
+ avctx->release_buffer(avctx, &s->picture);
+
+ return 0;
+}
+
+av_cold int ff_pnm_init(AVCodecContext *avctx)
+{
+ PNMContext *s = avctx->priv_data;
+
+ avcodec_get_frame_defaults((AVFrame*)&s->picture);
+ avctx->coded_frame = (AVFrame*)&s->picture;
+
+ return 0;
+}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnm.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnm.h
index ef0cd8676e..ac4b1084fb 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnm.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnm.h
@@ -30,8 +30,11 @@ typedef struct PNMContext {
uint8_t *bytestream_end;
AVFrame picture;
int maxval; ///< maximum value of a pixel
+ int type;
} PNMContext;
int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s);
+av_cold int ff_pnm_end(AVCodecContext *avctx);
+av_cold int ff_pnm_init(AVCodecContext *avctx);
#endif /* AVCODEC_PNM_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnm_parser.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnm_parser.c
index 687f0ca6de..b8ba1a836c 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnm_parser.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnm_parser.c
@@ -23,63 +23,62 @@
#include "pnm.h"
-static int pnm_parse(AVCodecParserContext *s,
- AVCodecContext *avctx,
- const uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size)
+static int pnm_parse(AVCodecParserContext *s, AVCodecContext *avctx,
+ const uint8_t **poutbuf, int *poutbuf_size,
+ const uint8_t *buf, int buf_size)
{
ParseContext *pc = s->priv_data;
PNMContext pnmctx;
int next;
- for(; pc->overread>0; pc->overread--){
+ for (; pc->overread > 0; pc->overread--) {
pc->buffer[pc->index++]= pc->buffer[pc->overread_index++];
}
retry:
- if(pc->index){
- pnmctx.bytestream_start=
- pnmctx.bytestream= pc->buffer;
- pnmctx.bytestream_end= pc->buffer + pc->index;
- }else{
- pnmctx.bytestream_start=
- pnmctx.bytestream= (uint8_t *) buf; /* casts avoid warnings */
- pnmctx.bytestream_end= (uint8_t *) buf + buf_size;
+ if (pc->index) {
+ pnmctx.bytestream_start =
+ pnmctx.bytestream = pc->buffer;
+ pnmctx.bytestream_end = pc->buffer + pc->index;
+ } else {
+ pnmctx.bytestream_start =
+ pnmctx.bytestream = (uint8_t *) buf; /* casts avoid warnings */
+ pnmctx.bytestream_end = (uint8_t *) buf + buf_size;
}
- if(ff_pnm_decode_header(avctx, &pnmctx) < 0){
- if(pnmctx.bytestream < pnmctx.bytestream_end){
- if(pc->index){
- pc->index=0;
- }else{
+ if (ff_pnm_decode_header(avctx, &pnmctx) < 0) {
+ if (pnmctx.bytestream < pnmctx.bytestream_end) {
+ if (pc->index) {
+ pc->index = 0;
+ } else {
buf++;
buf_size--;
}
goto retry;
}
#if 0
- if(pc->index && pc->index*2 + FF_INPUT_BUFFER_PADDING_SIZE < pc->buffer_size && buf_size > pc->index){
+ if (pc->index && pc->index * 2 + FF_INPUT_BUFFER_PADDING_SIZE < pc->buffer_size && buf_size > pc->index) {
memcpy(pc->buffer + pc->index, buf, pc->index);
pc->index += pc->index;
- buf += pc->index;
- buf_size -= pc->index;
+ buf += pc->index;
+ buf_size -= pc->index;
goto retry;
}
#endif
- next= END_NOT_FOUND;
- }else{
- next= pnmctx.bytestream - pnmctx.bytestream_start
- + avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
- if(pnmctx.bytestream_start!=buf)
- next-= pc->index;
- if(next > buf_size)
- next= END_NOT_FOUND;
+ next = END_NOT_FOUND;
+ } else {
+ next = pnmctx.bytestream - pnmctx.bytestream_start
+ + avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
+ if (pnmctx.bytestream_start != buf)
+ next -= pc->index;
+ if (next > buf_size)
+ next = END_NOT_FOUND;
}
- if(ff_combine_frame(pc, next, &buf, &buf_size)<0){
- *poutbuf = NULL;
+ if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
+ *poutbuf = NULL;
*poutbuf_size = 0;
return buf_size;
}
- *poutbuf = buf;
+ *poutbuf = buf;
*poutbuf_size = buf_size;
return next;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnmdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnmdec.c
new file mode 100644
index 0000000000..5630e7689c
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnmdec.c
@@ -0,0 +1,268 @@
+/*
+ * PNM image format
+ * Copyright (c) 2002, 2003 Fabrice Bellard
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avcodec.h"
+#include "bytestream.h"
+#include "put_bits.h"
+#include "pnm.h"
+
+
+static int pnm_decode_frame(AVCodecContext *avctx, void *data,
+ int *data_size, AVPacket *avpkt)
+{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
+ PNMContext * const s = avctx->priv_data;
+ AVFrame *picture = data;
+ AVFrame * const p = (AVFrame*)&s->picture;
+ int i, j, n, linesize, h, upgrade = 0;
+ unsigned char *ptr;
+ int components, sample_len;
+
+ s->bytestream_start =
+ s->bytestream = buf;
+ s->bytestream_end = buf + buf_size;
+
+ if (ff_pnm_decode_header(avctx, s) < 0)
+ return -1;
+
+ if (p->data[0])
+ avctx->release_buffer(avctx, p);
+
+ p->reference = 0;
+ if (avctx->get_buffer(avctx, p) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ return -1;
+ }
+ p->pict_type = FF_I_TYPE;
+ p->key_frame = 1;
+
+ switch (avctx->pix_fmt) {
+ default:
+ return -1;
+ case PIX_FMT_RGB48BE:
+ n = avctx->width * 6;
+ components=3;
+ sample_len=16;
+ goto do_read;
+ case PIX_FMT_RGB24:
+ n = avctx->width * 3;
+ components=3;
+ sample_len=8;
+ goto do_read;
+ case PIX_FMT_GRAY8:
+ n = avctx->width;
+ components=1;
+ sample_len=8;
+ if (s->maxval < 255)
+ upgrade = 1;
+ goto do_read;
+ case PIX_FMT_GRAY16BE:
+ case PIX_FMT_GRAY16LE:
+ n = avctx->width * 2;
+ components=1;
+ sample_len=16;
+ if (s->maxval < 65535)
+ upgrade = 2;
+ goto do_read;
+ case PIX_FMT_MONOWHITE:
+ case PIX_FMT_MONOBLACK:
+ n = (avctx->width + 7) >> 3;
+ components=1;
+ sample_len=1;
+ do_read:
+ ptr = p->data[0];
+ linesize = p->linesize[0];
+ if (s->bytestream + n * avctx->height > s->bytestream_end)
+ return -1;
+ if(s->type < 4){
+ for (i=0; i<avctx->height; i++) {
+ PutBitContext pb;
+ init_put_bits(&pb, ptr, linesize);
+ for(j=0; j<avctx->width * components; j++){
+ unsigned int c=0;
+ int v=0;
+ while(s->bytestream < s->bytestream_end && (*s->bytestream < '0' || *s->bytestream > '9' ))
+ s->bytestream++;
+ if(s->bytestream >= s->bytestream_end)
+ return -1;
+ do{
+ v= 10*v + c;
+ c= (*s->bytestream++) - '0';
+ }while(c <= 9);
+ put_bits(&pb, sample_len, (((1<<sample_len)-1)*v + (s->maxval>>1))/s->maxval);
+ }
+ flush_put_bits(&pb);
+ ptr+= linesize;
+ }
+ }else{
+ for (i = 0; i < avctx->height; i++) {
+ if (!upgrade)
+ memcpy(ptr, s->bytestream, n);
+ else if (upgrade == 1) {
+ unsigned int j, f = (255 * 128 + s->maxval / 2) / s->maxval;
+ for (j = 0; j < n; j++)
+ ptr[j] = (s->bytestream[j] * f + 64) >> 7;
+ } else if (upgrade == 2) {
+ unsigned int j, v, f = (65535 * 32768 + s->maxval / 2) / s->maxval;
+ for (j = 0; j < n / 2; j++) {
+ v = be2me_16(((uint16_t *)s->bytestream)[j]);
+ ((uint16_t *)ptr)[j] = (v * f + 16384) >> 15;
+ }
+ }
+ s->bytestream += n;
+ ptr += linesize;
+ }
+ }
+ break;
+ case PIX_FMT_YUV420P:
+ {
+ unsigned char *ptr1, *ptr2;
+
+ n = avctx->width;
+ ptr = p->data[0];
+ linesize = p->linesize[0];
+ if (s->bytestream + n * avctx->height * 3 / 2 > s->bytestream_end)
+ return -1;
+ for (i = 0; i < avctx->height; i++) {
+ memcpy(ptr, s->bytestream, n);
+ s->bytestream += n;
+ ptr += linesize;
+ }
+ ptr1 = p->data[1];
+ ptr2 = p->data[2];
+ n >>= 1;
+ h = avctx->height >> 1;
+ for (i = 0; i < h; i++) {
+ memcpy(ptr1, s->bytestream, n);
+ s->bytestream += n;
+ memcpy(ptr2, s->bytestream, n);
+ s->bytestream += n;
+ ptr1 += p->linesize[1];
+ ptr2 += p->linesize[2];
+ }
+ }
+ break;
+ case PIX_FMT_RGB32:
+ ptr = p->data[0];
+ linesize = p->linesize[0];
+ if (s->bytestream + avctx->width * avctx->height * 4 > s->bytestream_end)
+ return -1;
+ for (i = 0; i < avctx->height; i++) {
+ int j, r, g, b, a;
+
+ for (j = 0; j < avctx->width; j++) {
+ r = *s->bytestream++;
+ g = *s->bytestream++;
+ b = *s->bytestream++;
+ a = *s->bytestream++;
+ ((uint32_t *)ptr)[j] = (a << 24) | (r << 16) | (g << 8) | b;
+ }
+ ptr += linesize;
+ }
+ break;
+ }
+ *picture = *(AVFrame*)&s->picture;
+ *data_size = sizeof(AVPicture);
+
+ return s->bytestream - s->bytestream_start;
+}
+
+
+#if CONFIG_PGM_DECODER
+AVCodec pgm_decoder = {
+ "pgm",
+ CODEC_TYPE_VIDEO,
+ CODEC_ID_PGM,
+ sizeof(PNMContext),
+ ff_pnm_init,
+ NULL,
+ ff_pnm_end,
+ pnm_decode_frame,
+ CODEC_CAP_DR1,
+ .pix_fmts = (const enum PixelFormat[]){PIX_FMT_GRAY8, PIX_FMT_GRAY16BE, PIX_FMT_NONE},
+ .long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"),
+};
+#endif
+
+#if CONFIG_PGMYUV_DECODER
+AVCodec pgmyuv_decoder = {
+ "pgmyuv",
+ CODEC_TYPE_VIDEO,
+ CODEC_ID_PGMYUV,
+ sizeof(PNMContext),
+ ff_pnm_init,
+ NULL,
+ ff_pnm_end,
+ pnm_decode_frame,
+ CODEC_CAP_DR1,
+ .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
+ .long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"),
+};
+#endif
+
+#if CONFIG_PPM_DECODER
+AVCodec ppm_decoder = {
+ "ppm",
+ CODEC_TYPE_VIDEO,
+ CODEC_ID_PPM,
+ sizeof(PNMContext),
+ ff_pnm_init,
+ NULL,
+ ff_pnm_end,
+ pnm_decode_frame,
+ CODEC_CAP_DR1,
+ .pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB48BE, PIX_FMT_NONE},
+ .long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"),
+};
+#endif
+
+#if CONFIG_PBM_DECODER
+AVCodec pbm_decoder = {
+ "pbm",
+ CODEC_TYPE_VIDEO,
+ CODEC_ID_PBM,
+ sizeof(PNMContext),
+ ff_pnm_init,
+ NULL,
+ ff_pnm_end,
+ pnm_decode_frame,
+ CODEC_CAP_DR1,
+ .pix_fmts = (const enum PixelFormat[]){PIX_FMT_MONOWHITE, PIX_FMT_NONE},
+ .long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"),
+};
+#endif
+
+#if CONFIG_PAM_DECODER
+AVCodec pam_decoder = {
+ "pam",
+ CODEC_TYPE_VIDEO,
+ CODEC_ID_PAM,
+ sizeof(PNMContext),
+ ff_pnm_init,
+ NULL,
+ ff_pnm_end,
+ pnm_decode_frame,
+ CODEC_CAP_DR1,
+ .pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_GRAY8, PIX_FMT_MONOWHITE, PIX_FMT_NONE},
+ .long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
+};
+#endif
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnmenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnmenc.c
index e619fc36cf..b14a151937 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnmenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnmenc.c
@@ -18,203 +18,67 @@
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
#include "avcodec.h"
#include "bytestream.h"
#include "pnm.h"
-static av_cold int common_init(AVCodecContext *avctx){
- PNMContext *s = avctx->priv_data;
-
- avcodec_get_frame_defaults((AVFrame*)&s->picture);
- avctx->coded_frame= (AVFrame*)&s->picture;
-
- return 0;
-}
-
-static int pnm_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- AVPacket *avpkt)
+static int pnm_encode_frame(AVCodecContext *avctx, unsigned char *outbuf,
+ int buf_size, void *data)
{
- const uint8_t *buf = avpkt->data;
- int buf_size = avpkt->size;
- PNMContext * const s = avctx->priv_data;
- AVFrame *picture = data;
- AVFrame * const p= (AVFrame*)&s->picture;
- int i, n, linesize, h, upgrade = 0;
- unsigned char *ptr;
-
- s->bytestream_start=
- s->bytestream= buf;
- s->bytestream_end= buf + buf_size;
-
- if(ff_pnm_decode_header(avctx, s) < 0)
- return -1;
-
- if(p->data[0])
- avctx->release_buffer(avctx, p);
-
- p->reference= 0;
- if(avctx->get_buffer(avctx, p) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
- p->pict_type= FF_I_TYPE;
- p->key_frame= 1;
-
- switch(avctx->pix_fmt) {
- default:
- return -1;
- case PIX_FMT_RGB48BE:
- n = avctx->width * 6;
- goto do_read;
- case PIX_FMT_RGB24:
- n = avctx->width * 3;
- goto do_read;
- case PIX_FMT_GRAY8:
- n = avctx->width;
- if (s->maxval < 255)
- upgrade = 1;
- goto do_read;
- case PIX_FMT_GRAY16BE:
- case PIX_FMT_GRAY16LE:
- n = avctx->width * 2;
- if (s->maxval < 65535)
- upgrade = 2;
- goto do_read;
- case PIX_FMT_MONOWHITE:
- case PIX_FMT_MONOBLACK:
- n = (avctx->width + 7) >> 3;
- do_read:
- ptr = p->data[0];
- linesize = p->linesize[0];
- if(s->bytestream + n*avctx->height > s->bytestream_end)
- return -1;
- for(i = 0; i < avctx->height; i++) {
- if (!upgrade)
- memcpy(ptr, s->bytestream, n);
- else if (upgrade == 1) {
- unsigned int j, f = (255*128 + s->maxval/2) / s->maxval;
- for (j=0; j<n; j++)
- ptr[j] = (s->bytestream[j] * f + 64) >> 7;
- } else if (upgrade == 2) {
- unsigned int j, v, f = (65535*32768 + s->maxval/2) / s->maxval;
- for (j=0; j<n/2; j++) {
- v = be2me_16(((uint16_t *)s->bytestream)[j]);
- ((uint16_t *)ptr)[j] = (v * f + 16384) >> 15;
- }
- }
- s->bytestream += n;
- ptr += linesize;
- }
- break;
- case PIX_FMT_YUV420P:
- {
- unsigned char *ptr1, *ptr2;
-
- n = avctx->width;
- ptr = p->data[0];
- linesize = p->linesize[0];
- if(s->bytestream + n*avctx->height*3/2 > s->bytestream_end)
- return -1;
- for(i = 0; i < avctx->height; i++) {
- memcpy(ptr, s->bytestream, n);
- s->bytestream += n;
- ptr += linesize;
- }
- ptr1 = p->data[1];
- ptr2 = p->data[2];
- n >>= 1;
- h = avctx->height >> 1;
- for(i = 0; i < h; i++) {
- memcpy(ptr1, s->bytestream, n);
- s->bytestream += n;
- memcpy(ptr2, s->bytestream, n);
- s->bytestream += n;
- ptr1 += p->linesize[1];
- ptr2 += p->linesize[2];
- }
- }
- break;
- case PIX_FMT_RGB32:
- ptr = p->data[0];
- linesize = p->linesize[0];
- if(s->bytestream + avctx->width*avctx->height*4 > s->bytestream_end)
- return -1;
- for(i = 0; i < avctx->height; i++) {
- int j, r, g, b, a;
-
- for(j = 0;j < avctx->width; j++) {
- r = *s->bytestream++;
- g = *s->bytestream++;
- b = *s->bytestream++;
- a = *s->bytestream++;
- ((uint32_t *)ptr)[j] = (a << 24) | (r << 16) | (g << 8) | b;
- }
- ptr += linesize;
- }
- break;
- }
- *picture= *(AVFrame*)&s->picture;
- *data_size = sizeof(AVPicture);
-
- return s->bytestream - s->bytestream_start;
-}
-
-static int pnm_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int buf_size, void *data){
- PNMContext *s = avctx->priv_data;
- AVFrame *pict = data;
- AVFrame * const p= (AVFrame*)&s->picture;
+ PNMContext *s = avctx->priv_data;
+ AVFrame *pict = data;
+ AVFrame * const p = (AVFrame*)&s->picture;
int i, h, h1, c, n, linesize;
uint8_t *ptr, *ptr1, *ptr2;
- if(buf_size < avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height) + 200){
+ if (buf_size < avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height) + 200) {
av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n");
return -1;
}
- *p = *pict;
- p->pict_type= FF_I_TYPE;
- p->key_frame= 1;
+ *p = *pict;
+ p->pict_type = FF_I_TYPE;
+ p->key_frame = 1;
- s->bytestream_start=
- s->bytestream= outbuf;
- s->bytestream_end= outbuf+buf_size;
+ s->bytestream_start =
+ s->bytestream = outbuf;
+ s->bytestream_end = outbuf + buf_size;
- h = avctx->height;
+ h = avctx->height;
h1 = h;
- switch(avctx->pix_fmt) {
+ switch (avctx->pix_fmt) {
case PIX_FMT_MONOWHITE:
- c = '4';
- n = (avctx->width + 7) >> 3;
+ c = '4';
+ n = (avctx->width + 7) >> 3;
break;
case PIX_FMT_GRAY8:
- c = '5';
- n = avctx->width;
+ c = '5';
+ n = avctx->width;
break;
case PIX_FMT_GRAY16BE:
- c = '5';
- n = avctx->width * 2;
+ c = '5';
+ n = avctx->width * 2;
break;
case PIX_FMT_RGB24:
- c = '6';
- n = avctx->width * 3;
+ c = '6';
+ n = avctx->width * 3;
break;
case PIX_FMT_RGB48BE:
- c = '6';
- n = avctx->width * 6;
+ c = '6';
+ n = avctx->width * 6;
break;
case PIX_FMT_YUV420P:
- c = '5';
- n = avctx->width;
+ c = '5';
+ n = avctx->width;
h1 = (h * 3) / 2;
break;
default:
return -1;
}
snprintf(s->bytestream, s->bytestream_end - s->bytestream,
- "P%c\n%d %d\n",
- c, avctx->width, h1);
+ "P%c\n%d %d\n", c, avctx->width, h1);
s->bytestream += strlen(s->bytestream);
if (avctx->pix_fmt != PIX_FMT_MONOWHITE) {
snprintf(s->bytestream, s->bytestream_end - s->bytestream,
@@ -222,12 +86,12 @@ static int pnm_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int bu
s->bytestream += strlen(s->bytestream);
}
- ptr = p->data[0];
+ ptr = p->data[0];
linesize = p->linesize[0];
- for(i=0;i<h;i++) {
+ for (i = 0; i < h; i++) {
memcpy(s->bytestream, ptr, n);
s->bytestream += n;
- ptr += linesize;
+ ptr += linesize;
}
if (avctx->pix_fmt == PIX_FMT_YUV420P) {
@@ -235,7 +99,7 @@ static int pnm_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int bu
n >>= 1;
ptr1 = p->data[1];
ptr2 = p->data[2];
- for(i=0;i<h;i++) {
+ for (i = 0; i < h; i++) {
memcpy(s->bytestream, ptr1, n);
s->bytestream += n;
memcpy(s->bytestream, ptr2, n);
@@ -247,137 +111,6 @@ static int pnm_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int bu
return s->bytestream - s->bytestream_start;
}
-static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int buf_size, void *data){
- PNMContext *s = avctx->priv_data;
- AVFrame *pict = data;
- AVFrame * const p= (AVFrame*)&s->picture;
- int i, h, w, n, linesize, depth, maxval;
- const char *tuple_type;
- uint8_t *ptr;
-
- if(buf_size < avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height) + 200){
- av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n");
- return -1;
- }
-
- *p = *pict;
- p->pict_type= FF_I_TYPE;
- p->key_frame= 1;
-
- s->bytestream_start=
- s->bytestream= outbuf;
- s->bytestream_end= outbuf+buf_size;
-
- h = avctx->height;
- w = avctx->width;
- switch(avctx->pix_fmt) {
- case PIX_FMT_MONOWHITE:
- n = (w + 7) >> 3;
- depth = 1;
- maxval = 1;
- tuple_type = "BLACKANDWHITE";
- break;
- case PIX_FMT_GRAY8:
- n = w;
- depth = 1;
- maxval = 255;
- tuple_type = "GRAYSCALE";
- break;
- case PIX_FMT_RGB24:
- n = w * 3;
- depth = 3;
- maxval = 255;
- tuple_type = "RGB";
- break;
- case PIX_FMT_RGB32:
- n = w * 4;
- depth = 4;
- maxval = 255;
- tuple_type = "RGB_ALPHA";
- break;
- default:
- return -1;
- }
- snprintf(s->bytestream, s->bytestream_end - s->bytestream,
- "P7\nWIDTH %d\nHEIGHT %d\nDEPTH %d\nMAXVAL %d\nTUPLETYPE %s\nENDHDR\n",
- w, h, depth, maxval, tuple_type);
- s->bytestream += strlen(s->bytestream);
-
- ptr = p->data[0];
- linesize = p->linesize[0];
-
- if (avctx->pix_fmt == PIX_FMT_RGB32) {
- int j;
- unsigned int v;
-
- for(i=0;i<h;i++) {
- for(j=0;j<w;j++) {
- v = ((uint32_t *)ptr)[j];
- bytestream_put_be24(&s->bytestream, v);
- *s->bytestream++ = v >> 24;
- }
- ptr += linesize;
- }
- } else {
- for(i=0;i<h;i++) {
- memcpy(s->bytestream, ptr, n);
- s->bytestream += n;
- ptr += linesize;
- }
- }
- return s->bytestream - s->bytestream_start;
-}
-
-#if 0
-static int pnm_probe(AVProbeData *pd)
-{
- const char *p = pd->buf;
- if (pd->buf_size >= 8 &&
- p[0] == 'P' &&
- p[1] >= '4' && p[1] <= '6' &&
- pnm_space(p[2]) )
- return AVPROBE_SCORE_MAX - 1; /* to permit pgmyuv probe */
- else
- return 0;
-}
-
-static int pgmyuv_probe(AVProbeData *pd)
-{
- if (match_ext(pd->filename, "pgmyuv"))
- return AVPROBE_SCORE_MAX;
- else
- return 0;
-}
-
-static int pam_probe(AVProbeData *pd)
-{
- const char *p = pd->buf;
- if (pd->buf_size >= 8 &&
- p[0] == 'P' &&
- p[1] == '7' &&
- p[2] == '\n')
- return AVPROBE_SCORE_MAX;
- else
- return 0;
-}
-#endif
-
-
-#if CONFIG_PGM_DECODER
-AVCodec pgm_decoder = {
- "pgm",
- CODEC_TYPE_VIDEO,
- CODEC_ID_PGM,
- sizeof(PNMContext),
- common_init,
- NULL,
- NULL,
- pnm_decode_frame,
- CODEC_CAP_DR1,
- .pix_fmts= (const enum PixelFormat[]){PIX_FMT_GRAY8, PIX_FMT_GRAY16BE, PIX_FMT_NONE},
- .long_name= NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"),
-};
-#endif
#if CONFIG_PGM_ENCODER
AVCodec pgm_encoder = {
@@ -385,26 +118,10 @@ AVCodec pgm_encoder = {
CODEC_TYPE_VIDEO,
CODEC_ID_PGM,
sizeof(PNMContext),
- common_init,
+ ff_pnm_init,
pnm_encode_frame,
- .pix_fmts= (const enum PixelFormat[]){PIX_FMT_GRAY8, PIX_FMT_GRAY16BE, PIX_FMT_NONE},
- .long_name= NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"),
-};
-#endif // CONFIG_PGM_ENCODER
-
-#if CONFIG_PGMYUV_DECODER
-AVCodec pgmyuv_decoder = {
- "pgmyuv",
- CODEC_TYPE_VIDEO,
- CODEC_ID_PGMYUV,
- sizeof(PNMContext),
- common_init,
- NULL,
- NULL,
- pnm_decode_frame,
- CODEC_CAP_DR1,
- .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
- .long_name= NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"),
+ .pix_fmts = (const enum PixelFormat[]){PIX_FMT_GRAY8, PIX_FMT_GRAY16BE, PIX_FMT_NONE},
+ .long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"),
};
#endif
@@ -414,26 +131,10 @@ AVCodec pgmyuv_encoder = {
CODEC_TYPE_VIDEO,
CODEC_ID_PGMYUV,
sizeof(PNMContext),
- common_init,
+ ff_pnm_init,
pnm_encode_frame,
- .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
- .long_name= NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"),
-};
-#endif // CONFIG_PGMYUV_ENCODER
-
-#if CONFIG_PPM_DECODER
-AVCodec ppm_decoder = {
- "ppm",
- CODEC_TYPE_VIDEO,
- CODEC_ID_PPM,
- sizeof(PNMContext),
- common_init,
- NULL,
- NULL,
- pnm_decode_frame,
- CODEC_CAP_DR1,
- .pix_fmts= (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB48BE, PIX_FMT_NONE},
- .long_name= NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"),
+ .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
+ .long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"),
};
#endif
@@ -443,26 +144,10 @@ AVCodec ppm_encoder = {
CODEC_TYPE_VIDEO,
CODEC_ID_PPM,
sizeof(PNMContext),
- common_init,
+ ff_pnm_init,
pnm_encode_frame,
- .pix_fmts= (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB48BE, PIX_FMT_NONE},
- .long_name= NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"),
-};
-#endif // CONFIG_PPM_ENCODER
-
-#if CONFIG_PBM_DECODER
-AVCodec pbm_decoder = {
- "pbm",
- CODEC_TYPE_VIDEO,
- CODEC_ID_PBM,
- sizeof(PNMContext),
- common_init,
- NULL,
- NULL,
- pnm_decode_frame,
- CODEC_CAP_DR1,
- .pix_fmts= (const enum PixelFormat[]){PIX_FMT_MONOWHITE, PIX_FMT_NONE},
- .long_name= NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"),
+ .pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB48BE, PIX_FMT_NONE},
+ .long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"),
};
#endif
@@ -472,38 +157,9 @@ AVCodec pbm_encoder = {
CODEC_TYPE_VIDEO,
CODEC_ID_PBM,
sizeof(PNMContext),
- common_init,
+ ff_pnm_init,
pnm_encode_frame,
- .pix_fmts= (const enum PixelFormat[]){PIX_FMT_MONOWHITE, PIX_FMT_NONE},
- .long_name= NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"),
-};
-#endif // CONFIG_PBM_ENCODER
-
-#if CONFIG_PAM_DECODER
-AVCodec pam_decoder = {
- "pam",
- CODEC_TYPE_VIDEO,
- CODEC_ID_PAM,
- sizeof(PNMContext),
- common_init,
- NULL,
- NULL,
- pnm_decode_frame,
- CODEC_CAP_DR1,
- .pix_fmts= (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_GRAY8, PIX_FMT_MONOWHITE, PIX_FMT_NONE},
- .long_name= NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
+ .pix_fmts = (const enum PixelFormat[]){PIX_FMT_MONOWHITE, PIX_FMT_NONE},
+ .long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"),
};
#endif
-
-#if CONFIG_PAM_ENCODER
-AVCodec pam_encoder = {
- "pam",
- CODEC_TYPE_VIDEO,
- CODEC_ID_PAM,
- sizeof(PNMContext),
- common_init,
- pam_encode_frame,
- .pix_fmts= (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_GRAY8, PIX_FMT_MONOWHITE, PIX_FMT_NONE},
- .long_name= NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
-};
-#endif // CONFIG_PAM_ENCODER
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/int_altivec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/int_altivec.c
index d76a220048..4f7529fe4b 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/int_altivec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/int_altivec.c
@@ -79,34 +79,6 @@ static int ssd_int8_vs_int16_altivec(const int8_t *pix1, const int16_t *pix2,
return u.score[3];
}
-static void add_int16_altivec(int16_t * v1, int16_t * v2, int order)
-{
- int i;
- register vec_s16 vec, *pv;
-
- for(i = 0; i < order; i += 8){
- pv = (vec_s16*)v2;
- vec = vec_perm(pv[0], pv[1], vec_lvsl(0, v2));
- vec_st(vec_add(vec_ld(0, v1), vec), 0, v1);
- v1 += 8;
- v2 += 8;
- }
-}
-
-static void sub_int16_altivec(int16_t * v1, int16_t * v2, int order)
-{
- int i;
- register vec_s16 vec, *pv;
-
- for(i = 0; i < order; i += 8){
- pv = (vec_s16*)v2;
- vec = vec_perm(pv[0], pv[1], vec_lvsl(0, v2));
- vec_st(vec_sub(vec_ld(0, v1), vec), 0, v1);
- v1 += 8;
- v2 += 8;
- }
-}
-
static int32_t scalarproduct_int16_altivec(int16_t * v1, int16_t * v2, int order, const int shift)
{
int i;
@@ -137,10 +109,44 @@ static int32_t scalarproduct_int16_altivec(int16_t * v1, int16_t * v2, int order
return ires;
}
+static int32_t scalarproduct_and_madd_int16_altivec(int16_t *v1, int16_t *v2, int16_t *v3, int order, int mul)
+{
+ LOAD_ZERO;
+ vec_s16 *pv1 = (vec_s16*)v1;
+ vec_s16 *pv2 = (vec_s16*)v2;
+ vec_s16 *pv3 = (vec_s16*)v3;
+ register vec_s16 muls = {mul,mul,mul,mul,mul,mul,mul,mul};
+ register vec_s16 t0, t1, i0, i1;
+ register vec_s16 i2 = pv2[0], i3 = pv3[0];
+ register vec_s32 res = zero_s32v;
+ register vec_u8 align = vec_lvsl(0, v2);
+ int32_t ires;
+ order >>= 4;
+ do {
+ t0 = vec_perm(i2, pv2[1], align);
+ i2 = pv2[2];
+ t1 = vec_perm(pv2[1], i2, align);
+ i0 = pv1[0];
+ i1 = pv1[1];
+ res = vec_msum(t0, i0, res);
+ res = vec_msum(t1, i1, res);
+ t0 = vec_perm(i3, pv3[1], align);
+ i3 = pv3[2];
+ t1 = vec_perm(pv3[1], i3, align);
+ pv1[0] = vec_mladd(t0, muls, i0);
+ pv1[1] = vec_mladd(t1, muls, i1);
+ pv1 += 2;
+ pv2 += 2;
+ pv3 += 2;
+ } while(--order);
+ res = vec_splat(vec_sums(res, zero_s32v), 3);
+ vec_ste(res, 0, &ires);
+ return ires;
+}
+
void int_init_altivec(DSPContext* c, AVCodecContext *avctx)
{
c->ssd_int8_vs_int16 = ssd_int8_vs_int16_altivec;
- c->add_int16 = add_int16_altivec;
- c->sub_int16 = sub_int16_altivec;
c->scalarproduct_int16 = scalarproduct_int16_altivec;
+ c->scalarproduct_and_madd_int16 = scalarproduct_and_madd_int16_altivec;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pthread.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pthread.c
index 82eba38786..556e546188 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pthread.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pthread.c
@@ -26,10 +26,12 @@
#include "avcodec.h"
typedef int (action_func)(AVCodecContext *c, void *arg);
+typedef int (action_func2)(AVCodecContext *c, void *arg, int jobnr, int threadnr);
typedef struct ThreadContext {
pthread_t *workers;
action_func *func;
+ action_func2 *func2;
void *args;
int *rets;
int rets_count;
@@ -68,7 +70,8 @@ static void* attribute_align_arg worker(void *v)
}
pthread_mutex_unlock(&c->current_job_lock);
- c->rets[our_job%c->rets_count] = c->func(avctx, (char*)c->args + our_job*c->job_size);
+ c->rets[our_job%c->rets_count] = c->func ? c->func(avctx, (char*)c->args + our_job*c->job_size):
+ c->func2(avctx, c->args, our_job, self_id);
pthread_mutex_lock(&c->current_job_lock);
our_job = c->current_job++;
@@ -130,6 +133,13 @@ int avcodec_thread_execute(AVCodecContext *avctx, action_func* func, void *arg,
return 0;
}
+int avcodec_thread_execute2(AVCodecContext *avctx, action_func2* func2, void *arg, int *ret, int job_count)
+{
+ ThreadContext *c= avctx->thread_opaque;
+ c->func2 = func2;
+ return avcodec_thread_execute(avctx, NULL, arg, ret, job_count, 0);
+}
+
int avcodec_thread_init(AVCodecContext *avctx, int thread_count)
{
int i;
@@ -167,5 +177,6 @@ int avcodec_thread_init(AVCodecContext *avctx, int thread_count)
avcodec_thread_park_workers(c, thread_count);
avctx->execute = avcodec_thread_execute;
+ avctx->execute2 = avcodec_thread_execute2;
return 0;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/put_bits.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/put_bits.h
index b081c26842..c0139661a5 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/put_bits.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/put_bits.h
@@ -117,17 +117,22 @@ static inline void flush_put_bits(PutBitContext *s)
#endif
}
+#if defined(ALT_BITSTREAM_WRITER) || defined(BITSTREAM_WRITER_LE)
+#define align_put_bits align_put_bits_unsupported_here
+#define ff_put_string ff_put_string_unsupported_here
+#define ff_copy_bits ff_copy_bits_unsupported_here
+#else
/**
* Pads the bitstream with zeros up to the next byte boundary.
*/
void align_put_bits(PutBitContext *s);
/**
- * Puts the string s in the bitstream.
+ * Puts the string string in the bitstream.
*
* @param terminate_string 0-terminates the written string if value is 1
*/
-void ff_put_string(PutBitContext * pbc, const char *s, int terminate_string);
+void ff_put_string(PutBitContext *pb, const char *string, int terminate_string);
/**
* Copies the content of src to the bitstream.
@@ -135,9 +140,10 @@ void ff_put_string(PutBitContext * pbc, const char *s, int terminate_string);
* @param length the number of bits of src to copy
*/
void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length);
+#endif
/**
- * Write up to 31 bits into a bitstream.
+ * Writes up to 31 bits into a bitstream.
* Use put_bits32 to write 32 bits.
*/
static inline void put_bits(PutBitContext *s, int n, unsigned int value)
@@ -256,21 +262,21 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
}
#endif
-static inline void put_sbits(PutBitContext *pb, int bits, int32_t val)
+static inline void put_sbits(PutBitContext *pb, int n, int32_t value)
{
- assert(bits >= 0 && bits <= 31);
+ assert(n >= 0 && n <= 31);
- put_bits(pb, bits, val & ((1<<bits)-1));
+ put_bits(pb, n, value & ((1<<n)-1));
}
/**
- * Write exactly 32 bits into a bitstream
+ * Writes exactly 32 bits into a bitstream.
*/
static void av_unused put_bits32(PutBitContext *s, uint32_t value)
{
int lo = value & 0xffff;
int hi = value >> 16;
-#ifdef ALT_BITSTREAM_WRITER_LE
+#ifdef BITSTREAM_WRITER_LE
put_bits(s, 16, lo);
put_bits(s, 16, hi);
#else
@@ -296,7 +302,8 @@ static inline uint8_t* put_bits_ptr(PutBitContext *s)
* Skips the given number of bytes.
* PutBitContext must be flushed & aligned to a byte boundary before calling this.
*/
-static inline void skip_put_bytes(PutBitContext *s, int n){
+static inline void skip_put_bytes(PutBitContext *s, int n)
+{
assert((put_bits_count(s)&7)==0);
#ifdef ALT_BITSTREAM_WRITER
FIXME may need some cleaning of the buffer
@@ -312,7 +319,8 @@ static inline void skip_put_bytes(PutBitContext *s, int n){
* Must only be used if the actual values in the bitstream do not matter.
* If n is 0 the behavior is undefined.
*/
-static inline void skip_put_bits(PutBitContext *s, int n){
+static inline void skip_put_bits(PutBitContext *s, int n)
+{
#ifdef ALT_BITSTREAM_WRITER
s->index += n;
#else
@@ -327,7 +335,8 @@ static inline void skip_put_bits(PutBitContext *s, int n){
*
* @param size the new size in bytes of the buffer where to put bits
*/
-static inline void set_put_bits_buffer_size(PutBitContext *s, int size){
+static inline void set_put_bits_buffer_size(PutBitContext *s, int size)
+{
s->buf_end= s->buf + size;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qcelpdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qcelpdec.c
index 0df30daf34..16f9ae0be9 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qcelpdec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qcelpdec.c
@@ -406,31 +406,6 @@ static void compute_svector(QCELPContext *q, const float *gain,
}
/**
- * Compute the gain control
- *
- * @param v_in gain-controlled vector
- * @param v_ref vector to control gain of
- *
- * @return gain control
- *
- * FIXME: If v_ref is a zero vector, it energy is zero
- * and the behavior of the gain control is
- * undefined in the specs.
- *
- * TIA/EIA/IS-733 2.4.8.3-2/3/4/5, 2.4.8.6
- */
-static float compute_gain_ctrl(const float *v_ref, const float *v_in, const int len)
-{
- float scalefactor = ff_dot_productf(v_in, v_in, len);
-
- if(scalefactor)
- scalefactor = sqrt(ff_dot_productf(v_ref, v_ref, len) / scalefactor);
- else
- av_log_missing_feature(NULL, "Zero energy for gain control", 1);
- return scalefactor;
-}
-
-/**
* Apply generic gain control.
*
* @param v_out output vector
@@ -442,15 +417,13 @@ static float compute_gain_ctrl(const float *v_ref, const float *v_in, const int
static void apply_gain_ctrl(float *v_out, const float *v_ref,
const float *v_in)
{
- int i, j, len;
- float scalefactor;
+ int i;
- for(i=0, j=0; i<4; i++)
- {
- scalefactor = compute_gain_ctrl(v_ref + j, v_in + j, 40);
- for(len=j+40; j<len; j++)
- v_out[j] = scalefactor * v_in[j];
- }
+ for (i = 0; i < 160; i += 40)
+ ff_scale_vector_to_given_sum_of_squares(v_out + i, v_in + i,
+ ff_dot_productf(v_ref + i,
+ v_ref + i, 40),
+ 40);
}
/**
@@ -605,7 +578,7 @@ static void lspf2lpc(const float *lspf, float *lpc)
for (i=0; i<10; i++)
lsp[i] = cos(M_PI * lspf[i]);
- ff_acelp_lspd2lpc(lsp, lpc);
+ ff_acelp_lspd2lpc(lsp, lpc, 5);
for (i=0; i<10; i++)
{
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qdm2.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qdm2.c
index df1479c25e..4dc76126da 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qdm2.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qdm2.c
@@ -219,8 +219,6 @@ static uint8_t random_dequant_index[256][5];
static uint8_t random_dequant_type24[128][3];
static float noise_samples[128];
-static DECLARE_ALIGNED_16(MPA_INT, mpa_window[512]);
-
static av_cold void softclip_table_init(void) {
int i;
@@ -1684,7 +1682,7 @@ static void qdm2_synthesis_filter (QDM2Context *q, int index)
for (i = 0; i < 8; i++) {
ff_mpa_synth_filter(q->synth_buf[ch], &(q->synth_buf_offset[ch]),
- mpa_window, &dither_state,
+ ff_mpa_synth_window, &dither_state,
samples_ptr, q->nb_channels,
q->sb_samples[ch][(8 * index) + i]);
samples_ptr += 32 * q->nb_channels;
@@ -1713,7 +1711,7 @@ static av_cold void qdm2_init(QDM2Context *q) {
initialized = 1;
qdm2_init_vlc();
- ff_mpa_synth_init(mpa_window);
+ ff_mpa_synth_init(ff_mpa_synth_window);
softclip_table_init();
rnd_table_init();
init_noise_samples();
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qdrw.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qdrw.c
index 0f9609159c..f0c0350c23 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qdrw.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qdrw.c
@@ -135,15 +135,21 @@ static int decode_frame(AVCodecContext *avctx,
static av_cold int decode_init(AVCodecContext *avctx){
// QdrawContext * const a = avctx->priv_data;
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return 1;
- }
-
avctx->pix_fmt= PIX_FMT_PAL8;
return 0;
}
+static av_cold int decode_end(AVCodecContext *avctx){
+ QdrawContext * const a = avctx->priv_data;
+ AVFrame *pic = &a->pic;
+
+ if (pic->data[0])
+ avctx->release_buffer(avctx, pic);
+
+ return 0;
+}
+
AVCodec qdraw_decoder = {
"qdraw",
CODEC_TYPE_VIDEO,
@@ -151,7 +157,7 @@ AVCodec qdraw_decoder = {
sizeof(QdrawContext),
decode_init,
NULL,
- NULL,
+ decode_end,
decode_frame,
CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Apple QuickDraw"),
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/r210dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/r210dec.c
new file mode 100644
index 0000000000..0b100e5f7d
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/r210dec.c
@@ -0,0 +1,104 @@
+/*
+ * R210 decoder
+ *
+ * Copyright (c) 2009 Reimar Doeffinger <Reimar.Doeffinger@gmx.de>
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avcodec.h"
+#include "libavutil/bswap.h"
+
+static av_cold int decode_init(AVCodecContext *avctx)
+{
+ avctx->pix_fmt = PIX_FMT_RGB48;
+ avctx->bits_per_raw_sample = 10;
+
+ avctx->coded_frame = avcodec_alloc_frame();
+
+ return 0;
+}
+
+static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
+ AVPacket *avpkt)
+{
+ int h, w;
+ AVFrame *pic = avctx->coded_frame;
+ const uint32_t *src = (const uint32_t *)avpkt->data;
+ int aligned_width = FFALIGN(avctx->width, 64);
+ uint8_t *dst_line;
+
+ if (pic->data[0])
+ avctx->release_buffer(avctx, pic);
+
+ if (avpkt->size < 4 * aligned_width * avctx->height) {
+ av_log(avctx, AV_LOG_ERROR, "packet too small\n");
+ return -1;
+ }
+
+ pic->reference = 0;
+ if (avctx->get_buffer(avctx, pic) < 0)
+ return -1;
+
+ pic->pict_type = FF_I_TYPE;
+ pic->key_frame = 1;
+ dst_line = pic->data[0];
+
+ for (h = 0; h < avctx->height; h++) {
+ uint16_t *dst = (uint16_t *)dst_line;
+ for (w = 0; w < avctx->width; w++) {
+ uint32_t pixel = be2me_32(*src++);
+ uint16_t r, g, b;
+ b = pixel << 6;
+ g = (pixel >> 4) & 0xffc0;
+ r = (pixel >> 14) & 0xffc0;
+ *dst++ = r | (r >> 10);
+ *dst++ = g | (g >> 10);
+ *dst++ = b | (b >> 10);
+ }
+ src += aligned_width - avctx->width;
+ dst_line += pic->linesize[0];
+ }
+
+ *data_size = sizeof(AVFrame);
+ *(AVFrame*)data = *avctx->coded_frame;
+
+ return avpkt->size;
+}
+
+static av_cold int decode_close(AVCodecContext *avctx)
+{
+ AVFrame *pic = avctx->coded_frame;
+ if (pic->data[0])
+ avctx->release_buffer(avctx, pic);
+ av_freep(&avctx->coded_frame);
+
+ return 0;
+}
+
+AVCodec r210_decoder = {
+ "r210",
+ CODEC_TYPE_VIDEO,
+ CODEC_ID_R210,
+ 0,
+ decode_init,
+ NULL,
+ decode_close,
+ decode_frame,
+ CODEC_CAP_DR1,
+ .long_name = NULL_IF_CONFIG_SMALL("Uncompressed RGB 10-bit"),
+};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/raw.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/raw.c
index 1f60477aef..ee3edb6da7 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/raw.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/raw.c
@@ -35,14 +35,22 @@ const PixelFormatTag ff_raw_pixelFormatTags[] = {
{ PIX_FMT_YUV410P, MKTAG('Y', 'V', 'U', '9') },
{ PIX_FMT_YUV411P, MKTAG('Y', '4', '1', 'B') },
{ PIX_FMT_YUV422P, MKTAG('Y', '4', '2', 'B') },
+ { PIX_FMT_YUV422P, MKTAG('P', '4', '2', '2') },
{ PIX_FMT_GRAY8, MKTAG('Y', '8', '0', '0') },
{ PIX_FMT_GRAY8, MKTAG(' ', ' ', 'Y', '8') },
{ PIX_FMT_YUYV422, MKTAG('Y', 'U', 'Y', '2') }, /* Packed formats */
{ PIX_FMT_YUYV422, MKTAG('Y', '4', '2', '2') },
+ { PIX_FMT_YUYV422, MKTAG('V', '4', '2', '2') },
+ { PIX_FMT_YUYV422, MKTAG('V', 'Y', 'U', 'Y') },
+ { PIX_FMT_YUYV422, MKTAG('Y', 'U', 'N', 'V') },
{ PIX_FMT_UYVY422, MKTAG('U', 'Y', 'V', 'Y') },
{ PIX_FMT_UYVY422, MKTAG('H', 'D', 'Y', 'C') },
+ { PIX_FMT_UYVY422, MKTAG('U', 'Y', 'N', 'V') },
+ { PIX_FMT_UYVY422, MKTAG('U', 'Y', 'N', 'Y') },
+ { PIX_FMT_UYVY422, MKTAG('u', 'y', 'v', '1') },
+ { PIX_FMT_UYVY422, MKTAG('2', 'V', 'u', '1') },
{ PIX_FMT_GRAY8, MKTAG('G', 'R', 'E', 'Y') },
{ PIX_FMT_RGB555, MKTAG('R', 'G', 'B', 15) },
{ PIX_FMT_BGR555, MKTAG('B', 'G', 'R', 15) },
@@ -54,6 +62,7 @@ const PixelFormatTag ff_raw_pixelFormatTags[] = {
{ PIX_FMT_UYVY422, MKTAG('2', 'v', 'u', 'y') },
{ PIX_FMT_UYVY422, MKTAG('A', 'V', 'U', 'I') }, /* FIXME merge both fields */
{ PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', '2') },
+ { PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', 's') },
{ PIX_FMT_PAL8, MKTAG('W', 'R', 'A', 'W') },
{ PIX_FMT_NONE, 0 },
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rawdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rawdec.c
index 2f29271c9a..5439a47d9c 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rawdec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rawdec.c
@@ -142,12 +142,7 @@ static int raw_decode(AVCodecContext *avctx,
if ( avctx->codec_tag == MKTAG('Y', 'V', '1', '2')
|| avctx->codec_tag == MKTAG('Y', 'V', 'U', '9'))
- {
- // swap fields
- unsigned char *tmp = picture->data[1];
- picture->data[1] = picture->data[2];
- picture->data[2] = tmp;
- }
+ FFSWAP(uint8_t *, picture->data[1], picture->data[2]);
if(avctx->codec_tag == AV_RL32("yuv2") &&
avctx->pix_fmt == PIX_FMT_YUYV422) {
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rdft.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rdft.c
index 0fe26ab01a..d6f82a7c7e 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rdft.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rdft.c
@@ -27,20 +27,23 @@
*/
/* sin(2*pi*x/n) for 0<=x<n/4, followed by n/2<=x<3n/4 */
-DECLARE_ALIGNED_16(FFTSample, ff_sin_16[8]);
-DECLARE_ALIGNED_16(FFTSample, ff_sin_32[16]);
-DECLARE_ALIGNED_16(FFTSample, ff_sin_64[32]);
-DECLARE_ALIGNED_16(FFTSample, ff_sin_128[64]);
-DECLARE_ALIGNED_16(FFTSample, ff_sin_256[128]);
-DECLARE_ALIGNED_16(FFTSample, ff_sin_512[256]);
-DECLARE_ALIGNED_16(FFTSample, ff_sin_1024[512]);
-DECLARE_ALIGNED_16(FFTSample, ff_sin_2048[1024]);
-DECLARE_ALIGNED_16(FFTSample, ff_sin_4096[2048]);
-DECLARE_ALIGNED_16(FFTSample, ff_sin_8192[4096]);
-DECLARE_ALIGNED_16(FFTSample, ff_sin_16384[8192]);
-DECLARE_ALIGNED_16(FFTSample, ff_sin_32768[16384]);
-DECLARE_ALIGNED_16(FFTSample, ff_sin_65536[32768]);
-FFTSample * const ff_sin_tabs[] = {
+#if !CONFIG_HARDCODED_TABLES
+SINTABLE(16);
+SINTABLE(32);
+SINTABLE(64);
+SINTABLE(128);
+SINTABLE(256);
+SINTABLE(512);
+SINTABLE(1024);
+SINTABLE(2048);
+SINTABLE(4096);
+SINTABLE(8192);
+SINTABLE(16384);
+SINTABLE(32768);
+SINTABLE(65536);
+#endif
+SINTABLE_CONST FFTSample * const ff_sin_tabs[] = {
+ NULL, NULL, NULL, NULL,
ff_sin_16, ff_sin_32, ff_sin_64, ff_sin_128, ff_sin_256, ff_sin_512, ff_sin_1024,
ff_sin_2048, ff_sin_4096, ff_sin_8192, ff_sin_16384, ff_sin_32768, ff_sin_65536,
};
@@ -61,12 +64,14 @@ av_cold int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans)
if (ff_fft_init(&s->fft, nbits-1, trans == IRDFT || trans == RIDFT) < 0)
return -1;
- s->tcos = ff_cos_tabs[nbits-4];
- s->tsin = ff_sin_tabs[nbits-4]+(trans == RDFT || trans == IRIDFT)*(n>>2);
+ ff_init_ff_cos_tabs(nbits);
+ s->tcos = ff_cos_tabs[nbits];
+ s->tsin = ff_sin_tabs[nbits]+(trans == RDFT || trans == IRIDFT)*(n>>2);
+#if !CONFIG_HARDCODED_TABLES
for (i = 0; i < (n>>2); i++) {
- s->tcos[i] = cos(i*theta);
s->tsin[i] = sin(i*theta);
}
+#endif
return 0;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/roqaudioenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/roqaudioenc.c
index 9cff80c0aa..acb1b5f5a6 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/roqaudioenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/roqaudioenc.c
@@ -29,7 +29,6 @@
#define MAX_DPCM (127*127)
-static unsigned char dpcmValues[MAX_DPCM];
typedef struct
@@ -37,18 +36,6 @@ typedef struct
short lastSample[2];
} ROQDPCMContext;
-static av_cold void roq_dpcm_table_init(void)
-{
- int i;
-
- /* Create a table of quick DPCM values */
- for (i=0; i<MAX_DPCM; i++) {
- int s= ff_sqrt(i);
- int mid= s*s + s;
- dpcmValues[i]= s + (i>mid);
- }
-}
-
static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx)
{
ROQDPCMContext *context = avctx->priv_data;
@@ -66,8 +53,6 @@ static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx)
return -1;
}
- roq_dpcm_table_init();
-
avctx->frame_size = ROQ_FIRST_FRAME_SIZE;
context->lastSample[0] = context->lastSample[1] = 0;
@@ -92,8 +77,10 @@ static unsigned char dpcm_predict(short *previous, short current)
if (diff >= MAX_DPCM)
result = 127;
- else
- result = dpcmValues[diff];
+ else {
+ result = ff_sqrt(diff);
+ result += diff > result*result+result;
+ }
/* See if this overflows */
retry:
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/roqvideoenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/roqvideoenc.c
index 0f74ddd671..8dc77bd414 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/roqvideoenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/roqvideoenc.c
@@ -939,12 +939,6 @@ static int roq_encode_init(AVCodecContext *avctx)
if (((avctx->width)&(avctx->width-1))||((avctx->height)&(avctx->height-1)))
av_log(avctx, AV_LOG_ERROR, "Warning: dimensions not power of two\n");
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height)) {
- av_log(avctx, AV_LOG_ERROR, "Invalid dimensions (%dx%d)\n",
- avctx->width, avctx->height);
- return -1;
- }
-
enc->width = avctx->width;
enc->height = avctx->height;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rv10.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rv10.c
index d552bf9501..e1c5ed2f29 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rv10.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rv10.c
@@ -362,16 +362,17 @@ static int rv20_decode_picture_header(MpegEncContext *s)
new_w= 4*((uint8_t*)s->avctx->extradata)[6+2*f];
new_h= 4*((uint8_t*)s->avctx->extradata)[7+2*f];
}else{
- new_w= s->width; //FIXME wrong we of course must save the original in the context
- new_h= s->height;
+ new_w= s->orig_width ;
+ new_h= s->orig_height;
}
if(new_w != s->width || new_h != s->height){
av_log(s->avctx, AV_LOG_DEBUG, "attempting to change resolution to %dx%d\n", new_w, new_h);
- if (avcodec_check_dimensions(s->avctx, new_h, new_w) < 0)
+ if (avcodec_check_dimensions(s->avctx, new_w, new_h) < 0)
return -1;
MPV_common_end(s);
- s->width = s->avctx->width = new_w;
- s->height = s->avctx->height= new_h;
+ avcodec_set_dimensions(s->avctx, new_w, new_h);
+ s->width = new_w;
+ s->height = new_h;
if (MPV_common_init(s) < 0)
return -1;
}
@@ -452,8 +453,8 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
s->out_format = FMT_H263;
s->codec_id= avctx->codec_id;
- s->width = avctx->coded_width;
- s->height = avctx->coded_height;
+ s->orig_width = s->width = avctx->coded_width;
+ s->orig_height= s->height = avctx->coded_height;
s->h263_long_vectors= ((uint8_t*)avctx->extradata)[3] & 1;
avctx->sub_id= AV_RB32((uint8_t*)avctx->extradata + 4);
@@ -519,7 +520,7 @@ static av_cold int rv10_decode_end(AVCodecContext *avctx)
}
static int rv10_decode_packet(AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
+ const uint8_t *buf, int buf_size, int buf_size2)
{
MpegEncContext *s = avctx->priv_data;
int mb_count, mb_pos, left, start_mb_x;
@@ -602,6 +603,12 @@ static int rv10_decode_packet(AVCodecContext *avctx,
s->mv_type = MV_TYPE_16X16;
ret=ff_h263_decode_mb(s, s->block);
+ if (ret != SLICE_ERROR && s->gb.size_in_bits < get_bits_count(&s->gb) && 8*buf_size2 >= get_bits_count(&s->gb)){
+ av_log(avctx, AV_LOG_DEBUG, "update size from %d to %d\n", s->gb.size_in_bits, 8*buf_size2);
+ s->gb.size_in_bits= 8*buf_size2;
+ ret= SLICE_OK;
+ }
+
if (ret == SLICE_ERROR || s->gb.size_in_bits < get_bits_count(&s->gb)) {
av_log(s->avctx, AV_LOG_ERROR, "ERROR at MB %d %d\n", s->mb_x, s->mb_y);
return -1;
@@ -624,7 +631,7 @@ static int rv10_decode_packet(AVCodecContext *avctx,
ff_er_add_slice(s, start_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, AC_END|DC_END|MV_END);
- return buf_size;
+ return s->gb.size_in_bits;
}
static int get_slice_offset(AVCodecContext *avctx, const uint8_t *buf, int n)
@@ -661,14 +668,20 @@ static int rv10_decode_frame(AVCodecContext *avctx,
for(i=0; i<slice_count; i++){
int offset= get_slice_offset(avctx, slices_hdr, i);
- int size;
+ int size, size2;
if(i+1 == slice_count)
size= buf_size - offset;
else
size= get_slice_offset(avctx, slices_hdr, i+1) - offset;
- rv10_decode_packet(avctx, buf+offset, size);
+ if(i+2 >= slice_count)
+ size2= buf_size - offset;
+ else
+ size2= get_slice_offset(avctx, slices_hdr, i+2) - offset;
+
+ if(rv10_decode_packet(avctx, buf+offset, size, size2) > 8*size)
+ i++;
}
if(s->current_picture_ptr != NULL && s->mb_y>=s->mb_height){
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rv34.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rv34.c
index b709de998c..61bfc04a2b 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rv34.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/rv34.c
@@ -1287,6 +1287,7 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int
MPV_common_end(s);
s->width = r->si.width;
s->height = r->si.height;
+ avcodec_set_dimensions(s->avctx, s->width, s->height);
if(MPV_common_init(s) < 0)
return -1;
s->avctx->width = s->width;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/smacker.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/smacker.c
index 0d39027b0b..19f0b289e5 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/smacker.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/smacker.c
@@ -514,10 +514,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
c->avctx = avctx;
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return 1;
- }
-
avctx->pix_fmt = PIX_FMT_PAL8;
@@ -559,6 +555,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
static av_cold int smka_decode_init(AVCodecContext *avctx)
{
avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
+ avctx->sample_fmt = avctx->bits_per_coded_sample == 8 ? SAMPLE_FMT_U8 : SAMPLE_FMT_S16;
return 0;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/snow.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/snow.c
index aeab1dfc75..86c86390e1 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/snow.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/snow.c
@@ -4451,6 +4451,8 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
frame_start(s);
s->m.current_picture_ptr= &s->m.current_picture;
+ s->m.last_picture.pts= s->m.current_picture.pts;
+ s->m.current_picture.pts= pict->pts;
if(pict->pict_type == FF_P_TYPE){
int block_width = (width +15)>>4;
int block_height= (height+15)>>4;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/svq1dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/svq1dec.c
index 078ff2c15e..7bc18f604e 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/svq1dec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/svq1dec.c
@@ -838,5 +838,5 @@ AVCodec svq1_decoder = {
CODEC_CAP_DR1,
.flush= ff_mpeg_flush,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV410P, PIX_FMT_NONE},
- .long_name= NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1"),
+ .long_name= NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"),
};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/svq1enc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/svq1enc.c
index ce46816c16..1ca42f28d1 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/svq1enc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/svq1enc.c
@@ -590,5 +590,5 @@ AVCodec svq1_encoder = {
svq1_encode_frame,
svq1_encode_end,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV410P, PIX_FMT_NONE},
- .long_name= NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1"),
+ .long_name= NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"),
};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/svq3.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/svq3.c
index 9598a14db4..787cfe0cb1 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/svq3.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/svq3.c
@@ -796,6 +796,7 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
s->flags2 = avctx->flags2;
s->unrestricted_mv = 1;
h->is_complex=1;
+ avctx->pix_fmt = avctx->codec->pix_fmts[0];
if (!s->context_initialized) {
s->width = avctx->width;
@@ -1066,6 +1067,6 @@ AVCodec svq3_decoder = {
decode_end,
svq3_decode_frame,
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_DELAY,
- .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 3"),
+ .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 3 / Sorenson Video 3 / SVQ3"),
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_NONE},
};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/synth_filter.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/synth_filter.c
new file mode 100644
index 0000000000..a48939dbf3
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/synth_filter.c
@@ -0,0 +1,56 @@
+/*
+ * copyright (c) 2008 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "synth_filter.h"
+
+void ff_synth_filter_float(FFTContext *imdct,
+ float *synth_buf_ptr, int *synth_buf_offset,
+ float synth_buf2[32], const float window[512],
+ float out[32], const float in[32], float scale, float bias)
+{
+ float *synth_buf= synth_buf_ptr + *synth_buf_offset;
+ int i, j;
+
+ ff_imdct_half(imdct, synth_buf, in);
+
+ for (i = 0; i < 16; i++){
+ float a= synth_buf2[i ];
+ float b= synth_buf2[i + 16];
+ float c= 0;
+ float d= 0;
+ for (j = 0; j < 512 - *synth_buf_offset; j += 64){
+ a += window[i + j ]*(-synth_buf[15 - i + j ]);
+ b += window[i + j + 16]*( synth_buf[ i + j ]);
+ c += window[i + j + 32]*( synth_buf[16 + i + j ]);
+ d += window[i + j + 48]*( synth_buf[31 - i + j ]);
+ }
+ for ( ; j < 512; j += 64){
+ a += window[i + j ]*(-synth_buf[15 - i + j - 512]);
+ b += window[i + j + 16]*( synth_buf[ i + j - 512]);
+ c += window[i + j + 32]*( synth_buf[16 + i + j - 512]);
+ d += window[i + j + 48]*( synth_buf[31 - i + j - 512]);
+ }
+ out[i ] = a*scale + bias;
+ out[i + 16] = b*scale + bias;
+ synth_buf2[i ] = c;
+ synth_buf2[i + 16] = d;
+ }
+ *synth_buf_offset= (*synth_buf_offset - 32)&511;
+}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/synth_filter.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/synth_filter.h
new file mode 100644
index 0000000000..bb5e47cd35
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/synth_filter.h
@@ -0,0 +1,31 @@
+/*
+ * copyright (c) 2008 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_SYNTH_FILTER_H
+#define AVCODEC_SYNTH_FILTER_H
+
+#include "dsputil.h"
+
+void ff_synth_filter_float(FFTContext *imdct,
+ float *synth_buf_ptr, int *synth_buf_offset,
+ float synth_buf2[32], const float window[512],
+ float out[32], const float in[32], float scale, float bias);
+
+#endif /* AVCODEC_SYNTH_FILTER_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tableprint.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tableprint.c
new file mode 100644
index 0000000000..4f94c6a53f
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tableprint.c
@@ -0,0 +1,73 @@
+/*
+ * Generate a file for hardcoded tables
+ *
+ * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdio.h>
+#include <inttypes.h>
+#include "tableprint.h"
+
+#define WRITE_1D_FUNC(name, type, fmtstr, linebrk)\
+void write_##name##_array(const void *arg, int len, int dummy)\
+{\
+ const type *data = arg;\
+ int i;\
+ printf(" ");\
+ for (i = 0; i < len - 1; i++) {\
+ printf(" "fmtstr",", data[i]);\
+ if ((i & linebrk) == linebrk) printf("\n ");\
+ }\
+ printf(" "fmtstr"\n", data[i]);\
+}
+
+WRITE_1D_FUNC(int8, int8_t, "%3"PRIi8, 15)
+WRITE_1D_FUNC(uint32, uint32_t, "0x%08"PRIx32, 7)
+
+#define WRITE_2D_FUNC(name, type)\
+void write_##name##_2d_array(const void *arg, int len, int len2)\
+{\
+ const type *data = arg;\
+ int i;\
+ printf(" {\n");\
+ for (i = 0; i < len; i++) {\
+ write_##name##_array(data + i * len2, len2, 0);\
+ printf(i == len - 1 ? " }\n" : " }, {\n");\
+ }\
+}
+
+WRITE_2D_FUNC(int8, int8_t)
+WRITE_2D_FUNC(uint32, uint32_t)
+
+int main(int argc, char *argv[])
+{
+ int i;
+
+ printf("/* This file was generated by libavcodec/tableprint */\n");
+ printf("#include <stdint.h>\n");
+ tableinit();
+
+ for (i = 0; tables[i].declaration; i++) {
+ printf(tables[i].declaration);
+ printf(" = {\n");
+ tables[i].printfunc(tables[i].data, tables[i].size, tables[i].size2);
+ printf("};\n");
+ }
+ return 0;
+}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tableprint.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tableprint.h
new file mode 100644
index 0000000000..e73a9e20b3
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tableprint.h
@@ -0,0 +1,59 @@
+/*
+ * Generate a file for hardcoded tables
+ *
+ * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_TABLEPRINT_H
+#define AVCODEC_TABLEPRINT_H
+
+#include <stdint.h>
+
+/**
+ * \defgroup printfuncs Predefined functions for printing tables
+ *
+ * \{
+ */
+void write_int8_array (const void *, int, int);
+void write_uint32_array (const void *, int, int);
+void write_int8_2d_array (const void *, int, int);
+void write_uint32_2d_array(const void *, int, int);
+/** \} */ // end of printfuncs group
+
+struct tabledef {
+ /** String that declares the array. Adding " = { ..." after it should
+ * make a valid initializer, adding "extern" before and ";" if possible
+ * should make a valid extern declaration. */
+ const char *declaration;
+ /** Function used to print the table data (i.e. the part in {}).
+ * Should be one of the predefined write_*_array functions. */
+ void (*printfunc)(const void *, int, int);
+ /** Pointer passed to the printfunc, usually a pointer to the start
+ * of the array to be printed. */
+ const void *data;
+ int size; ///< size of the first dimension of the array
+ int size2; ///< size of the second dimension of the array if any
+};
+
+/** Initializes all the tables described in the tables array */
+void tableinit(void);
+/** Describes the tables that should be printed */
+extern const struct tabledef tables[];
+
+#endif /* AVCODEC_TABLEPRINT_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tiff.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tiff.c
index 8818a66530..f8f3cbde95 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tiff.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tiff.c
@@ -31,7 +31,8 @@
#include "lzw.h"
#include "tiff.h"
#include "faxcompr.h"
-
+#include "libavutil/common.h"
+#include "libavutil/intreadwrite.h"
typedef struct TiffContext {
AVCodecContext *avctx;
@@ -148,7 +149,7 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t* dst, int stride, const uin
memcpy(src2, src, size);
}else{
for(i = 0; i < size; i++)
- src2[i] = ff_reverse[src[i]];
+ src2[i] = av_reverse[src[i]];
}
memset(src2+size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
switch(s->compr){
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tiffenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tiffenc.c
index 7af39142c9..1d6b5b01f7 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tiffenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tiffenc.c
@@ -32,6 +32,7 @@
#include "tiff.h"
#include "rle.h"
#include "lzw.h"
+#include "put_bits.h"
#define TIFF_MAX_ENTRY 32
@@ -352,7 +353,8 @@ static int encode_frame(AVCodecContext * avctx, unsigned char *buf,
for (i = 0; i < s->height; i++) {
if (strip_sizes[i / s->rps] == 0) {
if(s->compr == TIFF_LZW){
- ff_lzw_encode_init(s->lzws, ptr, s->buf_size - (*s->buf - s->buf_start), 12);
+ ff_lzw_encode_init(s->lzws, ptr, s->buf_size - (*s->buf - s->buf_start),
+ 12, FF_LZW_TIFF, put_bits);
}
strip_offsets[i / s->rps] = ptr - buf;
}
@@ -372,7 +374,7 @@ static int encode_frame(AVCodecContext * avctx, unsigned char *buf,
ptr += n;
if(s->compr == TIFF_LZW && (i==s->height-1 || i%s->rps == s->rps-1)){
int ret;
- ret = ff_lzw_encode_flush(s->lzws);
+ ret = ff_lzw_encode_flush(s->lzws, flush_put_bits);
strip_sizes[(i / s->rps )] += ret ;
ptr += ret;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/truemotion2.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/truemotion2.c
index ee3d6d9212..44b89e70d1 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/truemotion2.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/truemotion2.c
@@ -813,9 +813,6 @@ static av_cold int decode_init(AVCodecContext *avctx){
TM2Context * const l = avctx->priv_data;
int i;
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return -1;
- }
if((avctx->width & 3) || (avctx->height & 3)){
av_log(avctx, AV_LOG_ERROR, "Width and height must be multiple of 4\n");
return -1;
@@ -848,6 +845,7 @@ static av_cold int decode_init(AVCodecContext *avctx){
static av_cold int decode_end(AVCodecContext *avctx){
TM2Context * const l = avctx->priv_data;
+ AVFrame *pic = &l->pic;
int i;
if(l->last)
@@ -865,6 +863,10 @@ static av_cold int decode_end(AVCodecContext *avctx){
av_free(l->U2);
av_free(l->V2);
}
+
+ if (pic->data[0])
+ avctx->release_buffer(avctx, pic);
+
return 0;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tscc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tscc.c
index d1a924da40..b00b5c5568 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tscc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tscc.c
@@ -141,10 +141,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
c->height = avctx->height;
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return 1;
- }
-
// Needed if zlib unused or init aborted before inflateInit
memset(&(c->zstream), 0, sizeof(z_stream));
switch(avctx->bits_per_coded_sample){
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/twinvq.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/twinvq.c
index 57c3301a12..7131584232 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/twinvq.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/twinvq.c
@@ -22,6 +22,7 @@
#include "avcodec.h"
#include "get_bits.h"
#include "dsputil.h"
+#include "lsp.h"
#include <math.h>
#include <stdint.h>
@@ -536,17 +537,6 @@ static void rearrange_lsp(int order, float *lsp, float min_dist)
}
}
-static void bubblesort(float *lsp, int lp_order)
-{
- int i,j;
-
- /* sort lsp in ascending order. float bubble agorithm,
- O(n) if data already sorted, O(n^2) - otherwise */
- for (i = 0; i < lp_order - 1; i++)
- for (j = i; j >= 0 && lsp[j] > lsp[j+1]; j--)
- FFSWAP(float, lsp[j], lsp[j+1]);
-}
-
static void decode_lsp(TwinContext *tctx, int lpc_idx1, uint8_t *lpc_idx2,
int lpc_hist_idx, float *lsp, float *hist)
{
@@ -583,7 +573,7 @@ static void decode_lsp(TwinContext *tctx, int lpc_idx1, uint8_t *lpc_idx2,
rearrange_lsp(mtab->n_lsp, lsp, 0.0001);
rearrange_lsp(mtab->n_lsp, lsp, 0.000095);
- bubblesort(lsp, mtab->n_lsp);
+ ff_sort_nearly_sorted_floats(lsp, mtab->n_lsp);
}
static void dec_lpc_spectrum_inv(TwinContext *tctx, float *lsp,
@@ -1014,6 +1004,7 @@ static av_cold void init_bitstream_params(TwinContext *tctx)
int bsize_no_main_cb[3];
int bse_bits[3];
int i;
+ enum FrameType frametype;
for (i = 0; i < 3; i++)
// +1 for history usage switch
@@ -1062,8 +1053,8 @@ static av_cold void init_bitstream_params(TwinContext *tctx)
tctx->length_change[i] = num_rounded_up;
}
- for (i = 0; i < 4; i++)
- construct_perm_table(tctx, i);
+ for (frametype = FT_SHORT; frametype <= FT_PPC; frametype++)
+ construct_perm_table(tctx, frametype);
}
static av_cold int twin_decode_init(AVCodecContext *avctx)
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ulti.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ulti.c
index f58874a607..12dc6ac14f 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ulti.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ulti.c
@@ -55,6 +55,16 @@ static av_cold int ulti_decode_init(AVCodecContext *avctx)
return 0;
}
+static av_cold int ulti_decode_end(AVCodecContext *avctx){
+ UltimotionDecodeContext *s = avctx->priv_data;
+ AVFrame *pic = &s->frame;
+
+ if (pic->data[0])
+ avctx->release_buffer(avctx, pic);
+
+ return 0;
+}
+
static const int block_coords[8] = // 4x4 block coords in 8x8 superblock
{ 0, 0, 0, 4, 4, 4, 4, 0};
@@ -401,7 +411,7 @@ AVCodec ulti_decoder = {
sizeof(UltimotionDecodeContext),
ulti_decode_init,
NULL,
- NULL,
+ ulti_decode_end,
ulti_decode_frame,
CODEC_CAP_DR1,
NULL,
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/utils.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/utils.c
index c3df903f1e..d91cbc0428 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/utils.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/utils.c
@@ -45,25 +45,6 @@
#include <fcntl.h>
#endif
-const uint8_t ff_reverse[256]={
-0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0,
-0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8,
-0x04,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4,
-0x0C,0x8C,0x4C,0xCC,0x2C,0xAC,0x6C,0xEC,0x1C,0x9C,0x5C,0xDC,0x3C,0xBC,0x7C,0xFC,
-0x02,0x82,0x42,0xC2,0x22,0xA2,0x62,0xE2,0x12,0x92,0x52,0xD2,0x32,0xB2,0x72,0xF2,
-0x0A,0x8A,0x4A,0xCA,0x2A,0xAA,0x6A,0xEA,0x1A,0x9A,0x5A,0xDA,0x3A,0xBA,0x7A,0xFA,
-0x06,0x86,0x46,0xC6,0x26,0xA6,0x66,0xE6,0x16,0x96,0x56,0xD6,0x36,0xB6,0x76,0xF6,
-0x0E,0x8E,0x4E,0xCE,0x2E,0xAE,0x6E,0xEE,0x1E,0x9E,0x5E,0xDE,0x3E,0xBE,0x7E,0xFE,
-0x01,0x81,0x41,0xC1,0x21,0xA1,0x61,0xE1,0x11,0x91,0x51,0xD1,0x31,0xB1,0x71,0xF1,
-0x09,0x89,0x49,0xC9,0x29,0xA9,0x69,0xE9,0x19,0x99,0x59,0xD9,0x39,0xB9,0x79,0xF9,
-0x05,0x85,0x45,0xC5,0x25,0xA5,0x65,0xE5,0x15,0x95,0x55,0xD5,0x35,0xB5,0x75,0xF5,
-0x0D,0x8D,0x4D,0xCD,0x2D,0xAD,0x6D,0xED,0x1D,0x9D,0x5D,0xDD,0x3D,0xBD,0x7D,0xFD,
-0x03,0x83,0x43,0xC3,0x23,0xA3,0x63,0xE3,0x13,0x93,0x53,0xD3,0x33,0xB3,0x73,0xF3,
-0x0B,0x8B,0x4B,0xCB,0x2B,0xAB,0x6B,0xEB,0x1B,0x9B,0x5B,0xDB,0x3B,0xBB,0x7B,0xFB,
-0x07,0x87,0x47,0xC7,0x27,0xA7,0x67,0xE7,0x17,0x97,0x57,0xD7,0x37,0xB7,0x77,0xF7,
-0x0F,0x8F,0x4F,0xCF,0x2F,0xAF,0x6F,0xEF,0x1F,0x9F,0x5F,0xDF,0x3F,0xBF,0x7F,0xFF,
-};
-
static int volatile entangled_thread_counter=0;
int (*ff_lockmgr_cb)(void **mutex, enum AVLockOp op);
static void *codec_mutex;
@@ -145,17 +126,19 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height){
case PIX_FMT_YUYV422:
case PIX_FMT_UYVY422:
case PIX_FMT_YUV422P:
+ case PIX_FMT_YUV440P:
case PIX_FMT_YUV444P:
case PIX_FMT_GRAY8:
case PIX_FMT_GRAY16BE:
case PIX_FMT_GRAY16LE:
case PIX_FMT_YUVJ420P:
case PIX_FMT_YUVJ422P:
+ case PIX_FMT_YUVJ440P:
case PIX_FMT_YUVJ444P:
case PIX_FMT_YUVA420P:
w_align= 16; //FIXME check for non mpeg style codecs and use less alignment
h_align= 16;
- if(s->codec_id == CODEC_ID_MPEG2VIDEO)
+ if(s->codec_id == CODEC_ID_MPEG2VIDEO || s->codec_id == CODEC_ID_MJPEG || s->codec_id == CODEC_ID_AMV || s->codec_id == CODEC_ID_THP)
h_align= 32; // interlaced is rounded up to 2 MBs
break;
case PIX_FMT_YUV411P:
@@ -384,8 +367,10 @@ int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic){
}
/* If internal buffer type return the same buffer */
- if(pic->type == FF_BUFFER_TYPE_INTERNAL)
+ if(pic->type == FF_BUFFER_TYPE_INTERNAL) {
+ pic->reordered_opaque= s->reordered_opaque;
return 0;
+ }
/*
* Not internal type and reget_buffer not overridden, emulate cr buffer
@@ -414,6 +399,16 @@ int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, v
return 0;
}
+int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int jobnr, int threadnr),void *arg, int *ret, int count){
+ int i;
+
+ for(i=0; i<count; i++){
+ int r= func(c, arg, i, 0);
+ if(ret) ret[i]= r;
+ }
+ return 0;
+}
+
enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat *fmt){
while (*fmt != PIX_FMT_NONE && ff_is_hwaccel_pix_fmt(*fmt))
++fmt;
@@ -684,7 +679,7 @@ int avcodec_close(AVCodecContext *avctx)
if (HAVE_THREADS && avctx->thread_opaque)
avcodec_thread_free(avctx);
- if (avctx->codec->close)
+ if (avctx->codec && avctx->codec->close)
avctx->codec->close(avctx);
avcodec_default_free_buffers(avctx);
av_freep(&avctx->priv_data);
@@ -750,6 +745,35 @@ AVCodec *avcodec_find_decoder_by_name(const char *name)
return NULL;
}
+int av_get_bit_rate(AVCodecContext *ctx)
+{
+ int bit_rate;
+ int bits_per_sample;
+
+ switch(ctx->codec_type) {
+ case CODEC_TYPE_VIDEO:
+ bit_rate = ctx->bit_rate;
+ break;
+ case CODEC_TYPE_AUDIO:
+ bits_per_sample = av_get_bits_per_sample(ctx->codec_id);
+ bit_rate = bits_per_sample ? ctx->sample_rate * ctx->channels * bits_per_sample : ctx->bit_rate;
+ break;
+ case CODEC_TYPE_DATA:
+ bit_rate = ctx->bit_rate;
+ break;
+ case CODEC_TYPE_SUBTITLE:
+ bit_rate = ctx->bit_rate;
+ break;
+ case CODEC_TYPE_ATTACHMENT:
+ bit_rate = ctx->bit_rate;
+ break;
+ default:
+ bit_rate = 0;
+ break;
+ }
+ return bit_rate;
+}
+
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
{
const char *codec_name;
@@ -822,7 +846,6 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", q=%d-%d", enc->qmin, enc->qmax);
}
- bitrate = enc->bit_rate;
break;
case CODEC_TYPE_AUDIO:
snprintf(buf, buf_size,
@@ -838,58 +861,15 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", %s", avcodec_get_sample_fmt_name(enc->sample_fmt));
}
-
- /* for PCM codecs, compute bitrate directly */
- switch(enc->codec_id) {
- case CODEC_ID_PCM_F64BE:
- case CODEC_ID_PCM_F64LE:
- bitrate = enc->sample_rate * enc->channels * 64;
- break;
- case CODEC_ID_PCM_S32LE:
- case CODEC_ID_PCM_S32BE:
- case CODEC_ID_PCM_U32LE:
- case CODEC_ID_PCM_U32BE:
- case CODEC_ID_PCM_F32BE:
- case CODEC_ID_PCM_F32LE:
- bitrate = enc->sample_rate * enc->channels * 32;
- break;
- case CODEC_ID_PCM_S24LE:
- case CODEC_ID_PCM_S24BE:
- case CODEC_ID_PCM_U24LE:
- case CODEC_ID_PCM_U24BE:
- case CODEC_ID_PCM_S24DAUD:
- bitrate = enc->sample_rate * enc->channels * 24;
- break;
- case CODEC_ID_PCM_S16LE:
- case CODEC_ID_PCM_S16BE:
- case CODEC_ID_PCM_S16LE_PLANAR:
- case CODEC_ID_PCM_U16LE:
- case CODEC_ID_PCM_U16BE:
- bitrate = enc->sample_rate * enc->channels * 16;
- break;
- case CODEC_ID_PCM_S8:
- case CODEC_ID_PCM_U8:
- case CODEC_ID_PCM_ALAW:
- case CODEC_ID_PCM_MULAW:
- case CODEC_ID_PCM_ZORK:
- bitrate = enc->sample_rate * enc->channels * 8;
- break;
- default:
- bitrate = enc->bit_rate;
- break;
- }
break;
case CODEC_TYPE_DATA:
snprintf(buf, buf_size, "Data: %s", codec_name);
- bitrate = enc->bit_rate;
break;
case CODEC_TYPE_SUBTITLE:
snprintf(buf, buf_size, "Subtitle: %s", codec_name);
- bitrate = enc->bit_rate;
break;
case CODEC_TYPE_ATTACHMENT:
snprintf(buf, buf_size, "Attachment: %s", codec_name);
- bitrate = enc->bit_rate;
break;
default:
snprintf(buf, buf_size, "Invalid Codec type %d", enc->codec_type);
@@ -903,6 +883,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", pass 2");
}
+ bitrate = av_get_bit_rate(enc);
if (bitrate != 0) {
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", %d kb/s", bitrate / 1000);
@@ -914,6 +895,17 @@ unsigned avcodec_version( void )
return LIBAVCODEC_VERSION_INT;
}
+const char * avcodec_configuration(void)
+{
+ return FFMPEG_CONFIGURATION;
+}
+
+const char * avcodec_license(void)
+{
+#define LICENSE_PREFIX "libavcodec license: "
+ return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
+}
+
void avcodec_init(void)
{
static int initialized = 0;
@@ -936,6 +928,8 @@ void avcodec_default_free_buffers(AVCodecContext *s){
if(s->internal_buffer==NULL) return;
+ if (s->internal_buffer_count)
+ av_log(s, AV_LOG_WARNING, "Found %i unreleased buffers!\n", s->internal_buffer_count);
for(i=0; i<INTERNAL_BUFFER_SIZE; i++){
InternalBuffer *buf= &((InternalBuffer*)s->internal_buffer)[i];
for(j=0; j<4; j++){
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/v210dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/v210dec.c
index 0d71b5004f..ceeccb6346 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/v210dec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/v210dec.c
@@ -30,8 +30,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "v210 needs even width\n");
return -1;
}
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0)
- return -1;
avctx->pix_fmt = PIX_FMT_YUV422P16;
avctx->bits_per_raw_sample = 10;
@@ -114,6 +112,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
static av_cold int decode_close(AVCodecContext *avctx)
{
+ AVFrame *pic = avctx->coded_frame;
+ if (pic->data[0])
+ avctx->release_buffer(avctx, pic);
av_freep(&avctx->coded_frame);
return 0;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/v210x.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/v210x.c
index 754b70a1f0..549a157f41 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/v210x.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/v210x.c
@@ -27,8 +27,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "v210x needs even width\n");
return -1;
}
- if(avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0)
- return -1;
avctx->pix_fmt = PIX_FMT_YUV422P16;
avctx->bits_per_raw_sample= 10;
@@ -124,6 +122,16 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
return avpkt->size;
}
+static av_cold int decode_close(AVCodecContext *avctx)
+{
+ AVFrame *pic = avctx->coded_frame;
+ if (pic->data[0])
+ avctx->release_buffer(avctx, pic);
+ av_freep(&avctx->coded_frame);
+
+ return 0;
+}
+
AVCodec v210x_decoder = {
"v210x",
CODEC_TYPE_VIDEO,
@@ -131,7 +139,7 @@ AVCodec v210x_decoder = {
0,
decode_init,
NULL,
- NULL,
+ decode_close,
decode_frame,
CODEC_CAP_DR1,
};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vb.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vb.c
index 02efa030a5..551b10657c 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vb.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vb.c
@@ -251,10 +251,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
c->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8;
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return -1;
- }
-
c->frame = av_malloc( avctx->width * avctx->height);
c->prev_frame = av_malloc( avctx->width * avctx->height);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vc1.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vc1.c
index 80676ca65a..4e1214d3d3 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vc1.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vc1.c
@@ -1259,7 +1259,11 @@ static int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
if(v->interlace){
v->fcm = decode012(gb);
- if(v->fcm) return -1; // interlaced frames/fields are not implemented
+ if(v->fcm){
+ if(!v->warn_interlaced++)
+ av_log(v->s.avctx, AV_LOG_ERROR, "Interlaced frames/fields support is not implemented\n");
+ return -1;
+ }
}
switch(get_unary(gb, 0, 4)) {
case 0:
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vc1.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vc1.h
index d39783b64f..2d91e4eea3 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vc1.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vc1.h
@@ -307,6 +307,8 @@ typedef struct VC1Context{
int x8_type;
uint8_t broken_link; ///< Broken link flag (BROKEN_LINK syntax element)
uint8_t closed_entry; ///< Closed entry point flag (CLOSED_ENTRY syntax element)
+
+ int warn_interlaced;
} VC1Context;
#endif /* FFMPEG_VC1_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vc1dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vc1dec.c
index 421d8f77a6..5f27b3cc53 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vc1dec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vc1dec.c
@@ -3191,6 +3191,8 @@ static int vc1_decode_frame(AVCodecContext *avctx,
buf_size2 = vc1_unescape_buffer(buf, divider - buf, buf2);
// TODO
+ if(!v->warn_interlaced++)
+ av_log(v->s.avctx, AV_LOG_ERROR, "Interlaced WVC1 support is not implemented\n");
av_free(buf2);return -1;
}else{
buf_size2 = vc1_unescape_buffer(buf, buf_size, buf2);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vdpau.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vdpau.c
index 4a7c86c0a8..7cc8ad1ca7 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vdpau.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vdpau.c
@@ -305,4 +305,54 @@ void ff_vdpau_vc1_decode_picture(MpegEncContext *s, const uint8_t *buf,
render->bitstream_buffers_used = 0;
}
+void ff_vdpau_mpeg4_decode_picture(MpegEncContext *s, const uint8_t *buf,
+ int buf_size)
+{
+ struct vdpau_render_state *render, *last, *next;
+ int i;
+
+ if (!s->current_picture_ptr) return;
+
+ render = (struct vdpau_render_state *)s->current_picture_ptr->data[0];
+ assert(render);
+
+ /* fill VdpPictureInfoMPEG4Part2 struct */
+ render->info.mpeg4.vop_time_increment_resolution = s->avctx->time_base.den;
+ render->info.mpeg4.vop_coding_type = 0;
+ render->info.mpeg4.vop_fcode_forward = s->f_code;
+ render->info.mpeg4.vop_fcode_backward = s->b_code;
+ render->info.mpeg4.resync_marker_disable = !s->resync_marker;
+ render->info.mpeg4.interlaced = !s->progressive_sequence;
+ render->info.mpeg4.quant_type = s->mpeg_quant;
+ render->info.mpeg4.quarter_sample = s->quarter_sample;
+ render->info.mpeg4.short_video_header = s->avctx->codec->id == CODEC_ID_H263;
+ render->info.mpeg4.rounding_control = s->no_rounding;
+ render->info.mpeg4.alternate_vertical_scan_flag = s->alternate_scan;
+ render->info.mpeg4.top_field_first = s->top_field_first;
+ for (i = 0; i < 64; ++i) {
+ render->info.mpeg4.intra_quantizer_matrix[i] = s->intra_matrix[i];
+ render->info.mpeg4.non_intra_quantizer_matrix[i] = s->inter_matrix[i];
+ }
+ render->info.mpeg4.forward_reference = VDP_INVALID_HANDLE;
+ render->info.mpeg4.backward_reference = VDP_INVALID_HANDLE;
+
+ switch (s->pict_type) {
+ case FF_B_TYPE:
+ next = (struct vdpau_render_state *)s->next_picture.data[0];
+ assert(next);
+ render->info.mpeg4.backward_reference = next->surface;
+ render->info.mpeg4.vop_coding_type = 2;
+ // no break here, going to set forward prediction
+ case FF_P_TYPE:
+ last = (struct vdpau_render_state *)s->last_picture.data[0];
+ assert(last);
+ render->info.mpeg4.forward_reference = last->surface;
+ }
+
+ ff_vdpau_add_data_chunk(s, buf, buf_size);
+
+ ff_draw_horiz_band(s, 0, s->avctx->height);
+ render->bitstream_buffers_used = 0;
+}
+
/* @}*/
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vdpau.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vdpau.h
index 53dbd7c02a..a8fa4d3877 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vdpau.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vdpau.h
@@ -70,14 +70,17 @@ struct vdpau_render_state {
/** picture parameter information for all supported codecs */
union VdpPictureInfo {
- VdpPictureInfoH264 h264;
- VdpPictureInfoMPEG1Or2 mpeg;
- VdpPictureInfoVC1 vc1;
+ VdpPictureInfoH264 h264;
+ VdpPictureInfoMPEG1Or2 mpeg;
+ VdpPictureInfoVC1 vc1;
+ VdpPictureInfoMPEG4Part2 mpeg4;
} info;
- /** Describe size/location of the compressed video data. */
+ /** Describe size/location of the compressed video data.
+ Set to 0 when freeing bitstream_buffers. */
int bitstream_buffers_allocated;
int bitstream_buffers_used;
+ /** The user is responsible for freeing this buffer using av_freep(). */
VdpBitstreamBuffer *bitstream_buffers;
};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vdpau_internal.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vdpau_internal.h
index ce0e00a38a..ce8a4269eb 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vdpau_internal.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vdpau_internal.h
@@ -39,4 +39,7 @@ void ff_vdpau_h264_picture_complete(MpegEncContext *s);
void ff_vdpau_vc1_decode_picture(MpegEncContext *s, const uint8_t *buf,
int buf_size);
+void ff_vdpau_mpeg4_decode_picture(MpegEncContext *s, const uint8_t *buf,
+ int buf_size);
+
#endif /* AVCODEC_VDPAU_INTERNAL_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vmnc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vmnc.c
index a97655a27c..b4c07f76e4 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vmnc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vmnc.c
@@ -468,9 +468,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
c->width = avctx->width;
c->height = avctx->height;
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return 1;
- }
c->bpp = avctx->bits_per_coded_sample;
c->bpp2 = c->bpp/8;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vorbis_dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vorbis_dec.c
index 0ed3ce61a4..93fafc1178 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vorbis_dec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vorbis_dec.c
@@ -160,6 +160,20 @@ typedef struct vorbis_context_s {
#define BARK(x) \
(13.1f * atan(0.00074f * (x)) + 2.24f * atan(1.85e-8f * (x) * (x)) + 1e-4f * (x))
+static const char idx_err_str[] = "Index value %d out of range (0 - %d) for %s at %s:%i\n";
+#define VALIDATE_INDEX(idx, limit) \
+ if (idx >= limit) {\
+ av_log(vc->avccontext, AV_LOG_ERROR,\
+ idx_err_str,\
+ (int)(idx), (int)(limit - 1), #idx, __FILE__, __LINE__);\
+ return -1;\
+ }
+#define GET_VALIDATED_INDEX(idx, bits, limit) \
+ {\
+ idx = get_bits(gb, bits);\
+ VALIDATE_INDEX(idx, limit)\
+ }
+
static float vorbisfloat2float(uint_fast32_t val)
{
double mant = val & 0x1fffff;
@@ -490,22 +504,15 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
AV_DEBUG(" %d floor %d class dim: %d subclasses %d \n", i, j, floor_setup->data.t1.class_dimensions[j], floor_setup->data.t1.class_subclasses[j]);
if (floor_setup->data.t1.class_subclasses[j]) {
- int bits = get_bits(gb, 8);
- if (bits >= vc->codebook_count) {
- av_log(vc->avccontext, AV_LOG_ERROR, "Masterbook index %d is out of range.\n", bits);
- return -1;
- }
- floor_setup->data.t1.class_masterbook[j] = bits;
+ GET_VALIDATED_INDEX(floor_setup->data.t1.class_masterbook[j], 8, vc->codebook_count)
AV_DEBUG(" masterbook: %d \n", floor_setup->data.t1.class_masterbook[j]);
}
for (k = 0; k < (1 << floor_setup->data.t1.class_subclasses[j]); ++k) {
int16_t bits = get_bits(gb, 8) - 1;
- if (bits != -1 && bits >= vc->codebook_count) {
- av_log(vc->avccontext, AV_LOG_ERROR, "Subclass book index %d is out of range.\n", bits);
- return -1;
- }
+ if (bits != -1)
+ VALIDATE_INDEX(bits, vc->codebook_count)
floor_setup->data.t1.subclass_books[j][k] = bits;
AV_DEBUG(" book %d. : %d \n", k, floor_setup->data.t1.subclass_books[j][k]);
@@ -564,10 +571,7 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
int idx;
uint_fast8_t book_idx;
for (idx = 0; idx < floor_setup->data.t0.num_books; ++idx) {
- book_idx = get_bits(gb, 8);
- if (book_idx >= vc->codebook_count)
- return -1;
- floor_setup->data.t0.book_list[idx] = book_idx;
+ GET_VALIDATED_INDEX(floor_setup->data.t0.book_list[idx], 8, vc->codebook_count)
if (vc->codebooks[book_idx].dimensions > max_codebook_dim)
max_codebook_dim = vc->codebooks[book_idx].dimensions;
}
@@ -650,11 +654,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
}
res_setup->classifications = get_bits(gb, 6) + 1;
- res_setup->classbook = get_bits(gb, 8);
- if (res_setup->classbook >= vc->codebook_count) {
- av_log(vc->avccontext, AV_LOG_ERROR, "classbook value %d out of range. \n", res_setup->classbook);
- return -1;
- }
+ GET_VALIDATED_INDEX(res_setup->classbook, 8, vc->codebook_count)
AV_DEBUG(" begin %d end %d part.size %d classif.s %d classbook %d \n", res_setup->begin, res_setup->end, res_setup->partition_size,
res_setup->classifications, res_setup->classbook);
@@ -673,12 +673,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
for (j = 0; j < res_setup->classifications; ++j) {
for (k = 0; k < 8; ++k) {
if (cascade[j]&(1 << k)) {
- int bits = get_bits(gb, 8);
- if (bits >= vc->codebook_count) {
- av_log(vc->avccontext, AV_LOG_ERROR, "book value %d out of range. \n", bits);
- return -1;
- }
- res_setup->books[j][k] = bits;
+ GET_VALIDATED_INDEX(res_setup->books[j][k], 8, vc->codebook_count)
AV_DEBUG(" %d class casscade depth %d book: %d \n", j, k, res_setup->books[j][k]);
@@ -723,16 +718,8 @@ static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc)
mapping_setup->magnitude = av_mallocz(mapping_setup->coupling_steps * sizeof(uint_fast8_t));
mapping_setup->angle = av_mallocz(mapping_setup->coupling_steps * sizeof(uint_fast8_t));
for (j = 0; j < mapping_setup->coupling_steps; ++j) {
- mapping_setup->magnitude[j] = get_bits(gb, ilog(vc->audio_channels - 1));
- mapping_setup->angle[j] = get_bits(gb, ilog(vc->audio_channels - 1));
- if (mapping_setup->magnitude[j] >= vc->audio_channels) {
- av_log(vc->avccontext, AV_LOG_ERROR, "magnitude channel %d out of range. \n", mapping_setup->magnitude[j]);
- return -1;
- }
- if (mapping_setup->angle[j] >= vc->audio_channels) {
- av_log(vc->avccontext, AV_LOG_ERROR, "angle channel %d out of range. \n", mapping_setup->angle[j]);
- return -1;
- }
+ GET_VALIDATED_INDEX(mapping_setup->magnitude[j], ilog(vc->audio_channels - 1), vc->audio_channels)
+ GET_VALIDATED_INDEX(mapping_setup->angle[j], ilog(vc->audio_channels - 1), vc->audio_channels)
}
} else {
mapping_setup->coupling_steps = 0;
@@ -752,20 +739,9 @@ static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc)
}
for (j = 0; j < mapping_setup->submaps; ++j) {
- int bits;
skip_bits(gb, 8); // FIXME check?
- bits = get_bits(gb, 8);
- if (bits >= vc->floor_count) {
- av_log(vc->avccontext, AV_LOG_ERROR, "submap floor value %d out of range. \n", bits);
- return -1;
- }
- mapping_setup->submap_floor[j] = bits;
- bits = get_bits(gb, 8);
- if (bits >= vc->residue_count) {
- av_log(vc->avccontext, AV_LOG_ERROR, "submap residue value %d out of range. \n", bits);
- return -1;
- }
- mapping_setup->submap_residue[j] = bits;
+ GET_VALIDATED_INDEX(mapping_setup->submap_floor[j], 8, vc->floor_count)
+ GET_VALIDATED_INDEX(mapping_setup->submap_residue[j], 8, vc->residue_count)
AV_DEBUG(" %d mapping %d submap : floor %d, residue %d \n", i, j, mapping_setup->submap_floor[j], mapping_setup->submap_residue[j]);
}
@@ -827,11 +803,7 @@ static int vorbis_parse_setup_hdr_modes(vorbis_context *vc)
mode_setup->blockflag = get_bits1(gb);
mode_setup->windowtype = get_bits(gb, 16); //FIXME check
mode_setup->transformtype = get_bits(gb, 16); //FIXME check
- mode_setup->mapping = get_bits(gb, 8);
- if (mode_setup->mapping >= vc->mapping_count) {
- av_log(vc->avccontext, AV_LOG_ERROR, "mode mapping value %d out of range. \n", mode_setup->mapping);
- return -1;
- }
+ GET_VALIDATED_INDEX(mode_setup->mapping, 8, vc->mapping_count);
AV_DEBUG(" %d mode: blockflag %d, windowtype %d, transformtype %d, mapping %d \n", i, mode_setup->blockflag, mode_setup->windowtype, mode_setup->transformtype, mode_setup->mapping);
}
@@ -978,7 +950,7 @@ static av_cold int vorbis_decode_init(AVCodecContext *avccontext)
}
if (!headers_len) {
- av_log(avccontext, AV_LOG_ERROR, "Extradata corrupt.\n");
+ av_log(avccontext, AV_LOG_ERROR, "Extradata missing.\n");
return -1;
}
@@ -1498,11 +1470,7 @@ static int vorbis_parse_audio_packet(vorbis_context *vc)
if (vc->mode_count == 1) {
mode_number = 0;
} else {
- mode_number = get_bits(gb, ilog(vc->mode_count-1));
- }
- if (mode_number >= vc->mode_count) {
- av_log(vc->avccontext, AV_LOG_ERROR, "mode number %d out of range.\n", mode_number);
- return -1;
+ GET_VALIDATED_INDEX(mode_number, ilog(vc->mode_count-1), vc->mode_count)
}
vc->mode_number = mode_number;
mapping = &vc->mappings[vc->modes[mode_number].mapping];
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vorbis_enc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vorbis_enc.c
index 61f78b576f..4e641386c7 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vorbis_enc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vorbis_enc.c
@@ -530,7 +530,8 @@ static int put_main_header(vorbis_enc_context *venc, uint8_t **out)
// identification header
init_put_bits(&pb, p, buffer_len);
put_bits(&pb, 8, 1); //magic
- ff_put_string(&pb, "vorbis", 0);
+ for (i = 0; "vorbis"[i]; i++)
+ put_bits(&pb, 8, "vorbis"[i]);
put_bits32(&pb, 0); // version
put_bits(&pb, 8, venc->channels);
put_bits32(&pb, venc->sample_rate);
@@ -549,7 +550,8 @@ static int put_main_header(vorbis_enc_context *venc, uint8_t **out)
// comment header
init_put_bits(&pb, p, buffer_len);
put_bits(&pb, 8, 3); //magic
- ff_put_string(&pb, "vorbis", 0);
+ for (i = 0; "vorbis"[i]; i++)
+ put_bits(&pb, 8, "vorbis"[i]);
put_bits32(&pb, 0); // vendor length TODO
put_bits32(&pb, 0); // amount of comments
put_bits(&pb, 1, 1); // framing
@@ -562,7 +564,8 @@ static int put_main_header(vorbis_enc_context *venc, uint8_t **out)
// setup header
init_put_bits(&pb, p, buffer_len);
put_bits(&pb, 8, 5); //magic
- ff_put_string(&pb, "vorbis", 0);
+ for (i = 0; "vorbis"[i]; i++)
+ put_bits(&pb, 8, "vorbis"[i]);
// codebooks
put_bits(&pb, 8, venc->ncodebooks - 1);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp3.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp3.c
index 60b84f0b5f..0593d4ec24 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp3.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp3.c
@@ -179,6 +179,14 @@ typedef struct Vp3DecodeContext {
int coded_fragment_list_index;
int pixel_addresses_initialized;
+ /* track which fragments have already been decoded; called 'fast'
+ * because this data structure avoids having to iterate through every
+ * fragment in coded_fragment_list; once a fragment has been fully
+ * decoded, it is removed from this list */
+ int *fast_fragment_list;
+ int fragment_list_y_head;
+ int fragment_list_c_head;
+
VLC dc_vlc[16];
VLC ac_vlc_1[16];
VLC ac_vlc_2[16];
@@ -723,6 +731,25 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb)
/* end the list of coded C fragments */
s->last_coded_c_fragment = s->coded_fragment_list_index - 1;
+ for (i = 0; i < s->fragment_count - 1; i++) {
+ s->fast_fragment_list[i] = i + 1;
+ }
+ s->fast_fragment_list[s->fragment_count - 1] = -1;
+
+ if (s->last_coded_y_fragment == -1)
+ s->fragment_list_y_head = -1;
+ else {
+ s->fragment_list_y_head = s->first_coded_y_fragment;
+ s->fast_fragment_list[s->last_coded_y_fragment] = -1;
+ }
+
+ if (s->last_coded_c_fragment == -1)
+ s->fragment_list_c_head = -1;
+ else {
+ s->fragment_list_c_head = s->first_coded_c_fragment;
+ s->fast_fragment_list[s->last_coded_c_fragment] = -1;
+ }
+
return 0;
}
@@ -1029,7 +1056,7 @@ static int unpack_block_qpis(Vp3DecodeContext *s, GetBitContext *gb)
*/
static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
VLC *table, int coeff_index,
- int first_fragment, int last_fragment,
+ int y_plane,
int eob_run)
{
int i;
@@ -1038,6 +1065,10 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
DCTELEM coeff = 0;
Vp3Fragment *fragment;
int bits_to_get;
+ int next_fragment;
+ int previous_fragment;
+ int fragment_num;
+ int *list_head;
/* local references to structure members to avoid repeated deferences */
uint8_t *perm= s->scantable.permutated;
@@ -1045,20 +1076,26 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
Vp3Fragment *all_fragments = s->all_fragments;
uint8_t *coeff_counts = s->coeff_counts;
VLC_TYPE (*vlc_table)[2] = table->table;
+ int *fast_fragment_list = s->fast_fragment_list;
- if ((first_fragment >= s->fragment_count) ||
- (last_fragment >= s->fragment_count)) {
-
- av_log(s->avctx, AV_LOG_ERROR, " vp3:unpack_vlcs(): bad fragment number (%d -> %d ?)\n",
- first_fragment, last_fragment);
- return 0;
+ if (y_plane) {
+ next_fragment = s->fragment_list_y_head;
+ list_head = &s->fragment_list_y_head;
+ } else {
+ next_fragment = s->fragment_list_c_head;
+ list_head = &s->fragment_list_c_head;
}
- for (i = first_fragment; i <= last_fragment; i++) {
- int fragment_num = coded_fragment_list[i];
+ i = next_fragment;
+ previous_fragment = -1; /* this indicates that the previous fragment is actually the list head */
+ while (i != -1) {
+ fragment_num = coded_fragment_list[i];
- if (coeff_counts[fragment_num] > coeff_index)
+ if (coeff_counts[fragment_num] > coeff_index) {
+ previous_fragment = i;
+ i = fast_fragment_list[i];
continue;
+ }
fragment = &all_fragments[fragment_num];
if (!eob_run) {
@@ -1091,10 +1128,20 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
s->next_coeff->next=NULL;
fragment->next_coeff= s->next_coeff++;
}
+ /* previous fragment is now this fragment */
+ previous_fragment = i;
} else {
coeff_counts[fragment_num] |= 128;
eob_run--;
+ /* remove this fragment from the list */
+ if (previous_fragment != -1)
+ fast_fragment_list[previous_fragment] = fast_fragment_list[i];
+ else
+ *list_head = fast_fragment_list[i];
+ /* previous fragment remains unchanged */
}
+
+ i = fast_fragment_list[i];
}
return eob_run;
@@ -1116,6 +1163,8 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb)
int ac_y_table;
int ac_c_table;
int residual_eob_run = 0;
+ VLC *y_tables[64];
+ VLC *c_tables[64];
/* fetch the DC table indexes */
dc_y_table = get_bits(gb, 4);
@@ -1123,14 +1172,14 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb)
/* unpack the Y plane DC coefficients */
residual_eob_run = unpack_vlcs(s, gb, &s->dc_vlc[dc_y_table], 0,
- s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);
+ 1, residual_eob_run);
/* reverse prediction of the Y-plane DC coefficients */
reverse_dc_prediction(s, 0, s->fragment_width, s->fragment_height);
/* unpack the C plane DC coefficients */
residual_eob_run = unpack_vlcs(s, gb, &s->dc_vlc[dc_c_table], 0,
- s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);
+ 0, residual_eob_run);
/* reverse prediction of the C-plane DC coefficients */
if (!(s->avctx->flags & CODEC_FLAG_GRAY))
@@ -1145,40 +1194,33 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb)
ac_y_table = get_bits(gb, 4);
ac_c_table = get_bits(gb, 4);
- /* unpack the group 1 AC coefficients (coeffs 1-5) */
+ /* build tables of AC VLC tables */
for (i = 1; i <= 5; i++) {
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_1[ac_y_table], i,
- s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);
-
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_1[ac_c_table], i,
- s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);
+ y_tables[i] = &s->ac_vlc_1[ac_y_table];
+ c_tables[i] = &s->ac_vlc_1[ac_c_table];
}
-
- /* unpack the group 2 AC coefficients (coeffs 6-14) */
for (i = 6; i <= 14; i++) {
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_2[ac_y_table], i,
- s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);
-
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_2[ac_c_table], i,
- s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);
+ y_tables[i] = &s->ac_vlc_2[ac_y_table];
+ c_tables[i] = &s->ac_vlc_2[ac_c_table];
}
-
- /* unpack the group 3 AC coefficients (coeffs 15-27) */
for (i = 15; i <= 27; i++) {
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_3[ac_y_table], i,
- s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);
-
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_3[ac_c_table], i,
- s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);
+ y_tables[i] = &s->ac_vlc_3[ac_y_table];
+ c_tables[i] = &s->ac_vlc_3[ac_c_table];
}
-
- /* unpack the group 4 AC coefficients (coeffs 28-63) */
for (i = 28; i <= 63; i++) {
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_4[ac_y_table], i,
- s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);
+ y_tables[i] = &s->ac_vlc_4[ac_y_table];
+ c_tables[i] = &s->ac_vlc_4[ac_c_table];
+ }
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_4[ac_c_table], i,
- s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);
+ /* decode all AC coefficents */
+ for (i = 1; i <= 63; i++) {
+ if (s->fragment_list_y_head != -1)
+ residual_eob_run = unpack_vlcs(s, gb, y_tables[i], i,
+ 1, residual_eob_run);
+
+ if (s->fragment_list_c_head != -1)
+ residual_eob_run = unpack_vlcs(s, gb, c_tables[i], i,
+ 0, residual_eob_run);
}
return 0;
@@ -1191,7 +1233,6 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb)
*/
#define COMPATIBLE_FRAME(x) \
(compatible_frame[s->all_fragments[x].coding_method] == current_frame_type)
-#define FRAME_CODED(x) (s->all_fragments[x].coding_method != MODE_COPY)
#define DC_COEFF(u) (s->coeffs[u].index ? 0 : s->coeffs[u].coeff) //FIXME do somethin to simplify this
static void reverse_dc_prediction(Vp3DecodeContext *s,
@@ -1248,7 +1289,7 @@ static void reverse_dc_prediction(Vp3DecodeContext *s,
* from other INTRA blocks. There are 2 golden frame coding types;
* blocks encoding in these modes can only predict from other blocks
* that were encoded with these 1 of these 2 modes. */
- static const unsigned char compatible_frame[8] = {
+ static const unsigned char compatible_frame[9] = {
1, /* MODE_INTER_NO_MV */
0, /* MODE_INTRA */
1, /* MODE_INTER_PLUS_MV */
@@ -1256,7 +1297,8 @@ static void reverse_dc_prediction(Vp3DecodeContext *s,
1, /* MODE_INTER_PRIOR_MV */
2, /* MODE_USING_GOLDEN */
2, /* MODE_GOLDEN_MV */
- 1 /* MODE_INTER_FOUR_MV */
+ 1, /* MODE_INTER_FOUR_MV */
+ 3 /* MODE_COPY */
};
int current_frame_type;
@@ -1284,24 +1326,24 @@ static void reverse_dc_prediction(Vp3DecodeContext *s,
if(x){
l= i-1;
vl = DC_COEFF(l);
- if(FRAME_CODED(l) && COMPATIBLE_FRAME(l))
+ if(COMPATIBLE_FRAME(l))
transform |= PL;
}
if(y){
u= i-fragment_width;
vu = DC_COEFF(u);
- if(FRAME_CODED(u) && COMPATIBLE_FRAME(u))
+ if(COMPATIBLE_FRAME(u))
transform |= PU;
if(x){
ul= i-fragment_width-1;
vul = DC_COEFF(ul);
- if(FRAME_CODED(ul) && COMPATIBLE_FRAME(ul))
+ if(COMPATIBLE_FRAME(ul))
transform |= PUL;
}
if(x + 1 < fragment_width){
ur= i-fragment_width+1;
vur = DC_COEFF(ur);
- if(FRAME_CODED(ur) && COMPATIBLE_FRAME(ur))
+ if(COMPATIBLE_FRAME(ur))
transform |= PUR;
}
}
@@ -1324,7 +1366,7 @@ static void reverse_dc_prediction(Vp3DecodeContext *s,
/* check for outranging on the [ul u l] and
* [ul u ur l] predictors */
- if ((transform == 13) || (transform == 15)) {
+ if ((transform == 15) || (transform == 13)) {
if (FFABS(predicted_dc - vu) > 128)
predicted_dc = vu;
else if (FFABS(predicted_dc - vl) > 128)
@@ -1599,42 +1641,45 @@ static void apply_loop_filter(Vp3DecodeContext *s)
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
- /* do not perform left edge filter for left columns frags */
- if ((x > 0) &&
- (s->all_fragments[fragment].coding_method != MODE_COPY)) {
- s->dsp.vp3_h_loop_filter(
- plane_data + s->all_fragments[fragment].first_pixel,
- stride, bounding_values);
- }
+ /* This code basically just deblocks on the edges of coded blocks.
+ * However, it has to be much more complicated because of the
+ * braindamaged deblock ordering used in VP3/Theora. Order matters
+ * because some pixels get filtered twice. */
+ if( s->all_fragments[fragment].coding_method != MODE_COPY )
+ {
+ /* do not perform left edge filter for left columns frags */
+ if (x > 0) {
+ s->dsp.vp3_h_loop_filter(
+ plane_data + s->all_fragments[fragment].first_pixel,
+ stride, bounding_values);
+ }
- /* do not perform top edge filter for top row fragments */
- if ((y > 0) &&
- (s->all_fragments[fragment].coding_method != MODE_COPY)) {
- s->dsp.vp3_v_loop_filter(
- plane_data + s->all_fragments[fragment].first_pixel,
- stride, bounding_values);
- }
+ /* do not perform top edge filter for top row fragments */
+ if (y > 0) {
+ s->dsp.vp3_v_loop_filter(
+ plane_data + s->all_fragments[fragment].first_pixel,
+ stride, bounding_values);
+ }
- /* do not perform right edge filter for right column
- * fragments or if right fragment neighbor is also coded
- * in this frame (it will be filtered in next iteration) */
- if ((x < width - 1) &&
- (s->all_fragments[fragment].coding_method != MODE_COPY) &&
- (s->all_fragments[fragment + 1].coding_method == MODE_COPY)) {
- s->dsp.vp3_h_loop_filter(
- plane_data + s->all_fragments[fragment + 1].first_pixel,
- stride, bounding_values);
- }
+ /* do not perform right edge filter for right column
+ * fragments or if right fragment neighbor is also coded
+ * in this frame (it will be filtered in next iteration) */
+ if ((x < width - 1) &&
+ (s->all_fragments[fragment + 1].coding_method == MODE_COPY)) {
+ s->dsp.vp3_h_loop_filter(
+ plane_data + s->all_fragments[fragment + 1].first_pixel,
+ stride, bounding_values);
+ }
- /* do not perform bottom edge filter for bottom row
- * fragments or if bottom fragment neighbor is also coded
- * in this frame (it will be filtered in the next row) */
- if ((y < height - 1) &&
- (s->all_fragments[fragment].coding_method != MODE_COPY) &&
- (s->all_fragments[fragment + width].coding_method == MODE_COPY)) {
- s->dsp.vp3_v_loop_filter(
- plane_data + s->all_fragments[fragment + width].first_pixel,
- stride, bounding_values);
+ /* do not perform bottom edge filter for bottom row
+ * fragments or if bottom fragment neighbor is also coded
+ * in this frame (it will be filtered in the next row) */
+ if ((y < height - 1) &&
+ (s->all_fragments[fragment + width].coding_method == MODE_COPY)) {
+ s->dsp.vp3_v_loop_filter(
+ plane_data + s->all_fragments[fragment + width].first_pixel,
+ stride, bounding_values);
+ }
}
fragment++;
@@ -1756,9 +1801,10 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx)
s->coeff_counts = av_malloc(s->fragment_count * sizeof(*s->coeff_counts));
s->coeffs = av_malloc(s->fragment_count * sizeof(Coeff) * 65);
s->coded_fragment_list = av_malloc(s->fragment_count * sizeof(int));
+ s->fast_fragment_list = av_malloc(s->fragment_count * sizeof(int));
s->pixel_addresses_initialized = 0;
if (!s->superblock_coding || !s->all_fragments || !s->coeff_counts ||
- !s->coeffs || !s->coded_fragment_list) {
+ !s->coeffs || !s->coded_fragment_list || !s->fast_fragment_list) {
vp3_decode_end(avctx);
return -1;
}
@@ -2057,6 +2103,7 @@ static av_cold int vp3_decode_end(AVCodecContext *avctx)
av_free(s->coeff_counts);
av_free(s->coeffs);
av_free(s->coded_fragment_list);
+ av_free(s->fast_fragment_list);
av_free(s->superblock_fragments);
av_free(s->superblock_macroblocks);
av_free(s->macroblock_fragments);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/w32thread.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/w32thread.c
index 9873845cdb..e6bfb8b893 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/w32thread.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/w32thread.c
@@ -29,10 +29,15 @@ typedef struct ThreadContext{
AVCodecContext *avctx;
HANDLE thread;
HANDLE work_sem;
+ HANDLE job_sem;
HANDLE done_sem;
int (*func)(AVCodecContext *c, void *arg);
+ int (*func2)(AVCodecContext *c, void *arg, int, int);
void *arg;
- int ret;
+ int argsize;
+ int *jobnr;
+ int *ret;
+ int threadnr;
}ThreadContext;
@@ -40,13 +45,22 @@ static unsigned WINAPI attribute_align_arg thread_func(void *v){
ThreadContext *c= v;
for(;;){
+ int ret, jobnr;
//printf("thread_func %X enter wait\n", (int)v); fflush(stdout);
WaitForSingleObject(c->work_sem, INFINITE);
+ // avoid trying to access jobnr if we should quit
+ if (!c->func && !c->func2)
+ break;
+ WaitForSingleObject(c->job_sem, INFINITE);
+ jobnr = (*c->jobnr)++;
+ ReleaseSemaphore(c->job_sem, 1, 0);
//printf("thread_func %X after wait (func=%X)\n", (int)v, (int)c->func); fflush(stdout);
if(c->func)
- c->ret= c->func(c->avctx, c->arg);
+ ret= c->func(c->avctx, (uint8_t *)c->arg + jobnr*c->argsize);
else
- return 0;
+ ret= c->func2(c->avctx, c->arg, jobnr, c->threadnr);
+ if (c->ret)
+ c->ret[jobnr] = ret;
//printf("thread_func %X signal complete\n", (int)v); fflush(stdout);
ReleaseSemaphore(c->done_sem, 1, 0);
}
@@ -65,12 +79,16 @@ void avcodec_thread_free(AVCodecContext *s){
for(i=0; i<s->thread_count; i++){
c[i].func= NULL;
- ReleaseSemaphore(c[i].work_sem, 1, 0);
+ c[i].func2= NULL;
+ }
+ ReleaseSemaphore(c[0].work_sem, s->thread_count, 0);
+ for(i=0; i<s->thread_count; i++){
WaitForSingleObject(c[i].thread, INFINITE);
- if(c[i].work_sem) CloseHandle(c[i].work_sem);
- if(c[i].done_sem) CloseHandle(c[i].done_sem);
if(c[i].thread) CloseHandle(c[i].thread);
}
+ if(c[0].work_sem) CloseHandle(c[0].work_sem);
+ if(c[0].job_sem) CloseHandle(c[0].job_sem);
+ if(c[0].done_sem) CloseHandle(c[0].done_sem);
av_freep(&s->thread_opaque);
}
@@ -78,28 +96,34 @@ void avcodec_thread_free(AVCodecContext *s){
int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size){
ThreadContext *c= s->thread_opaque;
int i;
+ int jobnr = 0;
assert(s == c->avctx);
- assert(count <= s->thread_count);
/* note, we can be certain that this is not called with the same AVCodecContext by different threads at the same time */
- for(i=0; i<count; i++){
- c[i].arg= (char*)arg + i*size;
+ for(i=0; i<s->thread_count; i++){
+ c[i].arg= arg;
+ c[i].argsize= size;
c[i].func= func;
- c[i].ret= 12345;
-
- ReleaseSemaphore(c[i].work_sem, 1, 0);
+ c[i].ret= ret;
+ c[i].jobnr = &jobnr;
}
- for(i=0; i<count; i++){
- WaitForSingleObject(c[i].done_sem, INFINITE);
+ ReleaseSemaphore(c[0].work_sem, count, 0);
+ for(i=0; i<count; i++)
+ WaitForSingleObject(c[0].done_sem, INFINITE);
- c[i].func= NULL;
- if(ret) ret[i]= c[i].ret;
- }
return 0;
}
+int avcodec_thread_execute2(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count){
+ ThreadContext *c= s->thread_opaque;
+ int i;
+ for(i=0; i<s->thread_count; i++)
+ c[i].func2 = func;
+ avcodec_thread_execute(s, NULL, arg, ret, count, 0);
+}
+
int avcodec_thread_init(AVCodecContext *s, int thread_count){
int i;
ThreadContext *c;
@@ -110,15 +134,21 @@ av_log(NULL, AV_LOG_INFO, "[w32thread] thread count = %d\n", thread_count);
assert(!s->thread_opaque);
c= av_mallocz(sizeof(ThreadContext)*thread_count);
s->thread_opaque= c;
+ if(!(c[0].work_sem = CreateSemaphore(NULL, 0, INT_MAX, NULL)))
+ goto fail;
+ if(!(c[0].job_sem = CreateSemaphore(NULL, 1, 1, NULL)))
+ goto fail;
+ if(!(c[0].done_sem = CreateSemaphore(NULL, 0, INT_MAX, NULL)))
+ goto fail;
for(i=0; i<thread_count; i++){
//printf("init semaphors %d\n", i); fflush(stdout);
c[i].avctx= s;
av_log(NULL, AV_LOG_INFO, "[w32thread] init semaphors %d\n", i+1);
- if(!(c[i].work_sem = CreateSemaphore(NULL, 0, s->thread_count, NULL)))
- goto fail;
- if(!(c[i].done_sem = CreateSemaphore(NULL, 0, s->thread_count, NULL)))
- goto fail;
+ c[i].work_sem = c[0].work_sem;
+ c[i].job_sem = c[0].job_sem;
+ c[i].done_sem = c[0].done_sem;
+ c[i].threadnr = i;
//printf("create thread %d\n", i); fflush(stdout);
av_log(NULL, AV_LOG_INFO, "[w32thread] create thread %d\n", i+1);
@@ -128,6 +158,7 @@ av_log(NULL, AV_LOG_INFO, "[w32thread] create thread %d\n", i+1);
//printf("init done\n"); fflush(stdout);
av_log(NULL, AV_LOG_INFO, "[w32thread] init done\n");
s->execute= avcodec_thread_execute;
+ s->execute2= avcodec_thread_execute2;
return 0;
fail:
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wavpack.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wavpack.c
index 95f1d7123b..783e7d70bf 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wavpack.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wavpack.c
@@ -378,7 +378,7 @@ static float wv_get_value_float(WavpackContext *s, uint32_t *crc, int S)
if(s->got_extra_bits){
const int max_bits = 1 + 23 + 8 + 1;
- const int left_bits = s->gb_extra_bits.size_in_bits - get_bits_count(&s->gb_extra_bits);
+ const int left_bits = get_bits_left(&s->gb_extra_bits);
if(left_bits + 8 * FF_INPUT_BUFFER_PADDING_SIZE < max_bits)
return 0.0;
@@ -897,7 +897,7 @@ static int wavpack_decode_frame(AVCodecContext *avctx,
return -1;
}
if(s->got_extra_bits && avctx->sample_fmt != SAMPLE_FMT_FLT){
- const int size = s->gb_extra_bits.size_in_bits - get_bits_count(&s->gb_extra_bits);
+ const int size = get_bits_left(&s->gb_extra_bits);
const int wanted = s->samples * s->extra_bits << s->stereo_in;
if(size < wanted){
av_log(avctx, AV_LOG_ERROR, "Too small EXTRABITS\n");
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wmadec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wmadec.c
index 5a31963520..958e185534 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wmadec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wmadec.c
@@ -240,8 +240,8 @@ static void decode_exp_lsp(WMACodecContext *s, int ch)
s->block_len, lsp_coefs);
}
-/** pow(10, i / 16.0) for i in -60..67 */
-static const float pow_tab[128] = {
+/** pow(10, i / 16.0) for i in -60..95 */
+static const float pow_tab[] = {
1.7782794100389e-04, 2.0535250264571e-04,
2.3713737056617e-04, 2.7384196342644e-04,
3.1622776601684e-04, 3.6517412725484e-04,
@@ -306,6 +306,20 @@ static const float pow_tab[128] = {
7.4989420933246e+03, 8.6596432336007e+03,
1.0000000000000e+04, 1.1547819846895e+04,
1.3335214321633e+04, 1.5399265260595e+04,
+ 1.7782794100389e+04, 2.0535250264571e+04,
+ 2.3713737056617e+04, 2.7384196342644e+04,
+ 3.1622776601684e+04, 3.6517412725484e+04,
+ 4.2169650342858e+04, 4.8696752516586e+04,
+ 5.6234132519035e+04, 6.4938163157621e+04,
+ 7.4989420933246e+04, 8.6596432336007e+04,
+ 1.0000000000000e+05, 1.1547819846895e+05,
+ 1.3335214321633e+05, 1.5399265260595e+05,
+ 1.7782794100389e+05, 2.0535250264571e+05,
+ 2.3713737056617e+05, 2.7384196342644e+05,
+ 3.1622776601684e+05, 3.6517412725484e+05,
+ 4.2169650342858e+05, 4.8696752516586e+05,
+ 5.6234132519035e+05, 6.4938163157621e+05,
+ 7.4989420933246e+05, 8.6596432336007e+05,
};
/**
@@ -341,12 +355,17 @@ static int decode_exp_vlc(WMACodecContext *s, int ch)
while (q < q_end) {
code = get_vlc2(&s->gb, s->exp_vlc.table, EXPVLCBITS, EXPMAX);
- if (code < 0)
+ if (code < 0){
+ av_log(s->avctx, AV_LOG_ERROR, "Exponent vlc invalid\n");
return -1;
+ }
/* NOTE: this offset is the same as MPEG4 AAC ! */
last_exp += code - 60;
- if ((unsigned)last_exp + 60 > FF_ARRAY_ELEMS(pow_tab))
+ if ((unsigned)last_exp + 60 > FF_ARRAY_ELEMS(pow_tab)) {
+ av_log(s->avctx, AV_LOG_ERROR, "Exponent out of range: %d\n",
+ last_exp);
return -1;
+ }
v = ptab[last_exp];
iv = iptab[last_exp];
if (v > max_scale)
@@ -440,12 +459,16 @@ static int wma_decode_block(WMACodecContext *s)
if (s->reset_block_lengths) {
s->reset_block_lengths = 0;
v = get_bits(&s->gb, n);
- if (v >= s->nb_block_sizes)
+ if (v >= s->nb_block_sizes){
+ av_log(s->avctx, AV_LOG_ERROR, "prev_block_len_bits %d out of range\n", s->frame_len_bits - v);
return -1;
+ }
s->prev_block_len_bits = s->frame_len_bits - v;
v = get_bits(&s->gb, n);
- if (v >= s->nb_block_sizes)
+ if (v >= s->nb_block_sizes){
+ av_log(s->avctx, AV_LOG_ERROR, "block_len_bits %d out of range\n", s->frame_len_bits - v);
return -1;
+ }
s->block_len_bits = s->frame_len_bits - v;
} else {
/* update block lengths */
@@ -453,8 +476,10 @@ static int wma_decode_block(WMACodecContext *s)
s->block_len_bits = s->next_block_len_bits;
}
v = get_bits(&s->gb, n);
- if (v >= s->nb_block_sizes)
+ if (v >= s->nb_block_sizes){
+ av_log(s->avctx, AV_LOG_ERROR, "next_block_len_bits %d out of range\n", s->frame_len_bits - v);
return -1;
+ }
s->next_block_len_bits = s->frame_len_bits - v;
} else {
/* fixed block len */
@@ -465,8 +490,10 @@ static int wma_decode_block(WMACodecContext *s)
/* now check if the block length is coherent with the frame length */
s->block_len = 1 << s->block_len_bits;
- if ((s->block_pos + s->block_len) > s->frame_len)
+ if ((s->block_pos + s->block_len) > s->frame_len){
+ av_log(s->avctx, AV_LOG_ERROR, "frame_len overflow\n");
return -1;
+ }
if (s->nb_channels == 2) {
s->ms_stereo = get_bits1(&s->gb);
@@ -530,8 +557,10 @@ static int wma_decode_block(WMACodecContext *s)
val = get_bits(&s->gb, 7) - 19;
} else {
code = get_vlc2(&s->gb, s->hgain_vlc.table, HGAINVLCBITS, HGAINMAX);
- if (code < 0)
+ if (code < 0){
+ av_log(s->avctx, AV_LOG_ERROR, "hgain vlc invalid\n");
return -1;
+ }
val += code - 18;
}
s->high_band_values[ch][i] = val;
@@ -613,7 +642,7 @@ static int wma_decode_block(WMACodecContext *s)
/* compute power of high bands */
exponents = s->exponents[ch] +
- (s->high_band_start[bsize]<<bsize);
+ (s->high_band_start[bsize]<<bsize>>esize);
last_high_band = 0; /* avoid warning */
for(j=0;j<n1;j++) {
n = s->exponent_high_bands[s->frame_len_bits -
@@ -629,11 +658,11 @@ static int wma_decode_block(WMACodecContext *s)
last_high_band = j;
tprintf(s->avctx, "%d: power=%f (%d)\n", j, exp_power[j], n);
}
- exponents += n<<bsize;
+ exponents += n<<bsize>>esize;
}
/* main freqs and high freqs */
- exponents = s->exponents[ch] + (s->coefs_start<<bsize);
+ exponents = s->exponents[ch] + (s->coefs_start<<bsize>>esize);
for(j=-1;j<n1;j++) {
if (j < 0) {
n = s->high_band_start[bsize] -
@@ -655,7 +684,7 @@ static int wma_decode_block(WMACodecContext *s)
*coefs++ = noise *
exponents[i<<bsize>>esize] * mult1;
}
- exponents += n<<bsize;
+ exponents += n<<bsize>>esize;
} else {
/* coded values + small noise */
for(i = 0;i < n; i++) {
@@ -664,7 +693,7 @@ static int wma_decode_block(WMACodecContext *s)
*coefs++ = ((*coefs1++) + noise) *
exponents[i<<bsize>>esize] * mult;
}
- exponents += n<<bsize;
+ exponents += n<<bsize>>esize;
}
}
@@ -865,6 +894,7 @@ static int wma_decode_superframe(AVCodecContext *avctx,
pos >>= 3;
len = buf_size - pos;
if (len > MAX_CODED_SUPERFRAME_SIZE || len < 0) {
+ av_log(s->avctx, AV_LOG_ERROR, "len %d invalid\n", len);
goto fail;
}
s->last_superframe_len = len;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wmaprodec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wmaprodec.c
index 4d16c7f523..cbc97d9c82 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wmaprodec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wmaprodec.c
@@ -762,6 +762,15 @@ static int decode_channel_transform(WMAProDecodeCtx* s)
*/
static int decode_coeffs(WMAProDecodeCtx *s, int c)
{
+ /* Integers 0..15 as single-precision floats. The table saves a
+ costly int to float conversion, and storing the values as
+ integers allows fast sign-flipping. */
+ static const int fval_tab[16] = {
+ 0x00000000, 0x3f800000, 0x40000000, 0x40400000,
+ 0x40800000, 0x40a00000, 0x40c00000, 0x40e00000,
+ 0x41000000, 0x41100000, 0x41200000, 0x41300000,
+ 0x41400000, 0x41500000, 0x41600000, 0x41700000,
+ };
int vlctable;
VLC* vlc;
WMAProChannelCtx* ci = &s->channel[c];
@@ -797,29 +806,32 @@ static int decode_coeffs(WMAProDecodeCtx *s, int c)
for (i = 0; i < 4; i += 2) {
idx = get_vlc2(&s->gb, vec2_vlc.table, VLCBITS, VEC2MAXDEPTH);
if (idx == HUFF_VEC2_SIZE - 1) {
- vals[i] = get_vlc2(&s->gb, vec1_vlc.table, VLCBITS, VEC1MAXDEPTH);
- if (vals[i] == HUFF_VEC1_SIZE - 1)
- vals[i] += ff_wma_get_large_val(&s->gb);
- vals[i+1] = get_vlc2(&s->gb, vec1_vlc.table, VLCBITS, VEC1MAXDEPTH);
- if (vals[i+1] == HUFF_VEC1_SIZE - 1)
- vals[i+1] += ff_wma_get_large_val(&s->gb);
+ int v0, v1;
+ v0 = get_vlc2(&s->gb, vec1_vlc.table, VLCBITS, VEC1MAXDEPTH);
+ if (v0 == HUFF_VEC1_SIZE - 1)
+ v0 += ff_wma_get_large_val(&s->gb);
+ v1 = get_vlc2(&s->gb, vec1_vlc.table, VLCBITS, VEC1MAXDEPTH);
+ if (v1 == HUFF_VEC1_SIZE - 1)
+ v1 += ff_wma_get_large_val(&s->gb);
+ ((float*)vals)[i ] = v0;
+ ((float*)vals)[i+1] = v1;
} else {
- vals[i] = symbol_to_vec2[idx] >> 4;
- vals[i+1] = symbol_to_vec2[idx] & 0xF;
+ vals[i] = fval_tab[symbol_to_vec2[idx] >> 4 ];
+ vals[i+1] = fval_tab[symbol_to_vec2[idx] & 0xF];
}
}
} else {
- vals[0] = symbol_to_vec4[idx] >> 12;
- vals[1] = (symbol_to_vec4[idx] >> 8) & 0xF;
- vals[2] = (symbol_to_vec4[idx] >> 4) & 0xF;
- vals[3] = symbol_to_vec4[idx] & 0xF;
+ vals[0] = fval_tab[ symbol_to_vec4[idx] >> 12 ];
+ vals[1] = fval_tab[(symbol_to_vec4[idx] >> 8) & 0xF];
+ vals[2] = fval_tab[(symbol_to_vec4[idx] >> 4) & 0xF];
+ vals[3] = fval_tab[ symbol_to_vec4[idx] & 0xF];
}
/** decode sign */
for (i = 0; i < 4; i++) {
if (vals[i]) {
int sign = get_bits1(&s->gb) - 1;
- ci->coeffs[cur_coeff] = (vals[i] ^ sign) - sign;
+ *(uint32_t*)&ci->coeffs[cur_coeff] = vals[i] ^ sign<<31;
num_zeros = 0;
} else {
ci->coeffs[cur_coeff] = 0;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wnv1.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wnv1.c
index aec474f2de..f537aee3af 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wnv1.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wnv1.c
@@ -26,6 +26,7 @@
#include "avcodec.h"
#include "get_bits.h"
+#include "libavutil/common.h"
typedef struct WNV1Context{
@@ -51,7 +52,7 @@ static inline int wnv1_get_code(WNV1Context *w, int base_value)
int v = get_vlc2(&w->gb, code_vlc.table, CODE_VLC_BITS, 1);
if(v==15)
- return ff_reverse[ get_bits(&w->gb, 8 - w->shift) ];
+ return av_reverse[ get_bits(&w->gb, 8 - w->shift) ];
else
return base_value + ((v - 7)<<w->shift);
}
@@ -87,7 +88,7 @@ static int decode_frame(AVCodecContext *avctx,
p->key_frame = 1;
for(i=8; i<buf_size; i++)
- rbuf[i]= ff_reverse[ buf[i] ];
+ rbuf[i]= av_reverse[ buf[i] ];
init_get_bits(&l->gb, rbuf+8, (buf_size-8)*8);
if (buf[2] >> 4 == 6)
@@ -143,6 +144,16 @@ static av_cold int decode_init(AVCodecContext *avctx){
return 0;
}
+static av_cold int decode_end(AVCodecContext *avctx){
+ WNV1Context * const l = avctx->priv_data;
+ AVFrame *pic = &l->pic;
+
+ if (pic->data[0])
+ avctx->release_buffer(avctx, pic);
+
+ return 0;
+}
+
AVCodec wnv1_decoder = {
"wnv1",
CODEC_TYPE_VIDEO,
@@ -150,7 +161,7 @@ AVCodec wnv1_decoder = {
sizeof(WNV1Context),
decode_init,
NULL,
- NULL,
+ decode_end,
decode_frame,
CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Winnov WNV1"),
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dsputil_mmx.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dsputil_mmx.c
index 2e00aa2a24..3a1588358d 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dsputil_mmx.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dsputil_mmx.c
@@ -597,7 +597,7 @@ static void add_bytes_l2_mmx(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){
}
#if HAVE_7REGS && HAVE_TEN_OPERANDS
-static void add_hfyu_median_prediction_cmov(uint8_t *dst, uint8_t *top, uint8_t *diff, int w, int *left, int *left_top) {
+static void add_hfyu_median_prediction_cmov(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top) {
x86_reg w2 = -w;
x86_reg x;
int l = *left & 0xff;
@@ -2380,25 +2380,31 @@ static void float_to_int16_sse2(int16_t *dst, const float *src, long len){
);
}
-#if HAVE_YASM
void ff_float_to_int16_interleave6_sse(int16_t *dst, const float **src, int len);
void ff_float_to_int16_interleave6_3dnow(int16_t *dst, const float **src, int len);
void ff_float_to_int16_interleave6_3dn2(int16_t *dst, const float **src, int len);
-void ff_add_hfyu_median_prediction_mmx2(uint8_t *dst, uint8_t *top, uint8_t *diff, int w, int *left, int *left_top);
+int32_t ff_scalarproduct_int16_mmx2(int16_t *v1, int16_t *v2, int order, int shift);
+int32_t ff_scalarproduct_int16_sse2(int16_t *v1, int16_t *v2, int order, int shift);
+int32_t ff_scalarproduct_and_madd_int16_mmx2(int16_t *v1, int16_t *v2, int16_t *v3, int order, int mul);
+int32_t ff_scalarproduct_and_madd_int16_sse2(int16_t *v1, int16_t *v2, int16_t *v3, int order, int mul);
+int32_t ff_scalarproduct_and_madd_int16_ssse3(int16_t *v1, int16_t *v2, int16_t *v3, int order, int mul);
+void ff_add_hfyu_median_prediction_mmx2(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top);
+int ff_add_hfyu_left_prediction_ssse3(uint8_t *dst, const uint8_t *src, int w, int left);
+int ff_add_hfyu_left_prediction_sse4(uint8_t *dst, const uint8_t *src, int w, int left);
void ff_x264_deblock_v_luma_sse2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0);
void ff_x264_deblock_h_luma_sse2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0);
-void ff_x264_deblock_v8_luma_intra_mmxext(uint8_t *pix, int stride, int alpha, int beta);
void ff_x264_deblock_h_luma_intra_mmxext(uint8_t *pix, int stride, int alpha, int beta);
-#if ARCH_X86_32
+void ff_x264_deblock_v_luma_intra_sse2(uint8_t *pix, int stride, int alpha, int beta);
+void ff_x264_deblock_h_luma_intra_sse2(uint8_t *pix, int stride, int alpha, int beta);
+
+#if HAVE_YASM && ARCH_X86_32
+void ff_x264_deblock_v8_luma_intra_mmxext(uint8_t *pix, int stride, int alpha, int beta);
static void ff_x264_deblock_v_luma_intra_mmxext(uint8_t *pix, int stride, int alpha, int beta)
{
ff_x264_deblock_v8_luma_intra_mmxext(pix+0, stride, alpha, beta);
ff_x264_deblock_v8_luma_intra_mmxext(pix+8, stride, alpha, beta);
}
-#endif
-void ff_x264_deblock_v_luma_intra_sse2(uint8_t *pix, int stride, int alpha, int beta);
-void ff_x264_deblock_h_luma_intra_sse2(uint8_t *pix, int stride, int alpha, int beta);
-#else
+#elif !HAVE_YASM
#define ff_float_to_int16_interleave6_sse(a,b,c) float_to_int16_interleave_misc_sse(a,b,c,6)
#define ff_float_to_int16_interleave6_3dnow(a,b,c) float_to_int16_interleave_misc_3dnow(a,b,c,6)
#define ff_float_to_int16_interleave6_3dn2(a,b,c) float_to_int16_interleave_misc_3dnow(a,b,c,6)
@@ -2505,78 +2511,6 @@ void ff_snow_inner_add_yblock_mmx(const uint8_t *obmc, const int obmc_stride, ui
int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8);
-static void add_int16_sse2(int16_t * v1, int16_t * v2, int order)
-{
- x86_reg o = -(order << 1);
- v1 += order;
- v2 += order;
- __asm__ volatile(
- "1: \n\t"
- "movdqu (%1,%2), %%xmm0 \n\t"
- "movdqu 16(%1,%2), %%xmm1 \n\t"
- "paddw (%0,%2), %%xmm0 \n\t"
- "paddw 16(%0,%2), %%xmm1 \n\t"
- "movdqa %%xmm0, (%0,%2) \n\t"
- "movdqa %%xmm1, 16(%0,%2) \n\t"
- "add $32, %2 \n\t"
- "js 1b \n\t"
- : "+r"(v1), "+r"(v2), "+r"(o)
- );
-}
-
-static void sub_int16_sse2(int16_t * v1, int16_t * v2, int order)
-{
- x86_reg o = -(order << 1);
- v1 += order;
- v2 += order;
- __asm__ volatile(
- "1: \n\t"
- "movdqa (%0,%2), %%xmm0 \n\t"
- "movdqa 16(%0,%2), %%xmm2 \n\t"
- "movdqu (%1,%2), %%xmm1 \n\t"
- "movdqu 16(%1,%2), %%xmm3 \n\t"
- "psubw %%xmm1, %%xmm0 \n\t"
- "psubw %%xmm3, %%xmm2 \n\t"
- "movdqa %%xmm0, (%0,%2) \n\t"
- "movdqa %%xmm2, 16(%0,%2) \n\t"
- "add $32, %2 \n\t"
- "js 1b \n\t"
- : "+r"(v1), "+r"(v2), "+r"(o)
- );
-}
-
-static int32_t scalarproduct_int16_sse2(int16_t * v1, int16_t * v2, int order, int shift)
-{
- int res = 0;
- DECLARE_ALIGNED_16(xmm_reg, sh);
- x86_reg o = -(order << 1);
-
- v1 += order;
- v2 += order;
- sh.a = shift;
- __asm__ volatile(
- "pxor %%xmm7, %%xmm7 \n\t"
- "1: \n\t"
- "movdqu (%0,%3), %%xmm0 \n\t"
- "movdqu 16(%0,%3), %%xmm1 \n\t"
- "pmaddwd (%1,%3), %%xmm0 \n\t"
- "pmaddwd 16(%1,%3), %%xmm1 \n\t"
- "paddd %%xmm0, %%xmm7 \n\t"
- "paddd %%xmm1, %%xmm7 \n\t"
- "add $32, %3 \n\t"
- "js 1b \n\t"
- "movhlps %%xmm7, %%xmm2 \n\t"
- "paddd %%xmm2, %%xmm7 \n\t"
- "psrad %4, %%xmm7 \n\t"
- "pshuflw $0x4E, %%xmm7,%%xmm2 \n\t"
- "paddd %%xmm2, %%xmm7 \n\t"
- "movd %%xmm7, %2 \n\t"
- : "+r"(v1), "+r"(v2), "=r"(res), "+r"(o)
- : "m"(sh)
- );
- return res;
-}
-
void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
{
mm_flags = mm_support();
@@ -2951,6 +2885,11 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
c->put_h264_chroma_pixels_tab[1]= put_h264_chroma_mc4_ssse3;
c->avg_h264_chroma_pixels_tab[1]= avg_h264_chroma_mc4_ssse3;
c->add_png_paeth_prediction= add_png_paeth_prediction_ssse3;
+#if HAVE_YASM
+ c->add_hfyu_left_prediction = ff_add_hfyu_left_prediction_ssse3;
+ if (mm_flags & FF_MM_SSE4) // not really sse4, just slow on Conroe
+ c->add_hfyu_left_prediction = ff_add_hfyu_left_prediction_sse4;
+#endif
}
#endif
@@ -3008,6 +2947,12 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
c->float_to_int16_interleave = float_to_int16_interleave_3dn2;
}
}
+ if(mm_flags & FF_MM_MMX2){
+#if HAVE_YASM
+ c->scalarproduct_int16 = ff_scalarproduct_int16_mmx2;
+ c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_mmx2;
+#endif
+ }
if(mm_flags & FF_MM_SSE){
c->vorbis_inverse_coupling = vorbis_inverse_coupling_sse;
c->ac3_downmix = ac3_downmix_sse;
@@ -3026,10 +2971,13 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_sse2;
c->float_to_int16 = float_to_int16_sse2;
c->float_to_int16_interleave = float_to_int16_interleave_sse2;
- c->add_int16 = add_int16_sse2;
- c->sub_int16 = sub_int16_sse2;
- c->scalarproduct_int16 = scalarproduct_int16_sse2;
+#if HAVE_YASM
+ c->scalarproduct_int16 = ff_scalarproduct_int16_sse2;
+ c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_sse2;
+#endif
}
+ if((mm_flags & FF_MM_SSSE3) && !(mm_flags & (FF_MM_SSE42|FF_MM_3DNOW)) && HAVE_YASM) // cachesplit
+ c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_ssse3;
}
if (CONFIG_ENCODERS)
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dsputil_yasm.asm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dsputil_yasm.asm
index 9d5e62e57d..023fc4d3bd 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dsputil_yasm.asm
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dsputil_yasm.asm
@@ -21,6 +21,13 @@
%include "x86inc.asm"
+SECTION_RODATA
+pb_f: times 16 db 15
+pb_zzzzzzzz77777777: times 8 db -1
+pb_7: times 8 db 7
+pb_zzzz3333zzzzbbbb: db -1,-1,-1,-1,3,3,3,3,-1,-1,-1,-1,11,11,11,11
+pb_zz11zz55zz99zzdd: db -1,-1,1,1,-1,-1,5,5,-1,-1,9,9,-1,-1,13,13
+
section .text align=16
%macro PSWAPD_SSE 2
@@ -92,7 +99,180 @@ FLOAT_TO_INT16_INTERLEAVE6 3dn2
-; void ff_add_hfyu_median_prediction_mmx2(uint8_t *dst, uint8_t *top, uint8_t *diff, int w, int *left, int *left_top)
+%macro SCALARPRODUCT 1
+; int scalarproduct_int16(int16_t *v1, int16_t *v2, int order, int shift)
+cglobal scalarproduct_int16_%1, 3,3,4, v1, v2, order, shift
+ shl orderq, 1
+ add v1q, orderq
+ add v2q, orderq
+ neg orderq
+ movd m3, shiftm
+ pxor m2, m2
+.loop:
+ movu m0, [v1q + orderq]
+ movu m1, [v1q + orderq + mmsize]
+ pmaddwd m0, [v2q + orderq]
+ pmaddwd m1, [v2q + orderq + mmsize]
+ paddd m2, m0
+ paddd m2, m1
+ add orderq, mmsize*2
+ jl .loop
+%if mmsize == 16
+ movhlps m0, m2
+ paddd m2, m0
+ psrad m2, m3
+ pshuflw m0, m2, 0x4e
+%else
+ psrad m2, m3
+ pshufw m0, m2, 0x4e
+%endif
+ paddd m2, m0
+ movd eax, m2
+ RET
+
+; int scalarproduct_and_madd_int16(int16_t *v1, int16_t *v2, int16_t *v3, int order, int mul)
+cglobal scalarproduct_and_madd_int16_%1, 4,4,8, v1, v2, v3, order, mul
+ shl orderq, 1
+ movd m7, mulm
+%if mmsize == 16
+ pshuflw m7, m7, 0
+ punpcklqdq m7, m7
+%else
+ pshufw m7, m7, 0
+%endif
+ pxor m6, m6
+ add v1q, orderq
+ add v2q, orderq
+ add v3q, orderq
+ neg orderq
+.loop:
+ movu m0, [v2q + orderq]
+ movu m1, [v2q + orderq + mmsize]
+ mova m4, [v1q + orderq]
+ mova m5, [v1q + orderq + mmsize]
+ movu m2, [v3q + orderq]
+ movu m3, [v3q + orderq + mmsize]
+ pmaddwd m0, m4
+ pmaddwd m1, m5
+ pmullw m2, m7
+ pmullw m3, m7
+ paddd m6, m0
+ paddd m6, m1
+ paddw m2, m4
+ paddw m3, m5
+ mova [v1q + orderq], m2
+ mova [v1q + orderq + mmsize], m3
+ add orderq, mmsize*2
+ jl .loop
+%if mmsize == 16
+ movhlps m0, m6
+ paddd m6, m0
+ pshuflw m0, m6, 0x4e
+%else
+ pshufw m0, m6, 0x4e
+%endif
+ paddd m6, m0
+ movd eax, m6
+ RET
+%endmacro
+
+INIT_MMX
+SCALARPRODUCT mmx2
+INIT_XMM
+SCALARPRODUCT sse2
+
+%macro SCALARPRODUCT_LOOP 1
+align 16
+.loop%1:
+ sub orderq, mmsize*2
+%if %1
+ mova m1, m4
+ mova m4, [v2q + orderq]
+ mova m0, [v2q + orderq + mmsize]
+ palignr m1, m0, %1
+ palignr m0, m4, %1
+ mova m3, m5
+ mova m5, [v3q + orderq]
+ mova m2, [v3q + orderq + mmsize]
+ palignr m3, m2, %1
+ palignr m2, m5, %1
+%else
+ mova m0, [v2q + orderq]
+ mova m1, [v2q + orderq + mmsize]
+ mova m2, [v3q + orderq]
+ mova m3, [v3q + orderq + mmsize]
+%endif
+ %define t0 [v1q + orderq]
+ %define t1 [v1q + orderq + mmsize]
+%ifdef ARCH_X86_64
+ mova m8, t0
+ mova m9, t1
+ %define t0 m8
+ %define t1 m9
+%endif
+ pmaddwd m0, t0
+ pmaddwd m1, t1
+ pmullw m2, m7
+ pmullw m3, m7
+ paddw m2, t0
+ paddw m3, t1
+ paddd m6, m0
+ paddd m6, m1
+ mova [v1q + orderq], m2
+ mova [v1q + orderq + mmsize], m3
+ jg .loop%1
+%if %1
+ jmp .end
+%endif
+%endmacro
+
+; int scalarproduct_and_madd_int16(int16_t *v1, int16_t *v2, int16_t *v3, int order, int mul)
+cglobal scalarproduct_and_madd_int16_ssse3, 4,5,10, v1, v2, v3, order, mul
+ shl orderq, 1
+ movd m7, mulm
+ pshuflw m7, m7, 0
+ punpcklqdq m7, m7
+ pxor m6, m6
+ mov r4d, v2d
+ and r4d, 15
+ and v2q, ~15
+ and v3q, ~15
+ mova m4, [v2q + orderq]
+ mova m5, [v3q + orderq]
+ ; linear is faster than branch tree or jump table, because the branches taken are cyclic (i.e. predictable)
+ cmp r4d, 0
+ je .loop0
+ cmp r4d, 2
+ je .loop2
+ cmp r4d, 4
+ je .loop4
+ cmp r4d, 6
+ je .loop6
+ cmp r4d, 8
+ je .loop8
+ cmp r4d, 10
+ je .loop10
+ cmp r4d, 12
+ je .loop12
+SCALARPRODUCT_LOOP 14
+SCALARPRODUCT_LOOP 12
+SCALARPRODUCT_LOOP 10
+SCALARPRODUCT_LOOP 8
+SCALARPRODUCT_LOOP 6
+SCALARPRODUCT_LOOP 4
+SCALARPRODUCT_LOOP 2
+SCALARPRODUCT_LOOP 0
+.end:
+ movhlps m0, m6
+ paddd m6, m0
+ pshuflw m0, m6, 0x4e
+ paddd m6, m0
+ movd eax, m6
+ RET
+
+
+
+; void ff_add_hfyu_median_prediction_mmx2(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top)
cglobal add_hfyu_median_prediction_mmx2, 6,6,0, dst, top, diff, w, left, left_top
movq mm0, [topq]
movq mm2, mm0
@@ -150,3 +330,70 @@ cglobal add_hfyu_median_prediction_mmx2, 6,6,0, dst, top, diff, w, left, left_to
movzx r2d, byte [topq-1]
mov [left_topq], r2d
RET
+
+
+%macro ADD_HFYU_LEFT_LOOP 1 ; %1 = is_aligned
+ add srcq, wq
+ add dstq, wq
+ neg wq
+%%.loop:
+ mova m1, [srcq+wq]
+ mova m2, m1
+ psllw m1, 8
+ paddb m1, m2
+ mova m2, m1
+ pshufb m1, m3
+ paddb m1, m2
+ pshufb m0, m5
+ mova m2, m1
+ pshufb m1, m4
+ paddb m1, m2
+%if mmsize == 16
+ mova m2, m1
+ pshufb m1, m6
+ paddb m1, m2
+%endif
+ paddb m0, m1
+%if %1
+ mova [dstq+wq], m0
+%else
+ movq [dstq+wq], m0
+ movhps [dstq+wq+8], m0
+%endif
+ add wq, mmsize
+ jl %%.loop
+ mov eax, mmsize-1
+ sub eax, wd
+ movd m1, eax
+ pshufb m0, m1
+ movd eax, m0
+ RET
+%endmacro
+
+; int ff_add_hfyu_left_prediction(uint8_t *dst, const uint8_t *src, int w, int left)
+INIT_MMX
+cglobal add_hfyu_left_prediction_ssse3, 3,3,7, dst, src, w, left
+.skip_prologue:
+ mova m5, [pb_7 GLOBAL]
+ mova m4, [pb_zzzz3333zzzzbbbb GLOBAL]
+ mova m3, [pb_zz11zz55zz99zzdd GLOBAL]
+ movd m0, leftm
+ psllq m0, 56
+ ADD_HFYU_LEFT_LOOP 1
+
+INIT_XMM
+cglobal add_hfyu_left_prediction_sse4, 3,3,7, dst, src, w, left
+ mova m5, [pb_f GLOBAL]
+ mova m6, [pb_zzzzzzzz77777777 GLOBAL]
+ mova m4, [pb_zzzz3333zzzzbbbb GLOBAL]
+ mova m3, [pb_zz11zz55zz99zzdd GLOBAL]
+ movd m0, leftm
+ pslldq m0, 15
+ test srcq, 15
+ jnz add_hfyu_left_prediction_ssse3.skip_prologue
+ test dstq, 15
+ jnz .unaligned
+ ADD_HFYU_LEFT_LOOP 1
+.unaligned:
+ ADD_HFYU_LEFT_LOOP 0
+
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dsputilenc_mmx.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dsputilenc_mmx.c
index 6059436252..3ee2c38d00 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dsputilenc_mmx.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dsputilenc_mmx.c
@@ -902,7 +902,7 @@ static void diff_bytes_mmx(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){
dst[i+0] = src1[i+0]-src2[i+0];
}
-static void sub_hfyu_median_prediction_mmx2(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top){
+static void sub_hfyu_median_prediction_mmx2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w, int *left, int *left_top){
x86_reg i=0;
uint8_t l, lt;
@@ -1348,8 +1348,7 @@ static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2, int si
#endif //HAVE_SSSE3
-/* FLAC specific */
-void ff_flac_compute_autocorr_sse2(const int32_t *data, int len, int lag,
+void ff_lpc_compute_autocorr_sse2(const int32_t *data, int len, int lag,
double *autoc);
@@ -1414,8 +1413,9 @@ void dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx)
c->sum_abs_dctelem= sum_abs_dctelem_sse2;
c->hadamard8_diff[0]= hadamard8_diff16_sse2;
c->hadamard8_diff[1]= hadamard8_diff_sse2;
- if (CONFIG_FLAC_ENCODER)
- c->flac_compute_autocorr = ff_flac_compute_autocorr_sse2;
+#if CONFIG_LPC
+ c->lpc_compute_autocorr = ff_lpc_compute_autocorr_sse2;
+#endif
}
#if HAVE_SSSE3
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/fft_mmx.asm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/fft_mmx.asm
index 6c1b26d401..26bd748ae9 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/fft_mmx.asm
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/fft_mmx.asm
@@ -264,6 +264,7 @@ IF%1 mova Z(1), m3
%endmacro
INIT_XMM
+%define mova movaps
%define Z(x) [r0+mmsize*x]
@@ -403,6 +404,7 @@ DEFINE_ARGS z, w, n, o1, o3
%endmacro
INIT_XMM
+%define mova movaps
DECL_PASS pass_sse, PASS_BIG 1
DECL_PASS pass_interleave_sse, PASS_BIG 0
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/flacdsp_mmx.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/lpc_mmx.c
index 01c0d7ae8a..40fc678b7c 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/flacdsp_mmx.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/lpc_mmx.c
@@ -1,5 +1,5 @@
/*
- * MMX optimized FLAC DSP utils
+ * MMX optimized LPC DSP utils
* Copyright (c) 2007 Loren Merritt
*
* This file is part of FFmpeg.
@@ -65,7 +65,7 @@ static void apply_welch_window_sse2(const int32_t *data, int len, double *w_data
#undef WELCH
}
-void ff_flac_compute_autocorr_sse2(const int32_t *data, int len, int lag,
+void ff_lpc_compute_autocorr_sse2(const int32_t *data, int len, int lag,
double *autoc)
{
double tmp[len + lag + 2];
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/x86inc.asm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/x86inc.asm
index 52624c3aca..c29ef3ee34 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/x86inc.asm
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/x86inc.asm
@@ -53,7 +53,7 @@
; in memory) must use an address mode that does fit.
; So all accesses to global variables must use this macro, e.g.
; mov eax, [foo GLOBAL]
-; instead of
+; instead of
; mov eax, [foo]
;
; x86_32 doesn't require PIC.
@@ -84,7 +84,7 @@
; PROLOGUE can also be invoked by adding the same options to cglobal
; e.g.
-; cglobal foo, 2,3, dst, src, tmp
+; cglobal foo, 2,3,0, dst, src, tmp
; declares a function (foo), taking two args (dst and src) and one local variable (tmp)
; TODO Some functions can use some args directly from the stack. If they're the
@@ -221,6 +221,7 @@ DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7
CAT_UNDEF arg_name %+ %%i, d
CAT_UNDEF arg_name %+ %%i, w
CAT_UNDEF arg_name %+ %%i, b
+ CAT_UNDEF arg_name %+ %%i, m
CAT_UNDEF arg_name, %%i
%assign %%i %%i+1
%endrep
@@ -232,6 +233,7 @@ DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7
%xdefine %1d r %+ %%i %+ d
%xdefine %1w r %+ %%i %+ w
%xdefine %1b r %+ %%i %+ b
+ %xdefine %1m r %+ %%i %+ m
CAT_XDEFINE arg_name, %%i, %1
%assign %%i %%i+1
%rotate 1
@@ -436,6 +438,7 @@ DECLARE_REG 6, ebp, ebp, bp, null, [esp + stack_offset + 28]
%ifdef PREFIX
%xdefine %1 _ %+ %1
%endif
+ %xdefine %1.skip_prologue %1 %+ .skip_prologue
%ifidn __OUTPUT_FORMAT__,elf
global %1:function hidden
%else
@@ -597,9 +600,6 @@ INIT_MMX
%endmacro
;Substitutions that reduce instruction size but are functionally equivalent
-%define movdqa movaps
-%define movdqu movups
-
%macro add 2
%ifnum %2
%if %2==128
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/xan.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/xan.c
index 83b64ca050..fcfd9c6d0c 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/xan.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/xan.c
@@ -74,9 +74,6 @@ static av_cold int xan_decode_init(AVCodecContext *avctx)
avctx->pix_fmt = PIX_FMT_PAL8;
- if(avcodec_check_dimensions(avctx, avctx->width, avctx->height))
- return -1;
-
s->buffer1_size = avctx->width * avctx->height;
s->buffer1 = av_malloc(s->buffer1_size);
s->buffer2_size = avctx->width * avctx->height;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/xl.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/xl.c
index fb4241f255..2a5110cb98 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/xl.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/xl.c
@@ -128,6 +128,16 @@ static av_cold int decode_init(AVCodecContext *avctx){
return 0;
}
+static av_cold int decode_end(AVCodecContext *avctx){
+ VideoXLContext * const a = avctx->priv_data;
+ AVFrame *pic = &a->pic;
+
+ if (pic->data[0])
+ avctx->release_buffer(avctx, pic);
+
+ return 0;
+}
+
AVCodec xl_decoder = {
"xl",
CODEC_TYPE_VIDEO,
@@ -135,7 +145,7 @@ AVCodec xl_decoder = {
sizeof(VideoXLContext),
decode_init,
NULL,
- NULL,
+ decode_end,
decode_frame,
CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Miro VideoXL"),
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/zmbv.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/zmbv.c
index de2eb9c4c6..35a31c0924 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/zmbv.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/zmbv.c
@@ -602,9 +602,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
c->width = avctx->width;
c->height = avctx->height;
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return 1;
- }
c->bpp = avctx->bits_per_coded_sample;
// Needed if zlib unused or init aborted before inflateInit
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/zmbvenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/zmbvenc.c
index 5a1428e4a8..a04c0597ee 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/zmbvenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/zmbvenc.c
@@ -61,21 +61,26 @@ static int score_tab[256];
* XXX should be optimized and moved to DSPContext
* TODO handle out of edge ME
*/
-static inline int block_cmp(uint8_t *src, int stride, uint8_t *src2, int stride2, int bw, int bh)
+static inline int block_cmp(uint8_t *src, int stride, uint8_t *src2, int stride2,
+ int bw, int bh, int *xored)
{
int sum = 0;
int i, j;
- uint8_t histogram[256]={0};
+ uint8_t histogram[256] = {0};
+ *xored = 0;
for(j = 0; j < bh; j++){
- for(i = 0; i < bw; i++)
- histogram[src[i] ^ src2[i]]++;
+ for(i = 0; i < bw; i++){
+ int t = src[i] ^ src2[i];
+ histogram[t]++;
+ *xored |= t;
+ }
src += stride;
src2 += stride2;
}
- for(i=1; i<256; i++)
- sum+= score_tab[histogram[i]];
+ for(i = 1; i < 256; i++)
+ sum += score_tab[histogram[i]];
return sum;
}
@@ -83,22 +88,22 @@ static inline int block_cmp(uint8_t *src, int stride, uint8_t *src2, int stride2
/** Motion estimation function
* TODO make better ME decisions
*/
-static int zmbv_me(ZmbvEncContext *c, uint8_t *src, int sstride, uint8_t *prev, int pstride,
- int x, int y, int *mx, int *my)
+static int zmbv_me(ZmbvEncContext *c, uint8_t *src, int sstride, uint8_t *prev,
+ int pstride, int x, int y, int *mx, int *my, int *xored)
{
int dx, dy, tx, ty, tv, bv, bw, bh;
*mx = *my = 0;
bw = FFMIN(ZMBV_BLOCK, c->avctx->width - x);
bh = FFMIN(ZMBV_BLOCK, c->avctx->height - y);
- bv = block_cmp(src, sstride, prev, pstride, bw, bh);
+ bv = block_cmp(src, sstride, prev, pstride, bw, bh, xored);
if(!bv) return 0;
for(ty = FFMAX(y - c->range, 0); ty < FFMIN(y + c->range, c->avctx->height - bh); ty++){
for(tx = FFMAX(x - c->range, 0); tx < FFMIN(x + c->range, c->avctx->width - bw); tx++){
if(tx == x && ty == y) continue; // we already tested this block
dx = tx - x;
dy = ty - y;
- tv = block_cmp(src, sstride, prev + dx + dy*pstride, pstride, bw, bh);
+ tv = block_cmp(src, sstride, prev + dx + dy*pstride, pstride, bw, bh, xored);
if(tv < bv){
bv = tv;
*mx = dx;
@@ -173,7 +178,7 @@ static int encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_size, void
work_size += avctx->width;
}
}else{
- int x, y, bh2, bw2;
+ int x, y, bh2, bw2, xored;
uint8_t *tsrc, *tprev;
uint8_t *mv;
int mx, my, bv;
@@ -192,11 +197,11 @@ static int encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_size, void
tsrc = src + x;
tprev = prev + x;
- bv = zmbv_me(c, tsrc, p->linesize[0], tprev, c->pstride, x, y, &mx, &my);
- mv[0] = (mx << 1) | !!bv;
+ bv = zmbv_me(c, tsrc, p->linesize[0], tprev, c->pstride, x, y, &mx, &my, &xored);
+ mv[0] = (mx << 1) | !!xored;
mv[1] = my << 1;
tprev += mx + my * c->pstride;
- if(bv){
+ if(xored){
for(j = 0; j < bh2; j++){
for(i = 0; i < bw2; i++)
c->work_buf[work_size++] = tsrc[i] ^ tprev[i];
@@ -263,10 +268,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
return -1;
}
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return -1;
- }
-
// Needed if zlib unused or init aborted before deflateInit
memset(&(c->zstream), 0, sizeof(z_stream));
c->comp_size = avctx->width * avctx->height + 1024 +
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/Makefile b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/Makefile
index f8380b7611..a0c3858d83 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/Makefile
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/Makefile
@@ -5,11 +5,13 @@ FFLIBS = avformat avcodec avutil
HEADERS = avdevice.h
-OBJS = alldevices.o
+OBJS = alldevices.o avdevice.o
# input/output devices
-OBJS-$(CONFIG_ALSA_INDEV) += alsa-audio-common.o alsa-audio-dec.o
-OBJS-$(CONFIG_ALSA_OUTDEV) += alsa-audio-common.o alsa-audio-enc.o
+OBJS-$(CONFIG_ALSA_INDEV) += alsa-audio-common.o \
+ alsa-audio-dec.o
+OBJS-$(CONFIG_ALSA_OUTDEV) += alsa-audio-common.o \
+ alsa-audio-enc.o
OBJS-$(CONFIG_BKTR_INDEV) += bktr.o
OBJS-$(CONFIG_DV1394_INDEV) += dv1394.o
OBJS-$(CONFIG_JACK_INDEV) += jack_audio.o
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alldevices.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alldevices.c
index 1947eee88f..91c062beb4 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alldevices.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alldevices.c
@@ -20,12 +20,6 @@
#include "config.h"
#include "libavformat/avformat.h"
-#include "avdevice.h"
-
-unsigned avdevice_version(void)
-{
- return LIBAVDEVICE_VERSION_INT;
-}
#define REGISTER_OUTDEV(X,x) { \
extern AVOutputFormat x##_muxer; \
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alsa-audio-common.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alsa-audio-common.c
index f1d78b0cc5..e125b2d386 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alsa-audio-common.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alsa-audio-common.c
@@ -28,8 +28,8 @@
* @author Nicolas George ( nicolas george normalesup org )
*/
-#include "libavformat/avformat.h"
#include <alsa/asoundlib.h>
+#include "libavformat/avformat.h"
#include "alsa-audio.h"
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alsa-audio-dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alsa-audio-dec.c
index 48ed75ee1f..4dac3f9cb4 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alsa-audio-dec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alsa-audio-dec.c
@@ -45,12 +45,12 @@
* plugin.
*/
-#include "libavformat/avformat.h"
#include <alsa/asoundlib.h>
+#include "libavformat/avformat.h"
#include "alsa-audio.h"
-av_cold static int audio_read_header(AVFormatContext *s1,
+static av_cold int audio_read_header(AVFormatContext *s1,
AVFormatParameters *ap)
{
AlsaData *s = s1->priv_data;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alsa-audio-enc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alsa-audio-enc.c
index 901af8b19b..a0b01449b0 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alsa-audio-enc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/alsa-audio-enc.c
@@ -37,12 +37,12 @@
* which gives a low latency suitable for real-time playback.
*/
-#include "libavformat/avformat.h"
#include <alsa/asoundlib.h>
+#include "libavformat/avformat.h"
#include "alsa-audio.h"
-av_cold static int audio_write_header(AVFormatContext *s1)
+static av_cold int audio_write_header(AVFormatContext *s1)
{
AlsaData *s = s1->priv_data;
AVStream *st;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/avdevice.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/avdevice.c
new file mode 100644
index 0000000000..3d67b4b8be
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/avdevice.c
@@ -0,0 +1,35 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avdevice.h"
+
+unsigned avdevice_version(void)
+{
+ return LIBAVDEVICE_VERSION_INT;
+}
+
+const char * avdevice_configuration(void)
+{
+ return FFMPEG_CONFIGURATION;
+}
+
+const char * avdevice_license(void)
+{
+#define LICENSE_PREFIX "libavdevice license: "
+ return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
+}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/avdevice.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/avdevice.h
index 61400c111b..124cfa28a0 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/avdevice.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/avdevice.h
@@ -19,6 +19,8 @@
#ifndef AVDEVICE_AVDEVICE_H
#define AVDEVICE_AVDEVICE_H
+#include "libavutil/avutil.h"
+
#define LIBAVDEVICE_VERSION_MAJOR 52
#define LIBAVDEVICE_VERSION_MINOR 2
#define LIBAVDEVICE_VERSION_MICRO 0
@@ -37,6 +39,16 @@
unsigned avdevice_version(void);
/**
+ * Returns the libavdevice build-time configuration.
+ */
+const char * avdevice_configuration(void);
+
+/**
+ * Returns the libavdevice license.
+ */
+const char * avdevice_license(void);
+
+/**
* Initialize libavdevice and register all the input and output devices.
* @warning This function is not thread safe.
*/
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/oss_audio.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/oss_audio.c
index ed1a7a14a8..f3edbdbef0 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/oss_audio.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/oss_audio.c
@@ -248,34 +248,15 @@ static int audio_read_packet(AVFormatContext *s1, AVPacket *pkt)
int64_t cur_time;
struct audio_buf_info abufi;
- if (av_new_packet(pkt, s->frame_size) < 0)
- return AVERROR(EIO);
- for(;;) {
- struct timeval tv;
- fd_set fds;
-
- tv.tv_sec = 0;
- tv.tv_usec = 30 * 1000; /* 30 msecs -- a bit shorter than 1 frame at 30fps */
-
- FD_ZERO(&fds);
- FD_SET(s->fd, &fds);
-
- /* This will block until data is available or we get a timeout */
- (void) select(s->fd + 1, &fds, 0, 0, &tv);
+ if ((ret=av_new_packet(pkt, s->frame_size)) < 0)
+ return ret;
ret = read(s->fd, pkt->data, pkt->size);
- if (ret > 0)
- break;
- if (ret == -1 && (errno == EAGAIN || errno == EINTR)) {
- av_free_packet(pkt);
- pkt->size = 0;
- pkt->pts = av_gettime();
- return 0;
- }
- if (!(ret == 0 || (ret == -1 && (errno == EAGAIN || errno == EINTR)))) {
- av_free_packet(pkt);
- return AVERROR(EIO);
- }
+ if (ret <= 0){
+ av_free_packet(pkt);
+ pkt->size = 0;
+ if (ret<0) return AVERROR(errno);
+ else return AVERROR(EOF);
}
pkt->size = ret;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/v4l2.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/v4l2.c
index 940db71394..9ab42522f3 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/v4l2.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/v4l2.c
@@ -72,58 +72,81 @@ struct buff_data {
struct fmt_map {
enum PixelFormat ff_fmt;
- int32_t v4l2_fmt;
+ enum CodecID codec_id;
+ uint32_t v4l2_fmt;
};
static struct fmt_map fmt_conversion_table[] = {
{
.ff_fmt = PIX_FMT_YUV420P,
+ .codec_id = CODEC_ID_RAWVIDEO,
.v4l2_fmt = V4L2_PIX_FMT_YUV420,
},
{
.ff_fmt = PIX_FMT_YUV422P,
+ .codec_id = CODEC_ID_RAWVIDEO,
.v4l2_fmt = V4L2_PIX_FMT_YUV422P,
},
{
.ff_fmt = PIX_FMT_YUYV422,
+ .codec_id = CODEC_ID_RAWVIDEO,
.v4l2_fmt = V4L2_PIX_FMT_YUYV,
},
{
.ff_fmt = PIX_FMT_UYVY422,
+ .codec_id = CODEC_ID_RAWVIDEO,
.v4l2_fmt = V4L2_PIX_FMT_UYVY,
},
{
.ff_fmt = PIX_FMT_YUV411P,
+ .codec_id = CODEC_ID_RAWVIDEO,
.v4l2_fmt = V4L2_PIX_FMT_YUV411P,
},
{
.ff_fmt = PIX_FMT_YUV410P,
+ .codec_id = CODEC_ID_RAWVIDEO,
.v4l2_fmt = V4L2_PIX_FMT_YUV410,
},
{
.ff_fmt = PIX_FMT_RGB555,
+ .codec_id = CODEC_ID_RAWVIDEO,
.v4l2_fmt = V4L2_PIX_FMT_RGB555,
},
{
.ff_fmt = PIX_FMT_RGB565,
+ .codec_id = CODEC_ID_RAWVIDEO,
.v4l2_fmt = V4L2_PIX_FMT_RGB565,
},
{
.ff_fmt = PIX_FMT_BGR24,
+ .codec_id = CODEC_ID_RAWVIDEO,
.v4l2_fmt = V4L2_PIX_FMT_BGR24,
},
{
.ff_fmt = PIX_FMT_RGB24,
+ .codec_id = CODEC_ID_RAWVIDEO,
.v4l2_fmt = V4L2_PIX_FMT_RGB24,
},
{
.ff_fmt = PIX_FMT_BGRA,
+ .codec_id = CODEC_ID_RAWVIDEO,
.v4l2_fmt = V4L2_PIX_FMT_BGR32,
},
{
.ff_fmt = PIX_FMT_GRAY8,
+ .codec_id = CODEC_ID_RAWVIDEO,
.v4l2_fmt = V4L2_PIX_FMT_GREY,
},
+ {
+ .ff_fmt = PIX_FMT_NONE,
+ .codec_id = CODEC_ID_MJPEG,
+ .v4l2_fmt = V4L2_PIX_FMT_MJPEG,
+ },
+ {
+ .ff_fmt = PIX_FMT_NONE,
+ .codec_id = CODEC_ID_MJPEG,
+ .v4l2_fmt = V4L2_PIX_FMT_JPEG,
+ },
};
static int device_open(AVFormatContext *ctx, uint32_t *capabilities)
@@ -171,7 +194,7 @@ static int device_open(AVFormatContext *ctx, uint32_t *capabilities)
return fd;
}
-static int device_init(AVFormatContext *ctx, int *width, int *height, int pix_fmt)
+static int device_init(AVFormatContext *ctx, int *width, int *height, uint32_t pix_fmt)
{
struct video_data *s = ctx->priv_data;
int fd = s->fd;
@@ -215,12 +238,15 @@ static int first_field(int fd)
return 1;
}
-static uint32_t fmt_ff2v4l(enum PixelFormat pix_fmt)
+static uint32_t fmt_ff2v4l(enum PixelFormat pix_fmt, enum CodecID codec_id)
{
int i;
for (i = 0; i < FF_ARRAY_ELEMS(fmt_conversion_table); i++) {
- if (fmt_conversion_table[i].ff_fmt == pix_fmt) {
+ if ((codec_id == CODEC_ID_NONE ||
+ fmt_conversion_table[i].codec_id == codec_id) &&
+ (pix_fmt == PIX_FMT_NONE ||
+ fmt_conversion_table[i].ff_fmt == pix_fmt)) {
return fmt_conversion_table[i].v4l2_fmt;
}
}
@@ -228,12 +254,13 @@ static uint32_t fmt_ff2v4l(enum PixelFormat pix_fmt)
return 0;
}
-static enum PixelFormat fmt_v4l2ff(uint32_t pix_fmt)
+static enum PixelFormat fmt_v4l2ff(uint32_t v4l2_fmt, enum CodecID codec_id)
{
int i;
for (i = 0; i < FF_ARRAY_ELEMS(fmt_conversion_table); i++) {
- if (fmt_conversion_table[i].v4l2_fmt == pix_fmt) {
+ if (fmt_conversion_table[i].v4l2_fmt == v4l2_fmt &&
+ fmt_conversion_table[i].codec_id == codec_id) {
return fmt_conversion_table[i].ff_fmt;
}
}
@@ -241,6 +268,19 @@ static enum PixelFormat fmt_v4l2ff(uint32_t pix_fmt)
return PIX_FMT_NONE;
}
+static enum CodecID fmt_v4l2codec(uint32_t v4l2_fmt)
+{
+ int i;
+
+ for (i = 0; i < FF_ARRAY_ELEMS(fmt_conversion_table); i++) {
+ if (fmt_conversion_table[i].v4l2_fmt == v4l2_fmt) {
+ return fmt_conversion_table[i].codec_id;
+ }
+ }
+
+ return CODEC_ID_NONE;
+}
+
static int mmap_init(AVFormatContext *ctx)
{
struct video_data *s = ctx->priv_data;
@@ -297,7 +337,7 @@ static int mmap_init(AVFormatContext *ctx)
}
s->buf_len[i] = buf.length;
- if (s->buf_len[i] < s->frame_size) {
+ if (s->frame_size > 0 && s->buf_len[i] < s->frame_size) {
av_log(ctx, AV_LOG_ERROR, "Buffer len [%d] = %d != %d\n", i, s->buf_len[i], s->frame_size);
return -1;
@@ -368,7 +408,7 @@ static int mmap_read_frame(AVFormatContext *ctx, AVPacket *pkt)
return -1;
}
assert (buf.index < s->buffers);
- if (buf.bytesused != s->frame_size) {
+ if (s->frame_size > 0 && buf.bytesused != s->frame_size) {
av_log(ctx, AV_LOG_ERROR, "The v4l2 frame is %d bytes, but %d bytes are expected\n", buf.bytesused, s->frame_size);
return -1;
@@ -506,6 +546,38 @@ static int v4l2_set_parameters( AVFormatContext *s1, AVFormatParameters *ap )
return 0;
}
+uint32_t device_try_init(AVFormatContext *s1,
+ const AVFormatParameters *ap,
+ int *width,
+ int *height,
+ enum CodecID *codec_id)
+{
+ uint32_t desired_format = fmt_ff2v4l(ap->pix_fmt, ap->video_codec_id);
+
+ if (desired_format == 0 ||
+ device_init(s1, width, height, desired_format) < 0) {
+ int i;
+
+ desired_format = 0;
+ for (i = 0; i<FF_ARRAY_ELEMS(fmt_conversion_table); i++) {
+ if (ap->video_codec_id == CODEC_ID_NONE ||
+ fmt_conversion_table[i].codec_id == ap->video_codec_id) {
+ desired_format = fmt_conversion_table[i].v4l2_fmt;
+ if (device_init(s1, width, height, desired_format) >= 0) {
+ break;
+ }
+ desired_format = 0;
+ }
+ }
+ }
+ if (desired_format != 0) {
+ *codec_id = fmt_v4l2codec(desired_format);
+ assert(*codec_id != CODEC_ID_NONE);
+ }
+
+ return desired_format;
+}
+
static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap)
{
struct video_data *s = s1->priv_data;
@@ -513,6 +585,7 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap)
int width, height;
int res;
uint32_t desired_format, capabilities;
+ enum CodecID codec_id;
if (ap->width <= 0 || ap->height <= 0) {
av_log(s1, AV_LOG_ERROR, "Wrong size (%dx%d)\n", ap->width, ap->height);
@@ -541,26 +614,10 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap)
}
av_log(s1, AV_LOG_INFO, "[%d]Capabilities: %x\n", s->fd, capabilities);
- desired_format = fmt_ff2v4l(ap->pix_fmt);
- if (desired_format == 0 || (device_init(s1, &width, &height, desired_format) < 0)) {
- int i, done;
-
- done = 0; i = 0;
- while (!done) {
- desired_format = fmt_conversion_table[i].v4l2_fmt;
- if (device_init(s1, &width, &height, desired_format) < 0) {
- desired_format = 0;
- i++;
- } else {
- done = 1;
- }
- if (i == FF_ARRAY_ELEMS(fmt_conversion_table)) {
- done = 1;
- }
- }
- }
+ desired_format = device_try_init(s1, ap, &width, &height, &codec_id);
if (desired_format == 0) {
- av_log(s1, AV_LOG_ERROR, "Cannot find a proper format.\n");
+ av_log(s1, AV_LOG_ERROR, "Cannot find a proper format for "
+ "codec_id %d, pix_fmt %d.\n", ap->video_codec_id, ap->pix_fmt);
close(s->fd);
return AVERROR(EIO);
@@ -570,7 +627,7 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap)
if( v4l2_set_parameters( s1, ap ) < 0 )
return AVERROR(EIO);
- st->codec->pix_fmt = fmt_v4l2ff(desired_format);
+ st->codec->pix_fmt = fmt_v4l2ff(desired_format, codec_id);
s->frame_size = avpicture_get_size(st->codec->pix_fmt, width, height);
if (capabilities & V4L2_CAP_STREAMING) {
s->io_method = io_mmap;
@@ -590,7 +647,7 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap)
s->top_field_first = first_field(s->fd);
st->codec->codec_type = CODEC_TYPE_VIDEO;
- st->codec->codec_id = CODEC_ID_RAWVIDEO;
+ st->codec->codec_id = codec_id;
st->codec->width = width;
st->codec->height = height;
st->codec->time_base.den = ap->time_base.den;
@@ -625,7 +682,7 @@ static int v4l2_read_packet(AVFormatContext *s1, AVPacket *pkt)
s1->streams[0]->codec->coded_frame->top_field_first = s->top_field_first;
}
- return s->frame_size;
+ return pkt->size;
}
static int v4l2_read_close(AVFormatContext *s1)
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/x11grab.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/x11grab.c
index a9fdce4271..60993276f5 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/x11grab.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/x11grab.c
@@ -35,6 +35,8 @@
* and Edouard Gomez <ed.gomez@free.fr>.
*/
+#define _XOPEN_SOURCE 600
+
#include "config.h"
#include "libavformat/avformat.h"
#include <time.h>
@@ -45,6 +47,7 @@
#include <X11/Xutil.h>
#include <sys/shm.h>
#include <X11/extensions/XShm.h>
+#include <X11/extensions/Xfixes.h>
/**
* X11 Device Demuxer context
@@ -64,7 +67,7 @@ struct x11_grab
XImage *image; /**< X11 image holding the grab */
int use_shm; /**< !0 when using XShm extension */
XShmSegmentInfo shminfo; /**< When using XShm, keeps track of XShm infos */
- int mouse_warning_shown;
+ int nomouse;
};
/**
@@ -84,7 +87,7 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
struct x11_grab *x11grab = s1->priv_data;
Display *dpy;
AVStream *st = NULL;
- int input_pixfmt;
+ enum PixelFormat input_pixfmt;
XImage *image;
int x_off = 0;
int y_off = 0;
@@ -95,6 +98,7 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
offset = strchr(param, '+');
if (offset) {
sscanf(offset, "%d,%d", &x_off, &y_off);
+ x11grab->nomouse= strstr(offset, "nomouse");
*offset= 0;
}
@@ -221,7 +225,6 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
x11grab->y_off = y_off;
x11grab->image = image;
x11grab->use_shm = use_shm;
- x11grab->mouse_warning_shown = 0;
st->codec->codec_type = CODEC_TYPE_VIDEO;
st->codec->codec_id = CODEC_ID_RAWVIDEO;
@@ -235,62 +238,6 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
}
/**
- * Get pointer coordinates from X11.
- *
- * @param x Integer where horizontal coordinate will be returned
- * @param y Integer where vertical coordinate will be returned
- * @param dpy X11 display from where pointer coordinates are retrieved
- * @param s1 Context used for logging errors if necessary
- */
-static void
-get_pointer_coordinates(int *x, int *y, Display *dpy, AVFormatContext *s1)
-{
- Window mrootwindow, childwindow;
- int dummy;
-
- mrootwindow = DefaultRootWindow(dpy);
-
- if (XQueryPointer(dpy, mrootwindow, &mrootwindow, &childwindow,
- x, y, &dummy, &dummy, (unsigned int*)&dummy)) {
- } else {
- struct x11_grab *s = s1->priv_data;
- if (!s->mouse_warning_shown) {
- av_log(s1, AV_LOG_INFO, "couldn't find mouse pointer\n");
- s->mouse_warning_shown = 1;
- }
- *x = -1;
- *y = -1;
- }
-}
-
-/**
- * Mouse painting helper function that applies an 'and' and 'or' mask pair to
- * '*dst' pixel. It actually draws a mouse pointer pixel to grabbed frame.
- *
- * @param dst Destination pixel
- * @param and Part of the mask that must be applied using a bitwise 'and'
- * operator
- * @param or Part of the mask that must be applied using a bitwise 'or'
- * operator
- * @param bits_per_pixel Bits per pixel used in the grabbed image
- */
-static void inline
-apply_masks(uint8_t *dst, int and, int or, int bits_per_pixel)
-{
- switch (bits_per_pixel) {
- case 32:
- *(uint32_t*)dst = (*(uint32_t*)dst & and) | or;
- break;
- case 16:
- *(uint16_t*)dst = (*(uint16_t*)dst & and) | or;
- break;
- case 8:
- *dst = !!or;
- break;
- }
-}
-
-/**
* Paints a mouse pointer in an X11 image.
*
* @param image image to paint the mouse pointer to
@@ -300,71 +247,43 @@ apply_masks(uint8_t *dst, int and, int or, int bits_per_pixel)
* @param y Mouse pointer coordinate
*/
static void
-paint_mouse_pointer(XImage *image, struct x11_grab *s, int x, int y)
+paint_mouse_pointer(XImage *image, struct x11_grab *s)
{
- /* 16x20x1bpp bitmap for the black channel of the mouse pointer */
- static const uint16_t const mousePointerBlack[] =
- {
- 0x0000, 0x0003, 0x0005, 0x0009, 0x0011,
- 0x0021, 0x0041, 0x0081, 0x0101, 0x0201,
- 0x03c1, 0x0049, 0x0095, 0x0093, 0x0120,
- 0x0120, 0x0240, 0x0240, 0x0380, 0x0000
- };
-
- /* 16x20x1bpp bitmap for the white channel of the mouse pointer */
- static const uint16_t const mousePointerWhite[] =
- {
- 0x0000, 0x0000, 0x0002, 0x0006, 0x000e,
- 0x001e, 0x003e, 0x007e, 0x00fe, 0x01fe,
- 0x003e, 0x0036, 0x0062, 0x0060, 0x00c0,
- 0x00c0, 0x0180, 0x0180, 0x0000, 0x0000
- };
-
int x_off = s->x_off;
int y_off = s->y_off;
int width = s->width;
int height = s->height;
+ Display *dpy = s->dpy;
+ XFixesCursorImage *xcim;
+ int x, y;
+ int line, column;
+ int to_line, to_column;
+ int image_addr, xcim_addr;
- if ( x - x_off >= 0 && x < width + x_off
- && y - y_off >= 0 && y < height + y_off) {
- uint8_t *im_data = (uint8_t*)image->data;
- int bytes_per_pixel;
- int line;
- int masks;
+ xcim = XFixesGetCursorImage(dpy);;
- /* Select correct masks and pixel size */
- if (image->bits_per_pixel == 8) {
- masks = 1;
- } else {
- masks = (image->red_mask|image->green_mask|image->blue_mask);
- }
- bytes_per_pixel = image->bits_per_pixel>>3;
-
- /* Shift to right line */
- im_data += image->bytes_per_line * (y - y_off);
- /* Shift to right pixel in the line */
- im_data += bytes_per_pixel * (x - x_off);
-
- /* Draw the cursor - proper loop */
- for (line = 0; line < FFMIN(20, (y_off + height) - y); line++) {
- uint8_t *cursor = im_data;
- int column;
- uint16_t bm_b;
- uint16_t bm_w;
-
- bm_b = mousePointerBlack[line];
- bm_w = mousePointerWhite[line];
-
- for (column = 0; column < FFMIN(16, (x_off + width) - x); column++) {
- apply_masks(cursor, ~(masks*(bm_b&1)), masks*(bm_w&1),
- image->bits_per_pixel);
- cursor += bytes_per_pixel;
- bm_b >>= 1;
- bm_w >>= 1;
+ x = xcim->x - xcim->xhot;
+ y = xcim->y - xcim->yhot;
+
+ to_line = FFMIN((y + xcim->height), (height + y_off));
+ to_column = FFMIN((x + xcim->width), (width + x_off));
+
+ for (line = FFMAX(y, y_off); line < to_line; line++) {
+ for (column = FFMAX(x, x_off); column < to_column; column++) {
+ xcim_addr = (line - y) * xcim->width + column - x;
+
+ if ((unsigned char)(xcim->pixels[xcim_addr] >> 24) != 0) { // skip fully transparent pixel
+ image_addr = ((line - y_off) * width + column - x_off) * 4;
+
+ image->data[image_addr] = (unsigned char)(xcim->pixels[xcim_addr] >> 0);
+ image->data[image_addr+1] = (unsigned char)(xcim->pixels[xcim_addr] >> 8);
+ image->data[image_addr+2] = (unsigned char)(xcim->pixels[xcim_addr] >> 16);
}
- im_data += image->bytes_per_line;
}
}
+
+ XFree(xcim);
+ xcim = NULL;
}
@@ -468,10 +387,8 @@ x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
}
}
- {
- int pointer_x, pointer_y;
- get_pointer_coordinates(&pointer_x, &pointer_y, dpy, s1);
- paint_mouse_pointer(image, s, pointer_x, pointer_y);
+ if(!s->nomouse){
+ paint_mouse_pointer(image, s);
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/Makefile b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/Makefile
index ccf7909c0b..b8a8772bae 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/Makefile
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/Makefile
@@ -10,7 +10,14 @@ OBJS = allfilters.o \
avfilter.o \
defaults.o \
formats.o \
+ parseutils.o \
-#OBJS-$(CONFIG_XXX_FILTER) += vf_xxx.o
+OBJS-$(CONFIG_CROP_FILTER) += vf_crop.o
+OBJS-$(CONFIG_FORMAT_FILTER) += vf_format.o
+OBJS-$(CONFIG_NOFORMAT_FILTER) += vf_format.o
+OBJS-$(CONFIG_NULL_FILTER) += vf_null.o
+OBJS-$(CONFIG_SCALE_FILTER) += vf_scale.o
+OBJS-$(CONFIG_SLICIFY_FILTER) += vf_slicify.o
+OBJS-$(CONFIG_VFLIP_FILTER) += vf_vflip.o
include $(SUBDIR)../subdir.mak
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/allfilters.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/allfilters.c
index dff61142f4..a4cbdade86 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/allfilters.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/allfilters.c
@@ -34,6 +34,11 @@ void avfilter_register_all(void)
return;
initialized = 1;
-// REGISTER_FILTER (CROP,crop,vf);
-
+ REGISTER_FILTER (CROP, crop, vf);
+ REGISTER_FILTER (FORMAT, format, vf);
+ REGISTER_FILTER (NOFORMAT, noformat, vf);
+ REGISTER_FILTER (NULL, null, vf);
+ REGISTER_FILTER (SCALE, scale, vf);
+ REGISTER_FILTER (SLICIFY, slicify, vf);
+ REGISTER_FILTER (VFLIP, vflip, vf);
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/avfilter.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/avfilter.c
index 5739b765ac..eb0a868273 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/avfilter.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/avfilter.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+/* #define DEBUG */
+
#include "libavcodec/imgconvert.h"
#include "avfilter.h"
@@ -26,12 +28,16 @@ unsigned avfilter_version(void) {
return LIBAVFILTER_VERSION_INT;
}
-/** list of registered filters */
-static struct FilterList
+const char * avfilter_configuration(void)
{
- AVFilter *filter;
- struct FilterList *next;
-} *filters = NULL;
+ return FFMPEG_CONFIGURATION;
+}
+
+const char * avfilter_license(void)
+{
+#define LICENSE_PREFIX "libavfilter license: "
+ return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
+}
/** helper macros to get the in/out pad on the dst/src filter */
#define link_dpad(link) link->dst-> input_pads[link->dstpad]
@@ -160,21 +166,51 @@ int avfilter_config_links(AVFilterContext *filter)
return 0;
}
-AVFilterPicRef *avfilter_get_video_buffer(AVFilterLink *link, int perms)
+static void dprintf_picref(void *ctx, AVFilterPicRef *picref, int end)
+{
+ dprintf(ctx,
+ "picref[%p data[%p, %p, %p, %p] linesize[%d, %d, %d, %d] pts:%"PRId64" s:%dx%d]%s",
+ picref,
+ picref->data [0], picref->data [1], picref->data [2], picref->data [3],
+ picref->linesize[0], picref->linesize[1], picref->linesize[2], picref->linesize[3],
+ picref->pts, picref->w, picref->h,
+ end ? "\n" : "");
+}
+
+static void dprintf_link(void *ctx, AVFilterLink *link, int end)
+{
+ dprintf(ctx,
+ "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",
+ link, link->w, link->h,
+ avcodec_get_pix_fmt_name(link->format),
+ link->src ? link->src->filter->name : "",
+ link->dst ? link->dst->filter->name : "",
+ end ? "\n" : "");
+}
+
+#define DPRINTF_START(ctx, func) dprintf(NULL, "%-16s: ", #func)
+
+AVFilterPicRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
{
AVFilterPicRef *ret = NULL;
+ DPRINTF_START(NULL, get_video_buffer); dprintf_link(NULL, link, 0); dprintf(NULL, " perms:%d w:%d h:%d\n", perms, w, h);
+
if(link_dpad(link).get_video_buffer)
- ret = link_dpad(link).get_video_buffer(link, perms);
+ ret = link_dpad(link).get_video_buffer(link, perms, w, h);
if(!ret)
- ret = avfilter_default_get_video_buffer(link, perms);
+ ret = avfilter_default_get_video_buffer(link, perms, w, h);
+
+ DPRINTF_START(NULL, get_video_buffer); dprintf_link(NULL, link, 0); dprintf(NULL, " returning "); dprintf_picref(NULL, ret, 1);
return ret;
}
int avfilter_request_frame(AVFilterLink *link)
{
+ DPRINTF_START(NULL, request_frame); dprintf_link(NULL, link, 1);
+
if(link_spad(link).request_frame)
return link_spad(link).request_frame(link);
else if(link->src->inputs[0])
@@ -190,9 +226,11 @@ int avfilter_poll_frame(AVFilterLink *link)
return link_spad(link).poll_frame(link);
for (i=0; i<link->src->input_count; i++) {
+ int val;
if(!link->src->inputs[i])
return -1;
- min = FFMIN(min, avfilter_poll_frame(link->src->inputs[i]));
+ val = avfilter_poll_frame(link->src->inputs[i]);
+ min = FFMIN(min, val);
}
return min;
@@ -205,6 +243,8 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterPicRef *picref)
void (*start_frame)(AVFilterLink *, AVFilterPicRef *);
AVFilterPad *dst = &link_dpad(link);
+ DPRINTF_START(NULL, start_frame); dprintf_link(NULL, link, 0); dprintf(NULL, " "); dprintf_picref(NULL, picref, 1);
+
if(!(start_frame = dst->start_frame))
start_frame = avfilter_default_start_frame;
@@ -218,7 +258,7 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterPicRef *picref)
link_dpad(link).min_perms, link_dpad(link).rej_perms);
*/
- link->cur_pic = avfilter_default_get_video_buffer(link, dst->min_perms);
+ link->cur_pic = avfilter_default_get_video_buffer(link, dst->min_perms, link->w, link->h);
link->srcpic = picref;
link->cur_pic->pts = link->srcpic->pts;
link->cur_pic->pixel_aspect = link->srcpic->pixel_aspect;
@@ -247,11 +287,13 @@ void avfilter_end_frame(AVFilterLink *link)
}
-void avfilter_draw_slice(AVFilterLink *link, int y, int h)
+void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
{
uint8_t *src[4], *dst[4];
int i, j, hsub, vsub;
- void (*draw_slice)(AVFilterLink *, int, int);
+ void (*draw_slice)(AVFilterLink *, int, int, int);
+
+ DPRINTF_START(NULL, draw_slice); dprintf_link(NULL, link, 0); dprintf(NULL, " y:%d h:%d dir:%d\n", y, h, slice_dir);
/* copy the slice if needed for permission reasons */
if(link->srcpic) {
@@ -283,37 +325,44 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h)
if(!(draw_slice = link_dpad(link).draw_slice))
draw_slice = avfilter_default_draw_slice;
- draw_slice(link, y, h);
+ draw_slice(link, y, h, slice_dir);
}
+#define MAX_REGISTERED_AVFILTERS_NB 64
+
+static AVFilter *registered_avfilters[MAX_REGISTERED_AVFILTERS_NB + 1];
+
+static int next_registered_avfilter_idx = 0;
+
AVFilter *avfilter_get_by_name(const char *name)
{
- struct FilterList *filt;
+ int i;
- for(filt = filters; filt; filt = filt->next)
- if(!strcmp(filt->filter->name, name))
- return filt->filter;
+ for (i = 0; registered_avfilters[i]; i++)
+ if (!strcmp(registered_avfilters[i]->name, name))
+ return registered_avfilters[i];
return NULL;
}
-void avfilter_register(AVFilter *filter)
+int avfilter_register(AVFilter *filter)
{
- struct FilterList *newfilt = av_malloc(sizeof(struct FilterList));
+ if (next_registered_avfilter_idx == MAX_REGISTERED_AVFILTERS_NB)
+ return -1;
- newfilt->filter = filter;
- newfilt->next = filters;
- filters = newfilt;
+ registered_avfilters[next_registered_avfilter_idx++] = filter;
+ return 0;
}
-void avfilter_uninit(void)
+AVFilter **av_filter_next(AVFilter **filter)
{
- struct FilterList *tmp;
+ return filter ? ++filter : &registered_avfilters[0];
+}
- for(; filters; filters = tmp) {
- tmp = filters->next;
- av_free(filters);
- }
+void avfilter_uninit(void)
+{
+ memset(registered_avfilters, 0, sizeof(registered_avfilters));
+ next_registered_avfilter_idx = 0;
}
static int pad_count(const AVFilterPad *pads)
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/avfilter.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/avfilter.h
index a41ece4ea9..dbdebfc76e 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/avfilter.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/avfilter.h
@@ -22,8 +22,10 @@
#ifndef AVFILTER_AVFILTER_H
#define AVFILTER_AVFILTER_H
-#define LIBAVFILTER_VERSION_MAJOR 0
-#define LIBAVFILTER_VERSION_MINOR 5
+#include "libavutil/avutil.h"
+
+#define LIBAVFILTER_VERSION_MAJOR 1
+#define LIBAVFILTER_VERSION_MINOR 12
#define LIBAVFILTER_VERSION_MICRO 0
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@@ -42,6 +44,17 @@
*/
unsigned avfilter_version(void);
+/**
+ * Returns the libavfilter build-time configuration.
+ */
+const char * avfilter_configuration(void);
+
+/**
+ * Returns the libavfilter license.
+ */
+const char * avfilter_license(void);
+
+
typedef struct AVFilterContext AVFilterContext;
typedef struct AVFilterLink AVFilterLink;
typedef struct AVFilterPad AVFilterPad;
@@ -71,6 +84,8 @@ typedef struct AVFilterPic
* reallocating it from scratch.
*/
void (*free)(struct AVFilterPic *pic);
+
+ int w, h; ///< width and height of the allocated buffer
} AVFilterPic;
/**
@@ -162,20 +177,19 @@ typedef struct AVFilterFormats AVFilterFormats;
struct AVFilterFormats
{
unsigned format_count; ///< number of formats
- int *formats; ///< list of formats
+ enum PixelFormat *formats; ///< list of pixel formats
unsigned refcount; ///< number of references to this list
AVFilterFormats ***refs; ///< references to this list
};
/**
- * Helper function to create a list of supported formats. This is intended
- * for use in AVFilter->query_formats().
- * @param len the number of formats supported
- * @param ... a list of the supported formats
- * @return the format list, with no existing references
+ * Creates a list of supported formats. This is intended for use in
+ * AVFilter->query_formats().
+ * @param pix_fmt list of pixel formats, terminated by PIX_FMT_NONE
+ * @return the format list, with no existing references
*/
-AVFilterFormats *avfilter_make_format_list(int len, ...);
+AVFilterFormats *avfilter_make_format_list(const enum PixelFormat *pix_fmts);
/**
* Returns a list of all colorspaces supported by FFmpeg.
@@ -287,11 +301,11 @@ struct AVFilterPad
/**
* Callback function to get a buffer. If NULL, the filter system will
- * handle buffer requests.
+ * use avfilter_default_get_video_buffer().
*
* Input video pads only.
*/
- AVFilterPicRef *(*get_video_buffer)(AVFilterLink *link, int perms);
+ AVFilterPicRef *(*get_video_buffer)(AVFilterLink *link, int perms, int w, int h);
/**
* Callback called after the slices of a frame are completely sent. If
@@ -308,7 +322,7 @@ struct AVFilterPad
*
* Input video pads only.
*/
- void (*draw_slice)(AVFilterLink *link, int y, int height);
+ void (*draw_slice)(AVFilterLink *link, int y, int height, int slice_dir);
/**
* Frame poll callback. This returns the number of immediately available
@@ -350,7 +364,7 @@ struct AVFilterPad
/** default handler for start_frame() for video inputs */
void avfilter_default_start_frame(AVFilterLink *link, AVFilterPicRef *picref);
/** default handler for draw_slice() for video inputs */
-void avfilter_default_draw_slice(AVFilterLink *link, int y, int h);
+void avfilter_default_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
/** default handler for end_frame() for video inputs */
void avfilter_default_end_frame(AVFilterLink *link);
/** default handler for config_props() for video outputs */
@@ -359,7 +373,7 @@ int avfilter_default_config_output_link(AVFilterLink *link);
int avfilter_default_config_input_link (AVFilterLink *link);
/** default handler for get_video_buffer() for video inputs */
AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link,
- int perms);
+ int perms, int w, int h);
/**
* A helper for query_formats() which sets all links to the same list of
* formats. If there are no links hooked to this filter, the list of formats is
@@ -373,7 +387,7 @@ int avfilter_default_query_formats(AVFilterContext *ctx);
* Filter definition. This defines the pads a filter contains, and all the
* callback functions used to interact with the filter.
*/
-typedef struct
+typedef struct AVFilter
{
const char *name; ///< filter name
@@ -405,6 +419,12 @@ typedef struct
const AVFilterPad *inputs; ///< NULL terminated list of inputs. NULL if none
const AVFilterPad *outputs; ///< NULL terminated list of outputs. NULL if none
+
+ /**
+ * A description for the filter. You should use the
+ * NULL_IF_CONFIG_SMALL() macro to define it.
+ */
+ const char *description;
} AVFilter;
/** An instance of a filter */
@@ -497,10 +517,13 @@ int avfilter_config_links(AVFilterContext *filter);
* @param link the output link to the filter from which the picture will
* be requested
* @param perms the required access permissions
+ * @param w the minimum width of the buffer to allocate
+ * @param h the minimum height of the buffer to allocate
* @return A reference to the picture. This must be unreferenced with
* avfilter_unref_pic when you are finished with it.
*/
-AVFilterPicRef *avfilter_get_video_buffer(AVFilterLink *link, int perms);
+AVFilterPicRef *avfilter_get_video_buffer(AVFilterLink *link, int perms,
+ int w, int h);
/**
* Requests an input frame from the filter at the other end of the link.
@@ -535,16 +558,25 @@ void avfilter_end_frame(AVFilterLink *link);
/**
* Sends a slice to the next filter.
+ *
+ * Slices have to be provided in sequential order, either in
+ * top-bottom or bottom-top order. If slices are provided in
+ * non-sequential order the behavior of the function is undefined.
+ *
* @param link the output link over which the frame is being sent
* @param y offset in pixels from the top of the image for this slice
* @param h height of this slice in pixels
+ * @param slice_dir the assumed direction for sending slices,
+ * from the top slice to the bottom slice if the value is 1,
+ * from the bottom slice to the top slice if the value is -1,
+ * for other values the behavior of the function is undefined.
*/
-void avfilter_draw_slice(AVFilterLink *link, int y, int h);
+void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
-/** Initialize the filter system. Registers all builtin filters */
+/** Initializes the filter system. Registers all builtin filters. */
void avfilter_register_all(void);
-/** Uninitialize the filter system. Unregisters all filters */
+/** Uninitializes the filter system. Unregisters all filters. */
void avfilter_uninit(void);
/**
@@ -553,8 +585,10 @@ void avfilter_uninit(void);
* filter can still by instantiated with avfilter_open even if it is not
* registered.
* @param filter the filter to register
+ * @return 0 if the registration was succesfull, a negative value
+ * otherwise
*/
-void avfilter_register(AVFilter *filter);
+int avfilter_register(AVFilter *filter);
/**
* Gets a filter definition matching the given name.
@@ -565,6 +599,14 @@ void avfilter_register(AVFilter *filter);
AVFilter *avfilter_get_by_name(const char *name);
/**
+ * If filter is NULL, returns a pointer to the first registered filter pointer,
+ * if filter is non-NULL, returns the next pointer after filter.
+ * If the returned pointer points to NULL, the last registered filter
+ * was already reached.
+ */
+AVFilter **av_filter_next(AVFilter **filter);
+
+/**
* Creates a filter instance.
* @param filter the filter to create an instance of
* @param inst_name Name to give to the new instance. Can be NULL for none.
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/defaults.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/defaults.c
index 7c20a08f35..7697fd459f 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/defaults.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/defaults.c
@@ -32,7 +32,7 @@ void avfilter_default_free_video_buffer(AVFilterPic *pic)
/* TODO: set the buffer's priv member to a context structure for the whole
* filter chain. This will allow for a buffer pool instead of the constant
* alloc & free cycle currently implemented. */
-AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms)
+AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
{
AVFilterPic *pic = av_mallocz(sizeof(AVFilterPic));
AVFilterPicRef *ref = av_mallocz(sizeof(AVFilterPicRef));
@@ -40,8 +40,8 @@ AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms)
char *buf;
ref->pic = pic;
- ref->w = link->w;
- ref->h = link->h;
+ ref->w = pic->w = w;
+ ref->h = pic->h = h;
/* make sure the buffer gets read permission or it's useless for output */
ref->perms = perms | AV_PERM_READ;
@@ -72,13 +72,13 @@ void avfilter_default_start_frame(AVFilterLink *link, AVFilterPicRef *picref)
out = link->dst->outputs[0];
if(out) {
- out->outpic = avfilter_get_video_buffer(out, AV_PERM_WRITE);
+ out->outpic = avfilter_get_video_buffer(out, AV_PERM_WRITE, link->w, link->h);
out->outpic->pts = picref->pts;
avfilter_start_frame(out, avfilter_ref_pic(out->outpic, ~0));
}
}
-void avfilter_default_draw_slice(AVFilterLink *link, int y, int h)
+void avfilter_default_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
{
AVFilterLink *out = NULL;
@@ -86,7 +86,7 @@ void avfilter_default_draw_slice(AVFilterLink *link, int y, int h)
out = link->dst->outputs[0];
if(out)
- avfilter_draw_slice(out, y, h);
+ avfilter_draw_slice(out, y, h, slice_dir);
}
void avfilter_default_end_frame(AVFilterLink *link)
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/formats.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/formats.c
index 33fec163a5..8747bb6fff 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/formats.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/formats.c
@@ -69,22 +69,20 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
return ret;
}
-AVFilterFormats *avfilter_make_format_list(int len, ...)
+AVFilterFormats *avfilter_make_format_list(const enum PixelFormat *pix_fmts)
{
- AVFilterFormats *ret;
- int i;
- va_list vl;
+ AVFilterFormats *formats;
+ int count;
- ret = av_mallocz(sizeof(AVFilterFormats));
- ret->formats = av_malloc(sizeof(*ret->formats) * len);
- ret->format_count = len;
+ for (count = 0; pix_fmts[count] != PIX_FMT_NONE; count++)
+ ;
- va_start(vl, len);
- for(i = 0; i < len; i ++)
- ret->formats[i] = va_arg(vl, int);
- va_end(vl);
+ formats = av_mallocz(sizeof(AVFilterFormats));
+ formats->formats = av_malloc(sizeof(*formats->formats) * count);
+ formats->format_count = count;
+ memcpy(formats->formats, pix_fmts, sizeof(*formats->formats) * count);
- return ret;
+ return formats;
}
AVFilterFormats *avfilter_all_colorspaces(void)
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/graphparser.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/graphparser.c
index 592934c6ff..c4a3bdf8fd 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/graphparser.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/graphparser.c
@@ -120,12 +120,12 @@ static AVFilterContext *parse_filter(const char **buf, AVFilterGraph *graph,
int index, AVClass *log_ctx)
{
char *opts = NULL;
- char *name = av_get_token(buf, "=,[");
+ char *name = av_get_token(buf, "=,;[\n");
AVFilterContext *ret;
if(**buf == '=') {
(*buf)++;
- opts = av_get_token(buf, "[],\n");
+ opts = av_get_token(buf, "[],;\n");
}
ret = create_filter(graph, index, name, opts, log_ctx);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/parseutils.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/parseutils.c
index 7cafa52cb0..79fa8b7470 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/parseutils.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/parseutils.c
@@ -227,7 +227,7 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx)
if (!strncmp(color_string, "0x", 2)) {
char *tail;
int len = strlen(color_string);
- int rgba = strtol(color_string, &tail, 16);
+ unsigned int rgba = strtoul(color_string, &tail, 16);
if (*tail || (len != 8 && len != 10)) {
av_log(log_ctx, AV_LOG_ERROR, "Invalid 0xRRGGBB[AA] color string: '%s'\n", color_string);
@@ -292,6 +292,8 @@ static int parse_key_value_pair(void *ctx, const char **buf,
av_log(ctx, AV_LOG_DEBUG, "Setting value '%s' for key '%s'\n", val, key);
ret = av_set_string3(ctx, key, val, 1, NULL);
+ if (ret == AVERROR(ENOENT))
+ av_log(ctx, AV_LOG_ERROR, "Key '%s' not found.\n", key);
av_free(key);
av_free(val);
@@ -412,6 +414,7 @@ int main(void)
"Red",
"0x000000",
"0x0000000",
+ "0xff000000",
"0x3e34ff",
"0x3e34ffaa",
"0xffXXee",
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_crop.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_crop.c
new file mode 100644
index 0000000000..e3944ef059
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_crop.c
@@ -0,0 +1,236 @@
+/*
+ * copyright (c) 2007 Bobby Bingham
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file libavfilter/vf_crop.c
+ * video crop filter
+ */
+
+#include "avfilter.h"
+
+typedef struct {
+ int x; ///< x offset of the non-cropped area with respect to the input area
+ int y; ///< y offset of the non-cropped area with respect to the input area
+ int w; ///< width of the cropped area
+ int h; ///< height of the cropped area
+
+ int bpp; ///< bits per pixel
+ int hsub, vsub; ///< chroma subsampling
+} CropContext;
+
+static int query_formats(AVFilterContext *ctx)
+{
+ static const enum PixelFormat pix_fmts[] = {
+ PIX_FMT_RGB48BE, PIX_FMT_RGB48LE,
+ PIX_FMT_ARGB, PIX_FMT_RGBA,
+ PIX_FMT_ABGR, PIX_FMT_BGRA,
+ PIX_FMT_RGB24, PIX_FMT_BGR24,
+ PIX_FMT_RGB565BE, PIX_FMT_RGB565LE,
+ PIX_FMT_RGB555BE, PIX_FMT_RGB555LE,
+ PIX_FMT_BGR565BE, PIX_FMT_BGR565LE,
+ PIX_FMT_BGR555BE, PIX_FMT_BGR555LE,
+ PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE,
+ PIX_FMT_YUV420P16LE, PIX_FMT_YUV420P16BE,
+ PIX_FMT_YUV422P16LE, PIX_FMT_YUV422P16BE,
+ PIX_FMT_YUV444P16LE, PIX_FMT_YUV444P16BE,
+ PIX_FMT_YUV444P, PIX_FMT_YUV422P,
+ PIX_FMT_YUV420P, PIX_FMT_YUV411P,
+ PIX_FMT_YUV410P, PIX_FMT_YUV440P,
+ PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P,
+ PIX_FMT_YUVJ420P, PIX_FMT_YUVJ440P,
+ PIX_FMT_YUVA420P,
+ PIX_FMT_RGB8, PIX_FMT_BGR8,
+ PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE,
+ PIX_FMT_PAL8, PIX_FMT_GRAY8,
+ PIX_FMT_NONE
+ };
+
+ avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts));
+
+ return 0;
+}
+
+static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
+{
+ CropContext *crop = ctx->priv;
+
+ if (args)
+ sscanf(args, "%d:%d:%d:%d", &crop->x, &crop->y, &crop->w, &crop->h);
+
+ return 0;
+}
+
+static int config_input(AVFilterLink *link)
+{
+ AVFilterContext *ctx = link->dst;
+ CropContext *crop = ctx->priv;
+
+ switch (link->format) {
+ case PIX_FMT_RGB48BE:
+ case PIX_FMT_RGB48LE:
+ crop->bpp = 48;
+ break;
+ case PIX_FMT_ARGB:
+ case PIX_FMT_RGBA:
+ case PIX_FMT_ABGR:
+ case PIX_FMT_BGRA:
+ crop->bpp = 32;
+ break;
+ case PIX_FMT_RGB24:
+ case PIX_FMT_BGR24:
+ crop->bpp = 24;
+ break;
+ case PIX_FMT_RGB565BE:
+ case PIX_FMT_RGB565LE:
+ case PIX_FMT_RGB555BE:
+ case PIX_FMT_RGB555LE:
+ case PIX_FMT_BGR565BE:
+ case PIX_FMT_BGR565LE:
+ case PIX_FMT_BGR555BE:
+ case PIX_FMT_BGR555LE:
+ case PIX_FMT_GRAY16BE:
+ case PIX_FMT_GRAY16LE:
+ case PIX_FMT_YUV420P16LE:
+ case PIX_FMT_YUV420P16BE:
+ case PIX_FMT_YUV422P16LE:
+ case PIX_FMT_YUV422P16BE:
+ case PIX_FMT_YUV444P16LE:
+ case PIX_FMT_YUV444P16BE:
+ crop->bpp = 16;
+ break;
+ default:
+ crop->bpp = 8;
+ }
+
+ avcodec_get_chroma_sub_sample(link->format, &crop->hsub, &crop->vsub);
+
+ if (crop->w == 0)
+ crop->w = link->w - crop->x;
+ if (crop->h == 0)
+ crop->h = link->h - crop->y;
+
+ crop->x &= ~((1 << crop->hsub) - 1);
+ crop->y &= ~((1 << crop->vsub) - 1);
+
+ av_log(link->dst, AV_LOG_INFO, "x:%d y:%d w:%d h:%d\n",
+ crop->x, crop->y, crop->w, crop->h);
+
+ if (crop->x < 0 || crop->y < 0 ||
+ crop->w <= 0 || crop->h <= 0 ||
+ (unsigned)crop->x + (unsigned)crop->w > link->w ||
+ (unsigned)crop->y + (unsigned)crop->h > link->h) {
+ av_log(ctx, AV_LOG_ERROR,
+ "Output area %d:%d:%d:%d not within the input area 0:0:%d:%d or zero-sized\n",
+ crop->x, crop->y, crop->w, crop->h, link->w, link->h);
+ return -1;
+ }
+
+ return 0;
+}
+
+static int config_output(AVFilterLink *link)
+{
+ CropContext *crop = link->src->priv;
+
+ link->w = crop->w;
+ link->h = crop->h;
+
+ return 0;
+}
+
+static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms,
+ int w, int h)
+{
+ return avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
+}
+
+static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
+{
+ CropContext *crop = link->dst->priv;
+ AVFilterPicRef *ref2 = avfilter_ref_pic(picref, ~0);
+ int i;
+
+ ref2->w = crop->w;
+ ref2->h = crop->h;
+
+ ref2->data[0] += crop->y * ref2->linesize[0];
+ ref2->data[0] += (crop->x * crop->bpp) >> 3;
+
+ if (link->format != PIX_FMT_PAL8 &&
+ link->format != PIX_FMT_BGR4_BYTE &&
+ link->format != PIX_FMT_RGB4_BYTE &&
+ link->format != PIX_FMT_BGR8 &&
+ link->format != PIX_FMT_RGB8) {
+ for (i = 1; i < 3; i ++) {
+ if (ref2->data[i]) {
+ ref2->data[i] += (crop->y >> crop->vsub) * ref2->linesize[i];
+ ref2->data[i] += ((crop->x * crop->bpp) >> 3) >> crop->hsub;
+ }
+ }
+ }
+
+ /* alpha plane */
+ if (ref2->data[3]) {
+ ref2->data[3] += crop->y * ref2->linesize[3];
+ ref2->data[3] += (crop->x * crop->bpp) >> 3;
+ }
+
+ avfilter_start_frame(link->dst->outputs[0], ref2);
+}
+
+static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
+{
+ AVFilterContext *ctx = link->dst;
+ CropContext *crop = ctx->priv;
+
+ if (y >= crop->y + crop->h || y + h <= crop->y)
+ return;
+
+ if (y < crop->y) {
+ h -= crop->y - y;
+ y = crop->y;
+ }
+ if (y + h > crop->y + crop->h)
+ h = crop->y + crop->h - y;
+
+ avfilter_draw_slice(ctx->outputs[0], y - crop->y, h, slice_dir);
+}
+
+AVFilter avfilter_vf_crop = {
+ .name = "crop",
+ .description = NULL_IF_CONFIG_SMALL("Crop the input video to x:y:width:height."),
+
+ .priv_size = sizeof(CropContext),
+
+ .query_formats = query_formats,
+ .init = init,
+
+ .inputs = (AVFilterPad[]) {{ .name = "default",
+ .type = CODEC_TYPE_VIDEO,
+ .start_frame = start_frame,
+ .draw_slice = draw_slice,
+ .get_video_buffer = get_video_buffer,
+ .config_props = config_input, },
+ { .name = NULL}},
+ .outputs = (AVFilterPad[]) {{ .name = "default",
+ .type = CODEC_TYPE_VIDEO,
+ .config_props = config_output, },
+ { .name = NULL}},
+};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_format.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_format.c
new file mode 100644
index 0000000000..66c569cb53
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_format.c
@@ -0,0 +1,162 @@
+/*
+ * copyright (c) 2007 Bobby Bingham
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file libavfilter/vf_format.c
+ * format and noformat video filters
+ */
+
+#include "avfilter.h"
+
+typedef struct {
+ /**
+ * List of flags telling if a given image format has been listed
+ * as argument to the filter.
+ */
+ int listed_pix_fmt_flags[PIX_FMT_NB];
+} FormatContext;
+
+#define PIX_FMT_NAME_MAXSIZE 32
+
+static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
+{
+ FormatContext *format = ctx->priv;
+ const char *cur, *sep;
+ char pix_fmt_name[PIX_FMT_NAME_MAXSIZE];
+ int pix_fmt_name_len;
+ enum PixelFormat pix_fmt;
+
+ /* parse the list of formats */
+ for (cur = args; cur; cur = sep ? sep+1 : NULL) {
+ if (!(sep = strchr(cur, ':')))
+ pix_fmt_name_len = strlen(cur);
+ else
+ pix_fmt_name_len = sep - cur;
+ if (pix_fmt_name_len >= PIX_FMT_NAME_MAXSIZE) {
+ av_log(ctx, AV_LOG_ERROR, "Format name too long\n");
+ return -1;
+ }
+
+ memcpy(pix_fmt_name, cur, pix_fmt_name_len);
+ pix_fmt_name[pix_fmt_name_len] = 0;
+ pix_fmt = avcodec_get_pix_fmt(pix_fmt_name);
+
+ if (pix_fmt == PIX_FMT_NONE) {
+ av_log(ctx, AV_LOG_ERROR, "Unknown pixel format: %s\n", pix_fmt_name);
+ return -1;
+ }
+
+ format->listed_pix_fmt_flags[pix_fmt] = 1;
+ }
+
+ return 0;
+}
+
+static AVFilterFormats *make_format_list(FormatContext *format, int flag)
+{
+ AVFilterFormats *formats;
+ enum PixelFormat pix_fmt;
+
+ formats = av_mallocz(sizeof(AVFilterFormats));
+ formats->formats = av_malloc(sizeof(enum PixelFormat) * PIX_FMT_NB);
+
+ for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++)
+ if (format->listed_pix_fmt_flags[pix_fmt] == flag)
+ formats->formats[formats->format_count++] = pix_fmt;
+
+ return formats;
+}
+
+static int query_formats_format(AVFilterContext *ctx)
+{
+ avfilter_set_common_formats(ctx, make_format_list(ctx->priv, 1));
+ return 0;
+}
+
+static int query_formats_noformat(AVFilterContext *ctx)
+{
+ avfilter_set_common_formats(ctx, make_format_list(ctx->priv, 0));
+ return 0;
+}
+
+static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms,
+ int w, int h)
+{
+ return avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
+}
+
+static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
+{
+ avfilter_start_frame(link->dst->outputs[0], picref);
+}
+
+static void end_frame(AVFilterLink *link)
+{
+ avfilter_end_frame(link->dst->outputs[0]);
+}
+
+static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
+{
+ avfilter_draw_slice(link->dst->outputs[0], y, h, slice_dir);
+}
+
+AVFilter avfilter_vf_format = {
+ .name = "format",
+ .description = "Convert the input video to one of the specified pixel formats.",
+
+ .init = init,
+
+ .query_formats = query_formats_format,
+
+ .priv_size = sizeof(FormatContext),
+
+ .inputs = (AVFilterPad[]) {{ .name = "default",
+ .type = CODEC_TYPE_VIDEO,
+ .get_video_buffer= get_video_buffer,
+ .start_frame = start_frame,
+ .draw_slice = draw_slice,
+ .end_frame = end_frame, },
+ { .name = NULL}},
+ .outputs = (AVFilterPad[]) {{ .name = "default",
+ .type = CODEC_TYPE_VIDEO },
+ { .name = NULL}},
+};
+
+AVFilter avfilter_vf_noformat = {
+ .name = "noformat",
+ .description = "Force libavfilter not to use any of the specified pixel formats for the input to the next filter.",
+
+ .init = init,
+
+ .query_formats = query_formats_noformat,
+
+ .priv_size = sizeof(FormatContext),
+
+ .inputs = (AVFilterPad[]) {{ .name = "default",
+ .type = CODEC_TYPE_VIDEO,
+ .get_video_buffer= get_video_buffer,
+ .start_frame = start_frame,
+ .draw_slice = draw_slice,
+ .end_frame = end_frame, },
+ { .name = NULL}},
+ .outputs = (AVFilterPad[]) {{ .name = "default",
+ .type = CODEC_TYPE_VIDEO },
+ { .name = NULL}},
+};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_null.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_null.c
new file mode 100644
index 0000000000..582708ce0c
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_null.c
@@ -0,0 +1,58 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file libavfilter/vf_null.c
+ * null video filter
+ */
+
+#include "avfilter.h"
+
+static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms,
+ int w, int h)
+{
+ return avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
+}
+
+static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
+{
+ avfilter_start_frame(link->dst->outputs[0], picref);
+}
+
+static void end_frame(AVFilterLink *link)
+{
+ avfilter_end_frame(link->dst->outputs[0]);
+}
+
+AVFilter avfilter_vf_null = {
+ .name = "null",
+ .description = NULL_IF_CONFIG_SMALL("Pass the source unchanged to the output."),
+
+ .priv_size = 0,
+
+ .inputs = (AVFilterPad[]) {{ .name = "default",
+ .type = CODEC_TYPE_VIDEO,
+ .get_video_buffer = get_video_buffer,
+ .start_frame = start_frame,
+ .end_frame = end_frame },
+ { .name = NULL}},
+
+ .outputs = (AVFilterPad[]) {{ .name = "default",
+ .type = CODEC_TYPE_VIDEO, },
+ { .name = NULL}},
+};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_scale.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_scale.c
new file mode 100644
index 0000000000..381d572ff9
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_scale.c
@@ -0,0 +1,196 @@
+/*
+ * copyright (c) 2007 Bobby Bingham
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file libavfilter/vf_scale.c
+ * scale video filter
+ */
+
+#include "avfilter.h"
+#include "libswscale/swscale.h"
+
+typedef struct {
+ struct SwsContext *sws; ///< software scaler context
+
+ /**
+ * New dimensions. Special values are:
+ * 0 = original width/height
+ * -1 = keep original aspect
+ */
+ int w, h;
+
+ int hsub, vsub; ///< chroma subsampling
+ int slice_y; ///< top of current output slice
+ int input_is_pal; ///< set to 1 if the input format is paletted
+} ScaleContext;
+
+static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
+{
+ ScaleContext *scale = ctx->priv;
+
+ if (args)
+ sscanf(args, "%d:%d", &scale->w, &scale->h);
+
+ /* sanity check params */
+ if (scale->w < -1 || scale->h < -1) {
+ av_log(ctx, AV_LOG_ERROR, "Size values less than -1 are not acceptable.\n");
+ return -1;
+ }
+ if (scale->w == -1 && scale->h == -1)
+ scale->w = scale->h = 0;
+
+ return 0;
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ ScaleContext *scale = ctx->priv;
+ sws_freeContext(scale->sws);
+ scale->sws = NULL;
+}
+
+static int query_formats(AVFilterContext *ctx)
+{
+ AVFilterFormats *formats;
+
+ if (ctx->inputs[0]) {
+ formats = avfilter_all_colorspaces();
+ avfilter_formats_ref(formats, &ctx->inputs[0]->out_formats);
+ }
+ if (ctx->outputs[0]) {
+ formats = avfilter_all_colorspaces();
+ avfilter_formats_ref(formats, &ctx->outputs[0]->in_formats);
+ }
+
+ return 0;
+}
+
+static int config_props(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ AVFilterLink *inlink = outlink->src->inputs[0];
+ ScaleContext *scale = ctx->priv;
+ int64_t w, h;
+
+ if (!(w = scale->w))
+ w = inlink->w;
+ if (!(h = scale->h))
+ h = inlink->h;
+ if (w == -1)
+ w = av_rescale(h, inlink->w, inlink->h);
+ if (h == -1)
+ h = av_rescale(w, inlink->h, inlink->w);
+
+ if (w > INT_MAX || h > INT_MAX ||
+ (h * inlink->w) > INT_MAX ||
+ (w * inlink->h) > INT_MAX)
+ av_log(ctx, AV_LOG_ERROR, "Rescaled value for width or height is too big.\n");
+
+ outlink->w = w;
+ outlink->h = h;
+
+ /* TODO: make algorithm configurable */
+ scale->sws = sws_getContext(inlink ->w, inlink ->h, inlink ->format,
+ outlink->w, outlink->h, outlink->format,
+ SWS_BILINEAR, NULL, NULL, NULL);
+
+ av_log(ctx, AV_LOG_INFO, "w:%d h:%d fmt:%s\n",
+ outlink->w, outlink->h, avcodec_get_pix_fmt_name(outlink->format));
+
+ scale->input_is_pal = inlink->format == PIX_FMT_PAL8 ||
+ inlink->format == PIX_FMT_BGR4_BYTE ||
+ inlink->format == PIX_FMT_RGB4_BYTE ||
+ inlink->format == PIX_FMT_BGR8 ||
+ inlink->format == PIX_FMT_RGB8;
+
+ return !scale->sws;
+}
+
+static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
+{
+ ScaleContext *scale = link->dst->priv;
+ AVFilterLink *outlink = link->dst->outputs[0];
+ AVFilterPicRef *outpicref;
+
+ avcodec_get_chroma_sub_sample(link->format, &scale->hsub, &scale->vsub);
+
+ outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
+ outpicref->pts = picref->pts;
+ outlink->outpic = outpicref;
+
+ av_reduce(&outpicref->pixel_aspect.num, &outpicref->pixel_aspect.den,
+ (int64_t)picref->pixel_aspect.num * outlink->h * link->w,
+ (int64_t)picref->pixel_aspect.den * outlink->w * link->h,
+ INT_MAX);
+
+ scale->slice_y = 0;
+ avfilter_start_frame(outlink, avfilter_ref_pic(outpicref, ~0));
+}
+
+static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
+{
+ ScaleContext *scale = link->dst->priv;
+ int out_h;
+ AVFilterPicRef *cur_pic = link->cur_pic;
+ uint8_t *data[4];
+
+ if (scale->slice_y == 0 && slice_dir == -1)
+ scale->slice_y = link->dst->outputs[0]->h;
+
+ data[0] = cur_pic->data[0] + y * cur_pic->linesize[0];
+ data[1] = scale->input_is_pal ?
+ cur_pic->data[1] :
+ cur_pic->data[1] + (y>>scale->vsub) * cur_pic->linesize[1];
+ data[2] = cur_pic->data[2] + (y>>scale->vsub) * cur_pic->linesize[2];
+ data[3] = cur_pic->data[3] + y * cur_pic->linesize[3];
+
+ out_h = sws_scale(scale->sws, data, cur_pic->linesize, y, h,
+ link->dst->outputs[0]->outpic->data,
+ link->dst->outputs[0]->outpic->linesize);
+
+ if (slice_dir == -1)
+ scale->slice_y -= out_h;
+ avfilter_draw_slice(link->dst->outputs[0], scale->slice_y, out_h, slice_dir);
+ if (slice_dir == 1)
+ scale->slice_y += out_h;
+}
+
+AVFilter avfilter_vf_scale = {
+ .name = "scale",
+ .description = "Scale the input video to width:height size and/or convert the image format.",
+
+ .init = init,
+ .uninit = uninit,
+
+ .query_formats = query_formats,
+
+ .priv_size = sizeof(ScaleContext),
+
+ .inputs = (AVFilterPad[]) {{ .name = "default",
+ .type = CODEC_TYPE_VIDEO,
+ .start_frame = start_frame,
+ .draw_slice = draw_slice,
+ .min_perms = AV_PERM_READ, },
+ { .name = NULL}},
+ .outputs = (AVFilterPad[]) {{ .name = "default",
+ .type = CODEC_TYPE_VIDEO,
+ .config_props = config_props, },
+ { .name = NULL}},
+};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_slicify.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_slicify.c
new file mode 100644
index 0000000000..b5e9544b3f
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_slicify.c
@@ -0,0 +1,115 @@
+/*
+ * copyright (c) 2007 Bobby Bingham
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file libavfilter/vf_slicify.c
+ * video slicing filter
+ */
+
+#include "avfilter.h"
+
+typedef struct {
+ int h; ///< output slice height
+ int vshift; ///< vertical chroma subsampling shift
+} SliceContext;
+
+static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
+{
+ SliceContext *slice = ctx->priv;
+
+ slice->h = 16;
+ if (args)
+ sscanf(args, "%d", &slice->h);
+
+ return 0;
+}
+
+static int config_props(AVFilterLink *link)
+{
+ SliceContext *slice = link->dst->priv;
+ int tmp;
+
+ avcodec_get_chroma_sub_sample(link->format, &tmp, &slice->vshift);
+
+ /* ensure that slices play nice with chroma subsampling, and enforce
+ * a reasonable minimum size for the slices */
+ slice->h = FFMAX(8, slice->h & (-1 << slice->vshift));
+
+ av_log(link->dst, AV_LOG_INFO, "h:%d\n", slice->h);
+
+ return 0;
+}
+
+static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms,
+ int w, int h)
+{
+ return avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
+}
+
+static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
+{
+ avfilter_start_frame(link->dst->outputs[0], picref);
+}
+
+static void end_frame(AVFilterLink *link)
+{
+ avfilter_end_frame(link->dst->outputs[0]);
+}
+
+static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
+{
+ SliceContext *slice = link->dst->priv;
+ int y2;
+
+ if (slice_dir == 1) {
+ for (y2 = y; y2 + slice->h <= y + h; y2 += slice->h)
+ avfilter_draw_slice(link->dst->outputs[0], y2, slice->h, slice_dir);
+
+ if (y2 < y + h)
+ avfilter_draw_slice(link->dst->outputs[0], y2, y + h - y2, slice_dir);
+ } else if (slice_dir == -1) {
+ for (y2 = y + h; y2 - slice->h >= y; y2 -= slice->h)
+ avfilter_draw_slice(link->dst->outputs[0], y2 - slice->h, slice->h, slice_dir);
+
+ if (y2 > y)
+ avfilter_draw_slice(link->dst->outputs[0], y, y2 - y, slice_dir);
+ }
+}
+
+AVFilter avfilter_vf_slicify = {
+ .name = "slicify",
+ .description = "Pass the images of input video on to next video filter as multiple slices.",
+
+ .init = init,
+
+ .priv_size = sizeof(SliceContext),
+
+ .inputs = (AVFilterPad[]) {{ .name = "default",
+ .type = CODEC_TYPE_VIDEO,
+ .get_video_buffer = get_video_buffer,
+ .start_frame = start_frame,
+ .draw_slice = draw_slice,
+ .config_props = config_props,
+ .end_frame = end_frame, },
+ { .name = NULL}},
+ .outputs = (AVFilterPad[]) {{ .name = "default",
+ .type = CODEC_TYPE_VIDEO, },
+ { .name = NULL}},
+};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_vflip.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_vflip.c
new file mode 100644
index 0000000000..39c0405c04
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_vflip.c
@@ -0,0 +1,104 @@
+/*
+ * copyright (c) 2007 Bobby Bingham
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file libavfilter/vf_vflip.c
+ * video vertical flip filter
+ */
+
+#include "avfilter.h"
+
+typedef struct {
+ int vsub; ///< vertical chroma subsampling
+} FlipContext;
+
+static int config_input(AVFilterLink *link)
+{
+ FlipContext *flip = link->dst->priv;
+ int tmp;
+
+ avcodec_get_chroma_sub_sample(link->format, &tmp, &flip->vsub);
+
+ return 0;
+}
+
+static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms,
+ int w, int h)
+{
+ FlipContext *flip = link->dst->priv;
+ int i;
+
+ AVFilterPicRef *picref = avfilter_get_video_buffer(link->dst->outputs[0],
+ perms, w, h);
+
+ for (i = 0; i < 4; i ++) {
+ int vsub = i == 1 || i == 2 ? flip->vsub : 0;
+
+ if (picref->data[i]) {
+ picref->data[i] += ((h >> vsub)-1) * picref->linesize[i];
+ picref->linesize[i] = -picref->linesize[i];
+ }
+ }
+
+ return picref;
+}
+
+static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
+{
+ FlipContext *flip = link->dst->priv;
+ AVFilterPicRef *ref2 = avfilter_ref_pic(picref, ~0);
+ int i;
+
+ for (i = 0; i < 4; i ++) {
+ int vsub = i == 1 || i == 2 ? flip->vsub : 0;
+
+ if (ref2->data[i]) {
+ ref2->data[i] += ((link->h >> vsub)-1) * ref2->linesize[i];
+ ref2->linesize[i] = -ref2->linesize[i];
+ }
+ }
+
+ avfilter_start_frame(link->dst->outputs[0], ref2);
+}
+
+static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
+{
+ AVFilterContext *ctx = link->dst;
+
+ avfilter_draw_slice(ctx->outputs[0], link->h - (y+h), h, -1 * slice_dir);
+}
+
+AVFilter avfilter_vf_vflip = {
+ .name = "vflip",
+ .description = NULL_IF_CONFIG_SMALL("Flip the input video vertically."),
+
+ .priv_size = sizeof(FlipContext),
+
+ .inputs = (AVFilterPad[]) {{ .name = "default",
+ .type = CODEC_TYPE_VIDEO,
+ .get_video_buffer = get_video_buffer,
+ .start_frame = start_frame,
+ .draw_slice = draw_slice,
+ .config_props = config_input, },
+ { .name = NULL}},
+ .outputs = (AVFilterPad[]) {{ .name = "default",
+ .type = CODEC_TYPE_VIDEO, },
+ { .name = NULL}},
+};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/Makefile b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/Makefile
index c0ec8ddb37..2b3e186413 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/Makefile
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/Makefile
@@ -5,7 +5,15 @@ FFLIBS = avcodec avutil
HEADERS = avformat.h avio.h
-OBJS = allformats.o cutils.o metadata.o metadata_compat.o options.o os_support.o sdp.o seek.o utils.o
+OBJS = allformats.o \
+ cutils.o \
+ metadata.o \
+ metadata_compat.o \
+ options.o \
+ os_support.o \
+ sdp.o \
+ seek.o \
+ utils.o \
# muxers/demuxers
OBJS-$(CONFIG_AAC_DEMUXER) += raw.o id3v1.o id3v2.o
@@ -13,13 +21,14 @@ OBJS-$(CONFIG_AC3_DEMUXER) += raw.o
OBJS-$(CONFIG_AC3_MUXER) += raw.o
OBJS-$(CONFIG_ADTS_MUXER) += adtsenc.o
OBJS-$(CONFIG_AEA_DEMUXER) += aea.o
-OBJS-$(CONFIG_AIFF_DEMUXER) += aiff.o riff.o raw.o
-OBJS-$(CONFIG_AIFF_MUXER) += aiff.o riff.o
+OBJS-$(CONFIG_AIFF_DEMUXER) += aiffdec.o riff.o raw.o
+OBJS-$(CONFIG_AIFF_MUXER) += aiffenc.o riff.o
OBJS-$(CONFIG_AMR_DEMUXER) += amr.o
OBJS-$(CONFIG_AMR_MUXER) += amr.o
OBJS-$(CONFIG_APC_DEMUXER) += apc.o
OBJS-$(CONFIG_APE_DEMUXER) += ape.o apetag.o
-OBJS-$(CONFIG_ASF_DEMUXER) += asfdec.o asf.o asfcrypt.o riff.o avlanguage.o
+OBJS-$(CONFIG_ASF_DEMUXER) += asfdec.o asf.o asfcrypt.o \
+ riff.o avlanguage.o
OBJS-$(CONFIG_ASF_MUXER) += asfenc.o asf.o riff.o
OBJS-$(CONFIG_ASS_DEMUXER) += assdec.o
OBJS-$(CONFIG_ASS_MUXER) += assenc.o
@@ -35,6 +44,7 @@ OBJS-$(CONFIG_BFI_DEMUXER) += bfi.o
OBJS-$(CONFIG_C93_DEMUXER) += c93.o vocdec.o voc.o
OBJS-$(CONFIG_CAF_DEMUXER) += cafdec.o caf.o mov.o riff.o isom.o
OBJS-$(CONFIG_CAVSVIDEO_DEMUXER) += raw.o
+OBJS-$(CONFIG_CDG_DEMUXER) += cdg.o
OBJS-$(CONFIG_CRC_MUXER) += crcenc.o
OBJS-$(CONFIG_DAUD_DEMUXER) += daud.o
OBJS-$(CONFIG_DAUD_MUXER) += daud.o
@@ -54,7 +64,8 @@ OBJS-$(CONFIG_EAC3_DEMUXER) += raw.o id3v2.o
OBJS-$(CONFIG_EAC3_MUXER) += raw.o
OBJS-$(CONFIG_FFM_DEMUXER) += ffmdec.o
OBJS-$(CONFIG_FFM_MUXER) += ffmenc.o
-OBJS-$(CONFIG_FLAC_DEMUXER) += flacdec.o raw.o id3v1.o id3v2.o oggparsevorbis.o
+OBJS-$(CONFIG_FLAC_DEMUXER) += flacdec.o raw.o id3v1.o \
+ id3v2.o oggparsevorbis.o
OBJS-$(CONFIG_FLAC_MUXER) += flacenc.o
OBJS-$(CONFIG_FLIC_DEMUXER) += flic.o
OBJS-$(CONFIG_FLV_DEMUXER) += flvdec.o
@@ -80,11 +91,14 @@ OBJS-$(CONFIG_IMAGE2PIPE_MUXER) += img2.o
OBJS-$(CONFIG_INGENIENT_DEMUXER) += raw.o
OBJS-$(CONFIG_IPMOVIE_DEMUXER) += ipmovie.o
OBJS-$(CONFIG_ISS_DEMUXER) += iss.o
+OBJS-$(CONFIG_IV8_DEMUXER) += iv8.o
OBJS-$(CONFIG_LMLM4_DEMUXER) += lmlm4.o
OBJS-$(CONFIG_M4V_DEMUXER) += raw.o
OBJS-$(CONFIG_M4V_MUXER) += raw.o
-OBJS-$(CONFIG_MATROSKA_DEMUXER) += matroskadec.o matroska.o riff.o isom.o
-OBJS-$(CONFIG_MATROSKA_MUXER) += matroskaenc.o matroska.o riff.o isom.o avc.o flacenc.o
+OBJS-$(CONFIG_MATROSKA_DEMUXER) += matroskadec.o matroska.o \
+ riff.o isom.o
+OBJS-$(CONFIG_MATROSKA_MUXER) += matroskaenc.o matroska.o \
+ riff.o isom.o avc.o flacenc.o
OBJS-$(CONFIG_MJPEG_DEMUXER) += raw.o
OBJS-$(CONFIG_MJPEG_MUXER) += raw.o
OBJS-$(CONFIG_MLP_DEMUXER) += raw.o id3v2.o
@@ -96,7 +110,7 @@ OBJS-$(CONFIG_MOV_DEMUXER) += mov.o riff.o isom.o
OBJS-$(CONFIG_MOV_MUXER) += movenc.o riff.o isom.o avc.o
OBJS-$(CONFIG_MP2_MUXER) += mp3.o id3v1.o
OBJS-$(CONFIG_MP3_DEMUXER) += mp3.o id3v1.o id3v2.o
-OBJS-$(CONFIG_MP3_MUXER) += mp3.o id3v1.o
+OBJS-$(CONFIG_MP3_MUXER) += mp3.o id3v1.o id3v2.o
OBJS-$(CONFIG_MPC_DEMUXER) += mpc.o id3v1.o id3v2.o apetag.o
OBJS-$(CONFIG_MPC8_DEMUXER) += mpc8.o
OBJS-$(CONFIG_MPEG1SYSTEM_MUXER) += mpegenc.o
@@ -176,7 +190,6 @@ OBJS-$(CONFIG_QCP_DEMUXER) += qcp.o
OBJS-$(CONFIG_R3D_DEMUXER) += r3d.o
OBJS-$(CONFIG_RAWVIDEO_DEMUXER) += raw.o
OBJS-$(CONFIG_RAWVIDEO_MUXER) += raw.o
-OBJS-$(CONFIG_REDIR_DEMUXER) += rtsp.o
OBJS-$(CONFIG_RL2_DEMUXER) += rl2.o
OBJS-$(CONFIG_RM_DEMUXER) += rmdec.o rm.o
OBJS-$(CONFIG_RM_MUXER) += rmenc.o rm.o
@@ -192,8 +205,14 @@ OBJS-$(CONFIG_RTP_MUXER) += rtp.o \
rtpenc.o \
rtpenc_h264.o \
avc.o
-OBJS-$(CONFIG_RTSP_DEMUXER) += rdt.o rtsp.o rtp_vorbis.o rtp_asf.o
-OBJS-$(CONFIG_SDP_DEMUXER) += rtsp.o rtp.o rtpdec.o rtp_h264.o rtp_vorbis.o rtp_asf.o
+OBJS-$(CONFIG_RTSP_DEMUXER) += rtsp.o
+OBJS-$(CONFIG_SDP_DEMUXER) += rtsp.o \
+ rdt.o \
+ rtp.o \
+ rtpdec.o \
+ rtp_asf.o \
+ rtp_h264.o \
+ rtp_vorbis.o
OBJS-$(CONFIG_SEGAFILM_DEMUXER) += segafilm.o
OBJS-$(CONFIG_SHORTEN_DEMUXER) += raw.o id3v2.o
OBJS-$(CONFIG_SIFF_DEMUXER) += siff.o
@@ -210,7 +229,7 @@ OBJS-$(CONFIG_TIERTEXSEQ_DEMUXER) += tiertexseq.o
OBJS-$(CONFIG_TMV_DEMUXER) += tmv.o
OBJS-$(CONFIG_TRUEHD_DEMUXER) += raw.o id3v2.o
OBJS-$(CONFIG_TRUEHD_MUXER) += raw.o
-OBJS-$(CONFIG_TTA_DEMUXER) += tta.o
+OBJS-$(CONFIG_TTA_DEMUXER) += tta.o id3v1.o id3v2.o
OBJS-$(CONFIG_TXD_DEMUXER) += txd.o
OBJS-$(CONFIG_VC1_DEMUXER) += raw.o
OBJS-$(CONFIG_VC1T_DEMUXER) += vc1test.o
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiff.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiff.h
new file mode 100644
index 0000000000..48fecbe8b0
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiff.h
@@ -0,0 +1,53 @@
+/*
+ * AIFF/AIFF-C muxer/demuxer common header
+ * Copyright (c) 2006 Patrick Guimond
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file libavformat/aiff.h
+ * common header for AIFF muxer and demuxer
+ */
+
+#ifndef AVFORMAT_AIFF_H
+#define AVFORMAT_AIFF_H
+
+#include "avformat.h"
+#include "riff.h"
+
+static const AVCodecTag ff_codec_aiff_tags[] = {
+ { CODEC_ID_PCM_S16BE, MKTAG('N','O','N','E') },
+ { CODEC_ID_PCM_S8, MKTAG('N','O','N','E') },
+ { CODEC_ID_PCM_S24BE, MKTAG('N','O','N','E') },
+ { CODEC_ID_PCM_S32BE, MKTAG('N','O','N','E') },
+ { CODEC_ID_PCM_F32BE, MKTAG('f','l','3','2') },
+ { CODEC_ID_PCM_F64BE, MKTAG('f','l','6','4') },
+ { CODEC_ID_PCM_ALAW, MKTAG('a','l','a','w') },
+ { CODEC_ID_PCM_MULAW, MKTAG('u','l','a','w') },
+ { CODEC_ID_MACE3, MKTAG('M','A','C','3') },
+ { CODEC_ID_MACE6, MKTAG('M','A','C','6') },
+ { CODEC_ID_GSM, MKTAG('G','S','M',' ') },
+ { CODEC_ID_ADPCM_G726, MKTAG('G','7','2','6') },
+ { CODEC_ID_PCM_S16LE, MKTAG('s','o','w','t') },
+ { CODEC_ID_ADPCM_IMA_QT, MKTAG('i','m','a','4') },
+ { CODEC_ID_QDM2, MKTAG('Q','D','M','2') },
+ { CODEC_ID_QCELP, MKTAG('Q','c','l','p') },
+ { CODEC_ID_NONE, 0 },
+};
+
+#endif /* AVFORMAT_AIFF_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiff.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiffdec.c
index 570e05d4e3..a56bb0911d 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiff.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiffdec.c
@@ -1,5 +1,5 @@
/*
- * AIFF/AIFF-C muxer and demuxer
+ * AIFF/AIFF-C demuxer
* Copyright (c) 2006 Patrick Guimond
*
* This file is part of FFmpeg.
@@ -22,30 +22,15 @@
#include "libavutil/intfloat_readwrite.h"
#include "avformat.h"
#include "raw.h"
-#include "riff.h"
-
-static const AVCodecTag codec_aiff_tags[] = {
- { CODEC_ID_PCM_S16BE, MKTAG('N','O','N','E') },
- { CODEC_ID_PCM_S8, MKTAG('N','O','N','E') },
- { CODEC_ID_PCM_S24BE, MKTAG('N','O','N','E') },
- { CODEC_ID_PCM_S32BE, MKTAG('N','O','N','E') },
- { CODEC_ID_PCM_F32BE, MKTAG('f','l','3','2') },
- { CODEC_ID_PCM_F64BE, MKTAG('f','l','6','4') },
- { CODEC_ID_PCM_ALAW, MKTAG('a','l','a','w') },
- { CODEC_ID_PCM_MULAW, MKTAG('u','l','a','w') },
- { CODEC_ID_MACE3, MKTAG('M','A','C','3') },
- { CODEC_ID_MACE6, MKTAG('M','A','C','6') },
- { CODEC_ID_GSM, MKTAG('G','S','M',' ') },
- { CODEC_ID_ADPCM_G726, MKTAG('G','7','2','6') },
- { CODEC_ID_PCM_S16LE, MKTAG('s','o','w','t') },
- { CODEC_ID_ADPCM_IMA_QT, MKTAG('i','m','a','4') },
- { CODEC_ID_QDM2, MKTAG('Q','D','M','2') },
- { 0, 0 },
-};
+#include "aiff.h"
#define AIFF 0
#define AIFF_C_VERSION1 0xA2805140
+typedef struct {
+ int64_t data_end;
+} AIFFInputContext;
+
static enum CodecID aiff_codec_get_id(int bps)
{
if (bps <= 8)
@@ -81,19 +66,20 @@ static int get_tag(ByteIOContext *pb, uint32_t * tag)
/* Metadata string read */
static void get_meta(AVFormatContext *s, const char *key, int size)
{
- uint8_t str[1024];
- int res = get_buffer(s->pb, str, FFMIN(sizeof(str)-1, size));
+ uint8_t *str = av_malloc(size+1);
+ int res;
+
+ if (!str) {
+ url_fskip(s->pb, size);
+ return;
+ }
+
+ res = get_buffer(s->pb, str, size);
if (res < 0)
return;
str[res] = 0;
- if (size & 1)
- size++;
- size -= res;
- if (size)
- url_fskip(s->pb, size);
-
- av_metadata_set(&s->metadata, key, str);
+ av_metadata_set2(&s->metadata, key, str, AV_METADATA_DONT_STRDUP_VAL);
}
/* Returns the number of sound data frames or negative on error */
@@ -119,7 +105,7 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec,
/* Got an AIFF-C? */
if (version == AIFF_C_VERSION1) {
codec->codec_tag = get_le32(pb);
- codec->codec_id = ff_codec_get_id(codec_aiff_tags, codec->codec_tag);
+ codec->codec_id = ff_codec_get_id(ff_codec_aiff_tags, codec->codec_tag);
switch (codec->codec_id) {
case CODEC_ID_PCM_S16BE:
@@ -142,6 +128,10 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec,
codec->block_align = 33;
codec->frame_size = 160;
break;
+ case CODEC_ID_QCELP:
+ codec->block_align = 35;
+ codec->frame_size= 160;
+ break;
default:
break;
}
@@ -167,131 +157,6 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec,
return num_frames;
}
-#if CONFIG_AIFF_MUXER
-typedef struct {
- int64_t form;
- int64_t frames;
- int64_t ssnd;
-} AIFFOutputContext;
-
-static int aiff_write_header(AVFormatContext *s)
-{
- AIFFOutputContext *aiff = s->priv_data;
- ByteIOContext *pb = s->pb;
- AVCodecContext *enc = s->streams[0]->codec;
- AVExtFloat sample_rate;
- int aifc = 0;
-
- /* First verify if format is ok */
- if (!enc->codec_tag)
- return -1;
- if (enc->codec_tag != MKTAG('N','O','N','E'))
- aifc = 1;
-
- /* FORM AIFF header */
- put_tag(pb, "FORM");
- aiff->form = url_ftell(pb);
- put_be32(pb, 0); /* file length */
- put_tag(pb, aifc ? "AIFC" : "AIFF");
-
- if (aifc) { // compressed audio
- enc->bits_per_coded_sample = 16;
- if (!enc->block_align) {
- av_log(s, AV_LOG_ERROR, "block align not set\n");
- return -1;
- }
- /* Version chunk */
- put_tag(pb, "FVER");
- put_be32(pb, 4);
- put_be32(pb, 0xA2805140);
- }
-
- /* Common chunk */
- put_tag(pb, "COMM");
- put_be32(pb, aifc ? 24 : 18); /* size */
- put_be16(pb, enc->channels); /* Number of channels */
-
- aiff->frames = url_ftell(pb);
- put_be32(pb, 0); /* Number of frames */
-
- if (!enc->bits_per_coded_sample)
- enc->bits_per_coded_sample = av_get_bits_per_sample(enc->codec_id);
- if (!enc->bits_per_coded_sample) {
- av_log(s, AV_LOG_ERROR, "could not compute bits per sample\n");
- return -1;
- }
- if (!enc->block_align)
- enc->block_align = (enc->bits_per_coded_sample * enc->channels) >> 3;
-
- put_be16(pb, enc->bits_per_coded_sample); /* Sample size */
-
- sample_rate = av_dbl2ext((double)enc->sample_rate);
- put_buffer(pb, (uint8_t*)&sample_rate, sizeof(sample_rate));
-
- if (aifc) {
- put_le32(pb, enc->codec_tag);
- put_be16(pb, 0);
- }
-
- /* Sound data chunk */
- put_tag(pb, "SSND");
- aiff->ssnd = url_ftell(pb); /* Sound chunk size */
- put_be32(pb, 0); /* Sound samples data size */
- put_be32(pb, 0); /* Data offset */
- put_be32(pb, 0); /* Block-size (block align) */
-
- av_set_pts_info(s->streams[0], 64, 1, s->streams[0]->codec->sample_rate);
-
- /* Data is starting here */
- put_flush_packet(pb);
-
- return 0;
-}
-
-static int aiff_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
- ByteIOContext *pb = s->pb;
- put_buffer(pb, pkt->data, pkt->size);
- return 0;
-}
-
-static int aiff_write_trailer(AVFormatContext *s)
-{
- ByteIOContext *pb = s->pb;
- AIFFOutputContext *aiff = s->priv_data;
- AVCodecContext *enc = s->streams[0]->codec;
-
- /* Chunks sizes must be even */
- int64_t file_size, end_size;
- end_size = file_size = url_ftell(pb);
- if (file_size & 1) {
- put_byte(pb, 0);
- end_size++;
- }
-
- if (!url_is_streamed(s->pb)) {
- /* File length */
- url_fseek(pb, aiff->form, SEEK_SET);
- put_be32(pb, file_size - aiff->form - 4);
-
- /* Number of sample frames */
- url_fseek(pb, aiff->frames, SEEK_SET);
- put_be32(pb, (file_size-aiff->ssnd-12)/enc->block_align);
-
- /* Sound Data chunk size */
- url_fseek(pb, aiff->ssnd, SEEK_SET);
- put_be32(pb, file_size - aiff->ssnd - 4);
-
- /* return to the end */
- url_fseek(pb, end_size, SEEK_SET);
-
- put_flush_packet(pb);
- }
-
- return 0;
-}
-#endif /* CONFIG_AIFF_MUXER */
-
static int aiff_probe(AVProbeData *p)
{
/* check file header */
@@ -314,6 +179,7 @@ static int aiff_read_header(AVFormatContext *s,
unsigned version = AIFF_C_VERSION1;
ByteIOContext *pb = s->pb;
AVStream * st;
+ AIFFInputContext *aiff = s->priv_data;
/* check FORM header */
filesize = get_tag(pb, &tag);
@@ -366,6 +232,7 @@ static int aiff_read_header(AVFormatContext *s,
get_meta(s, "comment" , size);
break;
case MKTAG('S', 'S', 'N', 'D'): /* Sampled sound chunk */
+ aiff->data_end = url_ftell(pb) + size;
offset = get_be32(pb); /* Offset of sound data */
get_be32(pb); /* BlockSize... don't care */
offset += url_ftell(pb); /* Compute absolute data offset */
@@ -420,10 +287,22 @@ static int aiff_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
AVStream *st = s->streams[0];
- int res;
+ AIFFInputContext *aiff = s->priv_data;
+ int64_t max_size;
+ int res, size;
+
+ /* calculate size of remaining data */
+ max_size = aiff->data_end - url_ftell(s->pb);
+ if (max_size <= 0)
+ return AVERROR_EOF;
/* Now for that packet */
- res = av_get_packet(s->pb, pkt, (MAX_SIZE / st->codec->block_align) * st->codec->block_align);
+ if (st->codec->block_align >= 33) // GSM, QCLP, IMA4
+ size = st->codec->block_align;
+ else
+ size = (MAX_SIZE / st->codec->block_align) * st->codec->block_align;
+ size = FFMIN(max_size, size);
+ res = av_get_packet(s->pb, pkt, size);
if (res < 0)
return res;
@@ -432,32 +311,14 @@ static int aiff_read_packet(AVFormatContext *s,
return 0;
}
-#if CONFIG_AIFF_DEMUXER
AVInputFormat aiff_demuxer = {
"aiff",
NULL_IF_CONFIG_SMALL("Audio IFF"),
- 0,
+ sizeof(AIFFInputContext),
aiff_probe,
aiff_read_header,
aiff_read_packet,
NULL,
pcm_read_seek,
- .codec_tag= (const AVCodecTag* const []){codec_aiff_tags, 0},
-};
-#endif
-
-#if CONFIG_AIFF_MUXER
-AVOutputFormat aiff_muxer = {
- "aiff",
- NULL_IF_CONFIG_SMALL("Audio IFF"),
- "audio/aiff",
- "aif,aiff,afc,aifc",
- sizeof(AIFFOutputContext),
- CODEC_ID_PCM_S16BE,
- CODEC_ID_NONE,
- aiff_write_header,
- aiff_write_packet,
- aiff_write_trailer,
- .codec_tag= (const AVCodecTag* const []){codec_aiff_tags, 0},
+ .codec_tag= (const AVCodecTag* const []){ff_codec_aiff_tags, 0},
};
-#endif
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiffenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiffenc.c
new file mode 100644
index 0000000000..e3c6a0b1bf
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiffenc.c
@@ -0,0 +1,160 @@
+/*
+ * AIFF/AIFF-C muxer
+ * Copyright (c) 2006 Patrick Guimond
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avformat.h"
+#include "aiff.h"
+
+typedef struct {
+ int64_t form;
+ int64_t frames;
+ int64_t ssnd;
+} AIFFOutputContext;
+
+static int aiff_write_header(AVFormatContext *s)
+{
+ AIFFOutputContext *aiff = s->priv_data;
+ ByteIOContext *pb = s->pb;
+ AVCodecContext *enc = s->streams[0]->codec;
+ AVExtFloat sample_rate;
+ int aifc = 0;
+
+ /* First verify if format is ok */
+ if (!enc->codec_tag)
+ return -1;
+ if (enc->codec_tag != MKTAG('N','O','N','E'))
+ aifc = 1;
+
+ /* FORM AIFF header */
+ put_tag(pb, "FORM");
+ aiff->form = url_ftell(pb);
+ put_be32(pb, 0); /* file length */
+ put_tag(pb, aifc ? "AIFC" : "AIFF");
+
+ if (aifc) { // compressed audio
+ enc->bits_per_coded_sample = 16;
+ if (!enc->block_align) {
+ av_log(s, AV_LOG_ERROR, "block align not set\n");
+ return -1;
+ }
+ /* Version chunk */
+ put_tag(pb, "FVER");
+ put_be32(pb, 4);
+ put_be32(pb, 0xA2805140);
+ }
+
+ /* Common chunk */
+ put_tag(pb, "COMM");
+ put_be32(pb, aifc ? 24 : 18); /* size */
+ put_be16(pb, enc->channels); /* Number of channels */
+
+ aiff->frames = url_ftell(pb);
+ put_be32(pb, 0); /* Number of frames */
+
+ if (!enc->bits_per_coded_sample)
+ enc->bits_per_coded_sample = av_get_bits_per_sample(enc->codec_id);
+ if (!enc->bits_per_coded_sample) {
+ av_log(s, AV_LOG_ERROR, "could not compute bits per sample\n");
+ return -1;
+ }
+ if (!enc->block_align)
+ enc->block_align = (enc->bits_per_coded_sample * enc->channels) >> 3;
+
+ put_be16(pb, enc->bits_per_coded_sample); /* Sample size */
+
+ sample_rate = av_dbl2ext((double)enc->sample_rate);
+ put_buffer(pb, (uint8_t*)&sample_rate, sizeof(sample_rate));
+
+ if (aifc) {
+ put_le32(pb, enc->codec_tag);
+ put_be16(pb, 0);
+ }
+
+ /* Sound data chunk */
+ put_tag(pb, "SSND");
+ aiff->ssnd = url_ftell(pb); /* Sound chunk size */
+ put_be32(pb, 0); /* Sound samples data size */
+ put_be32(pb, 0); /* Data offset */
+ put_be32(pb, 0); /* Block-size (block align) */
+
+ av_set_pts_info(s->streams[0], 64, 1, s->streams[0]->codec->sample_rate);
+
+ /* Data is starting here */
+ put_flush_packet(pb);
+
+ return 0;
+}
+
+static int aiff_write_packet(AVFormatContext *s, AVPacket *pkt)
+{
+ ByteIOContext *pb = s->pb;
+ put_buffer(pb, pkt->data, pkt->size);
+ return 0;
+}
+
+static int aiff_write_trailer(AVFormatContext *s)
+{
+ ByteIOContext *pb = s->pb;
+ AIFFOutputContext *aiff = s->priv_data;
+ AVCodecContext *enc = s->streams[0]->codec;
+
+ /* Chunks sizes must be even */
+ int64_t file_size, end_size;
+ end_size = file_size = url_ftell(pb);
+ if (file_size & 1) {
+ put_byte(pb, 0);
+ end_size++;
+ }
+
+ if (!url_is_streamed(s->pb)) {
+ /* File length */
+ url_fseek(pb, aiff->form, SEEK_SET);
+ put_be32(pb, file_size - aiff->form - 4);
+
+ /* Number of sample frames */
+ url_fseek(pb, aiff->frames, SEEK_SET);
+ put_be32(pb, (file_size-aiff->ssnd-12)/enc->block_align);
+
+ /* Sound Data chunk size */
+ url_fseek(pb, aiff->ssnd, SEEK_SET);
+ put_be32(pb, file_size - aiff->ssnd - 4);
+
+ /* return to the end */
+ url_fseek(pb, end_size, SEEK_SET);
+
+ put_flush_packet(pb);
+ }
+
+ return 0;
+}
+
+AVOutputFormat aiff_muxer = {
+ "aiff",
+ NULL_IF_CONFIG_SMALL("Audio IFF"),
+ "audio/aiff",
+ "aif,aiff,afc,aifc",
+ sizeof(AIFFOutputContext),
+ CODEC_ID_PCM_S16BE,
+ CODEC_ID_NONE,
+ aiff_write_header,
+ aiff_write_packet,
+ aiff_write_trailer,
+ .codec_tag= (const AVCodecTag* const []){ff_codec_aiff_tags, 0},
+};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/allformats.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/allformats.c
index c35b060b5a..d57376dd91 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/allformats.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/allformats.c
@@ -68,6 +68,7 @@ void av_register_all(void)
REGISTER_DEMUXER (C93, c93);
REGISTER_DEMUXER (CAF, caf);
REGISTER_DEMUXER (CAVSVIDEO, cavsvideo);
+ REGISTER_DEMUXER (CDG, cdg);
REGISTER_MUXER (CRC, crc);
REGISTER_MUXDEMUX (DAUD, daud);
REGISTER_MUXDEMUX (DIRAC, dirac);
@@ -99,6 +100,7 @@ void av_register_all(void)
REGISTER_DEMUXER (IPMOVIE, ipmovie);
REGISTER_MUXER (IPOD, ipod);
REGISTER_DEMUXER (ISS, iss);
+ REGISTER_DEMUXER (IV8, iv8);
REGISTER_DEMUXER (LMLM4, lmlm4);
REGISTER_MUXDEMUX (M4V, m4v);
REGISTER_MUXDEMUX (MATROSKA, matroska);
@@ -162,7 +164,6 @@ void av_register_all(void)
REGISTER_DEMUXER (QCP, qcp);
REGISTER_DEMUXER (R3D, r3d);
REGISTER_MUXDEMUX (RAWVIDEO, rawvideo);
- REGISTER_DEMUXER (REDIR, redir);
REGISTER_DEMUXER (RL2, rl2);
REGISTER_MUXDEMUX (RM, rm);
REGISTER_MUXDEMUX (ROQ, roq);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/apetag.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/apetag.c
index 435dd3fdcf..6b4676787f 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/apetag.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/apetag.c
@@ -33,9 +33,9 @@
static int ape_tag_read_field(AVFormatContext *s)
{
ByteIOContext *pb = s->pb;
- uint8_t key[1024], value[1024];
+ uint8_t key[1024], *value;
uint32_t size, flags;
- int i, l, c;
+ int i, c;
size = get_le32(pb); /* field size */
flags = get_le32(pb); /* field flags */
@@ -51,13 +51,14 @@ static int ape_tag_read_field(AVFormatContext *s)
av_log(s, AV_LOG_WARNING, "Invalid APE tag key '%s'.\n", key);
return -1;
}
- l = FFMIN(size, sizeof(value)-1);
- get_buffer(pb, value, l);
- value[l] = 0;
- url_fskip(pb, size-l);
- if (l < size)
- av_log(s, AV_LOG_WARNING, "Too long '%s' tag was truncated.\n", key);
- av_metadata_set(&s->metadata, key, value);
+ if (size >= UINT_MAX)
+ return -1;
+ value = av_malloc(size+1);
+ if (!value)
+ return AVERROR_NOMEM;
+ get_buffer(pb, value, size);
+ value[size] = 0;
+ av_metadata_set2(&s->metadata, key, value, AV_METADATA_DONT_STRDUP_VAL);
return 0;
}
@@ -107,16 +108,4 @@ void ff_ape_parse_tag(AVFormatContext *s)
for (i=0; i<fields; i++)
if (ape_tag_read_field(s) < 0) break;
-
-#if ENABLE_DEBUG
- av_log(s, AV_LOG_DEBUG, "\nAPE Tags:\n\n");
- av_log(s, AV_LOG_DEBUG, "title = %s\n", s->title);
- av_log(s, AV_LOG_DEBUG, "author = %s\n", s->author);
- av_log(s, AV_LOG_DEBUG, "copyright = %s\n", s->copyright);
- av_log(s, AV_LOG_DEBUG, "comment = %s\n", s->comment);
- av_log(s, AV_LOG_DEBUG, "album = %s\n", s->album);
- av_log(s, AV_LOG_DEBUG, "year = %d\n", s->year);
- av_log(s, AV_LOG_DEBUG, "track = %d\n", s->track);
- av_log(s, AV_LOG_DEBUG, "genre = %s\n", s->genre);
-#endif
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/asf.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/asf.c
index 79ef61444b..cf01e07326 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/asf.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/asf.c
@@ -116,6 +116,18 @@ const ff_asf_guid ff_asf_language_guid = {
0xa9, 0x46, 0x43, 0x7c, 0xe0, 0xef, 0xfc, 0x4b, 0xb2, 0x29, 0x39, 0x3e, 0xde, 0x41, 0x5c, 0x85
};
+const ff_asf_guid ff_asf_content_encryption = {
+ 0xfb, 0xb3, 0x11, 0x22, 0x23, 0xbd, 0xd2, 0x11, 0xb4, 0xb7, 0x00, 0xa0, 0xc9, 0x55, 0xfc, 0x6e
+};
+
+const ff_asf_guid ff_asf_ext_content_encryption = {
+ 0x14, 0xe6, 0x8a, 0x29, 0x22, 0x26, 0x17, 0x4c, 0xb9, 0x35, 0xda, 0xe0, 0x7e, 0xe9, 0x28, 0x9c
+};
+
+const ff_asf_guid ff_asf_digital_signature = {
+ 0xfc, 0xb3, 0x11, 0x22, 0x23, 0xbd, 0xd2, 0x11, 0xb4, 0xb7, 0x00, 0xa0, 0xc9, 0x55, 0xfc, 0x6e
+};
+
const AVMetadataConv ff_asf_metadata_conv[] = {
{ "AlbumArtist", "artist" },
{ "AlbumTitle" , "album" },
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/asf.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/asf.h
index 314c0f8882..dd623e8f34 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/asf.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/asf.h
@@ -160,6 +160,9 @@ extern const ff_asf_guid ff_asf_ext_stream_audio_stream;
extern const ff_asf_guid ff_asf_metadata_header;
extern const ff_asf_guid ff_asf_my_guid;
extern const ff_asf_guid ff_asf_language_guid;
+extern const ff_asf_guid ff_asf_content_encryption;
+extern const ff_asf_guid ff_asf_ext_content_encryption;
+extern const ff_asf_guid ff_asf_digital_signature;
extern const AVMetadataConv ff_asf_metadata_conv[];
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/asfdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/asfdec.c
index fb5cf01be9..e0753092f2 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/asfdec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/asfdec.c
@@ -152,19 +152,27 @@ static int get_value(ByteIOContext *pb, int type){
static void get_tag(AVFormatContext *s, const char *key, int type, int len)
{
- char value[1024];
+ char *value;
+
+ if ((unsigned)len >= UINT_MAX)
+ return;
+
+ value = av_malloc(len+1);
+ if (!value)
+ return;
+
if (type <= 1) { // unicode or byte
- get_str16_nolen(s->pb, len, value, sizeof(value));
+ get_str16_nolen(s->pb, len, value, len);
} else if (type <= 5) { // boolean or DWORD or QWORD or WORD
uint64_t num = get_value(s->pb, type);
- snprintf(value, sizeof(value), "%"PRIu64, num);
+ snprintf(value, len, "%"PRIu64, num);
} else {
url_fskip(s->pb, len);
return;
}
if (!strncmp(key, "WM/", 3))
key += 3;
- av_metadata_set(&s->metadata, key, value);
+ av_metadata_set2(&s->metadata, key, value, AV_METADATA_DONT_STRDUP_VAL);
}
static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
@@ -532,6 +540,15 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
} else if (url_feof(pb)) {
return -1;
} else {
+ if (!s->keylen) {
+ if (!guidcmp(&g, &ff_asf_content_encryption)) {
+ av_log(s, AV_LOG_WARNING, "DRM protected stream detected, decoding will likely fail!\n");
+ } else if (!guidcmp(&g, &ff_asf_ext_content_encryption)) {
+ av_log(s, AV_LOG_WARNING, "Ext DRM protected stream detected, decoding will likely fail!\n");
+ } else if (!guidcmp(&g, &ff_asf_digital_signature)) {
+ av_log(s, AV_LOG_WARNING, "Digital signature detected, decoding will likely fail!\n");
+ }
+ }
url_fseek(pb, gsize - 24, SEEK_CUR);
}
}
@@ -1053,7 +1070,7 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
get_guid(s->pb, &g);
if (!guidcmp(&g, &index_guid)) {
- int64_t itime;
+ int64_t itime, last_pos=-1;
int pct, ict;
int64_t av_unused gsize= get_le64(s->pb);
get_guid(s->pb, &g);
@@ -1068,8 +1085,11 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
int64_t pos = s->data_offset + s->packet_size*(int64_t)pktnum;
int64_t index_pts= av_rescale(itime, i, 10000);
+ if(pos != last_pos){
av_log(s, AV_LOG_DEBUG, "pktnum:%d, pktct:%d\n", pktnum, pktct);
av_add_index_entry(s->streams[stream_index], pos, index_pts, s->packet_size, 0, AVINDEX_KEYFRAME);
+ last_pos=pos;
+ }
}
asf->index_read= 1;
} else {
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/au.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/au.c
index 24bdb62c7c..0ea0ea8c98 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/au.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/au.c
@@ -44,7 +44,7 @@ static const AVCodecTag codec_au_tags[] = {
{ CODEC_ID_PCM_F32BE, 6 },
{ CODEC_ID_PCM_F64BE, 7 },
{ CODEC_ID_PCM_ALAW, 27 },
- { 0, 0 },
+ { CODEC_ID_NONE, 0 },
};
#if CONFIG_AU_MUXER
@@ -157,14 +157,16 @@ static int au_read_header(AVFormatContext *s,
return 0;
}
-#define MAX_SIZE 4096
+#define BLOCK_SIZE 1024
static int au_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
int ret;
- ret= av_get_packet(s->pb, pkt, MAX_SIZE);
+ ret= av_get_packet(s->pb, pkt, BLOCK_SIZE *
+ s->streams[0]->codec->channels *
+ av_get_bits_per_sample(s->streams[0]->codec->codec_id) >> 3);
if (ret < 0)
return ret;
pkt->stream_index = 0;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/avformat.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/avformat.h
index 4060f84fb0..c8416fa090 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/avformat.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/avformat.h
@@ -22,7 +22,7 @@
#define AVFORMAT_AVFORMAT_H
#define LIBAVFORMAT_VERSION_MAJOR 52
-#define LIBAVFORMAT_VERSION_MINOR 39
+#define LIBAVFORMAT_VERSION_MINOR 44
#define LIBAVFORMAT_VERSION_MICRO 0
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
@@ -40,6 +40,16 @@
*/
unsigned avformat_version(void);
+/**
+ * Returns the libavformat build-time configuration.
+ */
+const char * avformat_configuration(void);
+
+/**
+ * Returns the libavformat license.
+ */
+const char * avformat_license(void);
+
#include <time.h>
#include <stdio.h> /* FILE */
#include "libavcodec/avcodec.h"
@@ -71,6 +81,8 @@ struct AVFormatContext;
#define AV_METADATA_MATCH_CASE 1
#define AV_METADATA_IGNORE_SUFFIX 2
+#define AV_METADATA_DONT_STRDUP_KEY 4
+#define AV_METADATA_DONT_STRDUP_VAL 8
typedef struct {
char *key;
@@ -89,6 +101,7 @@ typedef struct AVMetadataConv AVMetadataConv;
AVMetadataTag *
av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags);
+#if LIBAVFORMAT_VERSION_MAJOR == 52
/**
* Sets the given tag in m, overwriting an existing tag.
* @param key tag key to add to m (will be av_strduped)
@@ -96,6 +109,15 @@ av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int f
* @return >= 0 on success otherwise an error code <0
*/
int av_metadata_set(AVMetadata **pm, const char *key, const char *value);
+#endif
+
+/**
+ * Sets the given tag in m, overwriting an existing tag.
+ * @param key tag key to add to m (will be av_strduped depending on flags)
+ * @param value tag value to add to m (will be av_strduped depending on flags)
+ * @return >= 0 on success otherwise an error code <0
+ */
+int av_metadata_set2(AVMetadata **pm, const char *key, const char *value, int flags);
/**
* Converts all the metadata sets from ctx according to the source and
@@ -456,6 +478,11 @@ typedef struct AVStream {
* used internally, NOT PART OF PUBLIC API, dont read or write from outside of libav*
*/
struct AVPacketList *last_in_packet_buffer;
+
+ /**
+ * Average framerate
+ */
+ AVRational avg_frame_rate;
} AVStream;
#define AV_PROGRAM_RUNNING 1
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/avidec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/avidec.c
index baf38b6b17..41e42ed7cb 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/avidec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/avidec.c
@@ -170,8 +170,8 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){
if(last_pos == pos || pos == base - 8)
avi->non_interleaved= 1;
- if(last_pos != pos)
- av_add_index_entry(st, pos, ast->cum_len / FFMAX(1, ast->sample_size), len, 0, key ? AVINDEX_KEYFRAME : 0);
+ if(last_pos != pos && (len || !ast->sample_size))
+ av_add_index_entry(st, pos, ast->cum_len, len, 0, key ? AVINDEX_KEYFRAME : 0);
if(ast->sample_size)
ast->cum_len += len;
@@ -229,7 +229,7 @@ static void clean_index(AVFormatContext *s){
ts= st->index_entries[0].timestamp;
for(j=0; j<size; j+=max){
- av_add_index_entry(st, pos+j, ts + j/ast->sample_size, FFMIN(max, size-j), 0, AVINDEX_KEYFRAME);
+ av_add_index_entry(st, pos+j, ts+j, FFMIN(max, size-j), 0, AVINDEX_KEYFRAME);
}
}
}
@@ -237,14 +237,19 @@ static void clean_index(AVFormatContext *s){
static int avi_read_tag(AVFormatContext *s, const char *key, unsigned int size)
{
ByteIOContext *pb = s->pb;
- uint8_t value[1024];
+ char *value;
- int64_t i = url_ftell(pb);
size += (size & 1);
- get_strz(pb, value, sizeof(value));
- url_fseek(pb, i+size, SEEK_SET);
- return av_metadata_set(&s->metadata, key, value);
+ if (size == UINT_MAX)
+ return -1;
+ value = av_malloc(size+1);
+ if (!value)
+ return -1;
+ get_strz(pb, value, size);
+
+ return av_metadata_set2(&s->metadata, key, value,
+ AV_METADATA_DONT_STRDUP_VAL);
}
static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
@@ -691,14 +696,11 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
if(!st->nb_index_entries)
continue;
- if(ast->sample_size)
- ts /= ast->sample_size;
-
last_ts = st->index_entries[st->nb_index_entries - 1].timestamp;
if(!ast->remaining && ts > last_ts)
continue;
- ts = av_rescale_q(ts, st->time_base, AV_TIME_BASE_Q);
+ ts = av_rescale_q(ts, st->time_base, (AVRational){FFMAX(1, ast->sample_size), AV_TIME_BASE});
// av_log(s, AV_LOG_DEBUG, "%"PRId64" %d/%d %"PRId64"\n", ts, st->time_base.num, st->time_base.den, ast->frame_offset);
if(ts < best_ts){
@@ -711,14 +713,13 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
return -1;
best_ast = best_st->priv_data;
- best_ts = av_rescale_q(best_ts, AV_TIME_BASE_Q, best_st->time_base);
+ best_ts = av_rescale_q(best_ts, (AVRational){FFMAX(1, best_ast->sample_size), AV_TIME_BASE}, best_st->time_base);
if(best_ast->remaining)
i= av_index_search_timestamp(best_st, best_ts, AVSEEK_FLAG_ANY | AVSEEK_FLAG_BACKWARD);
else{
i= av_index_search_timestamp(best_st, best_ts, AVSEEK_FLAG_ANY);
if(i>=0)
- best_ast->frame_offset= best_st->index_entries[i].timestamp
- * FFMAX(1, best_ast->sample_size);
+ best_ast->frame_offset= best_st->index_entries[i].timestamp;
}
// av_log(s, AV_LOG_DEBUG, "%d\n", i);
@@ -791,7 +792,7 @@ resync:
int index;
assert(st->index_entries);
- index= av_index_search_timestamp(st, pkt->dts, 0);
+ index= av_index_search_timestamp(st, ast->frame_offset, 0);
e= &st->index_entries[index];
if(index >= 0 && e->timestamp == ast->frame_offset){
@@ -922,10 +923,10 @@ resync:
ast->packet_size= size + 8;
ast->remaining= size;
- {
+ if(size || !ast->sample_size){
uint64_t pos= url_ftell(pb) - 8;
if(!st->index_entries || !st->nb_index_entries || st->index_entries[st->nb_index_entries - 1].pos < pos){
- av_add_index_entry(st, pos, ast->frame_offset / FFMAX(1, ast->sample_size), size, 0, AVINDEX_KEYFRAME);
+ av_add_index_entry(st, pos, ast->frame_offset, size, 0, AVINDEX_KEYFRAME);
}
}
goto resync;
@@ -981,8 +982,8 @@ static int avi_read_idx1(AVFormatContext *s, int size)
if(last_pos == pos)
avi->non_interleaved= 1;
- else
- av_add_index_entry(st, pos, ast->cum_len / FFMAX(1, ast->sample_size), len, 0, (flags&AVIIF_INDEX) ? AVINDEX_KEYFRAME : 0);
+ else if(len || !ast->sample_size)
+ av_add_index_entry(st, pos, ast->cum_len, len, 0, (flags&AVIIF_INDEX) ? AVINDEX_KEYFRAME : 0);
if(ast->sample_size)
ast->cum_len += len;
else if (st->codec->block_align)
@@ -1078,6 +1079,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
AVStream *st;
int i, index;
int64_t pos;
+ AVIStream *ast;
if (!avi->index_loaded) {
/* we only load the index on demand */
@@ -1087,13 +1089,14 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
assert(stream_index>= 0);
st = s->streams[stream_index];
- index= av_index_search_timestamp(st, timestamp, flags);
+ ast= st->priv_data;
+ index= av_index_search_timestamp(st, timestamp * FFMAX(ast->sample_size, 1), flags);
if(index<0)
return -1;
/* find the position */
pos = st->index_entries[index].pos;
- timestamp = st->index_entries[index].timestamp;
+ timestamp = st->index_entries[index].timestamp / FFMAX(ast->sample_size, 1);
// av_log(s, AV_LOG_DEBUG, "XX %"PRId64" %d %"PRId64"\n", timestamp, index, st->index_entries[index].timestamp);
@@ -1128,7 +1131,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
assert((int64_t)st2->time_base.num*ast2->rate == (int64_t)st2->time_base.den*ast2->scale);
index = av_index_search_timestamp(
st2,
- av_rescale_q(timestamp, st->time_base, st2->time_base),
+ av_rescale_q(timestamp, st->time_base, st2->time_base) * FFMAX(ast2->sample_size, 1),
flags | AVSEEK_FLAG_BACKWARD);
if(index<0)
index=0;
@@ -1143,8 +1146,6 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
// av_log(s, AV_LOG_DEBUG, "%"PRId64" %d %"PRId64"\n", timestamp, index, st2->index_entries[index].timestamp);
/* extract the current frame number */
ast2->frame_offset = st2->index_entries[index].timestamp;
- if(ast2->sample_size)
- ast2->frame_offset *=ast2->sample_size;
}
/* do the seek */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/avio.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/avio.h
index d44e300497..5aa24ca0a7 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/avio.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/avio.h
@@ -333,11 +333,13 @@ int url_fdopen(ByteIOContext **s, URLContext *h);
/** @warning must be called before any I/O */
int url_setbufsize(ByteIOContext *s, int buf_size);
+#if LIBAVFORMAT_VERSION_MAJOR < 53
/** Reset the buffer for reading or writing.
* @note Will drop any data currently in the buffer without transmitting it.
* @param flags URL_RDONLY to set up the buffer for reading, or URL_WRONLY
* to set up the buffer for writing. */
int url_resetbuf(ByteIOContext *s, int flags);
+#endif
/** @note when opened as read/write, the buffers are only used for
writing */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aviobuf.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aviobuf.c
index c670d48c98..06c7a10749 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aviobuf.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aviobuf.c
@@ -28,6 +28,9 @@
#define IO_BUFFER_SIZE 32768
static void fill_buffer(ByteIOContext *s);
+#if LIBAVFORMAT_VERSION_MAJOR >= 53
+static int url_resetbuf(ByteIOContext *s, int flags);
+#endif
int init_put_byte(ByteIOContext *s,
unsigned char *buffer,
@@ -104,12 +107,8 @@ void put_byte(ByteIOContext *s, int b)
void put_buffer(ByteIOContext *s, const unsigned char *buf, int size)
{
- int len;
-
while (size > 0) {
- len = (s->buf_end - s->buf_ptr);
- if (len > size)
- len = size;
+ int len = FFMIN(s->buf_end - s->buf_ptr, size);
memcpy(s->buf_ptr, buf, len);
s->buf_ptr += len;
@@ -587,11 +586,19 @@ int url_setbufsize(ByteIOContext *s, int buf_size)
return 0;
}
+#if LIBAVFORMAT_VERSION_MAJOR < 53
int url_resetbuf(ByteIOContext *s, int flags)
+#else
+static int url_resetbuf(ByteIOContext *s, int flags)
+#endif
{
+#if LIBAVFORMAT_VERSION_MAJOR < 53
URLContext *h = s->opaque;
if ((flags & URL_RDWR) || (h && h->flags != flags && !h->flags & URL_RDWR))
return AVERROR(EINVAL);
+#else
+ assert(flags == URL_WRONLY || flags == URL_RDONLY);
+#endif
if (flags & URL_WRONLY) {
s->buf_end = s->buffer + s->buffer_size;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/caf.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/caf.c
index 98f7f78fa3..931a779469 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/caf.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/caf.c
@@ -54,5 +54,5 @@ const AVCodecTag ff_codec_caf_tags[] = {
/*{ MPEG4CELP MKBETAG('c','e','l','p') },*/
/*{ MPEG4HVXC MKBETAG('h','v','x','c') },*/
/*{ MPEG4TwinVQ MKBETAG('t','w','v','q') },*/
- { 0, 0 },
+ { CODEC_ID_NONE, 0 },
};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/cdg.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/cdg.c
new file mode 100644
index 0000000000..f40028d2f9
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/cdg.c
@@ -0,0 +1,66 @@
+/*
+ * CD Graphics Demuxer
+ * Copyright (c) 2009 Michael Tison
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avformat.h"
+
+#define CDG_PACKET_SIZE 24
+
+static int read_header(AVFormatContext *s, AVFormatParameters *ap)
+{
+ AVStream *vst;
+ int ret;
+
+ vst = av_new_stream(s, 0);
+ if (!vst)
+ return AVERROR(ENOMEM);
+
+ vst->codec->codec_type = CODEC_TYPE_VIDEO;
+ vst->codec->codec_id = CODEC_ID_CDGRAPHICS;
+
+ /// 75 sectors/sec * 4 packets/sector = 300 packets/sec
+ av_set_pts_info(vst, 32, 1, 300);
+
+ ret = url_fsize(s->pb);
+ if (ret > 0)
+ vst->duration = (ret * vst->time_base.den) / (CDG_PACKET_SIZE * 300);
+
+ return 0;
+}
+
+static int read_packet(AVFormatContext *s, AVPacket *pkt)
+{
+ int ret;
+
+ ret = av_get_packet(s->pb, pkt, CDG_PACKET_SIZE);
+
+ pkt->stream_index = 0;
+ return ret;
+}
+
+AVInputFormat cdg_demuxer = {
+ "cdg",
+ NULL_IF_CONFIG_SMALL("CD Graphics Format"),
+ 0,
+ NULL,
+ read_header,
+ read_packet,
+ .extensions = "cdg"
+};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/dv.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/dv.c
index 8e0a83492e..085e8d2d06 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/dv.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/dv.c
@@ -322,7 +322,7 @@ int dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
uint8_t *ppcm[4] = {0};
if (buf_size < DV_PROFILE_BYTES ||
- !(c->sys = dv_frame_profile(c->sys, buf, buf_size)) ||
+ !(c->sys = ff_dv_frame_profile(c->sys, buf, buf_size)) ||
buf_size < c->sys->frame_size) {
return -1; /* Broken frame, or not enough data */
}
@@ -368,7 +368,7 @@ static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c,
int64_t timestamp, int flags)
{
// FIXME: sys may be wrong if last dv_read_packet() failed (buffer is junk)
- const DVprofile* sys = dv_codec_profile(c->vst->codec);
+ const DVprofile* sys = ff_dv_codec_profile(c->vst->codec);
int64_t offset;
int64_t size = url_fsize(s->pb);
int64_t max_offset = ((size-1) / sys->frame_size) * sys->frame_size;
@@ -431,7 +431,7 @@ static int dv_read_header(AVFormatContext *s,
url_fseek(s->pb, -DV_PROFILE_BYTES, SEEK_CUR) < 0)
return AVERROR(EIO);
- c->dv_demux->sys = dv_frame_profile(c->dv_demux->sys, c->buf, DV_PROFILE_BYTES);
+ c->dv_demux->sys = ff_dv_frame_profile(c->dv_demux->sys, c->buf, DV_PROFILE_BYTES);
if (!c->dv_demux->sys) {
av_log(s, AV_LOG_ERROR, "Can't determine profile of DV input stream.\n");
return -1;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/dvenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/dvenc.c
index c87697dd13..351062b76a 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/dvenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/dvenc.c
@@ -321,7 +321,7 @@ DVMuxContext* dv_init_mux(AVFormatContext* s)
c->ast[i]->codec->channels != 2))
goto bail_out;
}
- c->sys = dv_codec_profile(vst->codec);
+ c->sys = ff_dv_codec_profile(vst->codec);
if (!c->sys)
goto bail_out;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmdec.c
index dc4da29f09..09f5779f68 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmdec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmdec.c
@@ -336,11 +336,25 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
codec->rc_buffer_aggressivity = av_int2dbl(get_be64(pb));
codec->codec_tag = get_be32(pb);
codec->thread_count = get_byte(pb);
+ codec->coder_type = get_be32(pb);
+ codec->me_cmp = get_be32(pb);
+ codec->partitions = get_be32(pb);
+ codec->me_subpel_quality = get_be32(pb);
+ codec->me_range = get_be32(pb);
+ codec->keyint_min = get_be32(pb);
+ codec->scenechange_threshold = get_be32(pb);
+ codec->b_frame_strategy = get_be32(pb);
+ codec->qcompress = av_int2dbl(get_be64(pb));
+ codec->qblur = av_int2dbl(get_be64(pb));
+ codec->max_qdiff = get_be32(pb);
+ codec->refs = get_be32(pb);
+ codec->directpred = get_be32(pb);
break;
case CODEC_TYPE_AUDIO:
codec->sample_rate = get_be32(pb);
codec->channels = get_le16(pb);
codec->frame_size = get_le16(pb);
+ codec->sample_fmt = get_le16(pb);
break;
default:
goto fail;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmenc.c
index 3de4984dfe..52d55d6936 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmenc.c
@@ -154,11 +154,25 @@ static int ffm_write_header(AVFormatContext *s)
put_be64(pb, av_dbl2int(codec->rc_buffer_aggressivity));
put_be32(pb, codec->codec_tag);
put_byte(pb, codec->thread_count);
+ put_be32(pb, codec->coder_type);
+ put_be32(pb, codec->me_cmp);
+ put_be32(pb, codec->partitions);
+ put_be32(pb, codec->me_subpel_quality);
+ put_be32(pb, codec->me_range);
+ put_be32(pb, codec->keyint_min);
+ put_be32(pb, codec->scenechange_threshold);
+ put_be32(pb, codec->b_frame_strategy);
+ put_be64(pb, av_dbl2int(codec->qcompress));
+ put_be64(pb, av_dbl2int(codec->qblur));
+ put_be32(pb, codec->max_qdiff);
+ put_be32(pb, codec->refs);
+ put_be32(pb, codec->directpred);
break;
case CODEC_TYPE_AUDIO:
put_be32(pb, codec->sample_rate);
put_le16(pb, codec->channels);
put_le16(pb, codec->frame_size);
+ put_le16(pb, codec->sample_fmt);
break;
default:
return -1;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/flvdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/flvdec.c
index b3b3cc1930..9c4314953b 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/flvdec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/flvdec.c
@@ -50,7 +50,7 @@ static void flv_set_audio_codec(AVFormatContext *s, AVStream *astream, int flv_c
switch(flv_codecid) {
//no distinction between S16 and S8 PCM codec flags
case FLV_CODECID_PCM:
- acodec->codec_id = acodec->bits_per_coded_sample == 8 ? CODEC_ID_PCM_S8 :
+ acodec->codec_id = acodec->bits_per_coded_sample == 8 ? CODEC_ID_PCM_U8 :
#if HAVE_BIGENDIAN
CODEC_ID_PCM_S16BE;
#else
@@ -58,7 +58,7 @@ static void flv_set_audio_codec(AVFormatContext *s, AVStream *astream, int flv_c
#endif
break;
case FLV_CODECID_PCM_LE:
- acodec->codec_id = acodec->bits_per_coded_sample == 8 ? CODEC_ID_PCM_S8 : CODEC_ID_PCM_S16LE; break;
+ acodec->codec_id = acodec->bits_per_coded_sample == 8 ? CODEC_ID_PCM_U8 : CODEC_ID_PCM_S16LE; break;
case FLV_CODECID_AAC : acodec->codec_id = CODEC_ID_AAC; break;
case FLV_CODECID_ADPCM: acodec->codec_id = CODEC_ID_ADPCM_SWF; break;
case FLV_CODECID_SPEEX:
@@ -82,6 +82,7 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream, int flv_co
switch(flv_codecid) {
case FLV_CODECID_H263 : vcodec->codec_id = CODEC_ID_FLV1 ; break;
case FLV_CODECID_SCREEN: vcodec->codec_id = CODEC_ID_FLASHSV; break;
+ case FLV_CODECID_SCREEN2: vcodec->codec_id = CODEC_ID_FLASHSV2; break;
case FLV_CODECID_VP6 : vcodec->codec_id = CODEC_ID_VP6F ;
case FLV_CODECID_VP6A :
if(flv_codecid == FLV_CODECID_VP6A)
@@ -410,9 +411,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
MPEG4AudioConfig cfg;
ff_mpeg4audio_get_config(&cfg, st->codec->extradata,
st->codec->extradata_size);
- if (cfg.chan_config > 7)
- return -1;
- st->codec->channels = ff_mpeg4audio_channels[cfg.chan_config];
+ st->codec->channels = cfg.channels;
st->codec->sample_rate = cfg.sample_rate;
dprintf(s, "mp4a config channels %d sample rate %d\n",
st->codec->channels, st->codec->sample_rate);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/flvenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/flvenc.c
index f616889a34..c255ff0512 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/flvenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/flvenc.c
@@ -29,6 +29,7 @@
static const AVCodecTag flv_video_codec_ids[] = {
{CODEC_ID_FLV1, FLV_CODECID_H263 },
{CODEC_ID_FLASHSV, FLV_CODECID_SCREEN},
+ {CODEC_ID_FLASHSV2, FLV_CODECID_SCREEN2},
{CODEC_ID_VP6F, FLV_CODECID_VP6 },
{CODEC_ID_VP6, FLV_CODECID_VP6 },
{CODEC_ID_H264, FLV_CODECID_H264 },
@@ -37,12 +38,13 @@ static const AVCodecTag flv_video_codec_ids[] = {
static const AVCodecTag flv_audio_codec_ids[] = {
{CODEC_ID_MP3, FLV_CODECID_MP3 >> FLV_AUDIO_CODECID_OFFSET},
- {CODEC_ID_PCM_S8, FLV_CODECID_PCM >> FLV_AUDIO_CODECID_OFFSET},
+ {CODEC_ID_PCM_U8, FLV_CODECID_PCM >> FLV_AUDIO_CODECID_OFFSET},
{CODEC_ID_PCM_S16BE, FLV_CODECID_PCM >> FLV_AUDIO_CODECID_OFFSET},
{CODEC_ID_PCM_S16LE, FLV_CODECID_PCM_LE >> FLV_AUDIO_CODECID_OFFSET},
{CODEC_ID_ADPCM_SWF, FLV_CODECID_ADPCM >> FLV_AUDIO_CODECID_OFFSET},
{CODEC_ID_AAC, FLV_CODECID_AAC >> FLV_AUDIO_CODECID_OFFSET},
{CODEC_ID_NELLYMOSER, FLV_CODECID_NELLYMOSER >> FLV_AUDIO_CODECID_OFFSET},
+ {CODEC_ID_SPEEX, FLV_CODECID_SPEEX >> FLV_AUDIO_CODECID_OFFSET},
{CODEC_ID_NONE, 0}
};
@@ -59,7 +61,22 @@ static int get_audio_flags(AVCodecContext *enc){
if (enc->codec_id == CODEC_ID_AAC) // specs force these parameters
return FLV_CODECID_AAC | FLV_SAMPLERATE_44100HZ | FLV_SAMPLESSIZE_16BIT | FLV_STEREO;
- else {
+ else if (enc->codec_id == CODEC_ID_SPEEX) {
+ if (enc->sample_rate != 16000) {
+ av_log(enc, AV_LOG_ERROR, "flv only supports wideband (16kHz) Speex audio\n");
+ return -1;
+ }
+ if (enc->channels != 1) {
+ av_log(enc, AV_LOG_ERROR, "flv only supports mono Speex audio\n");
+ return -1;
+ }
+ if (enc->frame_size / 320 > 8) {
+ av_log(enc, AV_LOG_WARNING, "Warning: Speex stream has more than "
+ "8 frames per packet. Adobe Flash "
+ "Player cannot handle this!\n");
+ }
+ return FLV_CODECID_SPEEX | FLV_SAMPLERATE_11025HZ | FLV_SAMPLESSIZE_16BIT;
+ } else {
switch (enc->sample_rate) {
case 44100:
flags |= FLV_SAMPLERATE_44100HZ;
@@ -90,7 +107,7 @@ static int get_audio_flags(AVCodecContext *enc){
case CODEC_ID_MP3:
flags |= FLV_CODECID_MP3 | FLV_SAMPLESSIZE_16BIT;
break;
- case CODEC_ID_PCM_S8:
+ case CODEC_ID_PCM_U8:
flags |= FLV_CODECID_PCM | FLV_SAMPLESSIZE_8BIT;
break;
case CODEC_ID_PCM_S16BE:
@@ -231,7 +248,7 @@ static int flv_write_header(AVFormatContext *s)
put_amf_double(pb, audio_enc->sample_rate);
put_amf_string(pb, "audiosamplesize");
- put_amf_double(pb, audio_enc->codec_id == CODEC_ID_PCM_S8 ? 8 : 16);
+ put_amf_double(pb, audio_enc->codec_id == CODEC_ID_PCM_U8 ? 8 : 16);
put_amf_string(pb, "stereo");
put_amf_bool(pb, audio_enc->channels == 2);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/gxfenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/gxfenc.c
index 501691e78d..603f595b32 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/gxfenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/gxfenc.c
@@ -93,7 +93,7 @@ static const AVCodecTag gxf_media_types[] = {
{ CODEC_ID_MPEG2VIDEO, 20 }, /* MPEG HD */
{ CODEC_ID_MPEG1VIDEO, 22 }, /* NTSC */
{ CODEC_ID_MPEG1VIDEO, 23 }, /* PAL */
- { 0, 0 },
+ { CODEC_ID_NONE, 0 },
};
#define SERVER_PATH "EXT:/PDR/default/"
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v1.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v1.c
index cf5cb950c9..845697f13e 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v1.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v1.c
@@ -21,6 +21,7 @@
#include "id3v1.h"
#include "libavcodec/avcodec.h"
+#include "libavutil/avstring.h"
const char * const ff_id3v1_genre_str[ID3v1_GENRE_MAX + 1] = {
[0] = "Blues",
@@ -149,6 +150,28 @@ const char * const ff_id3v1_genre_str[ID3v1_GENRE_MAX + 1] = {
[123] = "A capella",
[124] = "Euro-House",
[125] = "Dance Hall",
+ [126] = "Goa",
+ [127] = "Drum & Bass",
+ [128] = "Club-House",
+ [129] = "Hardcore",
+ [130] = "Terror",
+ [131] = "Indie",
+ [132] = "BritPop",
+ [133] = "Negerpunk",
+ [134] = "Polsk Punk",
+ [135] = "Beat",
+ [136] = "Christian Gangsta",
+ [137] = "Heavy Metal",
+ [138] = "Black Metal",
+ [139] = "Crossover",
+ [140] = "Contemporary Christian",
+ [141] = "Christian Rock",
+ [142] = "Merengue",
+ [143] = "Salsa",
+ [144] = "Thrash Metal",
+ [145] = "Anime",
+ [146] = "JPop",
+ [147] = "SynthPop",
};
static void get_string(AVFormatContext *s, const char *key,
@@ -179,7 +202,6 @@ static void get_string(AVFormatContext *s, const char *key,
*/
static int parse_tag(AVFormatContext *s, const uint8_t *buf)
{
- char str[5];
int genre;
if (!(buf[0] == 'T' &&
@@ -187,14 +209,12 @@ static int parse_tag(AVFormatContext *s, const uint8_t *buf)
buf[2] == 'G'))
return -1;
get_string(s, "title", buf + 3, 30);
- get_string(s, "author", buf + 33, 30);
+ get_string(s, "artist", buf + 33, 30);
get_string(s, "album", buf + 63, 30);
get_string(s, "year", buf + 93, 4);
get_string(s, "comment", buf + 97, 30);
- if (buf[125] == 0 && buf[126] != 0) {
- snprintf(str, sizeof(str), "%d", buf[126]);
- av_metadata_set(&s->metadata, "track", str);
- }
+ if (buf[125] == 0 && buf[126] != 0)
+ av_metadata_set2(&s->metadata, "track", av_d2str(buf[126]), AV_METADATA_DONT_STRDUP_VAL);
genre = buf[127];
if (genre <= ID3v1_GENRE_MAX)
av_metadata_set(&s->metadata, "genre", ff_id3v1_genre_str[genre]);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v1.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v1.h
index 206cab78ea..8eb58be2d1 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v1.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v1.h
@@ -26,7 +26,7 @@
#define ID3v1_TAG_SIZE 128
-#define ID3v1_GENRE_MAX 125
+#define ID3v1_GENRE_MAX 147
/**
* ID3v1 genres
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v2.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v2.c
index 88472e710e..7cf3b22215 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v2.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v2.c
@@ -213,7 +213,12 @@ void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t flags)
if (tag[0] == 'T')
read_ttag(s, tlen, tag);
-
+ else if (!tag[0]) {
+ if (tag[1])
+ av_log(s, AV_LOG_WARNING, "invalid frame id, assuming padding");
+ url_fskip(s->pb, len);
+ break;
+ }
/* Skip to end of tag */
url_fseek(s->pb, next, SEEK_SET);
}
@@ -229,17 +234,23 @@ void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t flags)
const AVMetadataConv ff_id3v2_metadata_conv[] = {
{ "TALB", "album"},
+ { "TAL", "album"},
{ "TCOM", "composer"},
{ "TCON", "genre"},
+ { "TCO", "genre"},
{ "TCOP", "copyright"},
{ "TDRL", "date"},
{ "TENC", "encoder"},
+ { "TEN", "encoder"},
{ "TIT2", "title"},
+ { "TT2", "title"},
{ "TLAN", "language"},
- { "TPE1", "author"},
+ { "TPE1", "artist"},
+ { "TP1", "artist"},
{ "TPOS", "disc"},
{ "TPUB", "publisher"},
{ "TRCK", "track"},
+ { "TRK", "track"},
{ "TSOA", "albumsort"},
{ "TSOP", "authorsort"},
{ "TSOT", "titlesort"},
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v2.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v2.h
index 7018ebbb0b..70030d297f 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v2.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/id3v2.h
@@ -58,6 +58,6 @@ extern const AVMetadataConv ff_id3v2_metadata_conv[];
* A list of ID3v2.4 text information frames.
* http://www.id3.org/id3v2.4.0-frames
*/
-extern const char const ff_id3v2_tags[][4];
+extern const char ff_id3v2_tags[][4];
#endif /* AVFORMAT_ID3V2_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/img2.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/img2.c
index a90381dc4b..9fb8bc4cbf 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/img2.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/img2.c
@@ -128,7 +128,9 @@ static int find_image_range(int *pfirst_index, int *plast_index,
if (av_get_frame_filename(buf, sizeof(buf), path, first_index) < 0){
*pfirst_index =
*plast_index = 1;
- return 0;
+ if(url_exist(buf))
+ return 0;
+ return -1;
}
if (url_exist(buf))
break;
@@ -221,7 +223,7 @@ static int img_read_header(AVFormatContext *s1, AVFormatParameters *ap)
if (!s->is_pipe) {
if (find_image_range(&first_index, &last_index, s->path) < 0)
- return AVERROR(EIO);
+ return AVERROR(ENOENT);
s->img_first = first_index;
s->img_last = last_index;
s->img_number = first_index;
@@ -341,8 +343,10 @@ static int img_write_packet(AVFormatContext *s, AVPacket *pkt)
if (!img->is_pipe) {
if (av_get_frame_filename(filename, sizeof(filename),
- img->path, img->img_number) < 0 && img->img_number>1)
+ img->path, img->img_number) < 0 && img->img_number>1) {
+ av_log(s, AV_LOG_ERROR, "Could not get frame filename from pattern\n");
return AVERROR(EIO);
+ }
for(i=0; i<3; i++){
if (url_fopen(&pb[i], filename, URL_WRONLY) < 0) {
av_log(s, AV_LOG_ERROR, "Could not open file : %s\n",filename);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/isom.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/isom.c
index 23d716fef3..f21cc5fbd5 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/isom.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/isom.c
@@ -32,6 +32,7 @@ const AVCodecTag ff_mp4_obj_type[] = {
{ CODEC_ID_MPEG4 , 0x20 },
{ CODEC_ID_H264 , 0x21 },
{ CODEC_ID_AAC , 0x40 },
+ { CODEC_ID_MP4ALS , 0x40 }, /* 14496-3 ALS */
{ CODEC_ID_MPEG2VIDEO, 0x61 }, /* MPEG2 Main */
{ CODEC_ID_MPEG2VIDEO, 0x60 }, /* MPEG2 Simple */
{ CODEC_ID_MPEG2VIDEO, 0x62 }, /* MPEG2 SNR */
@@ -54,7 +55,7 @@ const AVCodecTag ff_mp4_obj_type[] = {
{ CODEC_ID_VORBIS , 0xDD }, /* non standard, gpac uses it */
{ CODEC_ID_DVD_SUBTITLE, 0xE0 }, /* non standard, see unsupported-embedded-subs-2.mp4 */
{ CODEC_ID_QCELP , 0xE1 },
- { 0, 0 },
+ { CODEC_ID_NONE , 0 },
};
const AVCodecTag codec_movvideo_tags[] = {
@@ -64,7 +65,9 @@ const AVCodecTag codec_movvideo_tags[] = {
{ CODEC_ID_RAWVIDEO, MKTAG('y', 'u', 'v', '2') }, /* Uncompressed YUV422 */
{ CODEC_ID_RAWVIDEO, MKTAG('A', 'V', 'U', 'I') }, /* YUV with alpha-channel (AVID Uncompressed) */
{ CODEC_ID_RAWVIDEO, MKTAG('2', 'v', 'u', 'y') }, /* UNCOMPRESSED 8BIT 4:2:2 */
+ { CODEC_ID_RAWVIDEO, MKTAG('y', 'u', 'v', 's') }, /* same as 2vuy but byte swapped */
+ { CODEC_ID_R210, MKTAG('r', '2', '1', '0') }, /* UNCOMPRESSED 10BIT RGB */
{ CODEC_ID_V210, MKTAG('v', '2', '1', '0') }, /* UNCOMPRESSED 10BIT 4:2:2 */
{ CODEC_ID_MJPEG, MKTAG('j', 'p', 'e', 'g') }, /* PhotoJPEG */
@@ -183,7 +186,9 @@ const AVCodecTag codec_movaudio_tags[] = {
{ CODEC_ID_PCM_S16LE, MKTAG('s', 'o', 'w', 't') }, /* */
{ CODEC_ID_PCM_S16LE, MKTAG('l', 'p', 'c', 'm') },
{ CODEC_ID_PCM_F32BE, MKTAG('f', 'l', '3', '2') },
+ { CODEC_ID_PCM_F32LE, MKTAG('f', 'l', '3', '2') },
{ CODEC_ID_PCM_F64BE, MKTAG('f', 'l', '6', '4') },
+ { CODEC_ID_PCM_F64LE, MKTAG('f', 'l', '6', '4') },
{ CODEC_ID_PCM_S8, MKTAG('s', 'o', 'w', 't') },
{ CODEC_ID_PCM_U8, MKTAG('r', 'a', 'w', ' ') }, /* 8 bits unsigned */
{ CODEC_ID_PCM_U8, MKTAG('N', 'O', 'N', 'E') }, /* uncompressed */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/isom.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/isom.h
index 7799a09257..abd5f97f56 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/isom.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/isom.h
@@ -56,6 +56,10 @@ typedef struct {
typedef struct {
uint32_t type;
char *path;
+ char *dir;
+ char volume[28];
+ char filename[64];
+ int16_t nlvl_to, nlvl_from;
} MOVDref;
typedef struct {
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/iv8.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/iv8.c
new file mode 100644
index 0000000000..33894ad9f8
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/iv8.c
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2009 Michael Niedermayer
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avformat.h"
+
+
+static int probe(AVProbeData *p)
+{
+ // the single file i have starts with that, i dont know if others do too
+ if( p->buf[0] == 1
+ && p->buf[1] == 1
+ && p->buf[2] == 3
+ && p->buf[3] == 0xB8
+ && p->buf[4] == 0x80
+ && p->buf[5] == 0x60
+ )
+ return AVPROBE_SCORE_MAX-2;
+
+ return 0;
+}
+
+static int read_header(AVFormatContext *s, AVFormatParameters *ap)
+{
+ AVStream *st;
+
+ st = av_new_stream(s, 0);
+ if (!st)
+ return AVERROR(ENOMEM);
+
+ st->codec->codec_type = CODEC_TYPE_VIDEO;
+ st->codec->codec_id = CODEC_ID_MPEG4;
+ st->need_parsing = AVSTREAM_PARSE_FULL;
+ av_set_pts_info(st, 64, 1, 90000);
+
+ return 0;
+
+}
+
+static int read_packet(AVFormatContext *s, AVPacket *pkt)
+{
+ int ret, size, pts;
+
+ get_be16(s->pb); // 257
+ size= get_be16(s->pb);
+
+ get_be16(s->pb); //some flags, 0x80 indicates end of frame
+ get_be16(s->pb); //packet number
+ pts=get_be32(s->pb);
+ get_be32(s->pb); //6A 13 E3 88
+
+ size -= 12;
+ if(size<1)
+ return -1;
+
+ ret= av_get_packet(s->pb, pkt, size);
+
+ pkt->pts= pkt->dts= pts;
+ pkt->pos-=16;
+
+ pkt->stream_index = 0;
+
+ return ret;
+}
+
+AVInputFormat iv8_demuxer = {
+ "iv8",
+ NULL_IF_CONFIG_SMALL("A format generated by IndigoVision 8000 video server"),
+ 0,
+ probe,
+ read_header,
+ read_packet,
+ .flags= AVFMT_GENERIC_INDEX,
+ .value = CODEC_ID_MPEG4,
+};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/matroskaenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/matroskaenc.c
index a03b11bc3e..c119518967 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/matroskaenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/matroskaenc.c
@@ -619,6 +619,50 @@ static int mkv_write_tracks(AVFormatContext *s)
return 0;
}
+static int mkv_write_chapters(AVFormatContext *s)
+{
+ MatroskaMuxContext *mkv = s->priv_data;
+ ByteIOContext *pb = s->pb;
+ ebml_master chapters, editionentry;
+ AVRational scale = {1, 1E9};
+ int i, ret;
+
+ if (!s->nb_chapters)
+ return 0;
+
+ ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_CHAPTERS, url_ftell(pb));
+ if (ret < 0) return ret;
+
+ chapters = start_ebml_master(pb, MATROSKA_ID_CHAPTERS , 0);
+ editionentry = start_ebml_master(pb, MATROSKA_ID_EDITIONENTRY, 0);
+ put_ebml_uint(pb, MATROSKA_ID_EDITIONFLAGDEFAULT, 1);
+ put_ebml_uint(pb, MATROSKA_ID_EDITIONFLAGHIDDEN , 0);
+ for (i = 0; i < s->nb_chapters; i++) {
+ ebml_master chapteratom, chapterdisplay;
+ AVChapter *c = s->chapters[i];
+ AVMetadataTag *t = NULL;
+
+ chapteratom = start_ebml_master(pb, MATROSKA_ID_CHAPTERATOM, 0);
+ put_ebml_uint(pb, MATROSKA_ID_CHAPTERUID, c->id);
+ put_ebml_uint(pb, MATROSKA_ID_CHAPTERTIMESTART,
+ av_rescale_q(c->start, c->time_base, scale));
+ put_ebml_uint(pb, MATROSKA_ID_CHAPTERTIMEEND,
+ av_rescale_q(c->end, c->time_base, scale));
+ put_ebml_uint(pb, MATROSKA_ID_CHAPTERFLAGHIDDEN , 0);
+ put_ebml_uint(pb, MATROSKA_ID_CHAPTERFLAGENABLED, 1);
+ if ((t = av_metadata_get(c->metadata, "title", NULL, 0))) {
+ chapterdisplay = start_ebml_master(pb, MATROSKA_ID_CHAPTERDISPLAY, 0);
+ put_ebml_string(pb, MATROSKA_ID_CHAPSTRING, t->value);
+ put_ebml_string(pb, MATROSKA_ID_CHAPLANG , "und");
+ end_ebml_master(pb, chapterdisplay);
+ }
+ end_ebml_master(pb, chapteratom);
+ }
+ end_ebml_master(pb, editionentry);
+ end_ebml_master(pb, chapters);
+ return 0;
+}
+
static int mkv_write_header(AVFormatContext *s)
{
MatroskaMuxContext *mkv = s->priv_data;
@@ -678,6 +722,9 @@ static int mkv_write_header(AVFormatContext *s)
ret = mkv_write_tracks(s);
if (ret < 0) return ret;
+ ret = mkv_write_chapters(s);
+ if (ret < 0) return ret;
+
ret = mkv_add_seekhead_entry(mkv->cluster_seekhead, MATROSKA_ID_CLUSTER, url_ftell(pb));
if (ret < 0) return ret;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/metadata.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/metadata.c
index 54c66c9d88..080ebcde88 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/metadata.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/metadata.c
@@ -46,7 +46,7 @@ av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int f
return NULL;
}
-int av_metadata_set(AVMetadata **pm, const char *key, const char *value)
+int av_metadata_set2(AVMetadata **pm, const char *key, const char *value, int flags)
{
AVMetadata *m= *pm;
AVMetadataTag *tag= av_metadata_get(m, key, NULL, AV_METADATA_MATCH_CASE);
@@ -66,7 +66,13 @@ int av_metadata_set(AVMetadata **pm, const char *key, const char *value)
return AVERROR(ENOMEM);
}
if(value){
+ if(flags & AV_METADATA_DONT_STRDUP_KEY){
+ m->elems[m->count].key = key;
+ }else
m->elems[m->count].key = av_strdup(key );
+ if(flags & AV_METADATA_DONT_STRDUP_VAL){
+ m->elems[m->count].value= value;
+ }else
m->elems[m->count].value= av_strdup(value);
m->count++;
}
@@ -78,6 +84,13 @@ int av_metadata_set(AVMetadata **pm, const char *key, const char *value)
return 0;
}
+#if LIBAVFORMAT_VERSION_MAJOR == 52
+int av_metadata_set(AVMetadata **pm, const char *key, const char *value)
+{
+ return av_metadata_set2(pm, key, value, 0);
+}
+#endif
+
void av_metadata_free(AVMetadata **pm)
{
AVMetadata *m= *pm;
@@ -107,16 +120,16 @@ static void metadata_conv(AVMetadata **pm, const AVMetadataConv *d_conv,
if (s_conv != d_conv) {
if (s_conv)
for (sc=s_conv; sc->native; sc++)
- if (!strcasecmp(key, sc->native)) {
- key = sc->generic;
- break;
- }
+ if (!strcasecmp(key, sc->native)) {
+ key = sc->generic;
+ break;
+ }
if (d_conv)
for (dc=d_conv; dc->native; dc++)
if (!strcasecmp(key, dc->generic)) {
- key = dc->native;
- break;
- }
+ key = dc->native;
+ break;
+ }
}
av_metadata_set(&dst, key, mtag->value);
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mov.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mov.c
index fdf921cb2a..345b9c47c2 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mov.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mov.c
@@ -106,8 +106,9 @@ static int mov_read_udta_string(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
switch (atom.type) {
case MKTAG(0xa9,'n','a','m'): key = "title"; break;
case MKTAG(0xa9,'a','u','t'):
- case MKTAG(0xa9,'A','R','T'):
- case MKTAG(0xa9,'w','r','t'): key = "author"; break;
+ case MKTAG(0xa9,'A','R','T'): key = "author"; break;
+ case MKTAG(0xa9,'w','r','t'): key = "composer"; break;
+ case MKTAG( 'c','p','r','t'):
case MKTAG(0xa9,'c','p','y'): key = "copyright"; break;
case MKTAG(0xa9,'c','m','t'):
case MKTAG(0xa9,'i','n','f'): key = "comment"; break;
@@ -115,7 +116,12 @@ static int mov_read_udta_string(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
case MKTAG(0xa9,'d','a','y'): key = "year"; break;
case MKTAG(0xa9,'g','e','n'): key = "genre"; break;
case MKTAG(0xa9,'t','o','o'):
- case MKTAG(0xa9,'e','n','c'): key = "muxer"; break;
+ case MKTAG(0xa9,'e','n','c'): key = "encoder"; break;
+ case MKTAG( 'd','e','s','c'): key = "description";break;
+ case MKTAG( 'l','d','e','s'): key = "synopsis"; break;
+ case MKTAG( 't','v','s','h'): key = "show"; break;
+ case MKTAG( 't','v','e','n'): key = "episode_id";break;
+ case MKTAG( 't','v','n','n'): key = "network"; break;
case MKTAG( 't','r','k','n'): key = "track";
parse = mov_metadata_trkn; break;
}
@@ -274,18 +280,33 @@ static int mov_read_dref(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
if (dref->type == MKTAG('a','l','i','s') && size > 150) {
/* macintosh alias record */
uint16_t volume_len, len;
- char volume[28];
int16_t type;
url_fskip(pb, 10);
volume_len = get_byte(pb);
volume_len = FFMIN(volume_len, 27);
- get_buffer(pb, volume, 27);
- volume[volume_len] = 0;
- av_log(c->fc, AV_LOG_DEBUG, "volume %s, len %d\n", volume, volume_len);
+ get_buffer(pb, dref->volume, 27);
+ dref->volume[volume_len] = 0;
+ av_log(c->fc, AV_LOG_DEBUG, "volume %s, len %d\n", dref->volume, volume_len);
- url_fskip(pb, 112);
+ url_fskip(pb, 12);
+
+ len = get_byte(pb);
+ len = FFMIN(len, 63);
+ get_buffer(pb, dref->filename, 63);
+ dref->filename[len] = 0;
+ av_log(c->fc, AV_LOG_DEBUG, "filename %s, len %d\n", dref->filename, len);
+
+ url_fskip(pb, 16);
+
+ /* read next level up_from_alias/down_to_target */
+ dref->nlvl_from = get_be16(pb);
+ dref->nlvl_to = get_be16(pb);
+ av_log(c->fc, AV_LOG_DEBUG, "nlvl from %d, nlvl to %d\n",
+ dref->nlvl_from, dref->nlvl_to);
+
+ url_fskip(pb, 16);
for (type = 0; type != -1 && url_ftell(pb) < next; ) {
type = get_be16(pb);
@@ -299,7 +320,7 @@ static int mov_read_dref(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
if (!dref->path)
return AVERROR(ENOMEM);
get_buffer(pb, dref->path, len);
- if (len > volume_len && !strncmp(dref->path, volume, volume_len)) {
+ if (len > volume_len && !strncmp(dref->path, dref->volume, volume_len)) {
len -= volume_len;
memmove(dref->path, dref->path+volume_len, len);
dref->path[len] = 0;
@@ -308,6 +329,17 @@ static int mov_read_dref(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
if (dref->path[j] == ':')
dref->path[j] = '/';
av_log(c->fc, AV_LOG_DEBUG, "path %s\n", dref->path);
+ } else if (type == 0) { // directory name
+ av_free(dref->dir);
+ dref->dir = av_malloc(len+1);
+ if (!dref->dir)
+ return AVERROR(ENOMEM);
+ get_buffer(pb, dref->dir, len);
+ dref->dir[len] = 0;
+ for (j = 0; j < len; j++)
+ if (dref->dir[j] == ':')
+ dref->dir[j] = '/';
+ av_log(c->fc, AV_LOG_DEBUG, "dir %s\n", dref->dir);
} else
url_fskip(pb, len);
}
@@ -419,7 +451,7 @@ int ff_mov_read_esds(AVFormatContext *fc, ByteIOContext *pb, MOVAtom atom)
get_be32(pb); /* avg bitrate */
st->codec->codec_id= ff_codec_get_id(ff_mp4_obj_type, object_type_id);
- dprintf(fc, "esds object type id %d\n", object_type_id);
+ dprintf(fc, "esds object type id 0x%02x\n", object_type_id);
len = mp4_read_descr(fc, pb, &tag);
if (tag == MP4DecSpecificDescrTag) {
dprintf(fc, "Specific MPEG4 header len=%d\n", len);
@@ -434,9 +466,7 @@ int ff_mov_read_esds(AVFormatContext *fc, ByteIOContext *pb, MOVAtom atom)
MPEG4AudioConfig cfg;
ff_mpeg4audio_get_config(&cfg, st->codec->extradata,
st->codec->extradata_size);
- if (cfg.chan_config > 7)
- return -1;
- st->codec->channels = ff_mpeg4audio_channels[cfg.chan_config];
+ st->codec->channels = cfg.channels;
if (cfg.object_type == 29 && cfg.sampling_index < 3) // old mp3on4
st->codec->sample_rate = ff_mpa_freq_tab[cfg.sampling_index];
else
@@ -1024,7 +1054,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
st->codec->channels = get_be32(pb);
get_be32(pb); /* always 0x7F000000 */
st->codec->bits_per_coded_sample = get_be32(pb); /* bits per channel if sound is uncompressed */
- flags = get_be32(pb); /* lcpm format specific flag */
+ flags = get_be32(pb); /* lpcm format specific flag */
sc->bytes_per_frame = get_be32(pb); /* bytes per audio packet if constant */
sc->samples_per_frame = get_be32(pb); /* lpcm frames per audio packet if constant */
if (format == MKTAG('l','p','c','m'))
@@ -1362,29 +1392,6 @@ static int mov_read_stts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
return 0;
}
-static int mov_read_cslg(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
-{
- AVStream *st;
- MOVStreamContext *sc;
-
- if (c->fc->nb_streams < 1)
- return 0;
- st = c->fc->streams[c->fc->nb_streams-1];
- sc = st->priv_data;
-
- get_be32(pb); // version + flags
-
- sc->dts_shift = get_be32(pb);
- dprintf(c->fc, "dts shift %d\n", sc->dts_shift);
-
- get_be32(pb); // least dts to pts delta
- get_be32(pb); // greatest dts to pts delta
- get_be32(pb); // pts start
- get_be32(pb); // pts end
-
- return 0;
-}
-
static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
{
AVStream *st;
@@ -1415,7 +1422,12 @@ static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
sc->ctts_data[i].count = count;
sc->ctts_data[i].duration= duration;
+ if (duration < 0)
+ sc->dts_shift = FFMAX(sc->dts_shift, -duration);
}
+
+ dprintf(c->fc, "dts shift %d\n", sc->dts_shift);
+
return 0;
}
@@ -1429,6 +1441,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
unsigned int stss_index = 0;
unsigned int stps_index = 0;
unsigned int i, j;
+ uint64_t stream_size = 0;
/* adjust first dts according to edit list */
if (sc->time_offset) {
@@ -1453,7 +1466,6 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
current_dts -= sc->dts_shift;
- st->nb_frames = sc->sample_count;
for (i = 0; i < sc->chunk_count; i++) {
current_offset = sc->chunk_offsets[i];
if (stsc_index + 1 < sc->stsc_count &&
@@ -1488,6 +1500,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
}
current_offset += sample_size;
+ stream_size += sample_size;
current_dts += sc->stts_data[stts_index].duration;
distance++;
stts_sample++;
@@ -1498,6 +1511,8 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
}
}
}
+ if (st->duration > 0)
+ st->codec->bit_rate = stream_size*8*sc->time_scale/st->duration;
} else {
for (i = 0; i < sc->chunk_count; i++) {
unsigned chunk_samples;
@@ -1543,6 +1558,52 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
}
}
+static int mov_open_dref(ByteIOContext **pb, char *src, MOVDref *ref)
+{
+ /* try absolute path */
+ if (!url_fopen(pb, ref->path, URL_RDONLY))
+ return 0;
+
+ /* try relative path */
+ if (ref->nlvl_to > 0 && ref->nlvl_from > 0) {
+ char filename[1024];
+ char *src_path;
+ int i, l;
+
+ /* find a source dir */
+ src_path = strrchr(src, '/');
+ if (src_path)
+ src_path++;
+ else
+ src_path = src;
+
+ /* find a next level down to target */
+ for (i = 0, l = strlen(ref->path) - 1; l >= 0; l--)
+ if (ref->path[l] == '/') {
+ if (i == ref->nlvl_to - 1)
+ break;
+ else
+ i++;
+ }
+
+ /* compose filename if next level down to target was found */
+ if (i == ref->nlvl_to - 1) {
+ memcpy(filename, src, src_path - src);
+ filename[src_path - src] = 0;
+
+ for (i = 1; i < ref->nlvl_from; i++)
+ av_strlcat(filename, "../", 1024);
+
+ av_strlcat(filename, ref->path + l + 1, 1024);
+
+ if (!url_fopen(pb, filename, URL_RDONLY))
+ return 0;
+ }
+ }
+
+ return AVERROR(ENOENT);
+};
+
static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
{
AVStream *st;
@@ -1569,8 +1630,12 @@ static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
return 0;
}
- if (!sc->time_scale)
+ if (!sc->time_scale) {
+ av_log(c->fc, AV_LOG_WARNING, "stream %d, timescale not set\n", st->index);
sc->time_scale = c->time_scale;
+ if (!sc->time_scale)
+ sc->time_scale = 1;
+ }
av_set_pts_info(st, 64, 1, sc->time_scale);
@@ -1584,9 +1649,13 @@ static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
mov_build_index(c, st);
if (sc->dref_id-1 < sc->drefs_count && sc->drefs[sc->dref_id-1].path) {
- if (url_fopen(&sc->pb, sc->drefs[sc->dref_id-1].path, URL_RDONLY) < 0)
- av_log(c->fc, AV_LOG_ERROR, "stream %d, error opening file %s: %s\n",
- st->index, sc->drefs[sc->dref_id-1].path, strerror(errno));
+ MOVDref *dref = &sc->drefs[sc->dref_id - 1];
+ if (mov_open_dref(&sc->pb, c->fc->filename, dref) < 0)
+ av_log(c->fc, AV_LOG_ERROR,
+ "stream %d, error opening alias: path='%s', dir='%s', "
+ "filename='%s', volume='%s', nlvl_from=%d, nlvl_to=%d\n",
+ st->index, dref->path, dref->dir, dref->filename,
+ dref->volume, dref->nlvl_from, dref->nlvl_to);
} else
sc->pb = c->fc->pb;
@@ -1970,7 +2039,6 @@ static int mov_read_elst(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
static const MOVParseTableEntry mov_default_parse_table[] = {
{ MKTAG('a','v','s','s'), mov_read_extradata },
{ MKTAG('c','o','6','4'), mov_read_stco },
-{ MKTAG('c','s','l','g'), mov_read_cslg },
{ MKTAG('c','t','t','s'), mov_read_ctts }, /* composition time to sample */
{ MKTAG('d','i','n','f'), mov_read_default },
{ MKTAG('d','r','e','f'), mov_read_dref },
@@ -2189,18 +2257,18 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
return 0;
}
-static int mov_seek_stream(AVStream *st, int64_t timestamp, int flags)
+static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp, int flags)
{
MOVStreamContext *sc = st->priv_data;
int sample, time_sample;
int i;
sample = av_index_search_timestamp(st, timestamp, flags);
- dprintf(st->codec, "stream %d, timestamp %"PRId64", sample %d\n", st->index, timestamp, sample);
+ dprintf(s, "stream %d, timestamp %"PRId64", sample %d\n", st->index, timestamp, sample);
if (sample < 0) /* not sure what to do */
return -1;
sc->current_sample = sample;
- dprintf(st->codec, "stream %d, found sample %d\n", st->index, sc->current_sample);
+ dprintf(s, "stream %d, found sample %d\n", st->index, sc->current_sample);
/* adjust ctts index */
if (sc->ctts_data) {
time_sample = 0;
@@ -2230,7 +2298,7 @@ static int mov_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti
sample_time = 0;
st = s->streams[stream_index];
- sample = mov_seek_stream(st, sample_time, flags);
+ sample = mov_seek_stream(s, st, sample_time, flags);
if (sample < 0)
return -1;
@@ -2243,7 +2311,7 @@ static int mov_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti
continue;
timestamp = av_rescale_q(seek_timestamp, s->streams[stream_index]->time_base, st->time_base);
- mov_seek_stream(st, timestamp, flags);
+ mov_seek_stream(s, st, timestamp, flags);
}
return 0;
}
@@ -2258,8 +2326,10 @@ static int mov_read_close(AVFormatContext *s)
MOVStreamContext *sc = st->priv_data;
av_freep(&sc->ctts_data);
- for (j = 0; j < sc->drefs_count; j++)
+ for (j = 0; j < sc->drefs_count; j++) {
av_freep(&sc->drefs[j].path);
+ av_freep(&sc->drefs[j].dir);
+ }
av_freep(&sc->drefs);
if (sc->pb && sc->pb != s->pb)
url_fclose(sc->pb);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/movenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/movenc.c
index 5cd014d264..fe26cf01c0 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/movenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/movenc.c
@@ -33,7 +33,7 @@
#include <assert.h>
#define MOV_INDEX_CLUSTER_SIZE 16384
-#define globalTimescale 1000
+#define MOV_TIMESCALE 1000
#define MODE_MP4 0x01
#define MODE_MOV 0x02
@@ -58,8 +58,8 @@ typedef struct MOVIentry {
typedef struct MOVIndex {
int mode;
int entry;
- long timescale;
- long time;
+ unsigned timescale;
+ uint64_t time;
int64_t trackDuration;
long sampleCount;
long sampleSize;
@@ -85,7 +85,6 @@ typedef struct MOVMuxContext {
int nb_streams;
int64_t mdat_pos;
uint64_t mdat_size;
- long timescale;
MOVTrack *tracks;
} MOVMuxContext;
@@ -360,6 +359,14 @@ static int mov_write_esds_tag(ByteIOContext *pb, MOVTrack *track) // Basic
return updateSize(pb, pos);
}
+static int mov_pcm_le_gt16(enum CodecID codec_id)
+{
+ return codec_id == CODEC_ID_PCM_S24LE ||
+ codec_id == CODEC_ID_PCM_S32LE ||
+ codec_id == CODEC_ID_PCM_F32LE ||
+ codec_id == CODEC_ID_PCM_F64LE;
+}
+
static int mov_write_wave_tag(ByteIOContext *pb, MOVTrack *track)
{
int64_t pos = url_ftell(pb);
@@ -377,8 +384,7 @@ static int mov_write_wave_tag(ByteIOContext *pb, MOVTrack *track)
put_tag(pb, "mp4a");
put_be32(pb, 0);
mov_write_esds_tag(pb, track);
- } else if (track->enc->codec_id == CODEC_ID_PCM_S24LE ||
- track->enc->codec_id == CODEC_ID_PCM_S32LE) {
+ } else if (mov_pcm_le_gt16(track->enc->codec_id)) {
mov_write_enda_tag(pb);
} else if (track->enc->codec_id == CODEC_ID_AMR_NB) {
mov_write_amr_tag(pb, track);
@@ -402,16 +408,53 @@ static int mov_write_glbl_tag(ByteIOContext *pb, MOVTrack *track)
return 8+track->vosLen;
}
+/**
+ * Compute flags for 'lpcm' tag.
+ * See CoreAudioTypes and AudioStreamBasicDescription at Apple.
+ */
+static int mov_get_lpcm_flags(enum CodecID codec_id)
+{
+ switch (codec_id) {
+ case CODEC_ID_PCM_F32BE:
+ case CODEC_ID_PCM_F64BE:
+ return 11;
+ case CODEC_ID_PCM_F32LE:
+ case CODEC_ID_PCM_F64LE:
+ return 9;
+ case CODEC_ID_PCM_U8:
+ return 10;
+ case CODEC_ID_PCM_S16BE:
+ case CODEC_ID_PCM_S24BE:
+ case CODEC_ID_PCM_S32BE:
+ return 14;
+ case CODEC_ID_PCM_S8:
+ case CODEC_ID_PCM_S16LE:
+ case CODEC_ID_PCM_S24LE:
+ case CODEC_ID_PCM_S32LE:
+ return 12;
+ default:
+ return 0;
+ }
+}
+
static int mov_write_audio_tag(ByteIOContext *pb, MOVTrack *track)
{
int64_t pos = url_ftell(pb);
- int version = track->mode == MODE_MOV &&
- (track->audio_vbr ||
- track->enc->codec_id == CODEC_ID_PCM_S32LE ||
- track->enc->codec_id == CODEC_ID_PCM_S24LE);
+ int version = 0;
+ uint32_t tag = track->tag;
+
+ if (track->mode == MODE_MOV) {
+ if (track->timescale > UINT16_MAX) {
+ if (mov_get_lpcm_flags(track->enc->codec_id))
+ tag = AV_RL32("lpcm");
+ version = 2;
+ } else if (track->audio_vbr || mov_pcm_le_gt16(track->enc->codec_id)) {
+ version = 1;
+ }
+ }
put_be32(pb, 0); /* size */
- put_le32(pb, track->tag); // store it byteswapped
+ put_le32(pb, tag); // store it byteswapped
put_be32(pb, 0); /* Reserved */
put_be16(pb, 0); /* Reserved */
put_be16(pb, 1); /* Data-reference index, XXX == 1 */
@@ -421,23 +464,39 @@ static int mov_write_audio_tag(ByteIOContext *pb, MOVTrack *track)
put_be16(pb, 0); /* Revision level */
put_be32(pb, 0); /* Reserved */
- if (track->mode == MODE_MOV) {
- put_be16(pb, track->enc->channels);
- if (track->enc->codec_id == CODEC_ID_PCM_U8 ||
- track->enc->codec_id == CODEC_ID_PCM_S8)
- put_be16(pb, 8); /* bits per sample */
- else
- put_be16(pb, 16);
- put_be16(pb, track->audio_vbr ? -2 : 0); /* compression ID */
- } else { /* reserved for mp4/3gp */
- put_be16(pb, 2);
+ if (version == 2) {
+ put_be16(pb, 3);
put_be16(pb, 16);
+ put_be16(pb, 0xfffe);
put_be16(pb, 0);
- }
+ put_be32(pb, 0x00010000);
+ put_be32(pb, 72);
+ put_be64(pb, av_dbl2int(track->timescale));
+ put_be32(pb, track->enc->channels);
+ put_be32(pb, 0x7F000000);
+ put_be32(pb, av_get_bits_per_sample(track->enc->codec_id));
+ put_be32(pb, mov_get_lpcm_flags(track->enc->codec_id));
+ put_be32(pb, track->sampleSize);
+ put_be32(pb, track->enc->frame_size);
+ } else {
+ if (track->mode == MODE_MOV) {
+ put_be16(pb, track->enc->channels);
+ if (track->enc->codec_id == CODEC_ID_PCM_U8 ||
+ track->enc->codec_id == CODEC_ID_PCM_S8)
+ put_be16(pb, 8); /* bits per sample */
+ else
+ put_be16(pb, 16);
+ put_be16(pb, track->audio_vbr ? -2 : 0); /* compression ID */
+ } else { /* reserved for mp4/3gp */
+ put_be16(pb, 2);
+ put_be16(pb, 16);
+ put_be16(pb, 0);
+ }
- put_be16(pb, 0); /* packet size (= 0) */
- put_be16(pb, track->timescale); /* Time scale */
- put_be16(pb, 0); /* Reserved */
+ put_be16(pb, 0); /* packet size (= 0) */
+ put_be16(pb, track->timescale); /* Time scale */
+ put_be16(pb, 0); /* Reserved */
+ }
if(version == 1) { /* SoundDescription V1 extended info */
put_be32(pb, track->enc->frame_size); /* Samples per packet */
@@ -450,9 +509,8 @@ static int mov_write_audio_tag(ByteIOContext *pb, MOVTrack *track)
(track->enc->codec_id == CODEC_ID_AAC ||
track->enc->codec_id == CODEC_ID_AC3 ||
track->enc->codec_id == CODEC_ID_AMR_NB ||
- track->enc->codec_id == CODEC_ID_PCM_S24LE ||
- track->enc->codec_id == CODEC_ID_PCM_S32LE ||
- track->enc->codec_id == CODEC_ID_ALAC))
+ track->enc->codec_id == CODEC_ID_ALAC ||
+ mov_pcm_le_gt16(track->enc->codec_id)))
mov_write_wave_tag(pb, track);
else if(track->tag == MKTAG('m','p','4','a'))
mov_write_esds_tag(pb, track);
@@ -1084,7 +1142,8 @@ static int mov_write_mdia_tag(ByteIOContext *pb, MOVTrack *track)
static int mov_write_tkhd_tag(ByteIOContext *pb, MOVTrack *track, AVStream *st)
{
- int64_t duration = av_rescale_rnd(track->trackDuration, globalTimescale, track->timescale, AV_ROUND_UP);
+ int64_t duration = av_rescale_rnd(track->trackDuration, MOV_TIMESCALE,
+ track->timescale, AV_ROUND_UP);
int version = duration < INT32_MAX ? 0 : 1;
(version == 1) ? put_be32(pb, 104) : put_be32(pb, 92); /* size */
@@ -1149,7 +1208,9 @@ static int mov_write_edts_tag(ByteIOContext *pb, MOVTrack *track)
put_be32(pb, 0x0);
put_be32(pb, 0x1);
- put_be32(pb, av_rescale_rnd(track->trackDuration, globalTimescale, track->timescale, AV_ROUND_UP)); /* duration ... doesn't seem to effect psp */
+ /* duration ... doesn't seem to effect psp */
+ put_be32(pb, av_rescale_rnd(track->trackDuration, MOV_TIMESCALE,
+ track->timescale, AV_ROUND_UP));
put_be32(pb, track->cluster[0].cts); /* first pts is cts since dts is 0 */
put_be32(pb, 0x00010000);
@@ -1213,7 +1274,10 @@ static int mov_write_mvhd_tag(ByteIOContext *pb, MOVMuxContext *mov)
for (i=0; i<mov->nb_streams; i++) {
if(mov->tracks[i].entry > 0) {
- maxTrackLenTemp = av_rescale_rnd(mov->tracks[i].trackDuration, globalTimescale, mov->tracks[i].timescale, AV_ROUND_UP);
+ maxTrackLenTemp = av_rescale_rnd(mov->tracks[i].trackDuration,
+ MOV_TIMESCALE,
+ mov->tracks[i].timescale,
+ AV_ROUND_UP);
if(maxTrackLen < maxTrackLenTemp)
maxTrackLen = maxTrackLenTemp;
if(maxTrackID < mov->tracks[i].trackID)
@@ -1233,7 +1297,7 @@ static int mov_write_mvhd_tag(ByteIOContext *pb, MOVMuxContext *mov)
put_be32(pb, mov->time); /* creation time */
put_be32(pb, mov->time); /* modification time */
}
- put_be32(pb, mov->timescale); /* timescale */
+ put_be32(pb, MOV_TIMESCALE);
(version == 1) ? put_be64(pb, maxTrackLen) : put_be32(pb, maxTrackLen); /* duration of longest track */
put_be32(pb, 0x00010000); /* reserved (preferred rate) 1.0 = normal */
@@ -1275,7 +1339,7 @@ static int mov_write_itunes_hdlr_tag(ByteIOContext *pb, MOVMuxContext *mov,
put_tag(pb, "appl");
put_be32(pb, 0);
put_be32(pb, 0);
- put_be16(pb, 0);
+ put_byte(pb, 0);
return updateSize(pb, pos);
}
@@ -1370,13 +1434,18 @@ static int mov_write_ilst_tag(ByteIOContext *pb, MOVMuxContext *mov,
put_tag(pb, "ilst");
mov_write_string_metadata(s, pb, "\251nam", "title" , 1);
mov_write_string_metadata(s, pb, "\251ART", "author" , 1);
- mov_write_string_metadata(s, pb, "\251wrt", "author" , 1);
+ mov_write_string_metadata(s, pb, "\251wrt", "composer" , 1);
mov_write_string_metadata(s, pb, "\251alb", "album" , 1);
mov_write_string_metadata(s, pb, "\251day", "year" , 1);
mov_write_string_tag(pb, "\251too", LIBAVFORMAT_IDENT, 0, 1);
mov_write_string_metadata(s, pb, "\251cmt", "comment" , 1);
mov_write_string_metadata(s, pb, "\251gen", "genre" , 1);
mov_write_string_metadata(s, pb, "\251cpy", "copyright", 1);
+ mov_write_string_metadata(s, pb, "desc", "description",1);
+ mov_write_string_metadata(s, pb, "ldes", "synopsis" , 1);
+ mov_write_string_metadata(s, pb, "tvsh", "show" , 1);
+ mov_write_string_metadata(s, pb, "tven", "episode_id",1);
+ mov_write_string_metadata(s, pb, "tvnn", "network" , 1);
mov_write_trkn_tag(pb, mov, s);
return updateSize(pb, pos);
}
@@ -1551,7 +1620,6 @@ static int mov_write_moov_tag(ByteIOContext *pb, MOVMuxContext *mov,
int64_t pos = url_ftell(pb);
put_be32(pb, 0); /* size placeholder*/
put_tag(pb, "moov");
- mov->timescale = globalTimescale;
for (i=0; i<mov->nb_streams; i++) {
if(mov->tracks[i].entry <= 0) continue;
@@ -1783,11 +1851,17 @@ static int mov_write_header(AVFormatContext *s)
st->codec->frame_size = 1;
track->sampleSize = (av_get_bits_per_sample(st->codec->codec_id) >> 3) * st->codec->channels;
}
- if(track->mode != MODE_MOV &&
- track->enc->codec_id == CODEC_ID_MP3 && track->enc->sample_rate < 16000){
- av_log(s, AV_LOG_ERROR, "track %d: muxing mp3 at %dhz is not supported\n",
- i, track->enc->sample_rate);
- goto error;
+ if (track->mode != MODE_MOV) {
+ if (track->timescale > UINT16_MAX) {
+ av_log(s, AV_LOG_ERROR, "track %d: output format does not support "
+ "sample rate %dhz\n", i, track->timescale);
+ goto error;
+ }
+ if (track->enc->codec_id == CODEC_ID_MP3 && track->timescale < 16000) {
+ av_log(s, AV_LOG_ERROR, "track %d: muxing mp3 at %dhz is not supported\n",
+ i, track->enc->sample_rate);
+ goto error;
+ }
}
}else if(st->codec->codec_type == CODEC_TYPE_SUBTITLE){
track->timescale = st->codec->time_base.den;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mp3.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mp3.c
index 5b5e06d04f..7d3458c751 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mp3.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mp3.c
@@ -21,6 +21,7 @@
#include <strings.h>
#include "libavutil/avstring.h"
+#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "id3v2.h"
#include "id3v1.h"
@@ -142,6 +143,9 @@ static int mp3_read_header(AVFormatContext *s,
st->need_parsing = AVSTREAM_PARSE_FULL;
st->start_time = 0;
+ // lcm of all mp3 sample rates
+ av_set_pts_info(st, 64, 1, 14112000);
+
ff_id3v2_read(s);
if (!av_metadata_get(s->metadata, "", NULL, AV_METADATA_IGNORE_SUFFIX))
ff_id3v1_read(s);
@@ -251,6 +255,42 @@ static void id3v2_put_ttag(AVFormatContext *s, const char *buf, int len,
}
+static int mp3_write_packet(struct AVFormatContext *s, AVPacket *pkt)
+{
+ put_buffer(s->pb, pkt->data, pkt->size);
+ put_flush_packet(s->pb);
+ return 0;
+}
+
+static int mp3_write_trailer(struct AVFormatContext *s)
+{
+ uint8_t buf[ID3v1_TAG_SIZE];
+
+ /* write the id3v1 tag */
+ if (id3v1_create_tag(s, buf) > 0) {
+ put_buffer(s->pb, buf, ID3v1_TAG_SIZE);
+ put_flush_packet(s->pb);
+ }
+ return 0;
+}
+#endif /* CONFIG_MP2_MUXER || CONFIG_MP3_MUXER */
+
+#if CONFIG_MP2_MUXER
+AVOutputFormat mp2_muxer = {
+ "mp2",
+ NULL_IF_CONFIG_SMALL("MPEG audio layer 2"),
+ "audio/x-mpeg",
+ "mp2,m2a",
+ 0,
+ CODEC_ID_MP2,
+ CODEC_ID_NONE,
+ NULL,
+ mp3_write_packet,
+ mp3_write_trailer,
+};
+#endif
+
+#if CONFIG_MP3_MUXER
/**
* Write an ID3v2.4 header at beginning of stream
*/
@@ -311,41 +351,6 @@ static int mp3_write_header(struct AVFormatContext *s)
return 0;
}
-static int mp3_write_packet(struct AVFormatContext *s, AVPacket *pkt)
-{
- put_buffer(s->pb, pkt->data, pkt->size);
- put_flush_packet(s->pb);
- return 0;
-}
-
-static int mp3_write_trailer(struct AVFormatContext *s)
-{
- uint8_t buf[ID3v1_TAG_SIZE];
-
- /* write the id3v1 tag */
- if (id3v1_create_tag(s, buf) > 0) {
- put_buffer(s->pb, buf, ID3v1_TAG_SIZE);
- put_flush_packet(s->pb);
- }
- return 0;
-}
-#endif /* CONFIG_MP2_MUXER || CONFIG_MP3_MUXER */
-
-#if CONFIG_MP2_MUXER
-AVOutputFormat mp2_muxer = {
- "mp2",
- NULL_IF_CONFIG_SMALL("MPEG audio layer 2"),
- "audio/x-mpeg",
- "mp2,m2a",
- 0,
- CODEC_ID_MP2,
- CODEC_ID_NONE,
- NULL,
- mp3_write_packet,
- mp3_write_trailer,
-};
-#endif
-#if CONFIG_MP3_MUXER
AVOutputFormat mp3_muxer = {
"mp3",
NULL_IF_CONFIG_SMALL("MPEG audio layer 3"),
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mpeg.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mpeg.c
index f2296280d6..49218738dd 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mpeg.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mpeg.c
@@ -92,10 +92,10 @@ static int mpegps_probe(AVProbeData *p)
if(vid+audio > invalid) /* invalid VDR files nd short PES streams */
score= AVPROBE_SCORE_MAX/4;
-//av_log(NULL, AV_LOG_ERROR, "%d %d %d %d %d len:%d\n", sys, priv1, pspack,vid, audio, p->buf_size);
+//av_log(NULL, AV_LOG_ERROR, "%d %d %d %d %d %d len:%d\n", sys, priv1, pspack,vid, audio, invalid, p->buf_size);
if(sys>invalid && sys*9 <= pspack*10)
return pspack > 2 ? AVPROBE_SCORE_MAX/2+2 : AVPROBE_SCORE_MAX/4; // +1 for .mpg
- if(priv1 + vid + audio > invalid && (priv1+vid+audio)*9 <= pspack*10)
+ if(pspack > invalid && (priv1+vid+audio)*10 >= pspack*9)
return pspack > 2 ? AVPROBE_SCORE_MAX/2+2 : AVPROBE_SCORE_MAX/4; // +1 for .mpg
if((!!vid ^ !!audio) && (audio > 4 || vid > 1) && !sys && !pspack && p->buf_size>2048 && vid + audio > invalid) /* PES stream */
return (audio > 12 || vid > 3) ? AVPROBE_SCORE_MAX/2+2 : AVPROBE_SCORE_MAX/4;
@@ -129,6 +129,8 @@ static int mpegps_read_header(AVFormatContext *s,
m->sofdec++;
} while (v == sofdec[i] && i++ < 6);
+ m->sofdec = (m->sofdec == 6) ? 1 : 0;
+
/* no need to do more */
return 0;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mpegts.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mpegts.c
index eb0285a31f..a4d7759ce3 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mpegts.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mpegts.c
@@ -36,14 +36,12 @@
/* maximum size in which we look for synchronisation if
synchronisation is lost */
-#define MAX_RESYNC_SIZE 4096
+#define MAX_RESYNC_SIZE 65536
#define MAX_PES_PAYLOAD 200*1024
typedef struct PESContext PESContext;
-static PESContext* add_pes_stream(MpegTSContext *ts, int pid, int pcr_pid, int stream_type);
-
enum MpegTSFilterType {
MPEGTS_PES,
MPEGTS_SECTION,
@@ -505,7 +503,7 @@ static const StreamType ISO_types[] = {
{ 0x04, CODEC_TYPE_AUDIO, CODEC_ID_MP3 },
{ 0x0f, CODEC_TYPE_AUDIO, CODEC_ID_AAC },
{ 0x10, CODEC_TYPE_VIDEO, CODEC_ID_MPEG4 },
- { 0x11, CODEC_TYPE_AUDIO, CODEC_ID_AAC_LATM },
+ { 0x11, CODEC_TYPE_AUDIO, CODEC_ID_AAC }, /* LATM syntax */
{ 0x1b, CODEC_TYPE_VIDEO, CODEC_ID_H264 },
{ 0xd1, CODEC_TYPE_VIDEO, CODEC_ID_DIRAC },
{ 0xea, CODEC_TYPE_VIDEO, CODEC_ID_VC1 },
@@ -520,6 +518,7 @@ static const StreamType HDMV_types[] = {
{ 0x84, CODEC_TYPE_AUDIO, CODEC_ID_EAC3 },
{ 0x85, CODEC_TYPE_AUDIO, CODEC_ID_DTS }, /* DTS HD */
{ 0x86, CODEC_TYPE_AUDIO, CODEC_ID_DTS }, /* DTS HD MASTER*/
+ { 0x84, CODEC_TYPE_AUDIO, CODEC_ID_EAC3 },
{ 0x90, CODEC_TYPE_SUBTITLE, CODEC_ID_HDMV_PGS_SUBTITLE },
{ 0 },
};
@@ -546,6 +545,7 @@ static const StreamType DESC_types[] = {
{ 0x6a, CODEC_TYPE_AUDIO, CODEC_ID_AC3 }, /* AC-3 descriptor */
{ 0x7a, CODEC_TYPE_AUDIO, CODEC_ID_EAC3 }, /* E-AC-3 descriptor */
{ 0x7b, CODEC_TYPE_AUDIO, CODEC_ID_DTS },
+ { 0x56, CODEC_TYPE_SUBTITLE, CODEC_ID_DVB_TELETEXT },
{ 0x59, CODEC_TYPE_SUBTITLE, CODEC_ID_DVB_SUBTITLE }, /* subtitling descriptor */
{ 0x45, CODEC_TYPE_DATA, CODEC_ID_VBI_DATA }, /* VBI Data descriptor */
{ 0x46, CODEC_TYPE_DATA, CODEC_ID_VBI_TELETEXT }, /* VBI Teletext descriptor */
@@ -565,22 +565,20 @@ static void mpegts_find_stream_type(AVStream *st,
}
}
-static AVStream *new_pes_av_stream(PESContext *pes, uint32_t prog_reg_desc, uint32_t code)
+static int mpegts_set_stream_info(AVStream *st, PESContext *pes,
+ uint32_t stream_type, uint32_t prog_reg_desc)
{
- AVStream *st = av_new_stream(pes->stream, pes->pid);
-
- if (!st)
- return NULL;
-
av_set_pts_info(st, 33, 1, 90000);
st->priv_data = pes;
st->codec->codec_type = CODEC_TYPE_DATA;
st->codec->codec_id = CODEC_ID_NONE;
st->need_parsing = AVSTREAM_PARSE_FULL;
pes->st = st;
+ pes->stream_type = stream_type;
- dprintf(pes->stream, "stream_type=%x pid=%x prog_reg_desc=%.4s\n",
- pes->stream_type, pes->pid, (char*)&prog_reg_desc);
+ av_log(pes->stream, AV_LOG_DEBUG,
+ "stream=%d stream_type=%x pid=%x prog_reg_desc=%.4s\n",
+ st->index, pes->stream_type, pes->pid, (char*)&prog_reg_desc);
st->codec->codec_tag = pes->stream_type;
@@ -595,13 +593,13 @@ static AVStream *new_pes_av_stream(PESContext *pes, uint32_t prog_reg_desc, uint
// priv_data cannot be shared between streams
PESContext *sub_pes = av_malloc(sizeof(*sub_pes));
if (!sub_pes)
- return NULL;
+ return AVERROR(ENOMEM);
memcpy(sub_pes, pes, sizeof(*sub_pes));
sub_st = av_new_stream(pes->stream, pes->pid);
if (!sub_st) {
av_free(sub_pes);
- return NULL;
+ return AVERROR(ENOMEM);
}
av_set_pts_info(sub_st, 33, 1, 90000);
@@ -615,18 +613,245 @@ static AVStream *new_pes_av_stream(PESContext *pes, uint32_t prog_reg_desc, uint
if (st->codec->codec_id == CODEC_ID_NONE)
mpegts_find_stream_type(st, pes->stream_type, MISC_types);
- /* stream was not present in PMT, guess based on PES start code */
- if (st->codec->codec_id == CODEC_ID_NONE) {
- if (code >= 0x1c0 && code <= 0x1df) {
- st->codec->codec_type = CODEC_TYPE_AUDIO;
- st->codec->codec_id = CODEC_ID_MP2;
- } else if (code == 0x1bd) {
- st->codec->codec_type = CODEC_TYPE_AUDIO;
- st->codec->codec_id = CODEC_ID_AC3;
+ return 0;
+}
+
+static int64_t get_pts(const uint8_t *p)
+{
+ int64_t pts = (int64_t)((p[0] >> 1) & 0x07) << 30;
+ pts |= (AV_RB16(p + 1) >> 1) << 15;
+ pts |= AV_RB16(p + 3) >> 1;
+ return pts;
+}
+
+static void new_pes_packet(PESContext *pes, AVPacket *pkt)
+{
+ av_init_packet(pkt);
+
+ pkt->destruct = av_destruct_packet;
+ pkt->data = pes->buffer;
+ pkt->size = pes->data_index;
+ memset(pkt->data+pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+
+ // Separate out the AC3 substream from an HDMV combined TrueHD/AC3 PID
+ if (pes->sub_st && pes->stream_type == 0x83 && pes->extended_stream_id == 0x76)
+ pkt->stream_index = pes->sub_st->index;
+ else
+ pkt->stream_index = pes->st->index;
+ pkt->pts = pes->pts;
+ pkt->dts = pes->dts;
+ /* store position of first TS packet of this PES packet */
+ pkt->pos = pes->ts_packet_pos;
+
+ /* reset pts values */
+ pes->pts = AV_NOPTS_VALUE;
+ pes->dts = AV_NOPTS_VALUE;
+ pes->buffer = NULL;
+ pes->data_index = 0;
+}
+
+/* return non zero if a packet could be constructed */
+static int mpegts_push_data(MpegTSFilter *filter,
+ const uint8_t *buf, int buf_size, int is_start,
+ int64_t pos)
+{
+ PESContext *pes = filter->u.pes_filter.opaque;
+ MpegTSContext *ts = pes->ts;
+ const uint8_t *p;
+ int len, code;
+
+ if(!ts->pkt)
+ return 0;
+
+ if (is_start) {
+ if (pes->state == MPEGTS_PAYLOAD && pes->data_index > 0) {
+ new_pes_packet(pes, ts->pkt);
+ ts->stop_parse = 1;
}
+ pes->state = MPEGTS_HEADER;
+ pes->data_index = 0;
+ pes->ts_packet_pos = pos;
}
+ p = buf;
+ while (buf_size > 0) {
+ switch(pes->state) {
+ case MPEGTS_HEADER:
+ len = PES_START_SIZE - pes->data_index;
+ if (len > buf_size)
+ len = buf_size;
+ memcpy(pes->header + pes->data_index, p, len);
+ pes->data_index += len;
+ p += len;
+ buf_size -= len;
+ if (pes->data_index == PES_START_SIZE) {
+ /* we got all the PES or section header. We can now
+ decide */
+#if 0
+ av_hex_dump_log(pes->stream, AV_LOG_DEBUG, pes->header, pes->data_index);
+#endif
+ if (pes->header[0] == 0x00 && pes->header[1] == 0x00 &&
+ pes->header[2] == 0x01) {
+ /* it must be an mpeg2 PES stream */
+ code = pes->header[3] | 0x100;
+ dprintf(pes->stream, "pid=%x pes_code=%#x\n", pes->pid, code);
+
+ if ((!pes->st && pes->stream->nb_streams == MAX_STREAMS) ||
+ (pes->st && pes->st->discard == AVDISCARD_ALL) ||
+ code == 0x1be) /* padding_stream */
+ goto skip;
+
+ /* stream not present in PMT */
+ if (!pes->st) {
+ pes->st = av_new_stream(ts->stream, pes->pid);
+ if (!pes->st)
+ return AVERROR(ENOMEM);
+ mpegts_set_stream_info(pes->st, pes, 0, 0);
+ }
+
+ pes->total_size = AV_RB16(pes->header + 4);
+ /* NOTE: a zero total size means the PES size is
+ unbounded */
+ if (!pes->total_size)
+ pes->total_size = MAX_PES_PAYLOAD;
- return st;
+ /* allocate pes buffer */
+ pes->buffer = av_malloc(pes->total_size+FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!pes->buffer)
+ return AVERROR(ENOMEM);
+
+ if (code != 0x1bc && code != 0x1bf && /* program_stream_map, private_stream_2 */
+ code != 0x1f0 && code != 0x1f1 && /* ECM, EMM */
+ code != 0x1ff && code != 0x1f2 && /* program_stream_directory, DSMCC_stream */
+ code != 0x1f8) { /* ITU-T Rec. H.222.1 type E stream */
+ pes->state = MPEGTS_PESHEADER;
+ if (pes->st->codec->codec_id == CODEC_ID_NONE) {
+ dprintf(pes->stream, "pid=%x stream_type=%x probing\n",
+ pes->pid, pes->stream_type);
+ pes->st->codec->codec_id = CODEC_ID_PROBE;
+ }
+ } else {
+ pes->state = MPEGTS_PAYLOAD;
+ pes->data_index = 0;
+ }
+ } else {
+ /* otherwise, it should be a table */
+ /* skip packet */
+ skip:
+ pes->state = MPEGTS_SKIP;
+ continue;
+ }
+ }
+ break;
+ /**********************************************/
+ /* PES packing parsing */
+ case MPEGTS_PESHEADER:
+ len = PES_HEADER_SIZE - pes->data_index;
+ if (len < 0)
+ return -1;
+ if (len > buf_size)
+ len = buf_size;
+ memcpy(pes->header + pes->data_index, p, len);
+ pes->data_index += len;
+ p += len;
+ buf_size -= len;
+ if (pes->data_index == PES_HEADER_SIZE) {
+ pes->pes_header_size = pes->header[8] + 9;
+ pes->state = MPEGTS_PESHEADER_FILL;
+ }
+ break;
+ case MPEGTS_PESHEADER_FILL:
+ len = pes->pes_header_size - pes->data_index;
+ if (len < 0)
+ return -1;
+ if (len > buf_size)
+ len = buf_size;
+ memcpy(pes->header + pes->data_index, p, len);
+ pes->data_index += len;
+ p += len;
+ buf_size -= len;
+ if (pes->data_index == pes->pes_header_size) {
+ const uint8_t *r;
+ unsigned int flags, pes_ext, skip;
+
+ flags = pes->header[7];
+ r = pes->header + 9;
+ pes->pts = AV_NOPTS_VALUE;
+ pes->dts = AV_NOPTS_VALUE;
+ if ((flags & 0xc0) == 0x80) {
+ pes->dts = pes->pts = get_pts(r);
+ r += 5;
+ } else if ((flags & 0xc0) == 0xc0) {
+ pes->pts = get_pts(r);
+ r += 5;
+ pes->dts = get_pts(r);
+ r += 5;
+ }
+ pes->extended_stream_id = -1;
+ if (flags & 0x01) { /* PES extension */
+ pes_ext = *r++;
+ /* Skip PES private data, program packet sequence counter and P-STD buffer */
+ skip = (pes_ext >> 4) & 0xb;
+ skip += skip & 0x9;
+ r += skip;
+ if ((pes_ext & 0x41) == 0x01 &&
+ (r + 2) <= (pes->header + pes->pes_header_size)) {
+ /* PES extension 2 */
+ if ((r[0] & 0x7f) > 0 && (r[1] & 0x80) == 0)
+ pes->extended_stream_id = r[1];
+ }
+ }
+
+ /* we got the full header. We parse it and get the payload */
+ pes->state = MPEGTS_PAYLOAD;
+ pes->data_index = 0;
+ }
+ break;
+ case MPEGTS_PAYLOAD:
+ if (buf_size > 0 && pes->buffer) {
+ if (pes->data_index+buf_size > pes->total_size) {
+ new_pes_packet(pes, ts->pkt);
+ pes->total_size = MAX_PES_PAYLOAD;
+ pes->buffer = av_malloc(pes->total_size+FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!pes->buffer)
+ return AVERROR(ENOMEM);
+ ts->stop_parse = 1;
+ }
+ memcpy(pes->buffer+pes->data_index, p, buf_size);
+ pes->data_index += buf_size;
+ }
+ buf_size = 0;
+ break;
+ case MPEGTS_SKIP:
+ buf_size = 0;
+ break;
+ }
+ }
+
+ return 0;
+}
+
+static PESContext *add_pes_stream(MpegTSContext *ts, int pid, int pcr_pid)
+{
+ MpegTSFilter *tss;
+ PESContext *pes;
+
+ /* if no pid found, then add a pid context */
+ pes = av_mallocz(sizeof(PESContext));
+ if (!pes)
+ return 0;
+ pes->ts = ts;
+ pes->stream = ts->stream;
+ pes->pid = pid;
+ pes->pcr_pid = pcr_pid;
+ pes->state = MPEGTS_SKIP;
+ pes->pts = AV_NOPTS_VALUE;
+ pes->dts = AV_NOPTS_VALUE;
+ tss = mpegts_open_pes_filter(ts, pid, mpegts_push_data, pes);
+ if (!tss) {
+ av_free(pes);
+ return 0;
+ }
+ return pes;
}
static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len)
@@ -706,14 +931,17 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
st = pes->st;
} else {
if (ts->pids[pid]) mpegts_close_filter(ts, ts->pids[pid]); //wrongly added sdt filter probably
- pes = add_pes_stream(ts, pid, pcr_pid, stream_type);
+ pes = add_pes_stream(ts, pid, pcr_pid);
if (pes)
- st = new_pes_av_stream(pes, prog_reg_desc, 0);
+ st = av_new_stream(pes->stream, pes->pid);
}
if (!st)
return;
+ if (!pes->stream_type)
+ mpegts_set_stream_info(st, pes, stream_type, prog_reg_desc);
+
add_pid_to_pmt(ts, h->id, pid);
av_program_add_stream_index(ts->stream, h->id, st->index);
@@ -743,6 +971,13 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
mpegts_find_stream_type(st, desc_tag, DESC_types);
switch(desc_tag) {
+ case 0x56: /* DVB teletext descriptor */
+ language[0] = get8(&p, desc_end);
+ language[1] = get8(&p, desc_end);
+ language[2] = get8(&p, desc_end);
+ language[3] = 0;
+ av_metadata_set(&st->metadata, "language", language);
+ break;
case 0x59: /* subtitling descriptor */
language[0] = get8(&p, desc_end);
language[1] = get8(&p, desc_end);
@@ -909,243 +1144,6 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
}
}
-static int64_t get_pts(const uint8_t *p)
-{
- int64_t pts = (int64_t)((p[0] >> 1) & 0x07) << 30;
- pts |= (AV_RB16(p + 1) >> 1) << 15;
- pts |= AV_RB16(p + 3) >> 1;
- return pts;
-}
-
-static void new_pes_packet(PESContext *pes, AVPacket *pkt)
-{
- av_init_packet(pkt);
-
- pkt->destruct = av_destruct_packet;
- pkt->data = pes->buffer;
- pkt->size = pes->data_index;
- memset(pkt->data+pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-
- // Separate out the AC3 substream from an HDMV combined TrueHD/AC3 PID
- if (pes->sub_st && pes->stream_type == 0x83 && pes->extended_stream_id == 0x76)
- pkt->stream_index = pes->sub_st->index;
- else
- pkt->stream_index = pes->st->index;
- pkt->pts = pes->pts;
- pkt->dts = pes->dts;
- /* store position of first TS packet of this PES packet */
- pkt->pos = pes->ts_packet_pos;
-
- /* reset pts values */
- pes->pts = AV_NOPTS_VALUE;
- pes->dts = AV_NOPTS_VALUE;
- pes->buffer = NULL;
- pes->data_index = 0;
-}
-
-/* return non zero if a packet could be constructed */
-static int mpegts_push_data(MpegTSFilter *filter,
- const uint8_t *buf, int buf_size, int is_start,
- int64_t pos)
-{
- PESContext *pes = filter->u.pes_filter.opaque;
- MpegTSContext *ts = pes->ts;
- const uint8_t *p;
- int len, code;
-
- if(!ts->pkt)
- return 0;
-
- if (is_start) {
- if (pes->state == MPEGTS_PAYLOAD && pes->data_index > 0) {
- new_pes_packet(pes, ts->pkt);
- ts->stop_parse = 1;
- }
- pes->state = MPEGTS_HEADER;
- pes->data_index = 0;
- pes->ts_packet_pos = pos;
- }
- p = buf;
- while (buf_size > 0) {
- switch(pes->state) {
- case MPEGTS_HEADER:
- len = PES_START_SIZE - pes->data_index;
- if (len > buf_size)
- len = buf_size;
- memcpy(pes->header + pes->data_index, p, len);
- pes->data_index += len;
- p += len;
- buf_size -= len;
- if (pes->data_index == PES_START_SIZE) {
- /* we got all the PES or section header. We can now
- decide */
-#if 0
- av_hex_dump_log(pes->stream, AV_LOG_DEBUG, pes->header, pes->data_index);
-#endif
- if (pes->header[0] == 0x00 && pes->header[1] == 0x00 &&
- pes->header[2] == 0x01) {
- /* it must be an mpeg2 PES stream */
- code = pes->header[3] | 0x100;
- dprintf(pes->stream, "pid=%x pes_code=%#x\n", pes->pid, code);
-
- if ((!pes->st && pes->stream->nb_streams == MAX_STREAMS) ||
- (pes->st && pes->st->discard == AVDISCARD_ALL) ||
- code == 0x1be) /* padding_stream */
- goto skip;
-
- /* stream not present in PMT */
- if (!pes->st)
- pes->st = new_pes_av_stream(pes, 0, code);
- if (!pes->st)
- return AVERROR(ENOMEM);
-
- pes->total_size = AV_RB16(pes->header + 4);
- /* NOTE: a zero total size means the PES size is
- unbounded */
- if (!pes->total_size)
- pes->total_size = MAX_PES_PAYLOAD;
-
- /* allocate pes buffer */
- pes->buffer = av_malloc(pes->total_size+FF_INPUT_BUFFER_PADDING_SIZE);
- if (!pes->buffer)
- return AVERROR(ENOMEM);
-
- if (code != 0x1bc && code != 0x1bf && /* program_stream_map, private_stream_2 */
- code != 0x1f0 && code != 0x1f1 && /* ECM, EMM */
- code != 0x1ff && code != 0x1f2 && /* program_stream_directory, DSMCC_stream */
- code != 0x1f8) { /* ITU-T Rec. H.222.1 type E stream */
- pes->state = MPEGTS_PESHEADER;
- if (pes->st->codec->codec_id == CODEC_ID_NONE) {
- dprintf(pes->stream, "pid=%x stream_type=%x probing\n",
- pes->pid, pes->stream_type);
- pes->st->codec->codec_id = CODEC_ID_PROBE;
- }
- } else {
- pes->state = MPEGTS_PAYLOAD;
- pes->data_index = 0;
- }
- } else {
- /* otherwise, it should be a table */
- /* skip packet */
- skip:
- pes->state = MPEGTS_SKIP;
- continue;
- }
- }
- break;
- /**********************************************/
- /* PES packing parsing */
- case MPEGTS_PESHEADER:
- len = PES_HEADER_SIZE - pes->data_index;
- if (len < 0)
- return -1;
- if (len > buf_size)
- len = buf_size;
- memcpy(pes->header + pes->data_index, p, len);
- pes->data_index += len;
- p += len;
- buf_size -= len;
- if (pes->data_index == PES_HEADER_SIZE) {
- pes->pes_header_size = pes->header[8] + 9;
- pes->state = MPEGTS_PESHEADER_FILL;
- }
- break;
- case MPEGTS_PESHEADER_FILL:
- len = pes->pes_header_size - pes->data_index;
- if (len < 0)
- return -1;
- if (len > buf_size)
- len = buf_size;
- memcpy(pes->header + pes->data_index, p, len);
- pes->data_index += len;
- p += len;
- buf_size -= len;
- if (pes->data_index == pes->pes_header_size) {
- const uint8_t *r;
- unsigned int flags, pes_ext, skip;
-
- flags = pes->header[7];
- r = pes->header + 9;
- pes->pts = AV_NOPTS_VALUE;
- pes->dts = AV_NOPTS_VALUE;
- if ((flags & 0xc0) == 0x80) {
- pes->dts = pes->pts = get_pts(r);
- r += 5;
- } else if ((flags & 0xc0) == 0xc0) {
- pes->pts = get_pts(r);
- r += 5;
- pes->dts = get_pts(r);
- r += 5;
- }
- pes->extended_stream_id = -1;
- if (flags & 0x01) { /* PES extension */
- pes_ext = *r++;
- /* Skip PES private data, program packet sequence counter and P-STD buffer */
- skip = (pes_ext >> 4) & 0xb;
- skip += skip & 0x9;
- r += skip;
- if ((pes_ext & 0x41) == 0x01 &&
- (r + 2) <= (pes->header + pes->pes_header_size)) {
- /* PES extension 2 */
- if ((r[0] & 0x7f) > 0 && (r[1] & 0x80) == 0)
- pes->extended_stream_id = r[1];
- }
- }
-
- /* we got the full header. We parse it and get the payload */
- pes->state = MPEGTS_PAYLOAD;
- pes->data_index = 0;
- }
- break;
- case MPEGTS_PAYLOAD:
- if (buf_size > 0 && pes->buffer) {
- if (pes->data_index+buf_size > pes->total_size) {
- new_pes_packet(pes, ts->pkt);
- pes->total_size = MAX_PES_PAYLOAD;
- pes->buffer = av_malloc(pes->total_size+FF_INPUT_BUFFER_PADDING_SIZE);
- if (!pes->buffer)
- return AVERROR(ENOMEM);
- ts->stop_parse = 1;
- }
- memcpy(pes->buffer+pes->data_index, p, buf_size);
- pes->data_index += buf_size;
- }
- buf_size = 0;
- break;
- case MPEGTS_SKIP:
- buf_size = 0;
- break;
- }
- }
-
- return 0;
-}
-
-static PESContext *add_pes_stream(MpegTSContext *ts, int pid, int pcr_pid, int stream_type)
-{
- MpegTSFilter *tss;
- PESContext *pes;
-
- /* if no pid found, then add a pid context */
- pes = av_mallocz(sizeof(PESContext));
- if (!pes)
- return 0;
- pes->ts = ts;
- pes->stream = ts->stream;
- pes->pid = pid;
- pes->pcr_pid = pcr_pid;
- pes->stream_type = stream_type;
- pes->state = MPEGTS_SKIP;
- pes->pts = AV_NOPTS_VALUE;
- pes->dts = AV_NOPTS_VALUE;
- tss = mpegts_open_pes_filter(ts, pid, mpegts_push_data, pes);
- if (!tss) {
- av_free(pes);
- return 0;
- }
- return pes;
-}
-
/* handle one TS packet */
static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
{
@@ -1161,7 +1159,7 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
is_start = packet[1] & 0x40;
tss = ts->pids[pid];
if (ts->auto_guess && tss == NULL && is_start) {
- add_pes_stream(ts, pid, -1, 0);
+ add_pes_stream(ts, pid, -1);
tss = ts->pids[pid];
}
if (!tss)
@@ -1229,8 +1227,9 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
/* XXX: try to find a better synchro over several packets (use
get_packet_size() ?) */
-static int mpegts_resync(ByteIOContext *pb)
+static int mpegts_resync(AVFormatContext *s)
{
+ ByteIOContext *pb = s->pb;
int c, i;
for(i = 0;i < MAX_RESYNC_SIZE; i++) {
@@ -1242,13 +1241,15 @@ static int mpegts_resync(ByteIOContext *pb)
return 0;
}
}
+ av_log(s, AV_LOG_ERROR, "max resync size reached, could not find sync byte\n");
/* no sync found */
return -1;
}
/* return -1 if error or EOF. Return 0 if OK. */
-static int read_packet(ByteIOContext *pb, uint8_t *buf, int raw_packet_size)
+static int read_packet(AVFormatContext *s, uint8_t *buf, int raw_packet_size)
{
+ ByteIOContext *pb = s->pb;
int skip, len;
for(;;) {
@@ -1259,8 +1260,8 @@ static int read_packet(ByteIOContext *pb, uint8_t *buf, int raw_packet_size)
if (buf[0] != 0x47) {
/* find a new packet start */
url_fseek(pb, -TS_PACKET_SIZE, SEEK_CUR);
- if (mpegts_resync(pb) < 0)
- return AVERROR_INVALIDDATA;
+ if (mpegts_resync(s) < 0)
+ return AVERROR(EAGAIN);
else
continue;
} else {
@@ -1276,7 +1277,6 @@ static int read_packet(ByteIOContext *pb, uint8_t *buf, int raw_packet_size)
static int handle_packets(MpegTSContext *ts, int nb_packets)
{
AVFormatContext *s = ts->stream;
- ByteIOContext *pb = s->pb;
uint8_t packet[TS_PACKET_SIZE];
int packet_num, ret;
@@ -1288,7 +1288,7 @@ static int handle_packets(MpegTSContext *ts, int nb_packets)
packet_num++;
if (nb_packets != 0 && packet_num >= nb_packets)
break;
- ret = read_packet(pb, packet, ts->raw_packet_size);
+ ret = read_packet(s, packet, ts->raw_packet_size);
if (ret != 0)
return ret;
ret = handle_packet(ts, packet);
@@ -1433,7 +1433,7 @@ static int mpegts_read_header(AVFormatContext *s,
mpegts_open_section_filter(ts, PAT_PID, pat_cb, ts, 1);
- handle_packets(ts, s->probesize);
+ handle_packets(ts, s->probesize / ts->raw_packet_size);
/* if could not find service, enable auto_guess */
ts->auto_guess = 1;
@@ -1462,7 +1462,7 @@ static int mpegts_read_header(AVFormatContext *s,
nb_pcrs = 0;
nb_packets = 0;
for(;;) {
- ret = read_packet(s->pb, packet, ts->raw_packet_size);
+ ret = read_packet(s, packet, ts->raw_packet_size);
if (ret < 0)
return -1;
pid = AV_RB16(packet + 1) & 0x1fff;
@@ -1511,7 +1511,7 @@ static int mpegts_raw_read_packet(AVFormatContext *s,
if (av_new_packet(pkt, TS_PACKET_SIZE) < 0)
return AVERROR(ENOMEM);
pkt->pos= url_ftell(s->pb);
- ret = read_packet(s->pb, pkt->data, ts->raw_packet_size);
+ ret = read_packet(s, pkt->data, ts->raw_packet_size);
if (ret < 0) {
av_free_packet(pkt);
return ret;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mpegtsenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mpegtsenc.c
index 48df4386da..a8d5d38129 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mpegtsenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mpegtsenc.c
@@ -741,8 +741,7 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
}
}
- if (st->codec->codec_type == CODEC_TYPE_SUBTITLE ||
- st->codec->codec_type == CODEC_TYPE_VIDEO) {
+ if (st->codec->codec_type != CODEC_TYPE_AUDIO) {
// for video and subtitle, write a single pes packet
mpegts_write_pes(s, st, buf, size, pts, dts);
av_free(data);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mtv.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mtv.c
index 42aa91f7b3..8d08b792f1 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mtv.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mtv.c
@@ -25,6 +25,7 @@
*/
#include "libavutil/bswap.h"
+#include "libavutil/intreadwrite.h"
#include "avformat.h"
#define MTV_ASUBCHUNK_DATA_SIZE 500
@@ -39,7 +40,7 @@ typedef struct MTVDemuxContext {
unsigned int file_size; ///< filesize, not always right
unsigned int segments; ///< number of 512 byte segments
unsigned int audio_identifier; ///< 'MP3' on all files I have seen
- unsigned int audio_br; ///< bitrate of audio chanel (mp3)
+ unsigned int audio_br; ///< bitrate of audio channel (mp3)
unsigned int img_colorfmt; ///< frame colorfmt rgb 565/555
unsigned int img_bpp; ///< frame bits per pixel
unsigned int img_width; //
@@ -56,6 +57,22 @@ static int mtv_probe(AVProbeData *p)
if(*(p->buf) != 'A' || *(p->buf+1) != 'M' || *(p->buf+2) != 'V')
return 0;
+ /* Check for nonzero in bpp and (width|height) header fields */
+ if(!(p->buf[51] && AV_RL16(&p->buf[52]) | AV_RL16(&p->buf[54])))
+ return 0;
+
+ /* If width or height are 0 then imagesize header field should not */
+ if(!AV_RL16(&p->buf[52]) || !AV_RL16(&p->buf[54]))
+ {
+ if(!!AV_RL16(&p->buf[56]))
+ return AVPROBE_SCORE_MAX/2;
+ else
+ return 0;
+ }
+
+ if(p->buf[51] != 16)
+ return AVPROBE_SCORE_MAX/4; // But we are going to assume 16bpp anyway ..
+
return AVPROBE_SCORE_MAX;
}
@@ -77,6 +94,17 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap)
mtv->img_width = get_le16(pb);
mtv->img_height = get_le16(pb);
mtv->img_segment_size = get_le16(pb);
+
+ /* Calculate width and height if missing from header */
+
+ if(!mtv->img_width)
+ mtv->img_width=mtv->img_segment_size / (mtv->img_bpp>>3)
+ / mtv->img_height;
+
+ if(!mtv->img_height)
+ mtv->img_height=mtv->img_segment_size / (mtv->img_bpp>>3)
+ / mtv->img_width;
+
url_fskip(pb, 4);
audio_subsegments = get_le16(pb);
mtv->full_segment_size =
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mvi.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mvi.c
index 2dc4667a68..89c47da473 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mvi.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mvi.c
@@ -86,7 +86,6 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
av_set_pts_info(vst, 64, msecs_per_frame, 1000000);
vst->codec->codec_type = CODEC_TYPE_VIDEO;
vst->codec->codec_id = CODEC_ID_MOTIONPIXELS;
- vst->codec->pix_fmt = PIX_FMT_RGB555;
mvi->get_int = (vst->codec->width * vst->codec->height < (1 << 16)) ? get_le16 : get_le24;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mxfdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mxfdec.c
index 7f6d439d39..2f6d2eaa2f 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mxfdec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mxfdec.c
@@ -214,18 +214,17 @@ static int mxf_get_stream_index(AVFormatContext *s, KLVPacket *klv)
/* XXX: use AVBitStreamFilter */
static int mxf_get_d10_aes3_packet(ByteIOContext *pb, AVStream *st, AVPacket *pkt, int64_t length)
{
- uint8_t buffer[61444];
const uint8_t *buf_ptr, *end_ptr;
uint8_t *data_ptr;
int i;
if (length > 61444) /* worst case PAL 1920 samples 8 channels */
return -1;
- get_buffer(pb, buffer, length);
av_new_packet(pkt, length);
+ get_buffer(pb, pkt->data, length);
data_ptr = pkt->data;
- end_ptr = buffer + length;
- buf_ptr = buffer + 4; /* skip SMPTE 331M header */
+ end_ptr = pkt->data + length;
+ buf_ptr = pkt->data + 4; /* skip SMPTE 331M header */
for (; buf_ptr < end_ptr; ) {
for (i = 0; i < st->codec->channels; i++) {
uint32_t sample = bytestream_get_le32(&buf_ptr);
@@ -690,7 +689,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
if (!(material_track->sequence = mxf_resolve_strong_ref(mxf, &material_track->sequence_ref, Sequence))) {
av_log(mxf->fc, AV_LOG_ERROR, "could not resolve material track sequence strong ref\n");
- return -1;
+ continue;
}
/* TODO: handle multiple source clips */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mxfenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mxfenc.c
index 8175a9b1cf..12dedccbbd 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mxfenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mxfenc.c
@@ -86,7 +86,7 @@ static const struct {
{ CODEC_ID_MPEG2VIDEO, 0 },
{ CODEC_ID_PCM_S24LE, 1 },
{ CODEC_ID_PCM_S16LE, 1 },
- { 0 }
+ { CODEC_ID_NONE }
};
static void mxf_write_wav_desc(AVFormatContext *s, AVStream *st);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/nsvdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/nsvdec.c
index 61a21ae178..9c215cd58f 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/nsvdec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/nsvdec.c
@@ -201,7 +201,7 @@ static const AVCodecTag nsv_codec_video_tags[] = {
*/
{ CODEC_ID_MPEG4, MKTAG('X', 'V', 'I', 'D') }, /* cf sample xvid decoder from nsv_codec_sdk.zip */
{ CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', '3') },
- { 0, 0 },
+ { CODEC_ID_NONE, 0 },
};
static const AVCodecTag nsv_codec_audio_tags[] = {
@@ -210,7 +210,7 @@ static const AVCodecTag nsv_codec_audio_tags[] = {
{ CODEC_ID_AAC, MKTAG('A', 'A', 'C', 'P') },
{ CODEC_ID_SPEEX, MKTAG('S', 'P', 'X', ' ') },
{ CODEC_ID_PCM_U16LE, MKTAG('P', 'C', 'M', ' ') },
- { 0, 0 },
+ { CODEC_ID_NONE, 0 },
};
//static int nsv_load_index(AVFormatContext *s);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggdec.c
index adf0ad051c..75afc84099 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggdec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggdec.c
@@ -116,7 +116,7 @@ ogg_reset (struct ogg * ogg)
os->pstart = 0;
os->psize = 0;
os->granule = -1;
- os->lastgp = -1;
+ os->lastpts = AV_NOPTS_VALUE;
os->nsegs = 0;
os->segp = 0;
}
@@ -288,7 +288,6 @@ ogg_read_page (AVFormatContext * s, int *str)
if (get_buffer (bc, os->buf + os->bufpos, size) < size)
return -1;
- os->lastgp = os->granule;
os->bufpos += size;
os->granule = gp;
os->flags = flags;
@@ -303,7 +302,7 @@ static int
ogg_packet (AVFormatContext * s, int *str, int *dstart, int *dsize)
{
struct ogg *ogg = s->priv_data;
- int idx;
+ int idx, i;
struct ogg_stream *os;
int complete = 0;
int segp = 0, psize = 0;
@@ -380,6 +379,7 @@ ogg_packet (AVFormatContext * s, int *str, int *dstart, int *dsize)
if (os->header > -1 && os->seq > os->header){
os->pflags = 0;
+ os->pduration = 0;
if (os->codec && os->codec->packet)
os->codec->packet (s, idx);
if (str)
@@ -392,6 +392,15 @@ ogg_packet (AVFormatContext * s, int *str, int *dstart, int *dsize)
os->psize = 0;
}
+ // determine whether there are more complete packets in this page
+ // if not, the page's granule will apply to this packet
+ os->page_end = 1;
+ for (i = os->segp; i < os->nsegs; i++)
+ if (os->segments[i] < 255) {
+ os->page_end = 0;
+ break;
+ }
+
os->seq++;
if (os->segp == os->nsegs)
ogg->curidx = -1;
@@ -518,12 +527,24 @@ ogg_read_packet (AVFormatContext * s, AVPacket * pkt)
return AVERROR(EIO);
pkt->stream_index = idx;
memcpy (pkt->data, os->buf + pstart, psize);
- if (os->lastgp != -1LL){
- pkt->pts = ogg_gptopts (s, idx, os->lastgp);
- os->lastgp = -1;
+
+ if (os->lastpts != AV_NOPTS_VALUE) {
+ pkt->pts = os->lastpts;
+ os->lastpts = AV_NOPTS_VALUE;
+ }
+ if (os->page_end) {
+ if (os->granule != -1LL) {
+ if (os->codec && os->codec->granule_is_start)
+ pkt->pts = ogg_gptopts(s, idx, os->granule);
+ else
+ os->lastpts = ogg_gptopts(s, idx, os->granule);
+ os->granule = -1LL;
+ } else
+ av_log(s, AV_LOG_WARNING, "Packet is missing granule\n");
}
pkt->flags = os->pflags;
+ pkt->duration = os->pduration;
return psize;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggdec.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggdec.h
index 91a59742ff..696233dd43 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggdec.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggdec.h
@@ -41,6 +41,11 @@ struct ogg_codec {
int (*header)(AVFormatContext *, int);
int (*packet)(AVFormatContext *, int);
uint64_t (*gptopts)(AVFormatContext *, int, uint64_t);
+ /**
+ * 1 if granule is the start time of the associated packet.
+ * 0 if granule is the end time of the associated packet.
+ */
+ int granule_is_start;
};
struct ogg_stream {
@@ -50,14 +55,17 @@ struct ogg_stream {
unsigned int pstart;
unsigned int psize;
unsigned int pflags;
+ unsigned int pduration;
uint32_t serial;
uint32_t seq;
- uint64_t granule, lastgp;
+ uint64_t granule;
+ int64_t lastpts;
int flags;
const struct ogg_codec *codec;
int header;
int nsegs, segp;
uint8_t segments[255];
+ int page_end; ///< current packet is the last one completed in the page
void *private;
};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggenc.c
index 9ab1ac0aff..669d3a0bb4 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggenc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggenc.c
@@ -83,10 +83,31 @@ static int ogg_write_page(AVFormatContext *s, const uint8_t *data, int size,
return size;
}
+static uint8_t *ogg_write_vorbiscomment(int offset, int bitexact,
+ int *header_len)
+{
+ const char *vendor = bitexact ? "ffmpeg" : LIBAVFORMAT_IDENT;
+ int size;
+ uint8_t *p, *p0;
+
+ size = offset + 4 + strlen(vendor) + 4;
+ p = av_mallocz(size);
+ if (!p)
+ return NULL;
+ p0 = p;
+
+ p += offset;
+ bytestream_put_le32(&p, strlen(vendor));
+ bytestream_put_buffer(&p, vendor, strlen(vendor));
+ bytestream_put_le32(&p, 0); // user comment list length
+
+ *header_len = size;
+ return p0;
+}
+
static int ogg_build_flac_headers(AVCodecContext *avctx,
OGGStreamContext *oggstream, int bitexact)
{
- const char *vendor = bitexact ? "ffmpeg" : LIBAVFORMAT_IDENT;
enum FLACExtradataFormat format;
uint8_t *streaminfo;
uint8_t *p;
@@ -111,16 +132,40 @@ static int ogg_build_flac_headers(AVCodecContext *avctx,
bytestream_put_buffer(&p, streaminfo, FLAC_STREAMINFO_SIZE);
// second packet: VorbisComment
- oggstream->header_len[1] = 1+3+4+strlen(vendor)+4;
- oggstream->header[1] = av_mallocz(oggstream->header_len[1]);
- p = oggstream->header[1];
+ p = ogg_write_vorbiscomment(4, bitexact, &oggstream->header_len[1]);
if (!p)
return AVERROR_NOMEM;
+ oggstream->header[1] = p;
bytestream_put_byte(&p, 0x84); // last metadata block and vorbis comment
bytestream_put_be24(&p, oggstream->header_len[1] - 4);
- bytestream_put_le32(&p, strlen(vendor));
- bytestream_put_buffer(&p, vendor, strlen(vendor));
- bytestream_put_le32(&p, 0); // user comment list length
+
+ return 0;
+}
+
+#define SPEEX_HEADER_SIZE 80
+
+static int ogg_build_speex_headers(AVCodecContext *avctx,
+ OGGStreamContext *oggstream, int bitexact)
+{
+ uint8_t *p;
+
+ if (avctx->extradata_size < SPEEX_HEADER_SIZE)
+ return -1;
+
+ // first packet: Speex header
+ p = av_mallocz(SPEEX_HEADER_SIZE);
+ if (!p)
+ return AVERROR_NOMEM;
+ oggstream->header[0] = p;
+ oggstream->header_len[0] = SPEEX_HEADER_SIZE;
+ bytestream_put_buffer(&p, avctx->extradata, SPEEX_HEADER_SIZE);
+ AV_WL32(&oggstream->header[0][68], 0); // set extra_headers to 0
+
+ // second packet: VorbisComment
+ p = ogg_write_vorbiscomment(0, bitexact, &oggstream->header_len[1]);
+ if (!p)
+ return AVERROR_NOMEM;
+ oggstream->header[1] = p;
return 0;
}
@@ -137,6 +182,7 @@ static int ogg_write_header(AVFormatContext *s)
av_set_pts_info(st, 64, st->codec->time_base.num, st->codec->time_base.den);
if (st->codec->codec_id != CODEC_ID_VORBIS &&
st->codec->codec_id != CODEC_ID_THEORA &&
+ st->codec->codec_id != CODEC_ID_SPEEX &&
st->codec->codec_id != CODEC_ID_FLAC) {
av_log(s, AV_LOG_ERROR, "Unsupported codec id in stream %d\n", i);
return -1;
@@ -156,6 +202,14 @@ static int ogg_write_header(AVFormatContext *s)
av_freep(&st->priv_data);
return err;
}
+ } else if (st->codec->codec_id == CODEC_ID_SPEEX) {
+ int err = ogg_build_speex_headers(st->codec, oggstream,
+ st->codec->flags & CODEC_FLAG_BITEXACT);
+ if (err) {
+ av_log(s, AV_LOG_ERROR, "Error writing Speex headers\n");
+ av_freep(&st->priv_data);
+ return err;
+ }
} else {
if (ff_split_xiph_headers(st->codec->extradata, st->codec->extradata_size,
st->codec->codec_id == CODEC_ID_VORBIS ? 30 : 42,
@@ -281,7 +335,8 @@ static int ogg_write_trailer(AVFormatContext *s)
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
OGGStreamContext *oggstream = st->priv_data;
- if (st->codec->codec_id == CODEC_ID_FLAC) {
+ if (st->codec->codec_id == CODEC_ID_FLAC ||
+ st->codec->codec_id == CODEC_ID_SPEEX) {
av_free(oggstream->header[0]);
av_free(oggstream->header[1]);
}
@@ -294,7 +349,7 @@ AVOutputFormat ogg_muxer = {
"ogg",
NULL_IF_CONFIG_SMALL("Ogg"),
"application/ogg",
- "ogg,ogv",
+ "ogg,ogv,spx",
0,
CODEC_ID_FLAC,
CODEC_ID_THEORA,
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggparseogm.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggparseogm.c
index f13f8c5242..beeb27d5bc 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggparseogm.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggparseogm.c
@@ -153,26 +153,30 @@ const struct ogg_codec ff_ogm_video_codec = {
.magic = "\001video",
.magicsize = 6,
.header = ogm_header,
- .packet = ogm_packet
+ .packet = ogm_packet,
+ .granule_is_start = 1,
};
const struct ogg_codec ff_ogm_audio_codec = {
.magic = "\001audio",
.magicsize = 6,
.header = ogm_header,
- .packet = ogm_packet
+ .packet = ogm_packet,
+ .granule_is_start = 1,
};
const struct ogg_codec ff_ogm_text_codec = {
.magic = "\001text",
.magicsize = 5,
.header = ogm_header,
- .packet = ogm_packet
+ .packet = ogm_packet,
+ .granule_is_start = 1,
};
const struct ogg_codec ff_ogm_old_codec = {
.magic = "\001Direct Show Samples embedded in Ogg",
.magicsize = 35,
.header = ogm_dshow_header,
- .packet = ogm_packet
+ .packet = ogm_packet,
+ .granule_is_start = 1,
};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggparsespeex.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggparsespeex.c
index cc00dd2207..14d2b38131 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggparsespeex.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggparsespeex.c
@@ -30,6 +30,10 @@
#include "avformat.h"
#include "oggdec.h"
+struct speex_params {
+ int final_packet_duration;
+};
+
static int speex_header(AVFormatContext *s, int idx) {
struct ogg *ogg = s->priv_data;
struct ogg_stream *os = ogg->streams + idx;
@@ -69,8 +73,53 @@ static int speex_header(AVFormatContext *s, int idx) {
return 1;
}
+static int ogg_page_packets(struct ogg_stream *os)
+{
+ int i;
+ int packets = 0;
+ for (i = 0; i < os->nsegs; i++)
+ if (os->segments[i] < 255)
+ packets++;
+ return packets;
+}
+
+static int speex_packet(AVFormatContext *s, int idx)
+{
+ struct ogg *ogg = s->priv_data;
+ struct ogg_stream *os = ogg->streams + idx;
+ struct speex_params *spxp = os->private;
+ int packet_size = s->streams[idx]->codec->frame_size;
+
+ if (!spxp) {
+ spxp = av_mallocz(sizeof(*spxp));
+ os->private = spxp;
+ }
+
+ if (os->flags & OGG_FLAG_EOS && os->lastpts != AV_NOPTS_VALUE &&
+ os->granule > 0) {
+ /* first packet of final page. we have to calculate the final packet
+ duration here because it is the only place we know the next-to-last
+ granule position. */
+ spxp->final_packet_duration = os->granule - os->lastpts -
+ packet_size * (ogg_page_packets(os) - 1);
+ }
+
+ if (!os->lastpts && os->granule > 0)
+ /* first packet */
+ os->pduration = os->granule - packet_size * (ogg_page_packets(os) - 1);
+ else if (os->flags & OGG_FLAG_EOS && os->segp == os->nsegs &&
+ spxp->final_packet_duration)
+ /* final packet */
+ os->pduration = spxp->final_packet_duration;
+ else
+ os->pduration = packet_size;
+
+ return 0;
+}
+
const struct ogg_codec ff_speex_codec = {
.magic = "Speex ",
.magicsize = 8,
- .header = speex_header
+ .header = speex_header,
+ .packet = speex_packet
};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggparsevorbis.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggparsevorbis.c
index 1ef7365f4a..6222962019 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggparsevorbis.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggparsevorbis.c
@@ -37,11 +37,8 @@
*/
const AVMetadataConv ff_vorbiscomment_metadata_conv[] = {
{ "ARTIST" , "author" },
- { "TITLE" , "title" },
- { "ALBUM" , "album" },
{ "DATE" , "year" },
{ "TRACKNUMBER", "track" },
- { "GENRE" , "genre" },
{ 0 }
};
@@ -105,10 +102,9 @@ vorbis_comment(AVFormatContext * as, uint8_t *buf, int size)
memcpy(ct, v, vl);
ct[vl] = 0;
- av_metadata_set(&as->metadata, tt, ct);
-
- av_freep(&tt);
- av_freep(&ct);
+ av_metadata_set2(&as->metadata, tt, ct,
+ AV_METADATA_DONT_STRDUP_KEY |
+ AV_METADATA_DONT_STRDUP_VAL);
}
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/options.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/options.c
index 795d02b73d..5cc007e046 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/options.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/options.c
@@ -50,7 +50,7 @@ static const AVOption options[]={
{"track", " set the track number", OFFSET(track), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, E},
{"year", "set the year", OFFSET(year), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, E},
#endif
-{"analyzeduration", "how many microseconds are analyzed to estimate duration", OFFSET(max_analyze_duration), FF_OPT_TYPE_INT, 3*AV_TIME_BASE, 0, INT_MAX, D},
+{"analyzeduration", "how many microseconds are analyzed to estimate duration", OFFSET(max_analyze_duration), FF_OPT_TYPE_INT, 5*AV_TIME_BASE, 0, INT_MAX, D},
{"cryptokey", "decryption key", OFFSET(key), FF_OPT_TYPE_BINARY, 0, 0, 0, D},
{"indexmem", "max memory used for timestamp index (per stream)", OFFSET(max_index_size), FF_OPT_TYPE_INT, 1<<20, 0, INT_MAX, D},
{"rtbufsize", "max memory used for buffering real-time frames", OFFSET(max_picture_buffer), FF_OPT_TYPE_INT, 3041280, 0, INT_MAX, D}, /* defaults to 1s of 15fps 352x288 YUYV422 video */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/os_support.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/os_support.h
index d4603632f7..f9a1706cb1 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/os_support.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/os_support.h
@@ -32,7 +32,7 @@
#if defined(__MINGW32__) && !defined(__MINGW32CE__)
# include <fcntl.h>
# define lseek(f,p,w) _lseeki64((f), (p), (w))
-#endif
+#endif /* defined(__MINGW32__) && !defined(__MINGW32CE__) */
static inline int is_dos_path(const char *path)
{
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/raw.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/raw.c
index 1449a20240..f4d7bb16c3 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/raw.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/raw.c
@@ -66,7 +66,7 @@ static int raw_write_packet(struct AVFormatContext *s, AVPacket *pkt)
static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
AVStream *st;
- int id;
+ enum CodecID id;
st = av_new_stream(s, 0);
if (!st)
@@ -282,6 +282,7 @@ static int video_read_header(AVFormatContext *s,
} else if ( st->codec->codec_id == CODEC_ID_MJPEG ||
st->codec->codec_id == CODEC_ID_MPEG4 ||
st->codec->codec_id == CODEC_ID_DIRAC ||
+ st->codec->codec_id == CODEC_ID_DNXHD ||
st->codec->codec_id == CODEC_ID_H264) {
st->codec->time_base= (AVRational){1,25};
}
@@ -472,7 +473,9 @@ static int h263_probe(AVProbeData *p)
last_src_fmt= src_fmt;
}
}
- if(valid_psc > 2*invalid_psc + 2*res_change + 2){
+//av_log(NULL, AV_LOG_ERROR, "h263_probe: psc:%d invalid:%d res_change:%d\n", valid_psc, invalid_psc, res_change);
+//h263_probe: psc:3 invalid:0 res_change:0 (1588/recent_ffmpeg_parses_mpg_incorrectly.mpg)
+ if(valid_psc > 2*invalid_psc + 2*res_change + 3){
return 50;
}else if(valid_psc > 2*invalid_psc)
return 25;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/riff.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/riff.c
index 43121afd7c..ca8d7da6bd 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/riff.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/riff.c
@@ -102,6 +102,7 @@ const AVCodecTag ff_codec_bmp_tags[] = {
{ CODEC_ID_DVVIDEO, MKTAG('c', 'd', 'v', 'c') }, /* Canopus DV */
{ CODEC_ID_DVVIDEO, MKTAG('C', 'D', 'V', 'H') }, /* Canopus DV */
{ CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'c', ' ') },
+ { CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'c', 's') },
{ CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'h', '1') },
{ CODEC_ID_MPEG1VIDEO, MKTAG('m', 'p', 'g', '1') },
{ CODEC_ID_MPEG1VIDEO, MKTAG('m', 'p', 'g', '2') },
@@ -116,9 +117,12 @@ const AVCodecTag ff_codec_bmp_tags[] = {
{ CODEC_ID_MPEG2VIDEO, MKTAG('D', 'V', 'R', ' ') },
{ CODEC_ID_MPEG2VIDEO, MKTAG('M', 'M', 'E', 'S') },
{ CODEC_ID_MPEG2VIDEO, MKTAG('L', 'M', 'P', '2') }, /* Lead MPEG2 in avi */
+ { CODEC_ID_MPEG2VIDEO, MKTAG('s', 'l', 'i', 'f') },
+ { CODEC_ID_MPEG2VIDEO, MKTAG('E', 'M', '2', 'V') },
{ CODEC_ID_MJPEG, MKTAG('M', 'J', 'P', 'G') },
{ CODEC_ID_MJPEG, MKTAG('L', 'J', 'P', 'G') },
{ CODEC_ID_MJPEG, MKTAG('d', 'm', 'b', '1') },
+ { CODEC_ID_MJPEG, MKTAG('m', 'j', 'p', 'a') },
{ CODEC_ID_LJPEG, MKTAG('L', 'J', 'P', 'G') },
{ CODEC_ID_MJPEG, MKTAG('J', 'P', 'G', 'L') }, /* Pegasus lossless JPEG */
{ CODEC_ID_JPEGLS, MKTAG('M', 'J', 'L', 'S') }, /* JPEG-LS custom FOURCC for avi - encoder */
@@ -130,6 +134,11 @@ const AVCodecTag ff_codec_bmp_tags[] = {
{ CODEC_ID_MJPEG, MKTAG('Q', 'I', 'V', 'G') },
{ CODEC_ID_MJPEG, MKTAG('S', 'L', 'M', 'J') }, /* SL M-JPEG */
{ CODEC_ID_MJPEG, MKTAG('C', 'J', 'P', 'G') }, /* Creative Webcam JPEG */
+ { CODEC_ID_MJPEG, MKTAG('I', 'J', 'L', 'V') }, /* Intel JPEG Library Video Codec */
+ { CODEC_ID_MJPEG, MKTAG('M', 'V', 'J', 'P') }, /* Midvid JPEG Video Codec */
+ { CODEC_ID_MJPEG, MKTAG('A', 'V', 'I', '1') },
+ { CODEC_ID_MJPEG, MKTAG('A', 'V', 'I', '2') },
+ { CODEC_ID_MJPEG, MKTAG('M', 'T', 'S', 'J') },
{ CODEC_ID_HUFFYUV, MKTAG('H', 'F', 'Y', 'U') },
{ CODEC_ID_FFVHUFF, MKTAG('F', 'F', 'V', 'H') },
{ CODEC_ID_CYUV, MKTAG('C', 'Y', 'U', 'V') },
@@ -138,12 +147,23 @@ const AVCodecTag ff_codec_bmp_tags[] = {
{ CODEC_ID_RAWVIDEO, MKTAG('I', '4', '2', '0') },
{ CODEC_ID_RAWVIDEO, MKTAG('Y', 'U', 'Y', '2') },
{ CODEC_ID_RAWVIDEO, MKTAG('Y', '4', '2', '2') },
+ { CODEC_ID_RAWVIDEO, MKTAG('V', '4', '2', '2') },
+ { CODEC_ID_RAWVIDEO, MKTAG('Y', 'U', 'N', 'V') },
+ { CODEC_ID_RAWVIDEO, MKTAG('U', 'Y', 'N', 'V') },
+ { CODEC_ID_RAWVIDEO, MKTAG('U', 'Y', 'N', 'Y') },
+ { CODEC_ID_RAWVIDEO, MKTAG('u', 'y', 'v', '1') },
+ { CODEC_ID_RAWVIDEO, MKTAG('2', 'V', 'u', '1') },
+ { CODEC_ID_RAWVIDEO, MKTAG('2', 'v', 'u', 'y') },
+ { CODEC_ID_RAWVIDEO, MKTAG('P', '4', '2', '2') },
{ CODEC_ID_RAWVIDEO, MKTAG('Y', 'V', '1', '2') },
{ CODEC_ID_RAWVIDEO, MKTAG('U', 'Y', 'V', 'Y') },
+ { CODEC_ID_RAWVIDEO, MKTAG('V', 'Y', 'U', 'Y') },
{ CODEC_ID_RAWVIDEO, MKTAG('I', 'Y', 'U', 'V') },
{ CODEC_ID_RAWVIDEO, MKTAG('Y', '8', '0', '0') },
{ CODEC_ID_RAWVIDEO, MKTAG('H', 'D', 'Y', 'C') },
{ CODEC_ID_RAWVIDEO, MKTAG('Y', 'V', 'U', '9') },
+ { CODEC_ID_FRWU, MKTAG('F', 'R', 'W', 'U') },
+ { CODEC_ID_R210, MKTAG('r', '2', '1', '0') },
{ CODEC_ID_V210, MKTAG('v', '2', '1', '0') },
{ CODEC_ID_INDEO3, MKTAG('I', 'V', '3', '1') },
{ CODEC_ID_INDEO3, MKTAG('I', 'V', '3', '2') },
@@ -268,7 +288,7 @@ const AVCodecTag ff_codec_wav_tags[] = {
{ CODEC_ID_PCM_S16LE, MKTAG('R', 'A', 'W', 'A') },
{ CODEC_ID_MP3, MKTAG('L', 'A', 'M', 'E') },
{ CODEC_ID_MP3, MKTAG('M', 'P', '3', ' ') },
- { 0, 0 },
+ { CODEC_ID_NONE, 0 },
};
#if CONFIG_MUXERS
@@ -302,7 +322,9 @@ int ff_put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
if(!enc->codec_tag || enc->codec_tag > 0xffff)
return -1;
- waveformatextensible = enc->channels > 2 && enc->channel_layout;
+ waveformatextensible = (enc->channels > 2 && enc->channel_layout)
+ || enc->sample_rate > 48000
+ || av_get_bits_per_sample(enc->codec_id) > 16;
if (waveformatextensible) {
put_le16(pb, 0xfffe);
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/riff.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/riff.h
index eac0d25470..876c22f31b 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/riff.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/riff.h
@@ -35,7 +35,7 @@ int64_t ff_start_tag(ByteIOContext *pb, const char *tag);
void ff_end_tag(ByteIOContext *pb, int64_t start);
typedef struct AVCodecTag {
- int id;
+ enum CodecID id;
unsigned int tag;
} AVCodecTag;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rmdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rmdec.c
index 944cbd0d00..ed05458167 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rmdec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rmdec.c
@@ -22,6 +22,7 @@
#include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
+#include "riff.h"
#include "rm.h"
struct RMStream {
@@ -48,6 +49,23 @@ typedef struct {
int audio_pkt_cnt; ///< Output packet counter
} RMDemuxContext;
+static const AVCodecTag rm_codec_tags[] = {
+ { CODEC_ID_RV10, MKTAG('R','V','1','0') },
+ { CODEC_ID_RV20, MKTAG('R','V','2','0') },
+ { CODEC_ID_RV20, MKTAG('R','V','T','R') },
+ { CODEC_ID_RV30, MKTAG('R','V','3','0') },
+ { CODEC_ID_RV40, MKTAG('R','V','4','0') },
+ { CODEC_ID_AC3, MKTAG('d','n','e','t') },
+ { CODEC_ID_RA_144, MKTAG('l','p','c','J') },
+ { CODEC_ID_RA_288, MKTAG('2','8','_','8') },
+ { CODEC_ID_COOK, MKTAG('c','o','o','k') },
+ { CODEC_ID_ATRAC3, MKTAG('a','t','r','c') },
+ { CODEC_ID_SIPR, MKTAG('s','i','p','r') },
+ { CODEC_ID_AAC, MKTAG('r','a','a','c') },
+ { CODEC_ID_AAC, MKTAG('r','a','c','p') },
+ { CODEC_ID_NONE },
+};
+
static const unsigned char sipr_swaps[38][2] = {
{ 0, 63 }, { 1, 22 }, { 2, 44 }, { 3, 90 },
{ 5, 81 }, { 7, 31 }, { 8, 86 }, { 9, 58 },
@@ -82,6 +100,20 @@ static void get_str8(ByteIOContext *pb, char *buf, int buf_size)
get_strl(pb, buf, buf_size, get_byte(pb));
}
+static int rm_read_extradata(ByteIOContext *pb, AVCodecContext *avctx, unsigned size)
+{
+ if (size >= 1<<24)
+ return -1;
+ avctx->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!avctx->extradata)
+ return AVERROR_NOMEM;
+ avctx->extradata_size = get_buffer(pb, avctx->extradata, size);
+ memset(avctx->extradata + avctx->extradata_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ if (avctx->extradata_size != size)
+ return AVERROR(EIO);
+ return 0;
+}
+
static void rm_read_metadata(AVFormatContext *s, int wide)
{
char buf[1024];
@@ -110,28 +142,32 @@ static int rm_read_audio_stream_info(AVFormatContext *s, ByteIOContext *pb,
{
char buf[256];
uint32_t version;
+ int ret;
/* ra type header */
- version = get_be32(pb); /* version */
- if (((version >> 16) & 0xff) == 3) {
+ version = get_be16(pb); /* version */
+ if (version == 3) {
+ int header_size = get_be16(pb);
int64_t startpos = url_ftell(pb);
url_fskip(pb, 14);
rm_read_metadata(s, 0);
- if ((startpos + (version & 0xffff)) >= url_ftell(pb) + 2) {
+ if ((startpos + header_size) >= url_ftell(pb) + 2) {
// fourcc (should always be "lpcJ")
get_byte(pb);
get_str8(pb, buf, sizeof(buf));
}
// Skip extra header crap (this should never happen)
- if ((startpos + (version & 0xffff)) > url_ftell(pb))
- url_fskip(pb, (version & 0xffff) + startpos - url_ftell(pb));
+ if ((startpos + header_size) > url_ftell(pb))
+ url_fskip(pb, header_size + startpos - url_ftell(pb));
st->codec->sample_rate = 8000;
st->codec->channels = 1;
st->codec->codec_type = CODEC_TYPE_AUDIO;
st->codec->codec_id = CODEC_ID_RA_144;
} else {
int flavor, sub_packet_h, coded_framesize, sub_packet_size;
+ int codecdata_length;
/* old version (4) */
+ url_fskip(pb, 2); /* unused */
get_be32(pb); /* .ra4 */
get_be32(pb); /* data size */
get_be16(pb); /* version2 */
@@ -145,13 +181,13 @@ static int rm_read_audio_stream_info(AVFormatContext *s, ByteIOContext *pb,
st->codec->block_align= get_be16(pb); /* frame size */
ast->sub_packet_size = sub_packet_size = get_be16(pb); /* sub packet size */
get_be16(pb); /* ??? */
- if (((version >> 16) & 0xff) == 5) {
+ if (version == 5) {
get_be16(pb); get_be16(pb); get_be16(pb);
}
st->codec->sample_rate = get_be16(pb);
get_be32(pb);
st->codec->channels = get_be16(pb);
- if (((version >> 16) & 0xff) == 5) {
+ if (version == 5) {
get_be32(pb);
get_buffer(pb, buf, 4);
buf[4] = 0;
@@ -160,11 +196,13 @@ static int rm_read_audio_stream_info(AVFormatContext *s, ByteIOContext *pb,
get_str8(pb, buf, sizeof(buf)); /* desc */
}
st->codec->codec_type = CODEC_TYPE_AUDIO;
- if (!strcmp(buf, "dnet")) {
- st->codec->codec_id = CODEC_ID_AC3;
+ st->codec->codec_tag = AV_RL32(buf);
+ st->codec->codec_id = ff_codec_get_id(rm_codec_tags, st->codec->codec_tag);
+ switch (st->codec->codec_id) {
+ case CODEC_ID_AC3:
st->need_parsing = AVSTREAM_PARSE_FULL;
- } else if (!strcmp(buf, "28_8")) {
- st->codec->codec_id = CODEC_ID_RA_288;
+ break;
+ case CODEC_ID_RA_288:
st->codec->extradata_size= 0;
ast->audio_framesize = st->codec->block_align;
st->codec->block_align = coded_framesize;
@@ -175,10 +213,12 @@ static int rm_read_audio_stream_info(AVFormatContext *s, ByteIOContext *pb,
}
av_new_packet(&ast->pkt, ast->audio_framesize * sub_packet_h);
- } else if ((!strcmp(buf, "cook")) || (!strcmp(buf, "atrc")) || (!strcmp(buf, "sipr"))) {
- int codecdata_length;
+ break;
+ case CODEC_ID_COOK:
+ case CODEC_ID_ATRAC3:
+ case CODEC_ID_SIPR:
get_be16(pb); get_byte(pb);
- if (((version >> 16) & 0xff) == 5)
+ if (version == 5)
get_byte(pb);
codecdata_length = get_be32(pb);
if(codecdata_length + FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)codecdata_length){
@@ -205,9 +245,8 @@ static int rm_read_audio_stream_info(AVFormatContext *s, ByteIOContext *pb,
}
st->codec->block_align = ast->sub_packet_size;
}
- st->codec->extradata_size= codecdata_length;
- st->codec->extradata= av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
- get_buffer(pb, st->codec->extradata, st->codec->extradata_size);
+ if ((ret = rm_read_extradata(s->pb, st->codec, codecdata_length)) < 0)
+ return ret;
if(ast->audio_framesize >= UINT_MAX / sub_packet_h){
av_log(s, AV_LOG_ERROR, "rm->audio_framesize * sub_packet_h too large\n");
@@ -215,10 +254,10 @@ static int rm_read_audio_stream_info(AVFormatContext *s, ByteIOContext *pb,
}
av_new_packet(&ast->pkt, ast->audio_framesize * sub_packet_h);
- } else if (!strcmp(buf, "raac") || !strcmp(buf, "racp")) {
- int codecdata_length;
+ break;
+ case CODEC_ID_AAC:
get_be16(pb); get_byte(pb);
- if (((version >> 16) & 0xff) == 5)
+ if (version == 5)
get_byte(pb);
st->codec->codec_id = CODEC_ID_AAC;
codecdata_length = get_be32(pb);
@@ -227,13 +266,12 @@ static int rm_read_audio_stream_info(AVFormatContext *s, ByteIOContext *pb,
return -1;
}
if (codecdata_length >= 1) {
- st->codec->extradata_size = codecdata_length - 1;
- st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
get_byte(pb);
- get_buffer(pb, st->codec->extradata, st->codec->extradata_size);
+ if ((ret = rm_read_extradata(s->pb, st->codec, codecdata_length - 1)) < 0)
+ return ret;
}
- } else {
- st->codec->codec_id = CODEC_ID_NONE;
+ break;
+ default:
av_strlcpy(st->codec->codec_name, buf, sizeof(st->codec->codec_name));
}
if (read_all) {
@@ -253,6 +291,7 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, ByteIOContext *pb,
unsigned int v;
int size;
int64_t codec_pos;
+ int ret;
av_set_pts_info(st, 64, 1, 1000);
codec_pos = url_ftell(pb);
@@ -269,12 +308,9 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, ByteIOContext *pb,
goto skip;
}
st->codec->codec_tag = get_le32(pb);
+ st->codec->codec_id = ff_codec_get_id(rm_codec_tags, st->codec->codec_tag);
// av_log(s, AV_LOG_DEBUG, "%X %X\n", st->codec->codec_tag, MKTAG('R', 'V', '2', '0'));
- if ( st->codec->codec_tag != MKTAG('R', 'V', '1', '0')
- && st->codec->codec_tag != MKTAG('R', 'V', '2', '0')
- && st->codec->codec_tag != MKTAG('R', 'V', '3', '0')
- && st->codec->codec_tag != MKTAG('R', 'V', '4', '0')
- && st->codec->codec_tag != MKTAG('R', 'V', 'T', 'R'))
+ if (st->codec->codec_id == CODEC_ID_NONE)
goto fail1;
st->codec->width = get_be16(pb);
st->codec->height = get_be16(pb);
@@ -284,26 +320,20 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, ByteIOContext *pb,
get_be32(pb);
fps2= get_be32(pb);
- st->codec->extradata_size= codec_data_size - (url_ftell(pb) - codec_pos);
-
- if(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)st->codec->extradata_size){
- //check is redundant as get_buffer() will catch this
- av_log(s, AV_LOG_ERROR, "st->codec->extradata_size too large\n");
- return -1;
- }
- st->codec->extradata= av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
- if (!st->codec->extradata)
- return AVERROR(ENOMEM);
- get_buffer(pb, st->codec->extradata, st->codec->extradata_size);
+ if ((ret = rm_read_extradata(s->pb, st->codec, codec_data_size - (url_ftell(pb) - codec_pos))) < 0)
+ return ret;
// av_log(s, AV_LOG_DEBUG, "fps= %d fps2= %d\n", fps, fps2);
st->codec->time_base.den = fps2;
- switch(((uint8_t*)st->codec->extradata)[4]>>4){
+ //XXX: do we really need that?
+ switch(st->codec->extradata[4]>>4){
case 1: st->codec->codec_id = CODEC_ID_RV10; break;
case 2: st->codec->codec_id = CODEC_ID_RV20; break;
case 3: st->codec->codec_id = CODEC_ID_RV30; break;
case 4: st->codec->codec_id = CODEC_ID_RV40; break;
- default: goto fail1;
+ default:
+ av_log(st->codec, AV_LOG_ERROR, "extra:%02X %02X %02X %02X %02X\n", st->codec->extradata[0], st->codec->extradata[1], st->codec->extradata[2], st->codec->extradata[3], st->codec->extradata[4]);
+ goto fail1;
}
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtmppkt.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtmppkt.c
index af416a4f1f..058a1ca37e 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtmppkt.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtmppkt.c
@@ -75,20 +75,25 @@ int ff_rtmp_packet_read(URLContext *h, RTMPPacket *p,
uint8_t hdr, t, buf[16];
int channel_id, timestamp, data_size, offset = 0;
uint32_t extra = 0;
- uint8_t type;
+ enum RTMPPacketType type;
if (url_read(h, &hdr, 1) != 1)
return AVERROR(EIO);
channel_id = hdr & 0x3F;
+ if (channel_id < 2) { //special case for channel number >= 64
+ buf[1] = 0;
+ if (url_read_complete(h, buf, channel_id + 1) != channel_id + 1)
+ return AVERROR(EIO);
+ channel_id = AV_RL16(buf) + 64;
+ }
data_size = prev_pkt[channel_id].data_size;
type = prev_pkt[channel_id].type;
extra = prev_pkt[channel_id].extra;
hdr >>= 6;
if (hdr == RTMP_PS_ONEBYTE) {
- //todo
- return -1;
+ timestamp = prev_pkt[channel_id].ts_delta;
} else {
if (url_read_complete(h, buf, 3) != 3)
return AVERROR(EIO);
@@ -97,15 +102,24 @@ int ff_rtmp_packet_read(URLContext *h, RTMPPacket *p,
if (url_read_complete(h, buf, 3) != 3)
return AVERROR(EIO);
data_size = AV_RB24(buf);
- if (url_read_complete(h, &type, 1) != 1)
+ if (url_read_complete(h, buf, 1) != 1)
return AVERROR(EIO);
+ type = buf[0];
if (hdr == RTMP_PS_TWELVEBYTES) {
if (url_read_complete(h, buf, 4) != 4)
return AVERROR(EIO);
extra = AV_RL32(buf);
}
}
+ if (timestamp == 0xFFFFFF) {
+ if (url_read_complete(h, buf, 4) != 4)
+ return AVERROR(EIO);
+ timestamp = AV_RB32(buf);
+ }
}
+ if (hdr != RTMP_PS_TWELVEBYTES)
+ timestamp += prev_pkt[channel_id].timestamp;
+
if (ff_rtmp_packet_create(p, channel_id, type, timestamp, data_size))
return -1;
p->extra = extra;
@@ -113,6 +127,7 @@ int ff_rtmp_packet_read(URLContext *h, RTMPPacket *p,
prev_pkt[channel_id].channel_id = channel_id;
prev_pkt[channel_id].type = type;
prev_pkt[channel_id].data_size = data_size;
+ prev_pkt[channel_id].ts_delta = timestamp - prev_pkt[channel_id].timestamp;
prev_pkt[channel_id].timestamp = timestamp;
prev_pkt[channel_id].extra = extra;
while (data_size > 0) {
@@ -138,18 +153,56 @@ int ff_rtmp_packet_write(URLContext *h, RTMPPacket *pkt,
uint8_t pkt_hdr[16], *p = pkt_hdr;
int mode = RTMP_PS_TWELVEBYTES;
int off = 0;
+ pkt->ts_delta = pkt->timestamp - prev_pkt[pkt->channel_id].timestamp;
+
+ //if channel_id = 0, this is first presentation of prev_pkt, send full hdr.
+ if (prev_pkt[pkt->channel_id].channel_id &&
+ pkt->extra == prev_pkt[pkt->channel_id].extra) {
+ if (pkt->type == prev_pkt[pkt->channel_id].type &&
+ pkt->data_size == prev_pkt[pkt->channel_id].data_size) {
+ mode = RTMP_PS_FOURBYTES;
+ if (pkt->ts_delta == prev_pkt[pkt->channel_id].ts_delta)
+ mode = RTMP_PS_ONEBYTE;
+ } else {
+ mode = RTMP_PS_EIGHTBYTES;
+ }
+ }
- //TODO: header compression
- bytestream_put_byte(&p, pkt->channel_id | (mode << 6));
+ if (pkt->channel_id < 64) {
+ bytestream_put_byte(&p, pkt->channel_id | (mode << 6));
+ } else if (pkt->channel_id < 64 + 256) {
+ bytestream_put_byte(&p, 0 | (mode << 6));
+ bytestream_put_byte(&p, pkt->channel_id - 64);
+ } else {
+ bytestream_put_byte(&p, 1 | (mode << 6));
+ bytestream_put_le16(&p, pkt->channel_id - 64);
+ }
if (mode != RTMP_PS_ONEBYTE) {
- bytestream_put_be24(&p, pkt->timestamp);
+ uint32_t timestamp = pkt->timestamp;
+ if (mode != RTMP_PS_TWELVEBYTES)
+ timestamp = pkt->ts_delta;
+ bytestream_put_be24(&p, timestamp >= 0xFFFFFF ? 0xFFFFFF : timestamp);
if (mode != RTMP_PS_FOURBYTES) {
bytestream_put_be24(&p, pkt->data_size);
bytestream_put_byte(&p, pkt->type);
if (mode == RTMP_PS_TWELVEBYTES)
bytestream_put_le32(&p, pkt->extra);
}
+ if (timestamp >= 0xFFFFFF)
+ bytestream_put_be32(&p, timestamp);
+ }
+ // save history
+ prev_pkt[pkt->channel_id].channel_id = pkt->channel_id;
+ prev_pkt[pkt->channel_id].type = pkt->type;
+ prev_pkt[pkt->channel_id].data_size = pkt->data_size;
+ prev_pkt[pkt->channel_id].timestamp = pkt->timestamp;
+ if (mode != RTMP_PS_TWELVEBYTES) {
+ prev_pkt[pkt->channel_id].ts_delta = pkt->ts_delta;
+ } else {
+ prev_pkt[pkt->channel_id].ts_delta = pkt->timestamp;
}
+ prev_pkt[pkt->channel_id].extra = pkt->extra;
+
url_write(h, pkt_hdr, p-pkt_hdr);
while (off < pkt->data_size) {
int towrite = FFMIN(chunk_size, pkt->data_size - off);
@@ -174,6 +227,7 @@ int ff_rtmp_packet_create(RTMPPacket *pkt, int channel_id, RTMPPacketType type,
pkt->type = type;
pkt->timestamp = timestamp;
pkt->extra = 0;
+ pkt->ts_delta = 0;
return 0;
}
@@ -228,10 +282,15 @@ int ff_amf_get_field_value(const uint8_t *data, const uint8_t *data_end,
int namelen = strlen(name);
int len;
+ while (*data != AMF_DATA_TYPE_OBJECT && data < data_end) {
+ len = ff_amf_tag_size(data, data_end);
+ if (len < 0)
+ len = data_end - data;
+ data += len;
+ }
if (data_end - data < 3)
return -1;
- if (*data++ != AMF_DATA_TYPE_OBJECT)
- return -1;
+ data++;
for (;;) {
int size = bytestream_get_be16(&data);
if (!size)
@@ -263,3 +322,113 @@ int ff_amf_get_field_value(const uint8_t *data, const uint8_t *data_end,
}
return -1;
}
+
+static const char* rtmp_packet_type(int type)
+{
+ switch (type) {
+ case RTMP_PT_CHUNK_SIZE: return "chunk size";
+ case RTMP_PT_BYTES_READ: return "bytes read";
+ case RTMP_PT_PING: return "ping";
+ case RTMP_PT_SERVER_BW: return "server bandwidth";
+ case RTMP_PT_CLIENT_BW: return "client bandwidth";
+ case RTMP_PT_AUDIO: return "audio packet";
+ case RTMP_PT_VIDEO: return "video packet";
+ case RTMP_PT_FLEX_STREAM: return "Flex shared stream";
+ case RTMP_PT_FLEX_OBJECT: return "Flex shared object";
+ case RTMP_PT_FLEX_MESSAGE: return "Flex shared message";
+ case RTMP_PT_NOTIFY: return "notification";
+ case RTMP_PT_SHARED_OBJ: return "shared object";
+ case RTMP_PT_INVOKE: return "invoke";
+ case RTMP_PT_METADATA: return "metadata";
+ default: return "unknown";
+ }
+}
+
+static void ff_amf_tag_contents(void *ctx, const uint8_t *data, const uint8_t *data_end)
+{
+ const uint8_t *base = data;
+ int i, size;
+ char buf[1024];
+
+ if (data >= data_end)
+ return;
+ switch (*data++) {
+ case AMF_DATA_TYPE_NUMBER:
+ av_log(ctx, AV_LOG_DEBUG, " number %g\n", av_int2dbl(AV_RB64(data)));
+ return;
+ case AMF_DATA_TYPE_BOOL:
+ av_log(ctx, AV_LOG_DEBUG, " bool %d\n", *data);
+ return;
+ case AMF_DATA_TYPE_STRING:
+ case AMF_DATA_TYPE_LONG_STRING:
+ if (data[-1] == AMF_DATA_TYPE_STRING) {
+ size = bytestream_get_be16(&data);
+ } else {
+ size = bytestream_get_be32(data);
+ }
+ size = FFMIN(size, 1023);
+ memcpy(buf, data, size);
+ buf[size] = 0;
+ av_log(ctx, AV_LOG_DEBUG, " string '%s'\n", buf);
+ return;
+ case AMF_DATA_TYPE_NULL:
+ av_log(ctx, AV_LOG_DEBUG, " NULL\n");
+ return;
+ case AMF_DATA_TYPE_ARRAY:
+ data += 4;
+ case AMF_DATA_TYPE_OBJECT:
+ av_log(ctx, AV_LOG_DEBUG, " {\n");
+ for (;;) {
+ int size = bytestream_get_be16(&data);
+ int t;
+ memcpy(buf, data, size);
+ buf[size] = 0;
+ if (!size) {
+ av_log(ctx, AV_LOG_DEBUG, " }\n");
+ data++;
+ break;
+ }
+ if (data + size >= data_end || data + size < data)
+ return;
+ data += size;
+ av_log(ctx, AV_LOG_DEBUG, " %s: ", buf);
+ ff_amf_tag_contents(ctx, data, data_end);
+ t = ff_amf_tag_size(data, data_end);
+ if (t < 0 || data + t >= data_end)
+ return;
+ data += t;
+ }
+ return;
+ case AMF_DATA_TYPE_OBJECT_END:
+ av_log(ctx, AV_LOG_DEBUG, " }\n");
+ return;
+ default:
+ return;
+ }
+}
+
+void ff_rtmp_packet_dump(void *ctx, RTMPPacket *p)
+{
+ av_log(ctx, AV_LOG_DEBUG, "RTMP packet type '%s'(%d) for channel %d, timestamp %d, extra field %d size %d\n",
+ rtmp_packet_type(p->type), p->type, p->channel_id, p->timestamp, p->extra, p->data_size);
+ if (p->type == RTMP_PT_INVOKE || p->type == RTMP_PT_NOTIFY) {
+ uint8_t *src = p->data, *src_end = p->data + p->data_size;
+ while (src < src_end) {
+ int sz;
+ ff_amf_tag_contents(ctx, src, src_end);
+ sz = ff_amf_tag_size(src, src_end);
+ if (sz < 0)
+ break;
+ src += sz;
+ }
+ } else if (p->type == RTMP_PT_SERVER_BW){
+ av_log(ctx, AV_LOG_DEBUG, "Server BW = %d\n", AV_RB32(p->data));
+ } else if (p->type == RTMP_PT_CLIENT_BW){
+ av_log(ctx, AV_LOG_DEBUG, "Client BW = %d\n", AV_RB32(p->data));
+ } else if (p->type != RTMP_PT_AUDIO && p->type != RTMP_PT_VIDEO && p->type != RTMP_PT_METADATA) {
+ int i;
+ for (i = 0; i < p->data_size; i++)
+ av_log(ctx, AV_LOG_DEBUG, " %02X", p->data[i]);
+ av_log(ctx, AV_LOG_DEBUG, "\n");
+ }
+}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtmppkt.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtmppkt.h
index b40f4fe061..560165b560 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtmppkt.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtmppkt.h
@@ -25,7 +25,7 @@
#include "avformat.h"
/** maximum possible number of different RTMP channels */
-#define RTMP_CHANNELS 64
+#define RTMP_CHANNELS 65599
/**
* channels used to for RTMP packets with different purposes (i.e. data, network
@@ -34,6 +34,7 @@
enum RTMPChannel {
RTMP_NETWORK_CHANNEL = 2, ///< channel for network-related messages (bandwidth report, ping, etc)
RTMP_SYSTEM_CHANNEL, ///< channel for sending server control messages
+ RTMP_SOURCE_CHANNEL, ///< channel for sending a/v to server
RTMP_VIDEO_CHANNEL = 8, ///< channel for video data
RTMP_AUDIO_CHANNEL, ///< channel for audio data
};
@@ -72,9 +73,10 @@ enum RTMPPacketSize {
* structure for holding RTMP packets
*/
typedef struct RTMPPacket {
- uint8_t channel_id; ///< RTMP channel ID (nothing to do with audio/video channels though)
+ int channel_id; ///< RTMP channel ID (nothing to do with audio/video channels though)
RTMPPacketType type; ///< packet payload type
- uint32_t timestamp; ///< packet full timestamp or timestamp increment to the previous one in milliseconds (latter only for media packets)
+ uint32_t timestamp; ///< packet full timestamp
+ uint32_t ts_delta; ///< timestamp increment to the previous one in milliseconds (latter only for media packets)
uint32_t extra; ///< probably an additional channel ID used during streaming data
uint8_t *data; ///< packet payload
int data_size; ///< packet payload size
@@ -127,6 +129,14 @@ int ff_rtmp_packet_write(URLContext *h, RTMPPacket *p,
int chunk_size, RTMPPacket *prev_pkt);
/**
+ * Prints information and contents of RTMP packet.
+ *
+ * @param h output context
+ * @param p packet to dump
+ */
+void ff_rtmp_packet_dump(void *ctx, RTMPPacket *p);
+
+/**
* @defgroup amffuncs functions used to work with AMF format (which is also used in .flv)
* @see amf_* funcs in libavformat/flvdec.c
* @{
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtmpproto.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtmpproto.c
index 55bd99033d..d117b018d3 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtmpproto.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtmpproto.c
@@ -43,13 +43,19 @@
#define LOG_CONTEXT s
#endif
+//#define DEBUG
+
/** RTMP protocol handler state */
typedef enum {
STATE_START, ///< client has not done anything yet
STATE_HANDSHAKED, ///< client has performed handshake
+ STATE_RELEASING, ///< client releasing stream before publish it (for output)
+ STATE_FCPUBLISH, ///< client FCPublishing stream (for output)
STATE_CONNECTING, ///< client connected to server successfully
STATE_READY, ///< client has sent all needed commands and waits for server reply
STATE_PLAYING, ///< client has started receiving multimedia data from server
+ STATE_PUBLISHING, ///< client has started sending multimedia data to server (for output)
+ STATE_STOPPED, ///< the broadcast has been stopped
} ClientState;
/** protocol handler context */
@@ -57,14 +63,15 @@ typedef struct RTMPContext {
URLContext* stream; ///< TCP stream used in interactions with RTMP server
RTMPPacket prev_pkt[2][RTMP_CHANNELS]; ///< packet history used when reading and sending packets
int chunk_size; ///< size of the chunks RTMP packets are divided into
+ int is_input; ///< input/output flag
char playpath[256]; ///< path to filename to play (with possible "mp4:" prefix)
+ char app[128]; ///< application
ClientState state; ///< current state
int main_channel_id; ///< an additional channel ID which is used for some invocations
uint8_t* flv_data; ///< buffer with data for demuxer
int flv_size; ///< current buffer size
int flv_off; ///< number of bytes read from current buffer
- uint32_t video_ts; ///< current video timestamp in milliseconds
- uint32_t audio_ts; ///< current audio timestamp in milliseconds
+ RTMPPacket out_pkt; ///< rtmp packet, created from flv a/v or metadata (for output)
} RTMPContext;
#define PLAYER_KEY_OPEN_PART_LEN 30 ///< length of partial key used for first client digest signing
@@ -94,43 +101,121 @@ static const uint8_t rtmp_server_key[] = {
* Generates 'connect' call and sends it to the server.
*/
static void gen_connect(URLContext *s, RTMPContext *rt, const char *proto,
- const char *host, int port, const char *app)
+ const char *host, int port)
{
RTMPPacket pkt;
- uint8_t ver[32], *p;
+ uint8_t ver[64], *p;
char tcurl[512];
- ff_rtmp_packet_create(&pkt, RTMP_VIDEO_CHANNEL, RTMP_PT_INVOKE, 0, 4096);
+ ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0, 4096);
p = pkt.data;
- snprintf(tcurl, sizeof(tcurl), "%s://%s:%d/%s", proto, host, port, app);
+ snprintf(tcurl, sizeof(tcurl), "%s://%s:%d/%s", proto, host, port, rt->app);
ff_amf_write_string(&p, "connect");
ff_amf_write_number(&p, 1.0);
ff_amf_write_object_start(&p);
ff_amf_write_field_name(&p, "app");
- ff_amf_write_string(&p, app);
+ ff_amf_write_string(&p, rt->app);
- snprintf(ver, sizeof(ver), "%s %d,%d,%d,%d", RTMP_CLIENT_PLATFORM, RTMP_CLIENT_VER1,
- RTMP_CLIENT_VER2, RTMP_CLIENT_VER3, RTMP_CLIENT_VER4);
+ if (rt->is_input) {
+ snprintf(ver, sizeof(ver), "%s %d,%d,%d,%d", RTMP_CLIENT_PLATFORM, RTMP_CLIENT_VER1,
+ RTMP_CLIENT_VER2, RTMP_CLIENT_VER3, RTMP_CLIENT_VER4);
+ } else {
+ snprintf(ver, sizeof(ver), "FMLE/3.0 (compatible; %s)", LIBAVFORMAT_IDENT);
+ ff_amf_write_field_name(&p, "type");
+ ff_amf_write_string(&p, "nonprivate");
+ }
ff_amf_write_field_name(&p, "flashVer");
ff_amf_write_string(&p, ver);
ff_amf_write_field_name(&p, "tcUrl");
ff_amf_write_string(&p, tcurl);
- ff_amf_write_field_name(&p, "fpad");
- ff_amf_write_bool(&p, 0);
- ff_amf_write_field_name(&p, "capabilities");
- ff_amf_write_number(&p, 15.0);
- ff_amf_write_field_name(&p, "audioCodecs");
- ff_amf_write_number(&p, 1639.0);
- ff_amf_write_field_name(&p, "videoCodecs");
- ff_amf_write_number(&p, 252.0);
- ff_amf_write_field_name(&p, "videoFunction");
- ff_amf_write_number(&p, 1.0);
+ if (rt->is_input) {
+ ff_amf_write_field_name(&p, "fpad");
+ ff_amf_write_bool(&p, 0);
+ ff_amf_write_field_name(&p, "capabilities");
+ ff_amf_write_number(&p, 15.0);
+ ff_amf_write_field_name(&p, "audioCodecs");
+ ff_amf_write_number(&p, 1639.0);
+ ff_amf_write_field_name(&p, "videoCodecs");
+ ff_amf_write_number(&p, 252.0);
+ ff_amf_write_field_name(&p, "videoFunction");
+ ff_amf_write_number(&p, 1.0);
+ }
ff_amf_write_object_end(&p);
pkt.data_size = p - pkt.data;
ff_rtmp_packet_write(rt->stream, &pkt, rt->chunk_size, rt->prev_pkt[1]);
+ ff_rtmp_packet_destroy(&pkt);
+}
+
+/**
+ * Generates 'releaseStream' call and sends it to the server. It should make
+ * the server release some channel for media streams.
+ */
+static void gen_release_stream(URLContext *s, RTMPContext *rt)
+{
+ RTMPPacket pkt;
+ uint8_t *p;
+
+ ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0,
+ 29 + strlen(rt->playpath));
+
+ av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Releasing stream...\n");
+ p = pkt.data;
+ ff_amf_write_string(&p, "releaseStream");
+ ff_amf_write_number(&p, 2.0);
+ ff_amf_write_null(&p);
+ ff_amf_write_string(&p, rt->playpath);
+
+ ff_rtmp_packet_write(rt->stream, &pkt, rt->chunk_size, rt->prev_pkt[1]);
+ ff_rtmp_packet_destroy(&pkt);
+}
+
+/**
+ * Generates 'FCPublish' call and sends it to the server. It should make
+ * the server preapare for receiving media streams.
+ */
+static void gen_fcpublish_stream(URLContext *s, RTMPContext *rt)
+{
+ RTMPPacket pkt;
+ uint8_t *p;
+
+ ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0,
+ 25 + strlen(rt->playpath));
+
+ av_log(LOG_CONTEXT, AV_LOG_DEBUG, "FCPublish stream...\n");
+ p = pkt.data;
+ ff_amf_write_string(&p, "FCPublish");
+ ff_amf_write_number(&p, 3.0);
+ ff_amf_write_null(&p);
+ ff_amf_write_string(&p, rt->playpath);
+
+ ff_rtmp_packet_write(rt->stream, &pkt, rt->chunk_size, rt->prev_pkt[1]);
+ ff_rtmp_packet_destroy(&pkt);
+}
+
+/**
+ * Generates 'FCUnpublish' call and sends it to the server. It should make
+ * the server destroy stream.
+ */
+static void gen_fcunpublish_stream(URLContext *s, RTMPContext *rt)
+{
+ RTMPPacket pkt;
+ uint8_t *p;
+
+ ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0,
+ 27 + strlen(rt->playpath));
+
+ av_log(LOG_CONTEXT, AV_LOG_DEBUG, "UnPublishing stream...\n");
+ p = pkt.data;
+ ff_amf_write_string(&p, "FCUnpublish");
+ ff_amf_write_number(&p, 5.0);
+ ff_amf_write_null(&p);
+ ff_amf_write_string(&p, rt->playpath);
+
+ ff_rtmp_packet_write(rt->stream, &pkt, rt->chunk_size, rt->prev_pkt[1]);
+ ff_rtmp_packet_destroy(&pkt);
}
/**
@@ -143,17 +228,40 @@ static void gen_create_stream(URLContext *s, RTMPContext *rt)
uint8_t *p;
av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Creating stream...\n");
- ff_rtmp_packet_create(&pkt, RTMP_VIDEO_CHANNEL, RTMP_PT_INVOKE, 0, 25);
+ ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0, 25);
p = pkt.data;
ff_amf_write_string(&p, "createStream");
- ff_amf_write_number(&p, 3.0);
+ ff_amf_write_number(&p, rt->is_input ? 3.0 : 4.0);
ff_amf_write_null(&p);
ff_rtmp_packet_write(rt->stream, &pkt, rt->chunk_size, rt->prev_pkt[1]);
ff_rtmp_packet_destroy(&pkt);
}
+
+/**
+ * Generates 'deleteStream' call and sends it to the server. It should make
+ * the server remove some channel for media streams.
+ */
+static void gen_delete_stream(URLContext *s, RTMPContext *rt)
+{
+ RTMPPacket pkt;
+ uint8_t *p;
+
+ av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Deleting stream...\n");
+ ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0, 34);
+
+ p = pkt.data;
+ ff_amf_write_string(&p, "deleteStream");
+ ff_amf_write_number(&p, 0.0);
+ ff_amf_write_null(&p);
+ ff_amf_write_number(&p, rt->main_channel_id);
+
+ ff_rtmp_packet_write(rt->stream, &pkt, rt->chunk_size, rt->prev_pkt[1]);
+ ff_rtmp_packet_destroy(&pkt);
+}
+
/**
* Generates 'play' call and sends it to the server, then pings the server
* to start actual playing.
@@ -165,7 +273,7 @@ static void gen_play(URLContext *s, RTMPContext *rt)
av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Sending play command for '%s'\n", rt->playpath);
ff_rtmp_packet_create(&pkt, RTMP_VIDEO_CHANNEL, RTMP_PT_INVOKE, 0,
- 29 + strlen(rt->playpath));
+ 20 + strlen(rt->playpath));
pkt.extra = rt->main_channel_id;
p = pkt.data;
@@ -173,7 +281,6 @@ static void gen_play(URLContext *s, RTMPContext *rt)
ff_amf_write_number(&p, 0.0);
ff_amf_write_null(&p);
ff_amf_write_string(&p, rt->playpath);
- ff_amf_write_number(&p, 0.0);
ff_rtmp_packet_write(rt->stream, &pkt, rt->chunk_size, rt->prev_pkt[1]);
ff_rtmp_packet_destroy(&pkt);
@@ -191,6 +298,30 @@ static void gen_play(URLContext *s, RTMPContext *rt)
}
/**
+ * Generates 'publish' call and sends it to the server.
+ */
+static void gen_publish(URLContext *s, RTMPContext *rt)
+{
+ RTMPPacket pkt;
+ uint8_t *p;
+
+ av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Sending publish command for '%s'\n", rt->playpath);
+ ff_rtmp_packet_create(&pkt, RTMP_SOURCE_CHANNEL, RTMP_PT_INVOKE, 0,
+ 30 + strlen(rt->playpath));
+ pkt.extra = rt->main_channel_id;
+
+ p = pkt.data;
+ ff_amf_write_string(&p, "publish");
+ ff_amf_write_number(&p, 0.0);
+ ff_amf_write_null(&p);
+ ff_amf_write_string(&p, rt->playpath);
+ ff_amf_write_string(&p, "live");
+
+ ff_rtmp_packet_write(rt->stream, &pkt, rt->chunk_size, rt->prev_pkt[1]);
+ ff_rtmp_packet_destroy(&pkt);
+}
+
+/**
* Generates ping reply and sends it to the server.
*/
static void gen_pong(URLContext *s, RTMPContext *rt, RTMPPacket *ppkt)
@@ -201,7 +332,7 @@ static void gen_pong(URLContext *s, RTMPContext *rt, RTMPPacket *ppkt)
ff_rtmp_packet_create(&pkt, RTMP_NETWORK_CHANNEL, RTMP_PT_PING, ppkt->timestamp + 1, 6);
p = pkt.data;
bytestream_put_be16(&p, 7);
- bytestream_put_be32(&p, AV_RB32(ppkt->data+2) + 1);
+ bytestream_put_be32(&p, AV_RB32(ppkt->data+2));
ff_rtmp_packet_write(rt->stream, &pkt, rt->chunk_size, rt->prev_pkt[1]);
ff_rtmp_packet_destroy(&pkt);
}
@@ -350,37 +481,42 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Server version %d.%d.%d.%d\n",
serverdata[5], serverdata[6], serverdata[7], serverdata[8]);
- server_pos = rtmp_validate_digest(serverdata + 1, 772);
- if (!server_pos) {
- server_pos = rtmp_validate_digest(serverdata + 1, 8);
+ if (rt->is_input) {
+ server_pos = rtmp_validate_digest(serverdata + 1, 772);
if (!server_pos) {
- av_log(LOG_CONTEXT, AV_LOG_ERROR, "Server response validating failed\n");
+ server_pos = rtmp_validate_digest(serverdata + 1, 8);
+ if (!server_pos) {
+ av_log(LOG_CONTEXT, AV_LOG_ERROR, "Server response validating failed\n");
+ return -1;
+ }
+ }
+
+ rtmp_calc_digest(tosend + 1 + client_pos, 32, 0,
+ rtmp_server_key, sizeof(rtmp_server_key),
+ digest);
+ rtmp_calc_digest(clientdata, RTMP_HANDSHAKE_PACKET_SIZE-32, 0,
+ digest, 32,
+ digest);
+ if (memcmp(digest, clientdata + RTMP_HANDSHAKE_PACKET_SIZE - 32, 32)) {
+ av_log(LOG_CONTEXT, AV_LOG_ERROR, "Signature mismatch\n");
return -1;
}
- }
- rtmp_calc_digest(tosend + 1 + client_pos, 32, 0,
- rtmp_server_key, sizeof(rtmp_server_key),
- digest);
- rtmp_calc_digest(clientdata, RTMP_HANDSHAKE_PACKET_SIZE-32, 0,
- digest, 32,
- digest);
- if (memcmp(digest, clientdata + RTMP_HANDSHAKE_PACKET_SIZE - 32, 32)) {
- av_log(LOG_CONTEXT, AV_LOG_ERROR, "Signature mismatch\n");
- return -1;
+ for (i = 0; i < RTMP_HANDSHAKE_PACKET_SIZE; i++)
+ tosend[i] = av_lfg_get(&rnd) >> 24;
+ rtmp_calc_digest(serverdata + 1 + server_pos, 32, 0,
+ rtmp_player_key, sizeof(rtmp_player_key),
+ digest);
+ rtmp_calc_digest(tosend, RTMP_HANDSHAKE_PACKET_SIZE - 32, 0,
+ digest, 32,
+ tosend + RTMP_HANDSHAKE_PACKET_SIZE - 32);
+
+ // write reply back to the server
+ url_write(rt->stream, tosend, RTMP_HANDSHAKE_PACKET_SIZE);
+ } else {
+ url_write(rt->stream, serverdata+1, RTMP_HANDSHAKE_PACKET_SIZE);
}
- for (i = 0; i < RTMP_HANDSHAKE_PACKET_SIZE; i++)
- tosend[i] = av_lfg_get(&rnd) >> 24;
- rtmp_calc_digest(serverdata + 1 + server_pos, 32, 0,
- rtmp_player_key, sizeof(rtmp_player_key),
- digest);
- rtmp_calc_digest(tosend, RTMP_HANDSHAKE_PACKET_SIZE - 32, 0,
- digest, 32,
- tosend + RTMP_HANDSHAKE_PACKET_SIZE - 32);
-
- // write reply back to the server
- url_write(rt->stream, tosend, RTMP_HANDSHAKE_PACKET_SIZE);
return 0;
}
@@ -395,6 +531,10 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
int i, t;
const uint8_t *data_end = pkt->data + pkt->data_size;
+#ifdef DEBUG
+ ff_rtmp_packet_dump(LOG_CONTEXT, pkt);
+#endif
+
switch (pkt->type) {
case RTMP_PT_CHUNK_SIZE:
if (pkt->data_size != 4) {
@@ -402,6 +542,8 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
"Chunk size change packet is not 4 bytes long (%d)\n", pkt->data_size);
return -1;
}
+ if (!rt->is_input)
+ ff_rtmp_packet_write(rt->stream, pkt, rt->chunk_size, rt->prev_pkt[1]);
rt->chunk_size = AV_RB32(pkt->data);
if (rt->chunk_size <= 0) {
av_log(LOG_CONTEXT, AV_LOG_ERROR, "Incorrect chunk size %d\n", rt->chunk_size);
@@ -426,9 +568,29 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
} else if (!memcmp(pkt->data, "\002\000\007_result", 10)) {
switch (rt->state) {
case STATE_HANDSHAKED:
+ if (!rt->is_input) {
+ gen_release_stream(s, rt);
+ gen_fcpublish_stream(s, rt);
+ rt->state = STATE_RELEASING;
+ } else {
+ rt->state = STATE_CONNECTING;
+ }
gen_create_stream(s, rt);
+ break;
+ case STATE_FCPUBLISH:
rt->state = STATE_CONNECTING;
break;
+ case STATE_RELEASING:
+ rt->state = STATE_FCPUBLISH;
+ /* hack for Wowza Media Server, it does not send result for
+ * releaseStream and FCPublish calls */
+ if (!pkt->data[10]) {
+ int pkt_id = (int) av_int2dbl(AV_RB64(pkt->data + 11));
+ if (pkt_id == 4)
+ rt->state = STATE_CONNECTING;
+ }
+ if (rt->state != STATE_CONNECTING)
+ break;
case STATE_CONNECTING:
//extract a number from the result
if (pkt->data[10] || pkt->data[19] != 5 || pkt->data[20]) {
@@ -436,14 +598,17 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
} else {
rt->main_channel_id = (int) av_int2dbl(AV_RB64(pkt->data + 21));
}
- gen_play(s, rt);
+ if (rt->is_input) {
+ gen_play(s, rt);
+ } else {
+ gen_publish(s, rt);
+ }
rt->state = STATE_READY;
break;
}
} else if (!memcmp(pkt->data, "\002\000\010onStatus", 11)) {
const uint8_t* ptr = pkt->data + 11;
uint8_t tmpstr[256];
- int t;
for (i = 0; i < 2; i++) {
t = ff_amf_tag_size(ptr, data_end);
@@ -461,10 +626,10 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
}
t = ff_amf_get_field_value(ptr, data_end,
"code", tmpstr, sizeof(tmpstr));
- if (!t && !strcmp(tmpstr, "NetStream.Play.Start")) {
- rt->state = STATE_PLAYING;
- return 0;
- }
+ if (!t && !strcmp(tmpstr, "NetStream.Play.Start")) rt->state = STATE_PLAYING;
+ if (!t && !strcmp(tmpstr, "NetStream.Play.Stop")) rt->state = STATE_STOPPED;
+ if (!t && !strcmp(tmpstr, "NetStream.Play.UnpublishNotify")) rt->state = STATE_STOPPED;
+ if (!t && !strcmp(tmpstr, "NetStream.Publish.Start")) rt->state = STATE_PUBLISHING;
}
break;
}
@@ -476,7 +641,10 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
* there is some significant data (media data or expected status notification).
*
* @param s reading context
- * @param for_header non-zero value tells function to work until it gets notification from the server that playing has been started, otherwise function will work until some media data is received (or an error happens)
+ * @param for_header non-zero value tells function to work until it
+ * gets notification from the server that playing has been started,
+ * otherwise function will work until some media data is received (or
+ * an error happens)
* @return 0 for successful operation, negative value in case of error
*/
static int get_packet(URLContext *s, int for_header)
@@ -484,7 +652,10 @@ static int get_packet(URLContext *s, int for_header)
RTMPContext *rt = s->priv_data;
int ret;
- for(;;) {
+ if (rt->state == STATE_STOPPED)
+ return AVERROR_EOF;
+
+ for (;;) {
RTMPPacket rpkt;
if ((ret = ff_rtmp_packet_read(rt->stream, &rpkt,
rt->chunk_size, rt->prev_pkt[0])) != 0) {
@@ -500,26 +671,23 @@ static int get_packet(URLContext *s, int for_header)
ff_rtmp_packet_destroy(&rpkt);
return -1;
}
- if (for_header && rt->state == STATE_PLAYING) {
+ if (rt->state == STATE_STOPPED) {
+ ff_rtmp_packet_destroy(&rpkt);
+ return AVERROR_EOF;
+ }
+ if (for_header && (rt->state == STATE_PLAYING || rt->state == STATE_PUBLISHING)) {
ff_rtmp_packet_destroy(&rpkt);
return 0;
}
- if (!rpkt.data_size) {
+ if (!rpkt.data_size || !rt->is_input) {
ff_rtmp_packet_destroy(&rpkt);
continue;
}
if (rpkt.type == RTMP_PT_VIDEO || rpkt.type == RTMP_PT_AUDIO ||
- rpkt.type == RTMP_PT_NOTIFY) {
+ (rpkt.type == RTMP_PT_NOTIFY && !memcmp("\002\000\012onMetaData", rpkt.data, 13))) {
uint8_t *p;
uint32_t ts = rpkt.timestamp;
- if (rpkt.type == RTMP_PT_VIDEO) {
- rt->video_ts += rpkt.timestamp;
- ts = rt->video_ts;
- } else if (rpkt.type == RTMP_PT_AUDIO) {
- rt->audio_ts += rpkt.timestamp;
- ts = rt->audio_ts;
- }
// generate packet header and put data into buffer for FLV demuxer
rt->flv_off = 0;
rt->flv_size = rpkt.data_size + 15;
@@ -551,6 +719,16 @@ static int rtmp_close(URLContext *h)
{
RTMPContext *rt = h->priv_data;
+ if (!rt->is_input) {
+ rt->flv_data = NULL;
+ if (rt->out_pkt.data_size)
+ ff_rtmp_packet_destroy(&rt->out_pkt);
+ if (rt->state > STATE_FCPUBLISH)
+ gen_fcunpublish_stream(h, rt);
+ }
+ if (rt->state > STATE_HANDSHAKED)
+ gen_delete_stream(h, rt);
+
av_freep(&rt->flv_data);
url_close(rt->stream);
av_free(rt);
@@ -569,17 +747,16 @@ static int rtmp_close(URLContext *h)
static int rtmp_open(URLContext *s, const char *uri, int flags)
{
RTMPContext *rt;
- char proto[8], hostname[256], path[1024], app[128], *fname;
+ char proto[8], hostname[256], path[1024], *fname;
uint8_t buf[2048];
- int port, is_input;
+ int port;
int ret;
- is_input = !(flags & URL_WRONLY);
-
rt = av_mallocz(sizeof(RTMPContext));
if (!rt)
return AVERROR(ENOMEM);
s->priv_data = rt;
+ rt->is_input = !(flags & URL_WRONLY);
url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname), &port,
path, sizeof(path), s->filename);
@@ -588,63 +765,67 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
port = RTMP_DEFAULT_PORT;
snprintf(buf, sizeof(buf), "tcp://%s:%d", hostname, port);
- if (url_open(&rt->stream, buf, URL_RDWR) < 0)
+ if (url_open(&rt->stream, buf, URL_RDWR) < 0) {
+ av_log(LOG_CONTEXT, AV_LOG_ERROR, "Cannot open connection %s\n", buf);
goto fail;
+ }
- if (!is_input) {
- av_log(LOG_CONTEXT, AV_LOG_ERROR, "RTMP output is not supported yet.\n");
- goto fail;
- } else {
- rt->state = STATE_START;
- if (rtmp_handshake(s, rt))
- return -1;
+ rt->state = STATE_START;
+ if (rtmp_handshake(s, rt))
+ return -1;
- rt->chunk_size = 128;
- rt->state = STATE_HANDSHAKED;
- //extract "app" part from path
- if (!strncmp(path, "/ondemand/", 10)) {
- fname = path + 10;
- memcpy(app, "ondemand", 9);
+ rt->chunk_size = 128;
+ rt->state = STATE_HANDSHAKED;
+ //extract "app" part from path
+ if (!strncmp(path, "/ondemand/", 10)) {
+ fname = path + 10;
+ memcpy(rt->app, "ondemand", 9);
+ } else {
+ char *p = strchr(path + 1, '/');
+ if (!p) {
+ fname = path + 1;
+ rt->app[0] = '\0';
} else {
- char *p = strchr(path + 1, '/');
- if (!p) {
- fname = path + 1;
- app[0] = '\0';
+ char *c = strchr(p + 1, ':');
+ fname = strchr(p + 1, '/');
+ if (!fname || c < fname) {
+ fname = p + 1;
+ av_strlcpy(rt->app, path + 1, p - path);
} else {
- char *c = strchr(p + 1, ':');
- fname = strchr(p + 1, '/');
- if (!fname || c < fname) {
- fname = p + 1;
- av_strlcpy(app, path + 1, p - path);
- } else {
- fname++;
- av_strlcpy(app, path + 1, fname - path - 1);
- }
+ fname++;
+ av_strlcpy(rt->app, path + 1, fname - path - 1);
}
}
- if (!strchr(fname, ':') &&
- (!strcmp(fname + strlen(fname) - 4, ".f4v") ||
- !strcmp(fname + strlen(fname) - 4, ".mp4"))) {
- memcpy(rt->playpath, "mp4:", 5);
- } else {
- rt->playpath[0] = 0;
- }
- strncat(rt->playpath, fname, sizeof(rt->playpath) - 5);
+ }
+ if (!strchr(fname, ':') &&
+ (!strcmp(fname + strlen(fname) - 4, ".f4v") ||
+ !strcmp(fname + strlen(fname) - 4, ".mp4"))) {
+ memcpy(rt->playpath, "mp4:", 5);
+ } else {
+ rt->playpath[0] = 0;
+ }
+ strncat(rt->playpath, fname, sizeof(rt->playpath) - 5);
- av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Proto = %s, path = %s, app = %s, fname = %s\n",
- proto, path, app, rt->playpath);
- gen_connect(s, rt, proto, hostname, port, app);
+ av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Proto = %s, path = %s, app = %s, fname = %s\n",
+ proto, path, rt->app, rt->playpath);
+ gen_connect(s, rt, proto, hostname, port);
+
+ do {
+ ret = get_packet(s, 1);
+ } while (ret == EAGAIN);
+ if (ret < 0)
+ goto fail;
- do {
- ret = get_packet(s, 1);
- } while (ret == EAGAIN);
- if (ret < 0)
- goto fail;
+ if (rt->is_input) {
// generate FLV header for demuxer
rt->flv_size = 13;
rt->flv_data = av_realloc(rt->flv_data, rt->flv_size);
rt->flv_off = 0;
memcpy(rt->flv_data, "FLV\1\5\0\0\0\011\0\0\0\0", rt->flv_size);
+ } else {
+ rt->flv_size = 0;
+ rt->flv_data = NULL;
+ rt->flv_off = 0;
}
s->max_packet_size = url_get_max_packet_size(rt->stream);
@@ -684,7 +865,68 @@ static int rtmp_read(URLContext *s, uint8_t *buf, int size)
static int rtmp_write(URLContext *h, uint8_t *buf, int size)
{
- return 0;
+ RTMPContext *rt = h->priv_data;
+ int size_temp = size;
+ int pktsize, pkttype;
+ uint32_t ts;
+ const uint8_t *buf_temp = buf;
+
+ if (size < 11) {
+ av_log(LOG_CONTEXT, AV_LOG_DEBUG, "FLV packet too small %d\n", size);
+ return 0;
+ }
+
+ do {
+ if (!rt->flv_off) {
+ //skip flv header
+ if (buf_temp[0] == 'F' && buf_temp[1] == 'L' && buf_temp[2] == 'V') {
+ buf_temp += 9 + 4;
+ size_temp -= 9 + 4;
+ }
+
+ pkttype = bytestream_get_byte(&buf_temp);
+ pktsize = bytestream_get_be24(&buf_temp);
+ ts = bytestream_get_be24(&buf_temp);
+ ts |= bytestream_get_byte(&buf_temp) << 24;
+ bytestream_get_be24(&buf_temp);
+ size_temp -= 11;
+ rt->flv_size = pktsize;
+
+ //force 12bytes header
+ if (((pkttype == RTMP_PT_VIDEO || pkttype == RTMP_PT_AUDIO) && ts == 0) ||
+ pkttype == RTMP_PT_NOTIFY) {
+ if (pkttype == RTMP_PT_NOTIFY)
+ pktsize += 16;
+ rt->prev_pkt[1][RTMP_SOURCE_CHANNEL].channel_id = 0;
+ }
+
+ //this can be a big packet, it's better to send it right here
+ ff_rtmp_packet_create(&rt->out_pkt, RTMP_SOURCE_CHANNEL, pkttype, ts, pktsize);
+ rt->out_pkt.extra = rt->main_channel_id;
+ rt->flv_data = rt->out_pkt.data;
+
+ if (pkttype == RTMP_PT_NOTIFY)
+ ff_amf_write_string(&rt->flv_data, "@setDataFrame");
+ }
+
+ if (rt->flv_size - rt->flv_off > size_temp) {
+ bytestream_get_buffer(&buf_temp, rt->flv_data + rt->flv_off, size_temp);
+ rt->flv_off += size_temp;
+ } else {
+ bytestream_get_buffer(&buf_temp, rt->flv_data + rt->flv_off, rt->flv_size - rt->flv_off);
+ rt->flv_off += rt->flv_size - rt->flv_off;
+ }
+
+ if (rt->flv_off == rt->flv_size) {
+ bytestream_get_be32(&buf_temp);
+
+ ff_rtmp_packet_write(rt->stream, &rt->out_pkt, rt->chunk_size, rt->prev_pkt[1]);
+ ff_rtmp_packet_destroy(&rt->out_pkt);
+ rt->flv_size = 0;
+ rt->flv_off = 0;
+ }
+ } while (buf_temp - buf < size_temp);
+ return size;
}
URLProtocol rtmp_protocol = {
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtp_h264.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtp_h264.c
index fb7891dd3f..bc47078c28 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtp_h264.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtp_h264.c
@@ -368,7 +368,7 @@ static int parse_h264_sdp_line(AVFormatContext *s, int st_index,
while (*p && *p == ' ') p++; // strip spaces.
while (*p && *p != ' ') p++; // eat protocol identifier
while (*p && *p == ' ') p++; // strip trailing spaces.
- while (*p && *p != '-' && (buf1 - dst) < sizeof(buf1) - 1) {
+ while (*p && *p != '-' && (dst - buf1) < sizeof(buf1) - 1) {
*dst++ = *p++;
}
*dst = '\0';
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtsp.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtsp.c
index d85ec76a2a..012e14717c 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtsp.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtsp.c
@@ -43,19 +43,18 @@
//#define DEBUG
//#define DEBUG_RTP_TCP
-static int rtsp_read_play(AVFormatContext *s);
+#if CONFIG_RTSP_DEMUXER
+static int tcp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
+ uint8_t *buf, int buf_size);
+static int rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
+ unsigned char **content_ptr,
+ int return_on_interleaved_data);
+#endif
#if LIBAVFORMAT_VERSION_INT < (53 << 16)
int rtsp_default_protocols = (1 << RTSP_LOWER_TRANSPORT_UDP);
#endif
-static int rtsp_probe(AVProbeData *p)
-{
- if (av_strstart(p->filename, "rtsp:", NULL))
- return AVPROBE_SCORE_MAX;
- return 0;
-}
-
#define SPACE_CHARS " \t\r\n"
/* we use memchr() instead of strchr() here because strchr() will return
* the terminating '\0' of SPACE_CHARS instead of NULL if c is '\0'. */
@@ -554,6 +553,198 @@ static int sdp_parse(AVFormatContext *s, const char *content)
return 0;
}
+static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
+ uint8_t *buf, int buf_size)
+{
+ RTSPState *rt = s->priv_data;
+ RTSPStream *rtsp_st;
+ fd_set rfds;
+ int fd, fd_max, n, i, ret, tcp_fd;
+ struct timeval tv;
+
+ for(;;) {
+ if (url_interrupt_cb())
+ return AVERROR(EINTR);
+ FD_ZERO(&rfds);
+ if (rt->rtsp_hd) {
+ tcp_fd = fd_max = url_get_file_handle(rt->rtsp_hd);
+ FD_SET(tcp_fd, &rfds);
+ } else {
+ fd_max = 0;
+ tcp_fd = -1;
+ }
+ for(i = 0; i < rt->nb_rtsp_streams; i++) {
+ rtsp_st = rt->rtsp_streams[i];
+ if (rtsp_st->rtp_handle) {
+ /* currently, we cannot probe RTCP handle because of
+ * blocking restrictions */
+ fd = url_get_file_handle(rtsp_st->rtp_handle);
+ if (fd > fd_max)
+ fd_max = fd;
+ FD_SET(fd, &rfds);
+ }
+ }
+ tv.tv_sec = 0;
+ tv.tv_usec = 100 * 1000;
+ n = select(fd_max + 1, &rfds, NULL, NULL, &tv);
+ if (n > 0) {
+ for(i = 0; i < rt->nb_rtsp_streams; i++) {
+ rtsp_st = rt->rtsp_streams[i];
+ if (rtsp_st->rtp_handle) {
+ fd = url_get_file_handle(rtsp_st->rtp_handle);
+ if (FD_ISSET(fd, &rfds)) {
+ ret = url_read(rtsp_st->rtp_handle, buf, buf_size);
+ if (ret > 0) {
+ *prtsp_st = rtsp_st;
+ return ret;
+ }
+ }
+ }
+ }
+#if CONFIG_RTSP_DEMUXER
+ if (FD_ISSET(tcp_fd, &rfds)) {
+ RTSPMessageHeader reply;
+
+ rtsp_read_reply(s, &reply, NULL, 0);
+ /* XXX: parse message */
+ if (rt->state != RTSP_STATE_PLAYING)
+ return 0;
+ }
+#endif
+ }
+ if (s->flags & AVFMT_FLAG_NONBLOCK)
+ return AVERROR(EAGAIN);
+ }
+}
+
+static int sdp_read_packet(AVFormatContext *s, AVPacket *pkt)
+{
+ RTSPState *rt = s->priv_data;
+ int ret, len;
+ uint8_t buf[10 * RTP_MAX_PACKET_LENGTH];
+ RTSPStream *rtsp_st;
+
+ /* get next frames from the same RTP packet */
+ if (rt->cur_transport_priv) {
+ if (rt->transport == RTSP_TRANSPORT_RDT)
+ ret = ff_rdt_parse_packet(rt->cur_transport_priv, pkt, NULL, 0);
+ else
+ ret = rtp_parse_packet(rt->cur_transport_priv, pkt, NULL, 0);
+ if (ret == 0) {
+ rt->cur_transport_priv = NULL;
+ return 0;
+ } else if (ret == 1) {
+ return 0;
+ } else {
+ rt->cur_transport_priv = NULL;
+ }
+ }
+
+ /* read next RTP packet */
+ redo:
+ switch(rt->lower_transport) {
+ default:
+#if CONFIG_RTSP_DEMUXER
+ case RTSP_LOWER_TRANSPORT_TCP:
+ len = tcp_read_packet(s, &rtsp_st, buf, sizeof(buf));
+ break;
+#endif
+ case RTSP_LOWER_TRANSPORT_UDP:
+ case RTSP_LOWER_TRANSPORT_UDP_MULTICAST:
+ len = udp_read_packet(s, &rtsp_st, buf, sizeof(buf));
+ if (len >=0 && rtsp_st->transport_priv && rt->transport == RTSP_TRANSPORT_RTP)
+ rtp_check_and_send_back_rr(rtsp_st->transport_priv, len);
+ break;
+ }
+ if (len < 0)
+ return len;
+ if (len == 0)
+ return AVERROR_EOF;
+ if (rt->transport == RTSP_TRANSPORT_RDT)
+ ret = ff_rdt_parse_packet(rtsp_st->transport_priv, pkt, buf, len);
+ else
+ ret = rtp_parse_packet(rtsp_st->transport_priv, pkt, buf, len);
+ if (ret < 0)
+ goto redo;
+ if (ret == 1) {
+ /* more packets may follow, so we save the RTP context */
+ rt->cur_transport_priv = rtsp_st->transport_priv;
+ }
+
+ return ret;
+}
+
+/* close and free RTSP streams */
+static void rtsp_close_streams(RTSPState *rt)
+{
+ int i;
+ RTSPStream *rtsp_st;
+
+ for(i=0;i<rt->nb_rtsp_streams;i++) {
+ rtsp_st = rt->rtsp_streams[i];
+ if (rtsp_st) {
+ if (rtsp_st->transport_priv) {
+ if (rt->transport == RTSP_TRANSPORT_RDT)
+ ff_rdt_parse_close(rtsp_st->transport_priv);
+ else
+ rtp_parse_close(rtsp_st->transport_priv);
+ }
+ if (rtsp_st->rtp_handle)
+ url_close(rtsp_st->rtp_handle);
+ if (rtsp_st->dynamic_handler && rtsp_st->dynamic_protocol_context)
+ rtsp_st->dynamic_handler->close(rtsp_st->dynamic_protocol_context);
+ }
+ }
+ av_free(rt->rtsp_streams);
+ if (rt->asf_ctx) {
+ av_close_input_stream (rt->asf_ctx);
+ rt->asf_ctx = NULL;
+ }
+ av_freep(&rt->auth_b64);
+}
+
+static int
+rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
+{
+ RTSPState *rt = s->priv_data;
+ AVStream *st = NULL;
+
+ /* open the RTP context */
+ if (rtsp_st->stream_index >= 0)
+ st = s->streams[rtsp_st->stream_index];
+ if (!st)
+ s->ctx_flags |= AVFMTCTX_NOHEADER;
+
+ if (rt->transport == RTSP_TRANSPORT_RDT)
+ rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,
+ rtsp_st->dynamic_protocol_context,
+ rtsp_st->dynamic_handler);
+ else
+ rtsp_st->transport_priv = rtp_parse_open(s, st, rtsp_st->rtp_handle,
+ rtsp_st->sdp_payload_type,
+ &rtsp_st->rtp_payload_data);
+
+ if (!rtsp_st->transport_priv) {
+ return AVERROR(ENOMEM);
+ } else if (rt->transport != RTSP_TRANSPORT_RDT) {
+ if(rtsp_st->dynamic_handler) {
+ rtp_parse_set_dynamic_protocol(rtsp_st->transport_priv,
+ rtsp_st->dynamic_protocol_context,
+ rtsp_st->dynamic_handler);
+ }
+ }
+
+ return 0;
+}
+
+#if CONFIG_RTSP_DEMUXER
+static int rtsp_probe(AVProbeData *p)
+{
+ if (av_strstart(p->filename, "rtsp:", NULL))
+ return AVPROBE_SCORE_MAX;
+ return 0;
+}
+
static void rtsp_parse_range(int *min_ptr, int *max_ptr, const char **pp)
{
const char *p;
@@ -704,6 +895,9 @@ void rtsp_parse_line(RTSPMessageHeader *reply, const char *buf)
} else if (av_stristart(p, "Notice:", &p) ||
av_stristart(p, "X-Notice:", &p)) {
reply->notice = strtol(p, NULL, 10);
+ } else if (av_stristart(p, "Location:", &p)) {
+ skip_spaces(&p);
+ av_strlcpy(reply->location, p , sizeof(reply->location));
}
}
@@ -877,70 +1071,6 @@ static void rtsp_send_cmd (AVFormatContext *s,
rtsp_read_reply(s, reply, content_ptr, 0);
}
-
-/* close and free RTSP streams */
-static void rtsp_close_streams(RTSPState *rt)
-{
- int i;
- RTSPStream *rtsp_st;
-
- for(i=0;i<rt->nb_rtsp_streams;i++) {
- rtsp_st = rt->rtsp_streams[i];
- if (rtsp_st) {
- if (rtsp_st->transport_priv) {
- if (rt->transport == RTSP_TRANSPORT_RDT)
- ff_rdt_parse_close(rtsp_st->transport_priv);
- else
- rtp_parse_close(rtsp_st->transport_priv);
- }
- if (rtsp_st->rtp_handle)
- url_close(rtsp_st->rtp_handle);
- if (rtsp_st->dynamic_handler && rtsp_st->dynamic_protocol_context)
- rtsp_st->dynamic_handler->close(rtsp_st->dynamic_protocol_context);
- }
- }
- av_free(rt->rtsp_streams);
- if (rt->asf_ctx) {
- av_close_input_stream (rt->asf_ctx);
- rt->asf_ctx = NULL;
- }
- av_freep(&rt->auth_b64);
-}
-
-static int
-rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
-{
- RTSPState *rt = s->priv_data;
- AVStream *st = NULL;
-
- /* open the RTP context */
- if (rtsp_st->stream_index >= 0)
- st = s->streams[rtsp_st->stream_index];
- if (!st)
- s->ctx_flags |= AVFMTCTX_NOHEADER;
-
- if (rt->transport == RTSP_TRANSPORT_RDT)
- rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,
- rtsp_st->dynamic_protocol_context,
- rtsp_st->dynamic_handler);
- else
- rtsp_st->transport_priv = rtp_parse_open(s, st, rtsp_st->rtp_handle,
- rtsp_st->sdp_payload_type,
- &rtsp_st->rtp_payload_data);
-
- if (!rtsp_st->transport_priv) {
- return AVERROR(ENOMEM);
- } else if (rt->transport != RTSP_TRANSPORT_RDT) {
- if(rtsp_st->dynamic_handler) {
- rtp_parse_set_dynamic_protocol(rtsp_st->transport_priv,
- rtsp_st->dynamic_protocol_context,
- rtsp_st->dynamic_handler);
- }
- }
-
- return 0;
-}
-
/**
* @returns 0 on success, <0 on error, 1 if protocol is unavailable.
*/
@@ -1125,12 +1255,19 @@ make_setup_request (AVFormatContext *s, const char *host, int port,
{
char url[1024];
struct in_addr in;
-
- in.s_addr = htonl(reply->transports[0].destination);
+ int port, ttl;
+
+ if (reply->transports[0].destination) {
+ in.s_addr = htonl(reply->transports[0].destination);
+ port = reply->transports[0].port_min;
+ ttl = reply->transports[0].ttl;
+ } else {
+ in = rtsp_st->sdp_ip;
+ port = rtsp_st->sdp_port;
+ ttl = rtsp_st->sdp_ttl;
+ }
snprintf(url, sizeof(url), "rtp://%s:%d?ttl=%d",
- inet_ntoa(in),
- reply->transports[0].port_min,
- reply->transports[0].ttl);
+ inet_ntoa(in), port, ttl);
if (url_open(&rtsp_st->rtp_handle, url, URL_RDWR) < 0) {
err = AVERROR_INVALIDDATA;
goto fail;
@@ -1161,18 +1298,48 @@ fail:
return err;
}
+static int rtsp_read_play(AVFormatContext *s)
+{
+ RTSPState *rt = s->priv_data;
+ RTSPMessageHeader reply1, *reply = &reply1;
+ char cmd[1024];
+
+ av_log(s, AV_LOG_DEBUG, "hello state=%d\n", rt->state);
+
+ if (!(rt->server_type == RTSP_SERVER_REAL && rt->need_subscription)) {
+ if (rt->state == RTSP_STATE_PAUSED) {
+ snprintf(cmd, sizeof(cmd),
+ "PLAY %s RTSP/1.0\r\n",
+ s->filename);
+ } else {
+ snprintf(cmd, sizeof(cmd),
+ "PLAY %s RTSP/1.0\r\n"
+ "Range: npt=%0.3f-\r\n",
+ s->filename,
+ (double)rt->seek_timestamp / AV_TIME_BASE);
+ }
+ rtsp_send_cmd(s, cmd, reply, NULL);
+ if (reply->status_code != RTSP_STATUS_OK) {
+ return -1;
+ }
+ }
+ rt->state = RTSP_STATE_PLAYING;
+ return 0;
+}
+
static int rtsp_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
RTSPState *rt = s->priv_data;
- char host[1024], path[1024], tcpname[1024], cmd[2048], auth[128], *option_list, *option;
+ char host[1024], path[1024], tcpname[1024], cmd[2048], auth[128];
+ char *option_list, *option, *filename;
URLContext *rtsp_hd;
int port, ret, err;
RTSPMessageHeader reply1, *reply = &reply1;
unsigned char *content = NULL;
int lower_transport_mask = 0;
char real_challenge[64];
-
+ redirect:
/* extract hostname and port */
url_split(NULL, 0, auth, sizeof(auth),
host, sizeof(host), &port, path, sizeof(path), s->filename);
@@ -1192,14 +1359,14 @@ static int rtsp_read_header(AVFormatContext *s,
/* search for options */
option_list = strchr(path, '?');
if (option_list) {
- /* remove the options from the path */
- *option_list++ = 0;
+ filename = strchr(s->filename, '?');
while(option_list) {
/* move the option pointer */
- option = option_list;
+ option = ++option_list;
option_list = strchr(option_list, '&');
if (option_list)
- *(option_list++) = 0;
+ *option_list = 0;
+
/* handle the options */
if (strcmp(option, "udp") == 0)
lower_transport_mask = (1<< RTSP_LOWER_TRANSPORT_UDP);
@@ -1207,7 +1374,13 @@ static int rtsp_read_header(AVFormatContext *s,
lower_transport_mask = (1<< RTSP_LOWER_TRANSPORT_UDP_MULTICAST);
else if (strcmp(option, "tcp") == 0)
lower_transport_mask = (1<< RTSP_LOWER_TRANSPORT_TCP);
+ else {
+ strcpy(++filename, option);
+ filename += strlen(option);
+ if (option_list) *filename = '&';
+ }
}
+ *filename = 0;
}
if (!lower_transport_mask)
@@ -1323,7 +1496,13 @@ static int rtsp_read_header(AVFormatContext *s,
rtsp_close_streams(rt);
av_freep(&content);
url_close(rt->rtsp_hd);
- av_freep(&rt->auth_b64);
+ if (reply->status_code >=300 && reply->status_code < 400) {
+ av_strlcpy(s->filename, reply->location, sizeof(s->filename));
+ av_log(s, AV_LOG_INFO, "Status %d: Redirecting to %s\n",
+ reply->status_code,
+ s->filename);
+ goto redirect;
+ }
return err;
}
@@ -1381,75 +1560,11 @@ static int tcp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
return len;
}
-static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
- uint8_t *buf, int buf_size)
-{
- RTSPState *rt = s->priv_data;
- RTSPStream *rtsp_st;
- fd_set rfds;
- int fd, fd_max, n, i, ret, tcp_fd;
- struct timeval tv;
-
- for(;;) {
- if (url_interrupt_cb())
- return AVERROR(EINTR);
- FD_ZERO(&rfds);
- if (rt->rtsp_hd) {
- tcp_fd = fd_max = url_get_file_handle(rt->rtsp_hd);
- FD_SET(tcp_fd, &rfds);
- } else {
- fd_max = 0;
- tcp_fd = -1;
- }
- for(i = 0; i < rt->nb_rtsp_streams; i++) {
- rtsp_st = rt->rtsp_streams[i];
- if (rtsp_st->rtp_handle) {
- /* currently, we cannot probe RTCP handle because of
- * blocking restrictions */
- fd = url_get_file_handle(rtsp_st->rtp_handle);
- if (fd > fd_max)
- fd_max = fd;
- FD_SET(fd, &rfds);
- }
- }
- tv.tv_sec = 0;
- tv.tv_usec = 100 * 1000;
- n = select(fd_max + 1, &rfds, NULL, NULL, &tv);
- if (n > 0) {
- for(i = 0; i < rt->nb_rtsp_streams; i++) {
- rtsp_st = rt->rtsp_streams[i];
- if (rtsp_st->rtp_handle) {
- fd = url_get_file_handle(rtsp_st->rtp_handle);
- if (FD_ISSET(fd, &rfds)) {
- ret = url_read(rtsp_st->rtp_handle, buf, buf_size);
- if (ret > 0) {
- *prtsp_st = rtsp_st;
- return ret;
- }
- }
- }
- }
- if (FD_ISSET(tcp_fd, &rfds)) {
- RTSPMessageHeader reply;
-
- rtsp_read_reply(s, &reply, NULL, 0);
- /* XXX: parse message */
- if (rt->state != RTSP_STATE_PLAYING)
- return 0;
- }
- }
- if (s->flags & AVFMT_FLAG_NONBLOCK)
- return AVERROR(EAGAIN);
- }
-}
-
static int rtsp_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
RTSPState *rt = s->priv_data;
- RTSPStream *rtsp_st;
- int ret, len;
- uint8_t buf[10 * RTP_MAX_PACKET_LENGTH];
+ int ret;
RTSPMessageHeader reply1, *reply = &reply1;
char cmd[1024];
@@ -1513,49 +1628,9 @@ static int rtsp_read_packet(AVFormatContext *s,
}
}
- /* get next frames from the same RTP packet */
- if (rt->cur_transport_priv) {
- if (rt->transport == RTSP_TRANSPORT_RDT)
- ret = ff_rdt_parse_packet(rt->cur_transport_priv, pkt, NULL, 0);
- else
- ret = rtp_parse_packet(rt->cur_transport_priv, pkt, NULL, 0);
- if (ret == 0) {
- rt->cur_transport_priv = NULL;
- return 0;
- } else if (ret == 1) {
- return 0;
- } else {
- rt->cur_transport_priv = NULL;
- }
- }
-
- /* read next RTP packet */
- redo:
- switch(rt->lower_transport) {
- default:
- case RTSP_LOWER_TRANSPORT_TCP:
- len = tcp_read_packet(s, &rtsp_st, buf, sizeof(buf));
- break;
- case RTSP_LOWER_TRANSPORT_UDP:
- case RTSP_LOWER_TRANSPORT_UDP_MULTICAST:
- len = udp_read_packet(s, &rtsp_st, buf, sizeof(buf));
- if (len >=0 && rtsp_st->transport_priv && rt->transport == RTSP_TRANSPORT_RTP)
- rtp_check_and_send_back_rr(rtsp_st->transport_priv, len);
- break;
- }
- if (len < 0)
- return len;
- if (len == 0)
- return AVERROR_EOF;
- if (rt->transport == RTSP_TRANSPORT_RDT)
- ret = ff_rdt_parse_packet(rtsp_st->transport_priv, pkt, buf, len);
- else
- ret = rtp_parse_packet(rtsp_st->transport_priv, pkt, buf, len);
- if (ret < 0)
- goto redo;
- if (ret == 1) {
- /* more packets may follow, so we save the RTP context */
- rt->cur_transport_priv = rtsp_st->transport_priv;
+ ret = sdp_read_packet(s, pkt);
+ if (ret < 0) {
+ return ret;
}
/* send dummy request to keep TCP connection alive */
@@ -1576,35 +1651,6 @@ static int rtsp_read_packet(AVFormatContext *s,
return 0;
}
-static int rtsp_read_play(AVFormatContext *s)
-{
- RTSPState *rt = s->priv_data;
- RTSPMessageHeader reply1, *reply = &reply1;
- char cmd[1024];
-
- av_log(s, AV_LOG_DEBUG, "hello state=%d\n", rt->state);
-
- if (!(rt->server_type == RTSP_SERVER_REAL && rt->need_subscription)) {
- if (rt->state == RTSP_STATE_PAUSED) {
- snprintf(cmd, sizeof(cmd),
- "PLAY %s RTSP/1.0\r\n",
- s->filename);
- } else {
- snprintf(cmd, sizeof(cmd),
- "PLAY %s RTSP/1.0\r\n"
- "Range: npt=%0.3f-\r\n",
- s->filename,
- (double)rt->seek_timestamp / AV_TIME_BASE);
- }
- rtsp_send_cmd(s, cmd, reply, NULL);
- if (reply->status_code != RTSP_STATUS_OK) {
- return -1;
- }
- }
- rt->state = RTSP_STATE_PLAYING;
- return 0;
-}
-
/* pause the stream */
static int rtsp_read_pause(AVFormatContext *s)
{
@@ -1675,7 +1721,6 @@ static int rtsp_read_close(AVFormatContext *s)
return 0;
}
-#if CONFIG_RTSP_DEMUXER
AVInputFormat rtsp_demuxer = {
"rtsp",
NULL_IF_CONFIG_SMALL("RTSP input format"),
@@ -1755,12 +1800,6 @@ static int sdp_read_header(AVFormatContext *s,
return err;
}
-static int sdp_read_packet(AVFormatContext *s,
- AVPacket *pkt)
-{
- return rtsp_read_packet(s, pkt);
-}
-
static int sdp_read_close(AVFormatContext *s)
{
RTSPState *rt = s->priv_data;
@@ -1768,7 +1807,6 @@ static int sdp_read_close(AVFormatContext *s)
return 0;
}
-#if CONFIG_SDP_DEMUXER
AVInputFormat sdp_demuxer = {
"sdp",
NULL_IF_CONFIG_SMALL("SDP"),
@@ -1778,70 +1816,3 @@ AVInputFormat sdp_demuxer = {
sdp_read_packet,
sdp_read_close,
};
-#endif
-
-#if CONFIG_REDIR_DEMUXER
-/* dummy redirector format (used directly in av_open_input_file now) */
-static int redir_probe(AVProbeData *pd)
-{
- const char *p;
- p = pd->buf;
- skip_spaces(&p);
- if (av_strstart(p, "http://", NULL) ||
- av_strstart(p, "rtsp://", NULL))
- return AVPROBE_SCORE_MAX;
- return 0;
-}
-
-static int redir_read_header(AVFormatContext *s, AVFormatParameters *ap)
-{
- char buf[4096], *q;
- int c;
- AVFormatContext *ic = NULL;
- ByteIOContext *f = s->pb;
-
- /* parse each URL and try to open it */
- c = url_fgetc(f);
- while (c != URL_EOF) {
- /* skip spaces */
- for(;;) {
- if (!redir_isspace(c))
- break;
- c = url_fgetc(f);
- }
- if (c == URL_EOF)
- break;
- /* record url */
- q = buf;
- for(;;) {
- if (c == URL_EOF || redir_isspace(c))
- break;
- if ((q - buf) < sizeof(buf) - 1)
- *q++ = c;
- c = url_fgetc(f);
- }
- *q = '\0';
- //printf("URL='%s'\n", buf);
- /* try to open the media file */
- if (av_open_input_file(&ic, buf, NULL, 0, NULL) == 0)
- break;
- }
- if (!ic)
- return AVERROR(EIO);
-
- *s = *ic;
- url_fclose(f);
-
- return 0;
-}
-
-AVInputFormat redir_demuxer = {
- "redir",
- NULL_IF_CONFIG_SMALL("Redirector format"),
- 0,
- redir_probe,
- redir_read_header,
- NULL,
- NULL,
-};
-#endif
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtsp.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtsp.h
index 3db8235afd..8f79c759ff 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtsp.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtsp.h
@@ -121,6 +121,10 @@ typedef struct RTSPMessageHeader {
* should be re-transmitted by the client in every RTSP command. */
char session_id[512];
+ /** the "Location:" field. This value is used to handle redirection.
+ */
+ char location[4096];
+
/** the "RealChallenge1:" field from the server */
char real_challenge[64];
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/sdp.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/sdp.c
index 67b10a21fe..832807062d 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/sdp.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/sdp.c
@@ -58,14 +58,14 @@ static void sdp_write_header(char *buff, int size, struct sdp_session_level *s)
{
av_strlcatf(buff, size, "v=%d\r\n"
"o=- %d %d IN IP4 %s\r\n"
- "t=%d %d\r\n"
- "s=%s\r\n"
- "a=tool:libavformat " AV_STRINGIFY(LIBAVFORMAT_VERSION) "\r\n",
+ "s=%s\r\n",
s->sdp_version,
s->id, s->version, s->src_addr,
- s->start_time, s->end_time,
s->name);
sdp_write_address(buff, size, s->dst_addr, s->ttl);
+ av_strlcatf(buff, size, "t=%d %d\r\n"
+ "a=tool:libavformat " AV_STRINGIFY(LIBAVFORMAT_VERSION) "\r\n",
+ s->start_time, s->end_time);
}
static int sdp_get_address(char *dest_addr, int size, int *ttl, const char *url)
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/smacker.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/smacker.c
index 7d0a8d59d4..8ec28bcd3b 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/smacker.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/smacker.c
@@ -183,7 +183,6 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap)
ast[i]->codec->bits_per_coded_sample = (smk->rates[i] & SMK_AUD_16BITS) ? 16 : 8;
if(ast[i]->codec->bits_per_coded_sample == 16 && ast[i]->codec->codec_id == CODEC_ID_PCM_U8)
ast[i]->codec->codec_id = CODEC_ID_PCM_S16LE;
- ast[i]->codec->sample_fmt = ast[i]->codec->bits_per_coded_sample == 8 ? SAMPLE_FMT_U8 : SAMPLE_FMT_S16;
av_set_pts_info(ast[i], 64, 1, ast[i]->codec->sample_rate
* ast[i]->codec->channels * ast[i]->codec->bits_per_coded_sample / 8);
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/soxdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/soxdec.c
index f6389caec9..ceaedec293 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/soxdec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/soxdec.c
@@ -93,21 +93,21 @@ static int sox_read_header(AVFormatContext *s,
return -1;
}
- if (comment_size &&
- comment_size + FF_INPUT_BUFFER_PADDING_SIZE >= comment_size) {
- char *comment = av_mallocz(comment_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (comment_size && comment_size < UINT_MAX) {
+ char *comment = av_malloc(comment_size+1);
if (get_buffer(pb, comment, comment_size) != comment_size) {
av_freep(&comment);
return AVERROR_IO;
}
- av_metadata_set(&s->metadata, "comment", comment);
- av_freep(&comment);
+ comment[comment_size] = 0;
+
+ av_metadata_set2(&s->metadata, "comment", comment,
+ AV_METADATA_DONT_STRDUP_VAL);
}
url_fskip(pb, header_size - SOX_FIXED_HDR - comment_size);
st->codec->sample_rate = sample_rate;
- st->codec->sample_fmt = SAMPLE_FMT_S32;
st->codec->bits_per_coded_sample = 32;
st->codec->bit_rate = st->codec->sample_rate *
st->codec->bits_per_coded_sample *
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/swf.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/swf.h
index 69064a281c..affebe9c73 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/swf.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/swf.h
@@ -81,7 +81,7 @@ typedef struct {
static const AVCodecTag swf_codec_tags[] = {
{CODEC_ID_FLV1, 0x02},
{CODEC_ID_VP6F, 0x04},
- {0, 0},
+ {CODEC_ID_NONE, 0},
};
static const AVCodecTag swf_audio_codec_tags[] = {
@@ -90,7 +90,7 @@ static const AVCodecTag swf_audio_codec_tags[] = {
{CODEC_ID_MP3, 0x02},
{CODEC_ID_PCM_S16LE, 0x03},
//{CODEC_ID_NELLYMOSER, 0x06},
- {0, 0},
+ {CODEC_ID_NONE, 0},
};
#endif /* AVFORMAT_SWF_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/tmv.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/tmv.c
index 566f562810..27afbbfa6d 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/tmv.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/tmv.c
@@ -43,10 +43,22 @@ typedef struct TMVContext {
unsigned stream_index;
} TMVContext;
+#define TMV_HEADER_SIZE 12
+
+#define PROBE_MIN_SAMPLE_RATE 5000
+#define PROBE_MAX_FPS 120
+#define PROBE_MIN_AUDIO_SIZE (PROBE_MIN_SAMPLE_RATE / PROBE_MAX_FPS)
+
static int tmv_probe(AVProbeData *p)
{
- if (AV_RL32(p->buf) == TMV_TAG)
- return AVPROBE_SCORE_MAX;
+ if (AV_RL32(p->buf) == TMV_TAG &&
+ AV_RL16(p->buf+4) >= PROBE_MIN_SAMPLE_RATE &&
+ AV_RL16(p->buf+6) >= PROBE_MIN_AUDIO_SIZE &&
+ !p->buf[8] && // compression method
+ p->buf[9] && // char cols
+ p->buf[10]) // char rows
+ return AVPROBE_SCORE_MAX /
+ ((p->buf[9] == 40 && p->buf[10] == 25) ? 1 : 4);
return 0;
}
@@ -68,6 +80,11 @@ static int tmv_read_header(AVFormatContext *s, AVFormatParameters *ap)
return AVERROR(ENOMEM);
ast->codec->sample_rate = get_le16(pb);
+ if (!ast->codec->sample_rate) {
+ av_log(s, AV_LOG_ERROR, "invalid sample rate\n");
+ return -1;
+ }
+
tmv->audio_chunk_size = get_le16(pb);
if (!tmv->audio_chunk_size) {
av_log(s, AV_LOG_ERROR, "invalid audio chunk size\n");
@@ -94,7 +111,6 @@ static int tmv_read_header(AVFormatContext *s, AVFormatParameters *ap)
ast->codec->codec_type = CODEC_TYPE_AUDIO;
ast->codec->codec_id = CODEC_ID_PCM_U8;
- ast->codec->sample_fmt = SAMPLE_FMT_U8;
ast->codec->channels = features & TMV_STEREO ? 2 : 1;
ast->codec->bits_per_coded_sample = 8;
ast->codec->bit_rate = ast->codec->sample_rate *
@@ -145,6 +161,23 @@ static int tmv_read_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
}
+static int tmv_read_seek(AVFormatContext *s, int stream_index,
+ int64_t timestamp, int flags)
+{
+ TMVContext *tmv = s->priv_data;
+ int64_t pos;
+
+ if (stream_index)
+ return -1;
+
+ pos = timestamp *
+ (tmv->audio_chunk_size + tmv->video_chunk_size + tmv->padding);
+
+ url_fseek(s->pb, pos + TMV_HEADER_SIZE, SEEK_SET);
+ tmv->stream_index = 0;
+ return 0;
+}
+
AVInputFormat tmv_demuxer = {
"tmv",
NULL_IF_CONFIG_SMALL("8088flex TMV"),
@@ -152,5 +185,7 @@ AVInputFormat tmv_demuxer = {
tmv_probe,
tmv_read_header,
tmv_read_packet,
+ NULL,
+ tmv_read_seek,
.flags = AVFMT_GENERIC_INDEX,
};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/tta.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/tta.c
index da6c04e703..e5b9e5f4ed 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/tta.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/tta.c
@@ -21,6 +21,8 @@
#include "libavcodec/get_bits.h"
#include "avformat.h"
+#include "id3v2.h"
+#include "id3v1.h"
typedef struct {
int totalframes, currentframe;
@@ -29,6 +31,13 @@ typedef struct {
static int tta_probe(AVProbeData *p)
{
const uint8_t *d = p->buf;
+
+ if (ff_id3v2_match(d))
+ d += ff_id3v2_tag_len(d);
+
+ if (d - p->buf >= p->buf_size)
+ return 0;
+
if (d[0] == 'T' && d[1] == 'T' && d[2] == 'A' && d[3] == '1')
return 80;
return 0;
@@ -39,8 +48,13 @@ static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap)
TTAContext *c = s->priv_data;
AVStream *st;
int i, channels, bps, samplerate, datalen, framelen;
- uint64_t framepos;
+ uint64_t framepos, start_offset;
+
+ ff_id3v2_read(s);
+ if (!av_metadata_get(s->metadata, "", NULL, AV_METADATA_IGNORE_SUFFIX))
+ ff_id3v1_read(s);
+ start_offset = url_ftell(s->pb);
if (get_le32(s->pb) != AV_RL32("TTA1"))
return -1; // not tta file
@@ -93,14 +107,14 @@ static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec->sample_rate = samplerate;
st->codec->bits_per_coded_sample = bps;
- st->codec->extradata_size = url_ftell(s->pb);
+ st->codec->extradata_size = url_ftell(s->pb) - start_offset;
if(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)st->codec->extradata_size){
//this check is redundant as get_buffer should fail
av_log(s, AV_LOG_ERROR, "extradata_size too large\n");
return -1;
}
st->codec->extradata = av_mallocz(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE);
- url_fseek(s->pb, 0, SEEK_SET);
+ url_fseek(s->pb, start_offset, SEEK_SET);
get_buffer(s->pb, st->codec->extradata, st->codec->extradata_size);
return 0;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/utils.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/utils.c
index 053b96f908..05edce4af1 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/utils.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/utils.c
@@ -41,6 +41,17 @@ unsigned avformat_version(void)
return LIBAVFORMAT_VERSION_INT;
}
+const char * avformat_configuration(void)
+{
+ return FFMPEG_CONFIGURATION;
+}
+
+const char * avformat_license(void)
+{
+#define LICENSE_PREFIX "libavformat license: "
+ return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
+}
+
/* fraction handling */
/**
@@ -472,6 +483,12 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
/* read probe data */
pd->buf= av_realloc(pd->buf, probe_size + AVPROBE_PADDING_SIZE);
pd->buf_size = get_buffer(pb, pd->buf, probe_size);
+
+ if ((int)pd->buf_size < 0) {
+ err = pd->buf_size;
+ goto fail;
+ }
+
memset(pd->buf+pd->buf_size, 0, AVPROBE_PADDING_SIZE);
if (url_fseek(pb, 0, SEEK_SET) < 0) {
url_fclose(pb);
@@ -595,7 +612,7 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt)
if(st->codec->codec_id == CODEC_ID_PROBE){
AVProbeData *pd = &st->probe_data;
-
+ av_log(s, AV_LOG_DEBUG, "probing stream %d\n", st->index);
--st->probe_packets;
pd->buf = av_realloc(pd->buf, pd->buf_size+pkt->size+AVPROBE_PADDING_SIZE);
@@ -608,6 +625,7 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt)
if(st->codec->codec_id != CODEC_ID_PROBE){
pd->buf_size=0;
av_freep(&pd->buf);
+ av_log(s, AV_LOG_DEBUG, "probed stream %d\n", st->index);
}
}
}
@@ -1021,11 +1039,12 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt)
}
if(s->debug & FF_FDEBUG_TS)
- av_log(s, AV_LOG_DEBUG, "av_read_packet stream=%d, pts=%"PRId64", dts=%"PRId64", size=%d, flags=%d\n",
+ av_log(s, AV_LOG_DEBUG, "av_read_packet stream=%d, pts=%"PRId64", dts=%"PRId64", size=%d, duration=%d, flags=%d\n",
st->cur_pkt.stream_index,
st->cur_pkt.pts,
st->cur_pkt.dts,
st->cur_pkt.size,
+ st->cur_pkt.duration,
st->cur_pkt.flags);
s->cur_st = st;
@@ -1047,11 +1066,12 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt)
}
}
if(s->debug & FF_FDEBUG_TS)
- av_log(s, AV_LOG_DEBUG, "av_read_frame_internal stream=%d, pts=%"PRId64", dts=%"PRId64", size=%d, flags=%d\n",
+ av_log(s, AV_LOG_DEBUG, "av_read_frame_internal stream=%d, pts=%"PRId64", dts=%"PRId64", size=%d, duration=%d, flags=%d\n",
pkt->stream_index,
pkt->pts,
pkt->dts,
pkt->size,
+ pkt->duration,
pkt->flags);
return 0;
@@ -1163,7 +1183,7 @@ int av_find_default_stream_index(AVFormatContext *s)
void av_read_frame_flush(AVFormatContext *s)
{
AVStream *st;
- int i;
+ int i, j;
flush_packet_queue(s);
@@ -1186,6 +1206,9 @@ void av_read_frame_flush(AVFormatContext *s)
st->cur_len = 0;
st->probe_packets = MAX_PROBE_PACKETS;
+
+ for(j=0; j<MAX_REORDER_DELAY+1; j++)
+ st->pts_buffer[j]= AV_NOPTS_VALUE;
}
}
@@ -1740,7 +1763,7 @@ static void av_estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset
AVPacket pkt1, *pkt = &pkt1;
AVStream *st;
int read_size, i, ret;
- int64_t end_time;
+ int64_t end_time, start_time[MAX_STREAMS];
int64_t filesize, offset, duration;
ic->cur_st = NULL;
@@ -1750,6 +1773,13 @@ static void av_estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset
for(i=0;i<ic->nb_streams;i++) {
st = ic->streams[i];
+ if(st->start_time != AV_NOPTS_VALUE){
+ start_time[i]= st->start_time;
+ }else if(st->first_dts != AV_NOPTS_VALUE){
+ start_time[i]= st->first_dts;
+ }else
+ av_log(st->codec, AV_LOG_WARNING, "start time is not set in av_estimate_timings_from_pts\n");
+
if (st->parser) {
av_parser_close(st->parser);
st->parser= NULL;
@@ -1757,36 +1787,6 @@ static void av_estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset
}
}
- /* we read the first packets to get the first PTS (not fully
- accurate, but it is enough now) */
- url_fseek(ic->pb, 0, SEEK_SET);
- read_size = 0;
- for(;;) {
- if (read_size >= DURATION_MAX_READ_SIZE)
- break;
- /* if all info is available, we can stop */
- for(i = 0;i < ic->nb_streams; i++) {
- st = ic->streams[i];
- if (st->start_time == AV_NOPTS_VALUE)
- break;
- }
- if (i == ic->nb_streams)
- break;
-
- do{
- ret = av_read_packet(ic, pkt);
- }while(ret == AVERROR(EAGAIN));
- if (ret != 0)
- break;
- read_size += pkt->size;
- st = ic->streams[pkt->stream_index];
- if (pkt->pts != AV_NOPTS_VALUE) {
- if (st->start_time == AV_NOPTS_VALUE)
- st->start_time = pkt->pts;
- }
- av_free_packet(pkt);
- }
-
/* estimate the end time (duration) */
/* XXX: may need to support wrapping */
filesize = ic->file_size;
@@ -1808,9 +1808,9 @@ static void av_estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset
read_size += pkt->size;
st = ic->streams[pkt->stream_index];
if (pkt->pts != AV_NOPTS_VALUE &&
- st->start_time != AV_NOPTS_VALUE) {
+ start_time[pkt->stream_index] != AV_NOPTS_VALUE) {
end_time = pkt->pts;
- duration = end_time - st->start_time;
+ duration = end_time - start_time[pkt->stream_index];
if (duration > 0) {
if (st->duration == AV_NOPTS_VALUE ||
st->duration < duration)
@@ -1895,6 +1895,7 @@ static void av_estimate_timings(AVFormatContext *ic, int64_t old_offset)
/* get accurate estimate from the PTSes */
av_estimate_timings_from_pts2(ic, old_offset);
} else {
+ av_log(ic, AV_LOG_WARNING, "Estimating duration from bitrate, this may be inaccurate\n");
/* less precise: use bitrate info */
av_estimate_timings_from_bit_rate(ic);
}
@@ -1927,6 +1928,7 @@ static int has_codec_parameters(AVCodecContext *enc)
if(!enc->frame_size &&
(enc->codec_id == CODEC_ID_VORBIS ||
enc->codec_id == CODEC_ID_AAC ||
+ enc->codec_id == CODEC_ID_MP3 ||
enc->codec_id == CODEC_ID_SPEEX))
return 0;
break;
@@ -2231,21 +2233,7 @@ int av_find_stream_info(AVFormatContext *ic)
decompress the frame. We try to avoid that in most cases as
it takes longer and uses more memory. For MPEG-4, we need to
decompress for QuickTime. */
- if (!has_codec_parameters(st->codec) /*&&
- (st->codec->codec_id == CODEC_ID_FLV1 ||
- st->codec->codec_id == CODEC_ID_H264 ||
- st->codec->codec_id == CODEC_ID_H263 ||
- st->codec->codec_id == CODEC_ID_H261 ||
- st->codec->codec_id == CODEC_ID_VORBIS ||
- st->codec->codec_id == CODEC_ID_MJPEG ||
- st->codec->codec_id == CODEC_ID_PNG ||
- st->codec->codec_id == CODEC_ID_PAM ||
- st->codec->codec_id == CODEC_ID_PGM ||
- st->codec->codec_id == CODEC_ID_PGMYUV ||
- st->codec->codec_id == CODEC_ID_PBM ||
- st->codec->codec_id == CODEC_ID_PPM ||
- st->codec->codec_id == CODEC_ID_SHORTEN ||
- (st->codec->codec_id == CODEC_ID_MPEG4 && !st->need_parsing))*/)
+ if (!has_codec_parameters(st->codec))
try_decode_frame(st, pkt);
count++;
@@ -2259,6 +2247,10 @@ int av_find_stream_info(AVFormatContext *ic)
}
for(i=0;i<ic->nb_streams;i++) {
st = ic->streams[i];
+ if(codec_info_nb_frames[i]>2)
+ av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
+ (codec_info_nb_frames[i]-2)*(int64_t)st->time_base.den,
+ codec_info_duration[i] *(int64_t)st->time_base.num, 60000);
if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
if(st->codec->codec_id == CODEC_ID_RAWVIDEO && !st->codec->codec_tag && !st->codec->bits_per_coded_sample)
st->codec->codec_tag= avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt);
@@ -2624,11 +2616,11 @@ int av_write_header(AVFormatContext *s)
}
//FIXME merge with compute_pkt_fields
-static int compute_pkt_fields2(AVStream *st, AVPacket *pkt){
+static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt){
int delay = FFMAX(st->codec->has_b_frames, !!st->codec->max_b_frames);
int num, den, frame_size, i;
-// av_log(st->codec, AV_LOG_DEBUG, "av_write_frame: pts:%"PRId64" dts:%"PRId64" cur_dts:%"PRId64" b:%d size:%d st:%d\n", pkt->pts, pkt->dts, st->cur_dts, delay, pkt->size, pkt->stream_index);
+// av_log(s, AV_LOG_DEBUG, "av_write_frame: pts:%"PRId64" dts:%"PRId64" cur_dts:%"PRId64" b:%d size:%d st:%d\n", pkt->pts, pkt->dts, st->cur_dts, delay, pkt->size, pkt->stream_index);
/* if(pkt->pts == AV_NOPTS_VALUE && pkt->dts == AV_NOPTS_VALUE)
return -1;*/
@@ -2663,15 +2655,17 @@ static int compute_pkt_fields2(AVStream *st, AVPacket *pkt){
}
if(st->cur_dts && st->cur_dts != AV_NOPTS_VALUE && st->cur_dts >= pkt->dts){
- av_log(st->codec, AV_LOG_ERROR, "error, non monotone timestamps %"PRId64" >= %"PRId64"\n", st->cur_dts, pkt->dts);
+ av_log(s, AV_LOG_ERROR,
+ "st:%d error, non monotone timestamps %"PRId64" >= %"PRId64"\n",
+ st->index, st->cur_dts, pkt->dts);
return -1;
}
if(pkt->dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && pkt->pts < pkt->dts){
- av_log(st->codec, AV_LOG_ERROR, "error, pts < dts\n");
+ av_log(s, AV_LOG_ERROR, "st:%d error, pts < dts\n", st->index);
return -1;
}
-// av_log(NULL, AV_LOG_DEBUG, "av_write_frame: pts2:%"PRId64" dts2:%"PRId64"\n", pkt->pts, pkt->dts);
+// av_log(s, AV_LOG_DEBUG, "av_write_frame: pts2:%"PRId64" dts2:%"PRId64"\n", pkt->pts, pkt->dts);
st->cur_dts= pkt->dts;
st->pts.val= pkt->dts;
@@ -2698,7 +2692,7 @@ static int compute_pkt_fields2(AVStream *st, AVPacket *pkt){
int av_write_frame(AVFormatContext *s, AVPacket *pkt)
{
- int ret = compute_pkt_fields2(s->streams[pkt->stream_index], pkt);
+ int ret = compute_pkt_fields2(s, s->streams[pkt->stream_index], pkt);
if(ret<0 && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
return ret;
@@ -2812,7 +2806,7 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt){
return 0;
//av_log(NULL, AV_LOG_DEBUG, "av_interleaved_write_frame %d %"PRId64" %"PRId64"\n", pkt->size, pkt->dts, pkt->pts);
- if(compute_pkt_fields2(st, pkt) < 0 && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
+ if(compute_pkt_fields2(s, st, pkt) < 0 && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
return -1;
if(pkt->dts == AV_NOPTS_VALUE && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
@@ -2875,6 +2869,11 @@ void av_program_add_stream_index(AVFormatContext *ac, int progid, unsigned int i
AVProgram *program=NULL;
void *tmp;
+ if (idx >= ac->nb_streams) {
+ av_log(ac, AV_LOG_ERROR, "stream index %d is not valid\n", idx);
+ return;
+ }
+
for(i=0; i<ac->nb_programs; i++){
if(ac->programs[i]->id != progid)
continue;
@@ -2899,6 +2898,19 @@ static void print_fps(double d, const char *postfix){
else av_log(NULL, AV_LOG_INFO, ", %1.0fk %s", d/1000, postfix);
}
+static void dump_metadata(void *ctx, AVMetadata *m, const char *indent)
+{
+ if(m && !(m->count == 1 && av_metadata_get(m, "language", NULL, 0))){
+ AVMetadataTag *tag=NULL;
+
+ av_log(ctx, AV_LOG_INFO, "%sMetadata:\n", indent);
+ while((tag=av_metadata_get(m, "", tag, AV_METADATA_IGNORE_SUFFIX))) {
+ if(strcmp("language", tag->key))
+ av_log(ctx, AV_LOG_INFO, "%s %-16s: %s\n", indent, tag->key, tag->value);
+ }
+ }
+}
+
/* "user interface" functions */
static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_output)
{
@@ -2929,6 +2941,8 @@ static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_out
display_aspect_ratio.num, display_aspect_ratio.den);
}
if(st->codec->codec_type == CODEC_TYPE_VIDEO){
+ if(st->avg_frame_rate.den && st->avg_frame_rate.num)
+ print_fps(av_q2d(st->avg_frame_rate), "fps");
if(st->r_frame_rate.den && st->r_frame_rate.num)
print_fps(av_q2d(st->r_frame_rate), "tbr");
if(st->time_base.den && st->time_base.num)
@@ -2937,6 +2951,7 @@ static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_out
print_fps(1/av_q2d(st->codec->time_base), "tbc");
}
av_log(NULL, AV_LOG_INFO, "\n");
+ dump_metadata(NULL, st->metadata, " ");
}
void dump_format(AVFormatContext *ic,
@@ -2945,12 +2960,16 @@ void dump_format(AVFormatContext *ic,
int is_output)
{
int i;
+ uint8_t *printed = av_mallocz(ic->nb_streams);
+ if (ic->nb_streams && !printed)
+ return;
av_log(NULL, AV_LOG_INFO, "%s #%d, %s, %s '%s':\n",
is_output ? "Output" : "Input",
index,
is_output ? ic->oformat->name : ic->iformat->name,
is_output ? "to" : "from", url);
+ dump_metadata(NULL, ic->metadata, " ");
if (!is_output) {
av_log(NULL, AV_LOG_INFO, " Duration: ");
if (ic->duration != AV_NOPTS_VALUE) {
@@ -2983,26 +3002,27 @@ void dump_format(AVFormatContext *ic,
av_log(NULL, AV_LOG_INFO, "\n");
}
if(ic->nb_programs) {
- int j, k;
+ int j, k, total = 0;
for(j=0; j<ic->nb_programs; j++) {
AVMetadataTag *name = av_metadata_get(ic->programs[j]->metadata,
"name", NULL, 0);
av_log(NULL, AV_LOG_INFO, " Program %d %s\n", ic->programs[j]->id,
name ? name->value : "");
- for(k=0; k<ic->programs[j]->nb_stream_indexes; k++)
+ dump_metadata(NULL, ic->programs[j]->metadata, " ");
+ for(k=0; k<ic->programs[j]->nb_stream_indexes; k++) {
dump_stream_format(ic, ic->programs[j]->stream_index[k], index, is_output);
- }
- } else
- for(i=0;i<ic->nb_streams;i++)
- dump_stream_format(ic, i, index, is_output);
- if (ic->metadata) {
- AVMetadataTag *tag=NULL;
- av_log(NULL, AV_LOG_INFO, " Metadata\n");
- while((tag=av_metadata_get(ic->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) {
- av_log(NULL, AV_LOG_INFO, " %-16s: %s\n", tag->key, tag->value);
+ printed[ic->programs[j]->stream_index[k]] = 1;
+ }
+ total += ic->programs[j]->nb_stream_indexes;
}
+ if (total < ic->nb_streams)
+ av_log(NULL, AV_LOG_INFO, " No Program\n");
}
+ for(i=0;i<ic->nb_streams;i++)
+ if (!printed[i])
+ dump_stream_format(ic, i, index, is_output);
+ av_free(printed);
}
#if LIBAVFORMAT_VERSION_MAJOR < 53
@@ -3244,6 +3264,7 @@ int av_get_frame_filename(char *buf, int buf_size,
static void hex_dump_internal(void *avcl, FILE *f, int level, uint8_t *buf, int size)
{
int len, i, j, c;
+#undef fprintf
#define PRINT(...) do { if (!f) av_log(avcl, level, __VA_ARGS__); else fprintf(f, __VA_ARGS__); } while(0)
for(i=0;i<size;i+=16) {
@@ -3282,6 +3303,7 @@ void av_hex_dump_log(void *avcl, int level, uint8_t *buf, int size)
//FIXME needs to know the time_base
static void pkt_dump_internal(void *avcl, FILE *f, int level, AVPacket *pkt, int dump_payload)
{
+#undef fprintf
#define PRINT(...) do { if (!f) av_log(avcl, level, __VA_ARGS__); else fprintf(f, __VA_ARGS__); } while(0)
PRINT("stream #%d:\n", pkt->stream_index);
PRINT(" keyframe=%d\n", ((pkt->flags & PKT_FLAG_KEY) != 0));
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/voc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/voc.c
index 7ebfa711c9..eed8db8cc7 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/voc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/voc.c
@@ -32,5 +32,5 @@ const AVCodecTag ff_voc_codec_tags[] = {
{CODEC_ID_PCM_ALAW, 0x06},
{CODEC_ID_PCM_MULAW, 0x07},
{CODEC_ID_ADPCM_CT, 0x0200},
- {0, 0},
+ {CODEC_ID_NONE, 0},
};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/voc.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/voc.h
index 7993146f47..3f995ad31f 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/voc.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/voc.h
@@ -26,7 +26,7 @@
#include "riff.h" /* for CodecTag */
typedef struct voc_dec_context {
- int remaining_size;
+ int64_t remaining_size;
} VocDecContext;
typedef enum voc_type {
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/vocdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/vocdec.c
index 94fbd7b9bf..246dbd91b4 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/vocdec.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/vocdec.c
@@ -76,6 +76,11 @@ voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
if (type == VOC_TYPE_EOF)
return AVERROR(EIO);
voc->remaining_size = get_le24(pb);
+ if (!voc->remaining_size) {
+ if (url_is_streamed(s->pb))
+ return AVERROR(EIO);
+ voc->remaining_size = url_fsize(pb) - url_ftell(pb);
+ }
max_size -= 4;
switch (type) {
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/vqf.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/vqf.c
index d2b48dda04..40fea47157 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/vqf.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/vqf.c
@@ -45,15 +45,18 @@ static int vqf_probe(AVProbeData *probe_packet)
static void add_metadata(AVFormatContext *s, const char *tag,
unsigned int tag_len, unsigned int remaining)
{
- char buf[2048];
- int len = FFMIN3(tag_len, remaining, sizeof(buf) - 1);
+ int len = FFMIN(tag_len, remaining);
+ char *buf;
- if (len != tag_len)
- av_log(s, AV_LOG_ERROR, "Warning: truncating metadata!\n");
+ if (len == UINT_MAX)
+ return;
+ buf = av_malloc(len+1);
+ if (!buf)
+ return;
get_buffer(s->pb, buf, len);
buf[len] = 0;
- av_metadata_set(&s->metadata, tag, buf);
+ av_metadata_set2(&s->metadata, tag, buf, AV_METADATA_DONT_STRDUP_VAL);
}
static int vqf_read_header(AVFormatContext *s, AVFormatParameters *ap)
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/wc3movie.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/wc3movie.c
index 5369057dd4..502ff52564 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/wc3movie.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/wc3movie.c
@@ -140,10 +140,9 @@ static int wc3_read_header(AVFormatContext *s,
unsigned int fourcc_tag;
unsigned int size;
AVStream *st;
- char buffer[513];
int ret = 0;
int current_palette = 0;
- int bytes_to_read;
+ char *buffer;
int i;
unsigned char rotate;
@@ -185,14 +184,14 @@ static int wc3_read_header(AVFormatContext *s,
case BNAM_TAG:
/* load up the name */
- if ((unsigned)size < 512)
- bytes_to_read = size;
- else
- bytes_to_read = 512;
- if ((ret = get_buffer(pb, buffer, bytes_to_read)) != bytes_to_read)
+ buffer = av_malloc(size+1);
+ if (!buffer)
+ return AVERROR_NOMEM;
+ if ((ret = get_buffer(pb, buffer, size)) != size)
return AVERROR(EIO);
- buffer[bytes_to_read] = 0;
- av_metadata_set(&s->metadata, "title", buffer);
+ buffer[size] = 0;
+ av_metadata_set2(&s->metadata, "title", buffer,
+ AV_METADATA_DONT_STRDUP_VAL);
break;
case SIZE_TAG:
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/wv.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/wv.c
index d46f90d78b..9809b37a15 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/wv.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/wv.c
@@ -21,6 +21,8 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
+#include "apetag.h"
+#include "id3v1.h"
// specs say that maximum block size is 1Mb
#define WV_BLOCK_LIMIT 1047576
@@ -99,9 +101,31 @@ static int wv_read_block_header(AVFormatContext *ctx, ByteIOContext *pb)
bpp = ((wc->flags & 3) + 1) << 3;
chan = 1 + !(wc->flags & WV_MONO);
rate = wv_rates[(wc->flags >> 23) & 0xF];
- if(rate == -1){
- av_log(ctx, AV_LOG_ERROR, "Unknown sampling rate\n");
- return -1;
+ if(rate == -1 && !wc->block_parsed){
+ int64_t block_end = url_ftell(pb) + wc->blksize - 24;
+ if(url_is_streamed(pb)){
+ av_log(ctx, AV_LOG_ERROR, "Cannot determine custom sampling rate\n");
+ return -1;
+ }
+ while(url_ftell(pb) < block_end){
+ int id, size;
+ id = get_byte(pb);
+ size = (id & 0x80) ? get_le24(pb) : get_byte(pb);
+ size <<= 1;
+ if(id&0x40)
+ size--;
+ if((id&0x3F) == 0x27){
+ rate = get_le24(pb);
+ break;
+ }else{
+ url_fskip(pb, size);
+ }
+ }
+ if(rate == -1){
+ av_log(ctx, AV_LOG_ERROR, "Cannot determine custom sampling rate\n");
+ return -1;
+ }
+ url_fseek(pb, block_end - wc->blksize + 24, SEEK_SET);
}
if(!wc->bpp) wc->bpp = bpp;
if(!wc->chan) wc->chan = chan;
@@ -115,7 +139,7 @@ static int wv_read_block_header(AVFormatContext *ctx, ByteIOContext *pb)
av_log(ctx, AV_LOG_ERROR, "Channels differ, this block: %i, header block: %i\n", chan, wc->chan);
return -1;
}
- if(wc->flags && rate != wc->rate){
+ if(wc->flags && rate != -1 && rate != wc->rate){
av_log(ctx, AV_LOG_ERROR, "Sampling rate differ, this block: %i, header block: %i\n", rate, wc->rate);
return -1;
}
@@ -130,10 +154,10 @@ static int wv_read_header(AVFormatContext *s,
WVContext *wc = s->priv_data;
AVStream *st;
+ wc->block_parsed = 0;
if(wv_read_block_header(s, pb) < 0)
return -1;
- wc->block_parsed = 0;
/* now we are ready: build format streams */
st = av_new_stream(s, 0);
if (!st)
@@ -146,6 +170,15 @@ static int wv_read_header(AVFormatContext *s,
av_set_pts_info(st, 64, 1, wc->rate);
s->start_time = 0;
s->duration = (int64_t)wc->samples * AV_TIME_BASE / st->codec->sample_rate;
+
+ if(!url_is_streamed(s->pb)) {
+ int64_t cur = url_ftell(s->pb);
+ ff_ape_parse_tag(s);
+ if(!av_metadata_get(s->metadata, "", NULL, AV_METADATA_IGNORE_SUFFIX))
+ ff_id3v1_read(s);
+ url_fseek(s->pb, cur, SEEK_SET);
+ }
+
return 0;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/Makefile b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/Makefile
index ec82439b98..34898e2089 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/Makefile
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/Makefile
@@ -15,6 +15,7 @@ HEADERS = adler32.h \
mathematics.h \
md5.h \
mem.h \
+ pixdesc.h \
pixfmt.h \
rational.h \
sha1.h \
@@ -34,6 +35,7 @@ OBJS = adler32.o \
mathematics.o \
md5.o \
mem.o \
+ pixdesc.o \
random_seed.o \
rational.o \
rc4.o \
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/avstring.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/avstring.c
index 8ee2a6b12f..6d45a9581a 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/avstring.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/avstring.c
@@ -24,6 +24,7 @@
#include <string.h>
#include <ctype.h>
#include "avstring.h"
+#include "mem.h"
int av_strstart(const char *str, const char *pfx, const char **ptr)
{
@@ -76,3 +77,10 @@ size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...)
return len;
}
+
+char *av_d2str(double d)
+{
+ char *str= av_malloc(16);
+ if(str) snprintf(str, 16, "%f", d);
+ return str;
+}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/avstring.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/avstring.h
index d716c3a282..b8203f372f 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/avstring.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/avstring.h
@@ -95,4 +95,9 @@ size_t av_strlcat(char *dst, const char *src, size_t size);
*/
size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...);
+/**
+ * Convert a number to a av_malloced string.
+ */
+char *av_d2str(double d);
+
#endif /* AVUTIL_AVSTRING_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/avutil.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/avutil.h
index fac1f5e2dd..4aab0432ba 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/avutil.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/avutil.h
@@ -35,7 +35,7 @@
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
#define LIBAVUTIL_VERSION_MAJOR 50
-#define LIBAVUTIL_VERSION_MINOR 3
+#define LIBAVUTIL_VERSION_MINOR 7
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
@@ -53,6 +53,16 @@
*/
unsigned avutil_version(void);
+/**
+ * Returns the libavutil build-time configuration.
+ */
+const char * avutil_configuration(void);
+
+/**
+ * Returns the libavutil license.
+ */
+const char * avutil_license(void);
+
#include "common.h"
#include "mathematics.h"
#include "rational.h"
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/common.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/common.h
index a6303d9872..a8a9bd39e6 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/common.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/common.h
@@ -136,6 +136,8 @@
/* misc math functions */
extern const uint8_t ff_log2_tab[256];
+extern const uint8_t av_reverse[256];
+
static inline av_const int av_log2(unsigned int v)
{
int n = 0;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/internal.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/internal.h
index 141186bb5f..7f620d8dd7 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/internal.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/internal.h
@@ -91,10 +91,6 @@
# define INT_BIT (CHAR_BIT * sizeof(int))
#endif
-#if ( defined(__PIC__) || defined(__pic__) ) && ! defined(PIC)
-# define PIC
-#endif
-
#ifndef offsetof
# define offsetof(T, F) ((unsigned int)((char *)&((T *)0)->F))
#endif
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/lfg.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/lfg.c
index e876d18fef..a6828634ae 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/lfg.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/lfg.c
@@ -39,6 +39,21 @@ void av_cold av_lfg_init(AVLFG *c, unsigned int seed){
c->index=0;
}
+void av_bmg_get(AVLFG *lfg, double out[2])
+{
+ double x1, x2, w;
+
+ do {
+ x1 = 2.0/UINT_MAX*av_lfg_get(lfg) - 1.0;
+ x2 = 2.0/UINT_MAX*av_lfg_get(lfg) - 1.0;
+ w = x1*x1 + x2*x2;
+ } while (w >= 1.0);
+
+ w = sqrt((-2.0 * log(w)) / w);
+ out[0] = x1 * w;
+ out[1] = x2 * w;
+}
+
#ifdef TEST
#include "log.h"
#include "common.h"
@@ -59,6 +74,24 @@ int main(void)
STOP_TIMER("624 calls of av_lfg_get");
}
av_log(NULL, AV_LOG_ERROR, "final value:%X\n", x);
+
+ /* BMG usage example */
+ {
+ double mean = 1000;
+ double stddev = 53;
+
+ av_lfg_init(&state, 42);
+
+ for (i = 0; i < 1000; i += 2) {
+ double bmg_out[2];
+ av_bmg_get(&state, bmg_out);
+ av_log(NULL, AV_LOG_INFO,
+ "%f\n%f\n",
+ bmg_out[0] * stddev + mean,
+ bmg_out[1] * stddev + mean);
+ }
+ }
+
return 0;
}
#endif
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/lfg.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/lfg.h
index 3250c18e79..ac89d120d5 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/lfg.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/lfg.h
@@ -51,4 +51,12 @@ static inline unsigned int av_mlfg_get(AVLFG *c){
return c->state[c->index++ & 63] = 2*a*b+a+b;
}
+/**
+ * Gets the next two numbers generated by a Box-Muller Gaussian
+ * generator using the random numbers issued by lfg.
+ *
+ * @param out[2] array where are placed the two generated numbers
+ */
+void av_bmg_get(AVLFG *lfg, double out[2]);
+
#endif /* AVUTIL_LFG_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/log.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/log.c
index 4bb9652c2c..166e724b07 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/log.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/log.c
@@ -27,6 +27,9 @@
#include "avutil.h"
#include "log.h"
+#if LIBAVUTIL_VERSION_MAJOR > 50
+static
+#endif
int av_log_level = AV_LOG_INFO;
void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/mathematics.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/mathematics.c
index f57cf8e4b6..9988baae9c 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/mathematics.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/mathematics.c
@@ -50,6 +50,25 @@ const uint8_t ff_log2_tab[256]={
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
};
+const uint8_t av_reverse[256]={
+0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0,
+0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8,
+0x04,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4,
+0x0C,0x8C,0x4C,0xCC,0x2C,0xAC,0x6C,0xEC,0x1C,0x9C,0x5C,0xDC,0x3C,0xBC,0x7C,0xFC,
+0x02,0x82,0x42,0xC2,0x22,0xA2,0x62,0xE2,0x12,0x92,0x52,0xD2,0x32,0xB2,0x72,0xF2,
+0x0A,0x8A,0x4A,0xCA,0x2A,0xAA,0x6A,0xEA,0x1A,0x9A,0x5A,0xDA,0x3A,0xBA,0x7A,0xFA,
+0x06,0x86,0x46,0xC6,0x26,0xA6,0x66,0xE6,0x16,0x96,0x56,0xD6,0x36,0xB6,0x76,0xF6,
+0x0E,0x8E,0x4E,0xCE,0x2E,0xAE,0x6E,0xEE,0x1E,0x9E,0x5E,0xDE,0x3E,0xBE,0x7E,0xFE,
+0x01,0x81,0x41,0xC1,0x21,0xA1,0x61,0xE1,0x11,0x91,0x51,0xD1,0x31,0xB1,0x71,0xF1,
+0x09,0x89,0x49,0xC9,0x29,0xA9,0x69,0xE9,0x19,0x99,0x59,0xD9,0x39,0xB9,0x79,0xF9,
+0x05,0x85,0x45,0xC5,0x25,0xA5,0x65,0xE5,0x15,0x95,0x55,0xD5,0x35,0xB5,0x75,0xF5,
+0x0D,0x8D,0x4D,0xCD,0x2D,0xAD,0x6D,0xED,0x1D,0x9D,0x5D,0xDD,0x3D,0xBD,0x7D,0xFD,
+0x03,0x83,0x43,0xC3,0x23,0xA3,0x63,0xE3,0x13,0x93,0x53,0xD3,0x33,0xB3,0x73,0xF3,
+0x0B,0x8B,0x4B,0xCB,0x2B,0xAB,0x6B,0xEB,0x1B,0x9B,0x5B,0xDB,0x3B,0xBB,0x7B,0xFB,
+0x07,0x87,0x47,0xC7,0x27,0xA7,0x67,0xE7,0x17,0x97,0x57,0xD7,0x37,0xB7,0x77,0xF7,
+0x0F,0x8F,0x4F,0xCF,0x2F,0xAF,0x6F,0xEF,0x1F,0x9F,0x5F,0xDF,0x3F,0xBF,0x7F,0xFF,
+};
+
int64_t av_gcd(int64_t a, int64_t b){
if(b) return av_gcd(b, a%b);
else return a;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pixdesc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/pixdesc.c
index d9f2eaac80..b689519fde 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pixdesc.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/pixdesc.c
@@ -19,13 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "libavutil/pixfmt.h"
+#include "pixfmt.h"
#include "pixdesc.h"
const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
[PIX_FMT_YUV420P] = {
.name = "yuv420p",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 1,
.log2_chroma_h= 1,
.comp = {
@@ -36,7 +36,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_YUYV422] = {
.name = "yuyv422",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 1,
.log2_chroma_h= 0,
.comp = {
@@ -47,7 +47,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_RGB24] = {
.name = "rgb24",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -58,7 +58,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_BGR24] = {
.name = "bgr24",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -69,7 +69,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_YUV422P] = {
.name = "yuv422p",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 1,
.log2_chroma_h= 0,
.comp = {
@@ -80,7 +80,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_YUV444P] = {
.name = "yuv444p",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -91,7 +91,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_YUV410P] = {
.name = "yuv410p",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 2,
.log2_chroma_h= 2,
.comp = {
@@ -102,7 +102,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_YUV411P] = {
.name = "yuv411p",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 2,
.log2_chroma_h= 0,
.comp = {
@@ -112,8 +112,8 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
},
[PIX_FMT_GRAY8] = {
- .name = "gray8",
- .nb_channels = 1,
+ .name = "gray",
+ .nb_components= 1,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -121,8 +121,8 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
},
[PIX_FMT_MONOWHITE] = {
- .name = "monowhite",
- .nb_channels = 1,
+ .name = "monow",
+ .nb_components= 1,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -131,8 +131,8 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
.flags = PIX_FMT_BITSTREAM,
},
[PIX_FMT_MONOBLACK] = {
- .name = "monoblack",
- .nb_channels = 1,
+ .name = "monob",
+ .nb_components= 1,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -142,7 +142,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_PAL8] = {
.name = "pal8",
- .nb_channels = 1,
+ .nb_components= 1,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -152,7 +152,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_YUVJ420P] = {
.name = "yuvj420p",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 1,
.log2_chroma_h= 1,
.comp = {
@@ -163,7 +163,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_YUVJ422P] = {
.name = "yuvj422p",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 1,
.log2_chroma_h= 0,
.comp = {
@@ -174,7 +174,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_YUVJ444P] = {
.name = "yuvj444p",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -183,9 +183,17 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{2,0,1,0,7}, /* V */
},
},
+ [PIX_FMT_XVMC_MPEG2_MC] = {
+ .name = "xvmcmc",
+ .flags = PIX_FMT_HWACCEL,
+ },
+ [PIX_FMT_XVMC_MPEG2_IDCT] = {
+ .name = "xvmcidct",
+ .flags = PIX_FMT_HWACCEL,
+ },
[PIX_FMT_UYVY422] = {
.name = "uyvy422",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 1,
.log2_chroma_h= 0,
.comp = {
@@ -196,7 +204,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_UYYVYY411] = {
.name = "uyyvyy411",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 2,
.log2_chroma_h= 0,
.comp = {
@@ -207,7 +215,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_BGR8] = {
.name = "bgr8",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -215,10 +223,11 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,0,1,3,2}, /* G */
{0,0,1,0,2}, /* R */
},
+ .flags = PIX_FMT_PAL,
},
[PIX_FMT_BGR4] = {
.name = "bgr4",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -230,7 +239,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_BGR4_BYTE] = {
.name = "bgr4_byte",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -238,10 +247,11 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,0,1,1,1}, /* G */
{0,0,1,0,0}, /* R */
},
+ .flags = PIX_FMT_PAL,
},
[PIX_FMT_RGB8] = {
.name = "rgb8",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -249,10 +259,11 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,0,1,3,2}, /* G */
{0,0,1,0,2}, /* B */
},
+ .flags = PIX_FMT_PAL,
},
[PIX_FMT_RGB4] = {
.name = "rgb4",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -264,7 +275,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_RGB4_BYTE] = {
.name = "rgb4_byte",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -272,10 +283,11 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,0,1,1,1}, /* G */
{0,0,1,0,0}, /* B */
},
+ .flags = PIX_FMT_PAL,
},
[PIX_FMT_NV12] = {
.name = "nv12",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 1,
.log2_chroma_h= 1,
.comp = {
@@ -286,7 +298,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_NV21] = {
.name = "nv21",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 1,
.log2_chroma_h= 1,
.comp = {
@@ -297,7 +309,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_ARGB] = {
.name = "argb",
- .nb_channels = 4,
+ .nb_components= 4,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -309,7 +321,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_RGBA] = {
.name = "rgba",
- .nb_channels = 4,
+ .nb_components= 4,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -321,7 +333,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_ABGR] = {
.name = "abgr",
- .nb_channels = 4,
+ .nb_components= 4,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -333,7 +345,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_BGRA] = {
.name = "bgra",
- .nb_channels = 4,
+ .nb_components= 4,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -345,7 +357,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_GRAY16BE] = {
.name = "gray16be",
- .nb_channels = 1,
+ .nb_components= 1,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -355,7 +367,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_GRAY16LE] = {
.name = "gray16le",
- .nb_channels = 1,
+ .nb_components= 1,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -364,7 +376,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_YUV440P] = {
.name = "yuv440p",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 1,
.comp = {
@@ -375,7 +387,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_YUVJ440P] = {
.name = "yuvj440p",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 1,
.comp = {
@@ -386,7 +398,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_YUVA420P] = {
.name = "yuva420p",
- .nb_channels = 4,
+ .nb_components= 4,
.log2_chroma_w= 1,
.log2_chroma_h= 1,
.comp = {
@@ -396,9 +408,45 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{3,0,1,0,7}, /* A */
},
},
+ [PIX_FMT_VDPAU_H264] = {
+ .name = "vdpau_h264",
+ .log2_chroma_w = 1,
+ .log2_chroma_h = 1,
+ .flags = PIX_FMT_HWACCEL,
+ },
+ [PIX_FMT_VDPAU_MPEG1] = {
+ .name = "vdpau_mpeg1",
+ .log2_chroma_w = 1,
+ .log2_chroma_h = 1,
+ .flags = PIX_FMT_HWACCEL,
+ },
+ [PIX_FMT_VDPAU_MPEG2] = {
+ .name = "vdpau_mpeg2",
+ .log2_chroma_w = 1,
+ .log2_chroma_h = 1,
+ .flags = PIX_FMT_HWACCEL,
+ },
+ [PIX_FMT_VDPAU_WMV3] = {
+ .name = "vdpau_wmv3",
+ .log2_chroma_w = 1,
+ .log2_chroma_h = 1,
+ .flags = PIX_FMT_HWACCEL,
+ },
+ [PIX_FMT_VDPAU_VC1] = {
+ .name = "vdpau_vc1",
+ .log2_chroma_w = 1,
+ .log2_chroma_h = 1,
+ .flags = PIX_FMT_HWACCEL,
+ },
+ [PIX_FMT_VDPAU_MPEG4] = {
+ .name = "vdpau_mpeg4",
+ .log2_chroma_w = 1,
+ .log2_chroma_h = 1,
+ .flags = PIX_FMT_HWACCEL,
+ },
[PIX_FMT_RGB48BE] = {
.name = "rgb48be",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -410,7 +458,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_RGB48LE] = {
.name = "rgb48le",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -421,7 +469,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_RGB565BE] = {
.name = "rgb565be",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -433,7 +481,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_RGB565LE] = {
.name = "rgb565le",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -444,7 +492,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_RGB555BE] = {
.name = "rgb555be",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -456,7 +504,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_RGB555LE] = {
.name = "rgb555le",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -467,7 +515,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_BGR565BE] = {
.name = "bgr565be",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -479,7 +527,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_BGR565LE] = {
.name = "bgr565le",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -490,7 +538,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_BGR555BE] = {
.name = "bgr555be",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -502,7 +550,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_BGR555LE] = {
.name = "bgr555le",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -511,9 +559,27 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
{0,1,1,0,4}, /* R */
},
},
+ [PIX_FMT_VAAPI_MOCO] = {
+ .name = "vaapi_moco",
+ .log2_chroma_w = 1,
+ .log2_chroma_h = 1,
+ .flags = PIX_FMT_HWACCEL,
+ },
+ [PIX_FMT_VAAPI_IDCT] = {
+ .name = "vaapi_idct",
+ .log2_chroma_w = 1,
+ .log2_chroma_h = 1,
+ .flags = PIX_FMT_HWACCEL,
+ },
+ [PIX_FMT_VAAPI_VLD] = {
+ .name = "vaapi_vld",
+ .log2_chroma_w = 1,
+ .log2_chroma_h = 1,
+ .flags = PIX_FMT_HWACCEL,
+ },
[PIX_FMT_YUV420P16LE] = {
.name = "yuv420p16le",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 1,
.log2_chroma_h= 1,
.comp = {
@@ -524,7 +590,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_YUV420P16BE] = {
.name = "yuv420p16be",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 1,
.log2_chroma_h= 1,
.comp = {
@@ -536,7 +602,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_YUV422P16LE] = {
.name = "yuv422p16le",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 1,
.log2_chroma_h= 0,
.comp = {
@@ -547,7 +613,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_YUV422P16BE] = {
.name = "yuv422p16be",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 1,
.log2_chroma_h= 0,
.comp = {
@@ -559,7 +625,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_YUV444P16LE] = {
.name = "yuv444p16le",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -570,7 +636,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
},
[PIX_FMT_YUV444P16BE] = {
.name = "yuv444p16be",
- .nb_channels = 3,
+ .nb_components= 3,
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
@@ -587,7 +653,7 @@ int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
int c, bits = 0;
int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
- for (c = 0; c < pixdesc->nb_channels; c++) {
+ for (c = 0; c < pixdesc->nb_components; c++) {
int s = c==1 || c==2 ? 0 : log2_pixels;
bits += (pixdesc->comp[c].depth_minus1+1) << s;
}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pixdesc.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/pixdesc.h
index e6d2dcd0df..c8743487c9 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pixdesc.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/pixdesc.h
@@ -19,12 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef AVCODEC_PIXDESC_H
-#define AVCODEC_PIXDESC_H
+#ifndef AVUTIL_PIXDESC_H
+#define AVUTIL_PIXDESC_H
#include <inttypes.h>
-#include "libavutil/intreadwrite.h"
+#include "intreadwrite.h"
typedef struct AVComponentDescriptor{
uint16_t plane :2; ///< which of the 4 planes contains the component
@@ -55,13 +55,14 @@ typedef struct AVComponentDescriptor{
*/
typedef struct AVPixFmtDescriptor{
const char *name;
- uint8_t nb_channels; ///< The number of components each pixel has, (1-4)
+ uint8_t nb_components; ///< The number of components each pixel has, (1-4)
/**
* Amount to shift the luma width right to find the chroma width.
* For YV12 this is 1 for example.
* chroma_width = -((-luma_width) >> log2_chroma_w)
* The note above is needed to ensure rounding up.
+ * This value only refers to the chroma components.
*/
uint8_t log2_chroma_w; ///< chroma_width = -((-luma_width )>>log2_chroma_w)
@@ -70,15 +71,23 @@ typedef struct AVPixFmtDescriptor{
* For YV12 this is 1 for example.
* chroma_height= -((-luma_height) >> log2_chroma_h)
* The note above is needed to ensure rounding up.
+ * This value only refers to the chroma components.
*/
uint8_t log2_chroma_h;
uint8_t flags;
- AVComponentDescriptor comp[4]; ///< parameters that describe how pixels are packed
+
+ /**
+ * Parameters that describe how pixels are packed. If the format
+ * has chroma components, they must be stored in comp[1] and
+ * comp[2].
+ */
+ AVComponentDescriptor comp[4];
}AVPixFmtDescriptor;
-#define PIX_FMT_BE 1 ///< big-endian
+#define PIX_FMT_BE 1 ///< Pixel format is big-endian.
#define PIX_FMT_PAL 2 ///< Pixel format has a palette in data[1], values are indexes in this palette.
#define PIX_FMT_BITSTREAM 4 ///< All values of a component are bit-wise packed end to end.
+#define PIX_FMT_HWACCEL 8 ///< Pixel format is an HW accelerated format.
/**
* The array of all the pixel format descriptors.
@@ -203,4 +212,4 @@ static inline void write_line(const uint16_t *src, uint8_t *data[4], const int l
*/
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc);
-#endif /* AVCODEC_PIXDESC_H */
+#endif /* AVUTIL_PIXDESC_H */
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/pixfmt.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/pixfmt.h
index 0b15238ff7..ddd17fb485 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/pixfmt.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/pixfmt.h
@@ -123,6 +123,7 @@ enum PixelFormat {
PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+ PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
};
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/tree.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/tree.c
index cce1d31090..4b78764628 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/tree.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/tree.c
@@ -136,10 +136,13 @@ void av_tree_destroy(AVTreeNode *t){
}
#if 0
-void av_tree_enumerate(AVTreeNode *t, void *opaque, int (*f)(void *opaque, void *elem)){
- int v= f(opaque, t->elem);
- if(v>=0) av_tree_enumerate(t->child[0], opaque, f);
- if(v<=0) av_tree_enumerate(t->child[1], opaque, f);
+void av_tree_enumerate(AVTreeNode *t, void *opaque, int (*cmp)(void *opaque, void *elem), int (*enu)(void *opaque, void *elem)){
+ if(t){
+ int v= cmp ? cmp(opaque, t->elem) : 0;
+ if(v>=0) av_tree_enumerate(t->child[0], opaque, cmp, enu);
+ if(v==0) enu(opaque, t->elem);
+ if(v<=0) av_tree_enumerate(t->child[1], opaque, cmp, enu);
+ }
}
#endif
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/utils.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/utils.c
index 2521d3401e..26499b8389 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/utils.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/utils.c
@@ -16,6 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "config.h"
#include "avutil.h"
/**
@@ -27,3 +28,14 @@ unsigned avutil_version(void)
{
return LIBAVUTIL_VERSION_INT;
}
+
+const char * avutil_configuration(void)
+{
+ return FFMPEG_CONFIGURATION;
+}
+
+const char * avutil_license(void)
+{
+#define LICENSE_PREFIX "libavutil license: "
+ return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
+}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libpostproc/postprocess.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libpostproc/postprocess.c
index 179fd7ec98..9bb9468311 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libpostproc/postprocess.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libpostproc/postprocess.c
@@ -92,6 +92,17 @@ unsigned postproc_version(void)
return LIBPOSTPROC_VERSION_INT;
}
+const char * postproc_configuration(void)
+{
+ return FFMPEG_CONFIGURATION;
+}
+
+const char * postproc_license(void)
+{
+#define LICENSE_PREFIX "libpostproc license: "
+ return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
+}
+
#if HAVE_ALTIVEC_H
#include <altivec.h>
#endif
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libpostproc/postprocess.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libpostproc/postprocess.h
index 2789cdf074..5f23bb240f 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libpostproc/postprocess.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libpostproc/postprocess.h
@@ -48,6 +48,16 @@
*/
unsigned postproc_version(void);
+/**
+ * Returns the libpostproc build-time configuration.
+ */
+const char * postproc_configuration(void);
+
+/**
+ * Returns the libpostproc license.
+ */
+const char * postproc_license(void);
+
#define PP_QUALITY_MAX 6
#define QP_STORE_T int8_t
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libswscale/swscale.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libswscale/swscale.c
index 8a9521fc0e..079ed31cd1 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libswscale/swscale.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libswscale/swscale.c
@@ -78,12 +78,24 @@ untested special converters
#include "libavutil/x86_cpu.h"
#include "libavutil/avutil.h"
#include "libavutil/bswap.h"
+#include "libavutil/pixdesc.h"
unsigned swscale_version(void)
{
return LIBSWSCALE_VERSION_INT;
}
+const char * swscale_configuration(void)
+{
+ return FFMPEG_CONFIGURATION;
+}
+
+const char * swscale_license(void)
+{
+#define LICENSE_PREFIX "libswscale license: "
+ return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
+}
+
#undef MOVNTQ
#undef PAVGB
@@ -123,6 +135,8 @@ unsigned swscale_version(void)
|| (x)==PIX_FMT_GRAY8 \
|| (x)==PIX_FMT_YUV410P \
|| (x)==PIX_FMT_YUV440P \
+ || (x)==PIX_FMT_NV12 \
+ || (x)==PIX_FMT_NV21 \
|| (x)==PIX_FMT_GRAY16BE \
|| (x)==PIX_FMT_GRAY16LE \
|| (x)==PIX_FMT_YUV444P \
@@ -366,114 +380,10 @@ DECLARE_ALIGNED(8, const uint8_t, dither_8x8_220[8][8])={
const char *sws_format_name(enum PixelFormat format)
{
- switch (format) {
- case PIX_FMT_YUV420P:
- return "yuv420p";
- case PIX_FMT_YUVA420P:
- return "yuva420p";
- case PIX_FMT_YUYV422:
- return "yuyv422";
- case PIX_FMT_RGB24:
- return "rgb24";
- case PIX_FMT_BGR24:
- return "bgr24";
- case PIX_FMT_YUV422P:
- return "yuv422p";
- case PIX_FMT_YUV444P:
- return "yuv444p";
- case PIX_FMT_RGB32:
- return "rgb32";
- case PIX_FMT_YUV410P:
- return "yuv410p";
- case PIX_FMT_YUV411P:
- return "yuv411p";
- case PIX_FMT_RGB565:
- return "rgb565";
- case PIX_FMT_RGB555:
- return "rgb555";
- case PIX_FMT_GRAY16BE:
- return "gray16be";
- case PIX_FMT_GRAY16LE:
- return "gray16le";
- case PIX_FMT_GRAY8:
- return "gray8";
- case PIX_FMT_MONOWHITE:
- return "mono white";
- case PIX_FMT_MONOBLACK:
- return "mono black";
- case PIX_FMT_PAL8:
- return "Palette";
- case PIX_FMT_YUVJ420P:
- return "yuvj420p";
- case PIX_FMT_YUVJ422P:
- return "yuvj422p";
- case PIX_FMT_YUVJ444P:
- return "yuvj444p";
- case PIX_FMT_XVMC_MPEG2_MC:
- return "xvmc_mpeg2_mc";
- case PIX_FMT_XVMC_MPEG2_IDCT:
- return "xvmc_mpeg2_idct";
- case PIX_FMT_UYVY422:
- return "uyvy422";
- case PIX_FMT_UYYVYY411:
- return "uyyvyy411";
- case PIX_FMT_RGB32_1:
- return "rgb32x";
- case PIX_FMT_BGR32_1:
- return "bgr32x";
- case PIX_FMT_BGR32:
- return "bgr32";
- case PIX_FMT_BGR565:
- return "bgr565";
- case PIX_FMT_BGR555:
- return "bgr555";
- case PIX_FMT_BGR8:
- return "bgr8";
- case PIX_FMT_BGR4:
- return "bgr4";
- case PIX_FMT_BGR4_BYTE:
- return "bgr4 byte";
- case PIX_FMT_RGB8:
- return "rgb8";
- case PIX_FMT_RGB4:
- return "rgb4";
- case PIX_FMT_RGB4_BYTE:
- return "rgb4 byte";
- case PIX_FMT_RGB48BE:
- return "rgb48be";
- case PIX_FMT_RGB48LE:
- return "rgb48le";
- case PIX_FMT_NV12:
- return "nv12";
- case PIX_FMT_NV21:
- return "nv21";
- case PIX_FMT_YUV440P:
- return "yuv440p";
- case PIX_FMT_VDPAU_H264:
- return "vdpau_h264";
- case PIX_FMT_VDPAU_MPEG1:
- return "vdpau_mpeg1";
- case PIX_FMT_VDPAU_MPEG2:
- return "vdpau_mpeg2";
- case PIX_FMT_VDPAU_WMV3:
- return "vdpau_wmv3";
- case PIX_FMT_VDPAU_VC1:
- return "vdpau_vc1";
- case PIX_FMT_YUV420P16LE:
- return "yuv420p16le";
- case PIX_FMT_YUV422P16LE:
- return "yuv422p16le";
- case PIX_FMT_YUV444P16LE:
- return "yuv444p16le";
- case PIX_FMT_YUV420P16BE:
- return "yuv420p16be";
- case PIX_FMT_YUV422P16BE:
- return "yuv422p16be";
- case PIX_FMT_YUV444P16BE:
- return "yuv444p16be";
- default:
+ if ((unsigned)format < PIX_FMT_NB && av_pix_fmt_descriptors[format].name)
+ return av_pix_fmt_descriptors[format].name;
+ else
return "Unknown format";
- }
}
static av_always_inline void yuv2yuvX16inC_template(const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
@@ -1787,6 +1697,12 @@ static int initMMX2HScaler(int dstW, int xInc, uint8_t *filterCode, int16_t *fil
int xpos, i;
// create an optimized horizontal scaling routine
+ /* This scaler is made of runtime-generated MMX2 code using specially
+ * tuned pshufw instructions. For every four output pixels, if four
+ * input pixels are enough for the fast bilinear scaling, then a chunk
+ * of fragmentB is used. If five input pixels are needed, then a chunk
+ * of fragmentA is used.
+ */
//code fragment
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libswscale/swscale.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libswscale/swscale.h
index 87e64e2885..d940e82271 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libswscale/swscale.h
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libswscale/swscale.h
@@ -31,7 +31,7 @@
#define LIBSWSCALE_VERSION_MAJOR 0
#define LIBSWSCALE_VERSION_MINOR 7
-#define LIBSWSCALE_VERSION_MICRO 1
+#define LIBSWSCALE_VERSION_MICRO 2
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
LIBSWSCALE_VERSION_MINOR, \
@@ -48,6 +48,16 @@
*/
unsigned swscale_version(void);
+/**
+ * Returns the libswscale build-time configuration.
+ */
+const char * swscale_configuration(void);
+
+/**
+ * Returns the libswscale license.
+ */
+const char * swscale_license(void);
+
/* values for the flags, the stuff on the command line is different */
#define SWS_FAST_BILINEAR 1
#define SWS_BILINEAR 2
@@ -112,6 +122,10 @@ typedef struct {
struct SwsContext;
+/**
+ * Frees the swscaler context swsContext.
+ * If swsContext is NULL, then does nothing.
+ */
void sws_freeContext(struct SwsContext *swsContext);
/**
@@ -135,7 +149,11 @@ struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat
/**
* Scales the image slice in srcSlice and puts the resulting scaled
* slice in the image in dst. A slice is a sequence of consecutive
- * rows in an image. Slices can be bottom to top or top to bottom.
+ * rows in an image.
+ *
+ * Slices have to be provided in sequential order, either in
+ * top-bottom or bottom-top order. If slices are provided in
+ * non-sequential order the behavior of the function is undefined.
*
* @param context the scaling context previously created with
* sws_getContext()
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libswscale/swscale_template.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libswscale/swscale_template.c
index e842cbca23..675db6aa3f 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libswscale/swscale_template.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libswscale/swscale_template.c
@@ -944,7 +944,7 @@ static inline void RENAME(yuv2yuvX)(SwsContext *c, const int16_t *lumFilter, con
static inline void RENAME(yuv2nv12X)(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
const int16_t *chrFilter, const int16_t **chrSrc, int chrFilterSize,
- uint8_t *dest, uint8_t *uDest, int dstW, int chrDstW, int dstFormat)
+ uint8_t *dest, uint8_t *uDest, int dstW, int chrDstW, enum PixelFormat dstFormat)
{
yuv2nv12XinC(lumFilter, lumSrc, lumFilterSize,
chrFilter, chrSrc, chrFilterSize,
@@ -1361,7 +1361,7 @@ static inline void RENAME(yuv2packed2)(SwsContext *c, const uint16_t *buf0, cons
* YV12 to RGB without scaling or interpolating
*/
static inline void RENAME(yuv2packed1)(SwsContext *c, const uint16_t *buf0, const uint16_t *uvbuf0, const uint16_t *uvbuf1,
- const uint16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, int dstFormat, int flags, int y)
+ const uint16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, enum PixelFormat dstFormat, int flags, int y)
{
const int yalpha1=0;
int i;
@@ -1784,8 +1784,56 @@ static inline void RENAME(BEToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *s
#endif
}
+static inline void RENAME(nvXXtoUV)(uint8_t *dst1, uint8_t *dst2,
+ const uint8_t *src, long width)
+{
+#if COMPILE_TEMPLATE_MMX
+ __asm__ volatile(
+ "movq "MANGLE(bm01010101)", %%mm4 \n\t"
+ "mov %0, %%"REG_a" \n\t"
+ "1: \n\t"
+ "movq (%1, %%"REG_a",2), %%mm0 \n\t"
+ "movq 8(%1, %%"REG_a",2), %%mm1 \n\t"
+ "movq %%mm0, %%mm2 \n\t"
+ "movq %%mm1, %%mm3 \n\t"
+ "pand %%mm4, %%mm0 \n\t"
+ "pand %%mm4, %%mm1 \n\t"
+ "psrlw $8, %%mm2 \n\t"
+ "psrlw $8, %%mm3 \n\t"
+ "packuswb %%mm1, %%mm0 \n\t"
+ "packuswb %%mm3, %%mm2 \n\t"
+ "movq %%mm0, (%2, %%"REG_a") \n\t"
+ "movq %%mm2, (%3, %%"REG_a") \n\t"
+ "add $8, %%"REG_a" \n\t"
+ " js 1b \n\t"
+ : : "g" ((x86_reg)-width), "r" (src+width*2), "r" (dst1+width), "r" (dst2+width)
+ : "%"REG_a
+ );
+#else
+ int i;
+ for (i = 0; i < width; i++) {
+ dst1[i] = src[2*i+0];
+ dst2[i] = src[2*i+1];
+ }
+#endif
+}
+
+static inline void RENAME(nv12ToUV)(uint8_t *dstU, uint8_t *dstV,
+ const uint8_t *src1, const uint8_t *src2,
+ long width, uint32_t *unused)
+{
+ RENAME(nvXXtoUV)(dstU, dstV, src1, width);
+}
+
+static inline void RENAME(nv21ToUV)(uint8_t *dstU, uint8_t *dstV,
+ const uint8_t *src1, const uint8_t *src2,
+ long width, uint32_t *unused)
+{
+ RENAME(nvXXtoUV)(dstV, dstU, src1, width);
+}
+
#if COMPILE_TEMPLATE_MMX
-static inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, const uint8_t *src, long width, int srcFormat)
+static inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, const uint8_t *src, long width, enum PixelFormat srcFormat)
{
if(srcFormat == PIX_FMT_BGR24) {
@@ -1838,7 +1886,7 @@ static inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, const uint8_t *src, long w
);
}
-static inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, long width, int srcFormat)
+static inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, long width, enum PixelFormat srcFormat)
{
__asm__ volatile(
"movq 24+%4, %%mm6 \n\t"
@@ -2197,7 +2245,7 @@ static inline void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, const uint8_t *src, int srcW, int xInc,
int flags, const int16_t *hLumFilter,
const int16_t *hLumFilterPos, int hLumFilterSize,
- int srcFormat, uint8_t *formatConvBuffer,
+ enum PixelFormat srcFormat, uint8_t *formatConvBuffer,
uint32_t *pal, int isAlpha)
{
int32_t av_unused *mmx2FilterPos = c->lumMmx2FilterPos;
@@ -2374,7 +2422,7 @@ static inline void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst,
inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, const uint8_t *src1, const uint8_t *src2,
int srcW, int xInc, int flags, const int16_t *hChrFilter,
const int16_t *hChrFilterPos, int hChrFilterSize,
- int srcFormat, uint8_t *formatConvBuffer,
+ enum PixelFormat srcFormat, uint8_t *formatConvBuffer,
uint32_t *pal)
{
int32_t av_unused *mmx2FilterPos = c->chrMmx2FilterPos;
@@ -2543,8 +2591,8 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
const int chrSrcW= c->chrSrcW;
const int lumXInc= c->lumXInc;
const int chrXInc= c->chrXInc;
- const int dstFormat= c->dstFormat;
- const int srcFormat= c->srcFormat;
+ const enum PixelFormat dstFormat= c->dstFormat;
+ const enum PixelFormat srcFormat= c->srcFormat;
const int flags= c->flags;
int16_t *vLumFilterPos= c->vLumFilterPos;
int16_t *vChrFilterPos= c->vChrFilterPos;
@@ -2613,8 +2661,8 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
will not get executed. This is not really intended but works
currently, so people might do it. */
if (srcSliceY ==0) {
- lumBufIndex=0;
- chrBufIndex=0;
+ lumBufIndex=-1;
+ chrBufIndex=-1;
dstY=0;
lastInLumBuf= -1;
lastInChrBuf= -1;
@@ -2914,6 +2962,8 @@ static void RENAME(sws_init_swScale)(SwsContext *c)
switch(srcFormat) {
case PIX_FMT_YUYV422 : c->hcscale_internal = RENAME(yuy2ToUV); break;
case PIX_FMT_UYVY422 : c->hcscale_internal = RENAME(uyvyToUV); break;
+ case PIX_FMT_NV12 : c->hcscale_internal = RENAME(nv12ToUV); break;
+ case PIX_FMT_NV21 : c->hcscale_internal = RENAME(nv21ToUV); break;
case PIX_FMT_RGB8 :
case PIX_FMT_BGR8 :
case PIX_FMT_PAL8 :
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/subdir.mak b/xbmc/cores/dvdplayer/Codecs/ffmpeg/subdir.mak
index d89573904e..1a5158ac69 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/subdir.mak
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/subdir.mak
@@ -5,7 +5,7 @@ include $(SUBDIR)../common.mak
LIBVERSION := $(lib$(NAME)_VERSION)
LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR)
-ifeq ($(CONFIG_STATIC),yes)
+ifdef CONFIG_STATIC
all: $(SUBDIR)$(LIBNAME)
install-libs: install-lib$(NAME)-static
@@ -36,7 +36,8 @@ $(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
clean::
rm -f $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
- $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
+ $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS)))) \
+ $(HOSTOBJS) $(HOSTPROGS)
distclean:: clean
rm -f $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/codec-regression.sh b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/codec-regression.sh
index 65273aa76e..20e0e3c43e 100755
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/codec-regression.sh
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/codec-regression.sh
@@ -7,157 +7,10 @@
set -e
-target_exec=$5
-target_path=$6
-
-datadir="./tests/data"
-target_datadir="${target_path}/${datadir}"
-
-test="${1#regtest-}"
-this="$test.$2"
-logfile="$datadir/$this.regression"
-outfile="$datadir/$4-"
+. $(dirname $0)/regression-funcs.sh
eval do_$test=y
-# various files
-ffmpeg="$target_exec ${target_path}/ffmpeg_g"
-tiny_psnr="tests/tiny_psnr"
-benchfile="$datadir/$this.bench"
-bench="$datadir/$this.bench.tmp"
-bench2="$datadir/$this.bench2.tmp"
-raw_src="${target_path}/$3/%02d.pgm"
-raw_dst="$datadir/$this.out.yuv"
-raw_ref="$datadir/$2.ref.yuv"
-pcm_src="$target_datadir/asynth1.sw"
-pcm_dst="$datadir/$this.out.wav"
-pcm_ref="$datadir/$2.ref.wav"
-crcfile="$datadir/$this.crc"
-target_crcfile="$target_datadir/$this.crc"
-
-if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
- do_md5sum() { md5sum -b $1; }
-elif [ X"`echo | md5 2> /dev/null`" != X ]; then
- do_md5sum() { md5 $1 | sed 's#MD5 (\(.*\)) = \(.*\)#\2 *\1#'; }
-elif [ -x /sbin/md5 ]; then
- do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
-else
- do_md5sum() { echo No md5sum program found; }
-fi
-
-FFMPEG_OPTS="-v 0 -y -flags +bitexact -dct fastint -idct simple -sws_flags +accurate_rnd+bitexact"
-
-do_ffmpeg()
-{
- f="$1"
- shift
- set -- $* ${target_path}/$f
- echo $ffmpeg $FFMPEG_OPTS $*
- $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench
- do_md5sum $f >> $logfile
- if [ $f = $raw_dst ] ; then
- $tiny_psnr $f $raw_ref >> $logfile
- elif [ $f = $pcm_dst ] ; then
- $tiny_psnr $f $pcm_ref 2 >> $logfile
- else
- wc -c $f >> $logfile
- fi
- expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
- echo `cat $bench2` $f >> $benchfile
-}
-
-do_ffmpeg_nomd5()
-{
- f="$1"
- shift
- set -- $* ${target_path}/$f
- echo $ffmpeg $FFMPEG_OPTS $*
- $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench
- if [ $f = $raw_dst ] ; then
- $tiny_psnr $f $raw_ref >> $logfile
- elif [ $f = $pcm_dst ] ; then
- $tiny_psnr $f $pcm_ref 2 >> $logfile
- else
- wc -c $f >> $logfile
- fi
- expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
- echo `cat $bench2` $f >> $benchfile
-}
-
-do_ffmpeg_crc()
-{
- f="$1"
- shift
- echo $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile"
- $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile"
- echo "$f `cat $crcfile`" >> $logfile
- rm -f "$crcfile"
-}
-
-do_ffmpeg_nocheck()
-{
- f="$1"
- shift
- echo $ffmpeg $FFMPEG_OPTS $*
- $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench
- expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
- echo `cat $bench2` $f >> $benchfile
-}
-
-do_video_decoding()
-{
- do_ffmpeg $raw_dst $1 -i $target_path/$file -f rawvideo $2
- rm -f $raw_dst
-}
-
-do_video_encoding()
-{
- file=${outfile}$1
- do_ffmpeg $file $2 -f image2 -vcodec pgmyuv -i $raw_src $3
-}
-
-do_audio_encoding()
-{
- file=${outfile}$1
- do_ffmpeg $file -ab 128k -ac 2 -f s16le -i $pcm_src $3
-}
-
-do_audio_decoding()
-{
- do_ffmpeg $pcm_dst -i $target_path/$file -sample_fmt s16 -f wav
-}
-
-do_lavf()
-{
- file=${outfile}lavf.$1
- do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src $2
- do_ffmpeg_crc $file -i $target_path/$file $3
-}
-
-do_streamed_images()
-{
- file=${outfile}${1}pipe.$1
- do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f image2pipe
- do_ffmpeg_crc $file -f image2pipe -i $target_path/$file
-}
-
-do_image_formats()
-{
- file=${outfile}lavf%02d.$1
- echo $ffmpeg -t 0.5 -y -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $2 $3 -flags +bitexact -sws_flags +accurate_rnd+bitexact $target_path/$file
- $ffmpeg -t 0.5 -y -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $2 $3 -flags +bitexact -sws_flags +accurate_rnd+bitexact $target_path/$file
- do_md5sum ${outfile}lavf02.$1 >> $logfile
- do_ffmpeg_crc $file $3 -i $target_path/$file
- wc -c ${outfile}lavf02.$1 >> $logfile
-}
-
-do_audio_only()
-{
- file=${outfile}lavf.$1
- do_ffmpeg $file -t 1 -qscale 10 -f s16le -i $pcm_src
- do_ffmpeg_crc $file -i $target_path/$file
-}
-
rm -f "$logfile"
rm -f "$benchfile"
@@ -364,17 +217,17 @@ fi
if [ -n "$do_dnxhd_1080i" ] ; then
# FIXME: interlaced raw DNxHD decoding is broken
-do_video_encoding dnxhd-1080i.mov "" "-vcodec dnxhd -flags +ildct -s hd1080 -b 120Mb -pix_fmt yuv422p -an"
+do_video_encoding dnxhd-1080i.mov "" "-vcodec dnxhd -flags +ildct -s hd1080 -b 120Mb -pix_fmt yuv422p -vframes 5 -an"
do_video_decoding "-r 25" "-s cif -pix_fmt yuv420p"
fi
if [ -n "$do_dnxhd_720p" ] ; then
-do_video_encoding dnxhd-720p.dnxhd "" "-s hd720 -b 90Mb -pix_fmt yuv422p -an"
+do_video_encoding dnxhd-720p.dnxhd "" "-s hd720 -b 90Mb -pix_fmt yuv422p -vframes 5 -an"
do_video_decoding "-r 25" "-s cif -pix_fmt yuv420p"
fi
if [ -n "$do_dnxhd_720p_rd" ] ; then
-do_video_encoding dnxhd-720p-rd.dnxhd "" "-mbd rd -s hd720 -b 90Mb -pix_fmt yuv422p -an"
+do_video_encoding dnxhd-720p-rd.dnxhd "" "-threads 4 -mbd rd -s hd720 -b 90Mb -pix_fmt yuv422p -vframes 5 -an"
do_video_decoding "-r 25" "-s cif -pix_fmt yuv420p"
fi
@@ -388,6 +241,11 @@ do_video_encoding flashsv.flv "" "-an -vcodec flashsv -sws_flags neighbor+full_c
do_video_decoding "" "-pix_fmt yuv420p -sws_flags area+accurate_rnd+bitexact"
fi
+if [ -n "$do_roq" ] ; then
+do_video_encoding roqav.roq "" "-vframes 5"
+do_video_decoding "" "-pix_fmt yuv420p"
+fi
+
if [ -n "$do_mp2" ] ; then
do_audio_encoding mp2.mp2 "-ar 44100"
do_audio_decoding
@@ -431,6 +289,11 @@ do_audio_encoding adpcm_swf.flv "-ar 44100" "-acodec adpcm_swf"
do_audio_decoding
fi
+if [ -n "$do_alac" ] ; then
+do_audio_encoding alac.m4a "-ar 44100" "-acodec alac -compression_level 1"
+do_audio_decoding
+fi
+
if [ -n "$do_flac" ] ; then
do_audio_encoding flac.flac "-ar 44100" "-acodec flac -compression_level 2"
do_audio_decoding
@@ -484,202 +347,4 @@ do_audio_enc_dec wav s16 pcm_zork
do_audio_enc_dec 302 s16 pcm_s24daud "-ac 6 -ar 96000"
fi
-# libavformat testing
-
-if [ -n "$do_avi" ] ; then
-do_lavf avi
-fi
-
-if [ -n "$do_asf" ] ; then
-do_lavf asf "-acodec mp2" "-r 25"
-fi
-
-if [ -n "$do_rm" ] ; then
-file=${outfile}lavf.rm
-do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src
-# broken
-#do_ffmpeg_crc $file -i $target_path/$file
-fi
-
-if [ -n "$do_mpg" ] ; then
-do_lavf mpg
-fi
-
-if [ -n "$do_mxf" ] ; then
-do_lavf mxf "-ar 48000 -bf 2 -timecode_frame_start 264363"
-do_lavf mxf_d10 "-ar 48000 -ac 2 -r 25 -s 720x576 -padtop 32 -vcodec mpeg2video -intra -flags +ildct+low_delay -dc 10 -flags2 +ivlc+non_linear_q -qscale 1 -ps 1 -qmin 1 -rc_max_vbv_use 1 -rc_min_vbv_use 1 -pix_fmt yuv422p -minrate 30000k -maxrate 30000k -b 30000k -bufsize 1200000 -top 1 -rc_init_occupancy 1200000 -qmax 12 -f mxf_d10"
-fi
-
-if [ -n "$do_ts" ] ; then
-do_lavf ts
-fi
-
-if [ -n "$do_swf" ] ; then
-do_lavf swf -an
-fi
-
-if [ -n "$do_ffm" ] ; then
-do_lavf ffm
-fi
-
-if [ -n "$do_flv_fmt" ] ; then
-do_lavf flv -an
-fi
-
-if [ -n "$do_mov" ] ; then
-do_lavf mov "-acodec pcm_alaw"
-fi
-
-if [ -n "$do_dv_fmt" ] ; then
-do_lavf dv "-ar 48000 -r 25 -s pal -ac 2"
-fi
-
-if [ -n "$do_gxf" ] ; then
-do_lavf gxf "-ar 48000 -r 25 -s pal -ac 1"
-fi
-
-if [ -n "$do_nut" ] ; then
-do_lavf nut "-acodec mp2"
-fi
-
-if [ -n "$do_mkv" ] ; then
-do_lavf mkv
-fi
-
-
-# streamed images
-# mjpeg
-#file=${outfile}lavf.mjpeg
-#do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
-#do_ffmpeg_crc $file -i $target_path/$file
-
-if [ -n "$do_pbmpipe" ] ; then
-do_streamed_images pbm
-fi
-
-if [ -n "$do_pgmpipe" ] ; then
-do_streamed_images pgm
-fi
-
-if [ -n "$do_ppmpipe" ] ; then
-do_streamed_images ppm
-fi
-
-if [ -n "$do_gif" ] ; then
-file=${outfile}lavf.gif
-do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -pix_fmt rgb24
-#do_ffmpeg_crc $file -i $target_path/$file
-fi
-
-if [ -n "$do_yuv4mpeg" ] ; then
-file=${outfile}lavf.y4m
-do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
-#do_ffmpeg_crc $file -i $target_path/$file
-fi
-
-# image formats
-
-if [ -n "$do_pgm" ] ; then
-do_image_formats pgm
-fi
-
-if [ -n "$do_ppm" ] ; then
-do_image_formats ppm
-fi
-
-if [ -n "$do_bmp" ] ; then
-do_image_formats bmp
-fi
-
-if [ -n "$do_tga" ] ; then
-do_image_formats tga
-fi
-
-if [ -n "$do_tiff" ] ; then
-do_image_formats tiff "-pix_fmt rgb24"
-fi
-
-if [ -n "$do_sgi" ] ; then
-do_image_formats sgi
-fi
-
-if [ -n "$do_jpg" ] ; then
-do_image_formats jpg "-flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p" "-f image2"
-fi
-
-if [ -n "$do_pcx" ] ; then
-do_image_formats pcx
-fi
-
-# audio only
-
-if [ -n "$do_wav" ] ; then
-do_audio_only wav
-fi
-
-if [ -n "$do_alaw" ] ; then
-do_audio_only al
-fi
-
-if [ -n "$do_mulaw" ] ; then
-do_audio_only ul
-fi
-
-if [ -n "$do_au" ] ; then
-do_audio_only au
-fi
-
-if [ -n "$do_mmf" ] ; then
-do_audio_only mmf
-fi
-
-if [ -n "$do_aiff" ] ; then
-do_audio_only aif
-fi
-
-if [ -n "$do_voc" ] ; then
-do_audio_only voc
-fi
-
-if [ -n "$do_ogg" ] ; then
-do_audio_only ogg
-fi
-
-# pix_fmt conversions
-
-if [ -n "$do_pixfmt" ] ; then
-conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
- yuvj422p yuvj444p rgb24 bgr24 rgb32 rgb565 rgb555 gray monow \
- monob yuv440p yuvj440p"
-for pix_fmt in $conversions ; do
- file=${outfile}lavf-${pix_fmt}.yuv
- do_ffmpeg_nocheck $file -r 1 -t 1 -f image2 -vcodec pgmyuv -i $raw_src \
- -f rawvideo -s 352x288 -pix_fmt $pix_fmt $target_path/$raw_dst
- do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $target_path/$raw_dst \
- -f rawvideo -s 352x288 -pix_fmt yuv444p
-done
-fi
-
-# libavfilter testing
-
-do_lavfi() {
- test_name=$1
- eval test=\$do_$test_name
- vfilters=$2
-
- if [ -n "$test" ] ; then
- do_video_encoding ${test_name}.avi "" "-vcodec rawvideo -vfilters $vfilters"
- fi
-}
-
-# example tests:
-# do_lavfi "crop" "crop=100:100:-1:-1"
-# do_lavfi "crop_scale" "crop=100:100,scale=200:-1"
-# do_lavfi "scale" "scale=200:200"
-
-# TODO: add tests for
-# direct rendering,
-# slices
-# chains with feedback loops
-
rm -f "$bench" "$bench2"
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavf-regression.sh b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavf-regression.sh
new file mode 100755
index 0000000000..7b97881bb3
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavf-regression.sh
@@ -0,0 +1,222 @@
+#!/bin/sh
+#
+# automatic regression test for libavformat
+#
+#
+#set -x
+
+set -e
+
+. $(dirname $0)/regression-funcs.sh
+
+eval do_$test=y
+
+do_lavf()
+{
+ file=${outfile}lavf.$1
+ do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src $2
+ do_ffmpeg_crc $file -i $target_path/$file $3
+}
+
+do_streamed_images()
+{
+ file=${outfile}${1}pipe.$1
+ do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f image2pipe
+ do_ffmpeg_crc $file -f image2pipe -i $target_path/$file
+}
+
+do_image_formats()
+{
+ file=${outfile}lavf%02d.$1
+ echo $ffmpeg -t 0.5 -y -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $2 $3 -flags +bitexact -sws_flags +accurate_rnd+bitexact $target_path/$file
+ $ffmpeg -t 0.5 -y -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $2 $3 -flags +bitexact -sws_flags +accurate_rnd+bitexact $target_path/$file
+ do_md5sum ${outfile}lavf02.$1 >> $logfile
+ do_ffmpeg_crc $file $3 -i $target_path/$file
+ wc -c ${outfile}lavf02.$1 >> $logfile
+}
+
+do_audio_only()
+{
+ file=${outfile}lavf.$1
+ do_ffmpeg $file -t 1 -qscale 10 -f s16le -i $pcm_src
+ do_ffmpeg_crc $file -i $target_path/$file
+}
+
+rm -f "$logfile"
+rm -f "$benchfile"
+
+if [ -n "$do_avi" ] ; then
+do_lavf avi
+fi
+
+if [ -n "$do_asf" ] ; then
+do_lavf asf "-acodec mp2" "-r 25"
+fi
+
+if [ -n "$do_rm" ] ; then
+file=${outfile}lavf.rm
+do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src
+# broken
+#do_ffmpeg_crc $file -i $target_path/$file
+fi
+
+if [ -n "$do_mpg" ] ; then
+do_lavf mpg
+fi
+
+if [ -n "$do_mxf" ] ; then
+do_lavf mxf "-ar 48000 -bf 2 -timecode_frame_start 264363"
+do_lavf mxf_d10 "-ar 48000 -ac 2 -r 25 -s 720x576 -padtop 32 -vcodec mpeg2video -intra -flags +ildct+low_delay -dc 10 -flags2 +ivlc+non_linear_q -qscale 1 -ps 1 -qmin 1 -rc_max_vbv_use 1 -rc_min_vbv_use 1 -pix_fmt yuv422p -minrate 30000k -maxrate 30000k -b 30000k -bufsize 1200000 -top 1 -rc_init_occupancy 1200000 -qmax 12 -f mxf_d10"
+fi
+
+if [ -n "$do_ts" ] ; then
+do_lavf ts
+fi
+
+if [ -n "$do_swf" ] ; then
+do_lavf swf -an
+fi
+
+if [ -n "$do_ffm" ] ; then
+do_lavf ffm
+fi
+
+if [ -n "$do_flv_fmt" ] ; then
+do_lavf flv -an
+fi
+
+if [ -n "$do_mov" ] ; then
+do_lavf mov "-acodec pcm_alaw"
+fi
+
+if [ -n "$do_dv_fmt" ] ; then
+do_lavf dv "-ar 48000 -r 25 -s pal -ac 2"
+fi
+
+if [ -n "$do_gxf" ] ; then
+do_lavf gxf "-ar 48000 -r 25 -s pal -ac 1"
+fi
+
+if [ -n "$do_nut" ] ; then
+do_lavf nut "-acodec mp2"
+fi
+
+if [ -n "$do_mkv" ] ; then
+do_lavf mkv
+fi
+
+
+# streamed images
+# mjpeg
+#file=${outfile}lavf.mjpeg
+#do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
+#do_ffmpeg_crc $file -i $target_path/$file
+
+if [ -n "$do_pbmpipe" ] ; then
+do_streamed_images pbm
+fi
+
+if [ -n "$do_pgmpipe" ] ; then
+do_streamed_images pgm
+fi
+
+if [ -n "$do_ppmpipe" ] ; then
+do_streamed_images ppm
+fi
+
+if [ -n "$do_gif" ] ; then
+file=${outfile}lavf.gif
+do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -pix_fmt rgb24
+#do_ffmpeg_crc $file -i $target_path/$file
+fi
+
+if [ -n "$do_yuv4mpeg" ] ; then
+file=${outfile}lavf.y4m
+do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
+#do_ffmpeg_crc $file -i $target_path/$file
+fi
+
+# image formats
+
+if [ -n "$do_pgm" ] ; then
+do_image_formats pgm
+fi
+
+if [ -n "$do_ppm" ] ; then
+do_image_formats ppm
+fi
+
+if [ -n "$do_bmp" ] ; then
+do_image_formats bmp
+fi
+
+if [ -n "$do_tga" ] ; then
+do_image_formats tga
+fi
+
+if [ -n "$do_tiff" ] ; then
+do_image_formats tiff "-pix_fmt rgb24"
+fi
+
+if [ -n "$do_sgi" ] ; then
+do_image_formats sgi
+fi
+
+if [ -n "$do_jpg" ] ; then
+do_image_formats jpg "-flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p" "-f image2"
+fi
+
+if [ -n "$do_pcx" ] ; then
+do_image_formats pcx
+fi
+
+# audio only
+
+if [ -n "$do_wav" ] ; then
+do_audio_only wav
+fi
+
+if [ -n "$do_alaw" ] ; then
+do_audio_only al
+fi
+
+if [ -n "$do_mulaw" ] ; then
+do_audio_only ul
+fi
+
+if [ -n "$do_au" ] ; then
+do_audio_only au
+fi
+
+if [ -n "$do_mmf" ] ; then
+do_audio_only mmf
+fi
+
+if [ -n "$do_aiff" ] ; then
+do_audio_only aif
+fi
+
+if [ -n "$do_voc" ] ; then
+do_audio_only voc
+fi
+
+if [ -n "$do_ogg" ] ; then
+do_audio_only ogg
+fi
+
+# pix_fmt conversions
+
+if [ -n "$do_pixfmt" ] ; then
+conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
+ yuvj422p yuvj444p rgb24 bgr24 rgb32 rgb565 rgb555 gray monow \
+ monob yuv440p yuvj440p"
+for pix_fmt in $conversions ; do
+ file=${outfile}lavf-${pix_fmt}.yuv
+ do_ffmpeg_nocheck $file -r 1 -t 1 -f image2 -vcodec pgmyuv -i $raw_src \
+ -f rawvideo -s 352x288 -pix_fmt $pix_fmt $target_path/$raw_dst
+ do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $target_path/$raw_dst \
+ -f rawvideo -s 352x288 -pix_fmt yuv444p
+done
+fi
+
+rm -f "$bench" "$bench2"
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavf.regression.ref b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavf.regression.ref
index 47b333ee2f..0ce3ca3eb7 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavf.regression.ref
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavf.regression.ref
@@ -21,7 +21,7 @@ b3174e2db508564c1cce0b5e3c1bc1bd *./tests/data/b-lavf.mxf_d10
62c5aeb636fc82cf6ba6277d36e42cb5 *./tests/data/b-lavf.swf
329479 ./tests/data/b-lavf.swf
./tests/data/b-lavf.swf CRC=0x881785d1
-7841ec48bf18b29aff8223b7134e99f1 *./tests/data/b-lavf.ffm
+a2dd3180dbfc7c8d50d34cea4cdc92d8 *./tests/data/b-lavf.ffm
376832 ./tests/data/b-lavf.ffm
./tests/data/b-lavf.ffm CRC=0x2b39ed74
62c3177547fb5853a5116661802e1ae2 *./tests/data/b-lavf.flv
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavfi-regression.sh b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavfi-regression.sh
new file mode 100755
index 0000000000..1f52fd7eee
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavfi-regression.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# automatic regression test for libavfilter
+#
+#
+#set -x
+
+set -e
+
+. $(dirname $0)/regression-funcs.sh
+
+eval do_$test=y
+
+rm -f "$logfile"
+rm -f "$benchfile"
+
+do_lavfi() {
+ test_name=$1
+ eval test=\$do_$test_name
+ vfilters=$2
+
+ if [ -n "$test" ] ; then
+ do_video_encoding ${test_name}.avi "" "-vcodec rawvideo -vfilters $vfilters"
+ fi
+}
+
+# example tests:
+# do_lavfi "crop" "crop=100:100:-1:-1"
+# do_lavfi "crop_scale" "crop=100:100,scale=200:-1"
+# do_lavfi "scale" "scale=200:200"
+
+# TODO: add tests for
+# direct rendering,
+# slices
+# chains with feedback loops
+
+rm -f "$bench" "$bench2"
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/regression-funcs.sh b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/regression-funcs.sh
new file mode 100755
index 0000000000..388a8fff9d
--- /dev/null
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/regression-funcs.sh
@@ -0,0 +1,126 @@
+#!/bin/sh
+#
+# common regression functions for ffmpeg
+#
+#
+
+test="${1#regtest-}"
+test_ref=$2
+raw_src_dir=$3
+outfile_prefix=$4
+target_exec=$5
+target_path=$6
+
+datadir="./tests/data"
+target_datadir="${target_path}/${datadir}"
+
+this="$test.$test_ref"
+logfile="$datadir/$this.regression"
+outfile="$datadir/${outfile_prefix}-"
+
+# various files
+ffmpeg="$target_exec ${target_path}/ffmpeg_g"
+tiny_psnr="tests/tiny_psnr"
+benchfile="$datadir/$this.bench"
+bench="$datadir/$this.bench.tmp"
+bench2="$datadir/$this.bench2.tmp"
+raw_src="${target_path}/$raw_src_dir/%02d.pgm"
+raw_dst="$datadir/$this.out.yuv"
+raw_ref="$datadir/$test_ref.ref.yuv"
+pcm_src="$target_datadir/asynth1.sw"
+pcm_dst="$datadir/$this.out.wav"
+pcm_ref="$datadir/$test_ref.ref.wav"
+crcfile="$datadir/$this.crc"
+target_crcfile="$target_datadir/$this.crc"
+
+if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
+ do_md5sum() { md5sum -b $1; }
+elif [ X"`echo | md5 2> /dev/null`" != X ]; then
+ do_md5sum() { md5 $1 | sed 's#MD5 (\(.*\)) = \(.*\)#\2 *\1#'; }
+elif [ -x /sbin/md5 ]; then
+ do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
+else
+ do_md5sum() { echo No md5sum program found; }
+fi
+
+FFMPEG_OPTS="-v 0 -y -flags +bitexact -dct fastint -idct simple -sws_flags +accurate_rnd+bitexact"
+
+do_ffmpeg()
+{
+ f="$1"
+ shift
+ set -- $* ${target_path}/$f
+ echo $ffmpeg $FFMPEG_OPTS $*
+ $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench
+ do_md5sum $f >> $logfile
+ if [ $f = $raw_dst ] ; then
+ $tiny_psnr $f $raw_ref >> $logfile
+ elif [ $f = $pcm_dst ] ; then
+ $tiny_psnr $f $pcm_ref 2 >> $logfile
+ else
+ wc -c $f >> $logfile
+ fi
+ expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
+ echo `cat $bench2` $f >> $benchfile
+}
+
+do_ffmpeg_nomd5()
+{
+ f="$1"
+ shift
+ set -- $* ${target_path}/$f
+ echo $ffmpeg $FFMPEG_OPTS $*
+ $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench
+ if [ $f = $raw_dst ] ; then
+ $tiny_psnr $f $raw_ref >> $logfile
+ elif [ $f = $pcm_dst ] ; then
+ $tiny_psnr $f $pcm_ref 2 >> $logfile
+ else
+ wc -c $f >> $logfile
+ fi
+ expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
+ echo `cat $bench2` $f >> $benchfile
+}
+
+do_ffmpeg_crc()
+{
+ f="$1"
+ shift
+ echo $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile"
+ $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile"
+ echo "$f `cat $crcfile`" >> $logfile
+ rm -f "$crcfile"
+}
+
+do_ffmpeg_nocheck()
+{
+ f="$1"
+ shift
+ echo $ffmpeg $FFMPEG_OPTS $*
+ $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench
+ expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
+ echo `cat $bench2` $f >> $benchfile
+}
+
+do_video_decoding()
+{
+ do_ffmpeg $raw_dst $1 -i $target_path/$file -f rawvideo $2
+ rm -f $raw_dst
+}
+
+do_video_encoding()
+{
+ file=${outfile}$1
+ do_ffmpeg $file $2 -f image2 -vcodec pgmyuv -i $raw_src $3
+}
+
+do_audio_encoding()
+{
+ file=${outfile}$1
+ do_ffmpeg $file -ab 128k -ac 2 -f s16le -i $pcm_src $3
+}
+
+do_audio_decoding()
+{
+ do_ffmpeg $pcm_dst -i $target_path/$file -sample_fmt s16 -f wav
+}
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/rotozoom.regression.ref b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/rotozoom.regression.ref
index 665de75f63..b3d88f7cc6 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/rotozoom.regression.ref
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/rotozoom.regression.ref
@@ -1,71 +1,71 @@
73ca6f1deab02d1d67a0e8495c026a9e *./tests/data/a-mpeg1.mpg
192783 ./tests/data/a-mpeg1.mpg
56147e94b12f08df7213e610e177823d *./tests/data/mpeg.rotozoom.out.yuv
-stddev: 4.95 PSNR: 34.21 bytes: 7603200/ 7603200
+stddev: 4.95 PSNR: 34.22 bytes: 7603200/ 7603200
2d55ce623a7be4e8136f80266e487678 *./tests/data/a-mpeg2.mpg
198667 ./tests/data/a-mpeg2.mpg
b7cae8a1f751b821cddcbe4d5dbc518c *./tests/data/mpeg2.rotozoom.out.yuv
-stddev: 4.96 PSNR: 34.19 bytes: 7603200/ 7603200
+stddev: 4.96 PSNR: 34.20 bytes: 7603200/ 7603200
788b83a7c8c6c1e648c05076dd40dc30 *./tests/data/a-mpeg2ivlc-qprd.mpg
247161 ./tests/data/a-mpeg2ivlc-qprd.mpg
cc6f08c1a24b58c19de325e79cfa40a3 *./tests/data/mpeg2.rotozoom.out.yuv
-stddev: 4.25 PSNR: 35.55 bytes: 7603200/ 7603200
+stddev: 4.25 PSNR: 35.56 bytes: 7603200/ 7603200
a144ff5d9b293b43fc13ec40119925c0 *./tests/data/a-mpeg2_422.mpg
359045 ./tests/data/a-mpeg2_422.mpg
5e7a85daf29ae185499cacab2b39c17f *./tests/data/mpeg2.rotozoom.out.yuv
-stddev: 54.55 PSNR: 13.38 bytes: 10137600/ 7603200
+stddev: 54.55 PSNR: 13.39 bytes: 10137600/ 7603200
f979bcca866e6e4cad5dc6cb06e56cfb *./tests/data/a-mpeg2.mpg
198041 ./tests/data/a-mpeg2.mpg
f6d9bf24ff8676a7f6076c05cd2c81a3 *./tests/data/mpeg2.rotozoom.out.yuv
-stddev: 4.97 PSNR: 34.18 bytes: 7603200/ 7603200
+stddev: 4.97 PSNR: 34.19 bytes: 7603200/ 7603200
f90197a8b6e62ae25f82625337f27240 *./tests/data/a-mpeg2i.mpg
204579 ./tests/data/a-mpeg2i.mpg
ea5057b60146c06d40449cdfc686bf13 *./tests/data/mpeg2.rotozoom.out.yuv
-stddev: 4.98 PSNR: 34.17 bytes: 7603200/ 7603200
+stddev: 4.98 PSNR: 34.18 bytes: 7603200/ 7603200
c346717be44450e41d9d6e07f59d1490 *./tests/data/a-mpeg2thread.mpg
182959 ./tests/data/a-mpeg2thread.mpg
02b85a7f67ced2d146a5c4e8000712b6 *./tests/data/mpeg2thread.rotozoom.out.yuv
-stddev: 4.75 PSNR: 34.57 bytes: 7603200/ 7603200
+stddev: 4.75 PSNR: 34.58 bytes: 7603200/ 7603200
ff30b3df75626398873ac4f30093a5ae *./tests/data/a-mpeg2threadivlc.mpg
182105 ./tests/data/a-mpeg2threadivlc.mpg
02b85a7f67ced2d146a5c4e8000712b6 *./tests/data/mpeg2thread.rotozoom.out.yuv
-stddev: 4.75 PSNR: 34.57 bytes: 7603200/ 7603200
+stddev: 4.75 PSNR: 34.58 bytes: 7603200/ 7603200
3942f86a6aa6fe5aea586fedf210e33e *./tests/data/a-mpeg2reuse.mpg
394265 ./tests/data/a-mpeg2reuse.mpg
afbc483eaa769925259e6094cfda2c72 *./tests/data/mpeg2thread.rotozoom.out.yuv
-stddev: 4.76 PSNR: 34.56 bytes: 7603200/ 7603200
+stddev: 4.76 PSNR: 34.57 bytes: 7603200/ 7603200
c09815e40a9d260628e1ebad8b2b3774 *./tests/data/a-msmpeg4v2.avi
129918 ./tests/data/a-msmpeg4v2.avi
8920194f8bf8f9cdd6c65b3df9e1a292 *./tests/data/msmpeg4v2.rotozoom.out.yuv
-stddev: 5.33 PSNR: 33.58 bytes: 7603200/ 7603200
+stddev: 5.33 PSNR: 33.59 bytes: 7603200/ 7603200
3069f95f2ffca1f20c8ea36e2625fabc *./tests/data/a-msmpeg4.avi
127680 ./tests/data/a-msmpeg4.avi
0e1c6e25c71c6a8fa8e506e3d97ca4c9 *./tests/data/msmpeg4.rotozoom.out.yuv
-stddev: 5.33 PSNR: 33.58 bytes: 7603200/ 7603200
+stddev: 5.33 PSNR: 33.59 bytes: 7603200/ 7603200
1011e26e7d351c96d7bbfe106d831b69 *./tests/data/a-wmv1.avi
129530 ./tests/data/a-wmv1.avi
81eee429b665254d19a06607463c0b5e *./tests/data/wmv1.rotozoom.out.yuv
-stddev: 5.33 PSNR: 33.59 bytes: 7603200/ 7603200
+stddev: 5.33 PSNR: 33.60 bytes: 7603200/ 7603200
1f6598e9776ed00aebdc44cc8d48cb7c *./tests/data/a-wmv2.avi
129860 ./tests/data/a-wmv2.avi
81eee429b665254d19a06607463c0b5e *./tests/data/wmv2.rotozoom.out.yuv
-stddev: 5.33 PSNR: 33.59 bytes: 7603200/ 7603200
+stddev: 5.33 PSNR: 33.60 bytes: 7603200/ 7603200
dfd005d4c9030a0dc889c828a6408b9c *./tests/data/a-h261.avi
191086 ./tests/data/a-h261.avi
db7ceff174823b98834faa2320ca89ac *./tests/data/h261.rotozoom.out.yuv
-stddev: 6.37 PSNR: 32.02 bytes: 7603200/ 7603200
+stddev: 6.37 PSNR: 32.03 bytes: 7603200/ 7603200
9a368687ab34c48079f11a202839a6bc *./tests/data/a-h263.avi
160106 ./tests/data/a-h263.avi
61213b91b359697ebcefb9e0a53ac54a *./tests/data/h263.rotozoom.out.yuv
-stddev: 5.43 PSNR: 33.41 bytes: 7603200/ 7603200
+stddev: 5.43 PSNR: 33.42 bytes: 7603200/ 7603200
c7644d40e9f40bbd98e5a978f9f94bb4 *./tests/data/a-h263p.avi
868018 ./tests/data/a-h263p.avi
4b0ee791f280029dc03c528f76f195d4 *./tests/data/h263p.rotozoom.out.yuv
-stddev: 1.91 PSNR: 42.49 bytes: 7603200/ 7603200
+stddev: 1.91 PSNR: 42.50 bytes: 7603200/ 7603200
47de227982e77830a2db278214a08773 *./tests/data/a-odivx.mp4
119797 ./tests/data/a-odivx.mp4
90a3577850239083a9042bef33c50e85 *./tests/data/mpeg4.rotozoom.out.yuv
-stddev: 5.34 PSNR: 33.56 bytes: 7603200/ 7603200
+stddev: 5.34 PSNR: 33.57 bytes: 7603200/ 7603200
56cd44907a48990e06bd065e189ff461 *./tests/data/a-huffyuv.avi
6455232 ./tests/data/a-huffyuv.avi
dde5895817ad9d219f79a52d0bdfb001 *./tests/data/huffyuv.rotozoom.out.yuv
@@ -73,43 +73,43 @@ stddev: 0.00 PSNR:999.99 bytes: 7603200/ 7603200
b517389e425d3065ab26ef4cc0658237 *./tests/data/a-mpeg4-rc.avi
227762 ./tests/data/a-mpeg4-rc.avi
cc947bbac9187bf08d3e2d425556aaa5 *./tests/data/rc.rotozoom.out.yuv
-stddev: 4.26 PSNR: 35.53 bytes: 7603200/ 7603200
+stddev: 4.26 PSNR: 35.54 bytes: 7603200/ 7603200
dee7be19486a76d96c88d18eefba8f86 *./tests/data/a-mpeg4-adv.avi
141546 ./tests/data/a-mpeg4-adv.avi
3f3a21e9db85a9c0f7022f557a5374c1 *./tests/data/mpeg4adv.rotozoom.out.yuv
-stddev: 4.94 PSNR: 34.24 bytes: 7603200/ 7603200
+stddev: 4.94 PSNR: 34.25 bytes: 7603200/ 7603200
e7a09631afd7b75c6a0544c365aadbe1 *./tests/data/a-mpeg4-qprd.avi
233154 ./tests/data/a-mpeg4-qprd.avi
b5b5f761b63bbf5844085b03e0a76636 *./tests/data/mpeg4adv.rotozoom.out.yuv
-stddev: 3.75 PSNR: 36.62 bytes: 7603200/ 7603200
+stddev: 3.75 PSNR: 36.63 bytes: 7603200/ 7603200
78c93c522b23bcc7f84f8b592b0191b6 *./tests/data/a-mpeg4-adap.avi
200120 ./tests/data/a-mpeg4-adap.avi
fd7db0b14fa76d0734bbfa36dbb513f8 *./tests/data/mpeg4adv.rotozoom.out.yuv
-stddev: 3.78 PSNR: 36.57 bytes: 7603200/ 7603200
+stddev: 3.78 PSNR: 36.58 bytes: 7603200/ 7603200
a5150067914ee1dee50f8fc8dcaee841 *./tests/data/a-mpeg4-Q.avi
165802 ./tests/data/a-mpeg4-Q.avi
4dcc71ad79bee90777cf5299044be362 *./tests/data/mpeg4adv.rotozoom.out.yuv
-stddev: 4.00 PSNR: 36.08 bytes: 7603200/ 7603200
+stddev: 4.00 PSNR: 36.09 bytes: 7603200/ 7603200
8496ffe953dc3398c657d99e962e4d77 *./tests/data/a-mpeg4-thread.avi
250162 ./tests/data/a-mpeg4-thread.avi
58165c879707aedeab460bab86dae4ef *./tests/data/mpeg4thread.rotozoom.out.yuv
-stddev: 3.73 PSNR: 36.67 bytes: 7603200/ 7603200
+stddev: 3.73 PSNR: 36.68 bytes: 7603200/ 7603200
90e65096aa9ebafa3fe3f44a5a47cdc4 *./tests/data/a-error-mpeg4-adv.avi
176588 ./tests/data/a-error-mpeg4-adv.avi
113defd3f8daf878e0b3fc03fafb4c09 *./tests/data/error.rotozoom.out.yuv
-stddev: 9.02 PSNR: 29.01 bytes: 7603200/ 7603200
+stddev: 9.02 PSNR: 29.02 bytes: 7603200/ 7603200
c41187c99588fb7229ad330b2f80d28b *./tests/data/a-mpeg4-nr.avi
155044 ./tests/data/a-mpeg4-nr.avi
f7fc191308679f709405e62271f5c65f *./tests/data/mpeg4nr.rotozoom.out.yuv
-stddev: 4.73 PSNR: 34.62 bytes: 7603200/ 7603200
+stddev: 4.73 PSNR: 34.63 bytes: 7603200/ 7603200
977f3caf286e8f36c6ab4c7464632f26 *./tests/data/a-mpeg1b.mpg
229806 ./tests/data/a-mpeg1b.mpg
f41c60846bfb8cb6dcf6071c846c82b4 *./tests/data/mpeg1b.rotozoom.out.yuv
-stddev: 4.13 PSNR: 35.79 bytes: 7603200/ 7603200
+stddev: 4.13 PSNR: 35.80 bytes: 7603200/ 7603200
765b2637f313eda33afdcdc384bfbc06 *./tests/data/a-mjpeg.avi
704100 ./tests/data/a-mjpeg.avi
3dc419bf8ddc7482d811e4c9dcf9d418 *./tests/data/mjpeg.rotozoom.out.yuv
-stddev: 4.38 PSNR: 35.28 bytes: 7603200/ 7603200
+stddev: 4.38 PSNR: 35.29 bytes: 7603200/ 7603200
554a4a6a5a9058c588f8bf2de405bc70 *./tests/data/a-ljpeg.avi
4766914 ./tests/data/a-ljpeg.avi
dde5895817ad9d219f79a52d0bdfb001 *./tests/data/ljpeg.rotozoom.out.yuv
@@ -117,27 +117,27 @@ stddev: 0.00 PSNR:999.99 bytes: 7603200/ 7603200
4fc53937f048c900ae6d50fda9dba206 *./tests/data/a-jpegls.avi
8334630 ./tests/data/a-jpegls.avi
592b3321994e26a990deb3a0a1415de9 *./tests/data/jpegls.rotozoom.out.yuv
-stddev: 0.65 PSNR: 51.83 bytes: 7603200/ 7603200
+stddev: 0.65 PSNR: 51.84 bytes: 7603200/ 7603200
b1467b0e8d8cad730e36d1e8ab49d573 *./tests/data/a-rv10.rm
154310 ./tests/data/a-rv10.rm
61213b91b359697ebcefb9e0a53ac54a *./tests/data/rv10.rotozoom.out.yuv
-stddev: 5.43 PSNR: 33.41 bytes: 7603200/ 7603200
+stddev: 5.43 PSNR: 33.42 bytes: 7603200/ 7603200
d864475aa16d84dd99de13e65003672a *./tests/data/a-rv20.rm
132734 ./tests/data/a-rv20.rm
c66afdcc0daac2f1b4167b9811968877 *./tests/data/rv20.rotozoom.out.yuv
-stddev: 5.42 PSNR: 33.44 bytes: 7603200/ 7603200
+stddev: 5.42 PSNR: 33.45 bytes: 7603200/ 7603200
4eb34d2de25f67a2706456e999338fe9 *./tests/data/a-asv1.avi
832512 ./tests/data/a-asv1.avi
c96ff7fd17c52f99ddb7922a4cb9168f *./tests/data/asv1.rotozoom.out.yuv
-stddev: 10.47 PSNR: 27.72 bytes: 7603200/ 7603200
+stddev: 10.47 PSNR: 27.73 bytes: 7603200/ 7603200
9649a4b68fb1107bad13e8a7574cc72d *./tests/data/a-asv2.avi
789072 ./tests/data/a-asv2.avi
74a78015b64b2cf8cb9da2e44f508a69 *./tests/data/asv2.rotozoom.out.yuv
-stddev: 10.28 PSNR: 27.88 bytes: 7603200/ 7603200
+stddev: 10.28 PSNR: 27.89 bytes: 7603200/ 7603200
2edc92093d36506bcc0a5c0e17e86113 *./tests/data/a-flv.flv
131360 ./tests/data/a-flv.flv
8999c8264fb0941561f64c4a736e9d88 *./tests/data/flv.rotozoom.out.yuv
-stddev: 5.33 PSNR: 33.58 bytes: 7603200/ 7603200
+stddev: 5.33 PSNR: 33.59 bytes: 7603200/ 7603200
d72b0960e162d4998b9acbabb07e99ab *./tests/data/a-ffv1.avi
3525804 ./tests/data/a-ffv1.avi
dde5895817ad9d219f79a52d0bdfb001 *./tests/data/ffv1.rotozoom.out.yuv
@@ -145,7 +145,7 @@ stddev: 0.00 PSNR:999.99 bytes: 7603200/ 7603200
af651d8ef0a66257ac8b2ef8b229f27b *./tests/data/a-snow.avi
57700 ./tests/data/a-snow.avi
8890189af71a0dd3447c4e8424c9a76b *./tests/data/snow.rotozoom.out.yuv
-stddev: 10.47 PSNR: 27.71 bytes: 7603200/ 7603200
+stddev: 10.47 PSNR: 27.72 bytes: 7603200/ 7603200
a8fccf278bbb17d37a756ecf11672b09 *./tests/data/a-snow53.avi
2721758 ./tests/data/a-snow53.avi
dde5895817ad9d219f79a52d0bdfb001 *./tests/data/snowll.rotozoom.out.yuv
@@ -153,94 +153,102 @@ stddev: 0.00 PSNR:999.99 bytes: 7603200/ 7603200
bfa766f89bfeabc0ae1044f3954bed52 *./tests/data/a-dv.dv
7200000 ./tests/data/a-dv.dv
7ec62bd3350a6848364669e6e1e4b9cc *./tests/data/dv.rotozoom.out.yuv
-stddev: 1.71 PSNR: 43.46 bytes: 7603200/ 7603200
+stddev: 1.71 PSNR: 43.47 bytes: 7603200/ 7603200
00a9d8683ac6826af41bcf7223fb0389 *./tests/data/a-dv411.dv
7200000 ./tests/data/a-dv411.dv
7f9fa421028aabb11eaf4c6513a5a843 *./tests/data/dv.rotozoom.out.yuv
-stddev: 10.09 PSNR: 28.04 bytes: 7603200/ 7603200
+stddev: 10.09 PSNR: 28.05 bytes: 7603200/ 7603200
61e31c79e8949b25c849753a0785b0d7 *./tests/data/a-dv50.dv
14400000 ./tests/data/a-dv50.dv
af3f2dd5ab62c1a1d98b07d4aeb6852f *./tests/data/dv50.rotozoom.out.yuv
-stddev: 0.82 PSNR: 49.81 bytes: 7603200/ 7603200
-981a11fcd1f5419facc016a7608b3df9 *./tests/data/a-dnxhd-1080i.mov
-30311415 ./tests/data/a-dnxhd-1080i.mov
-a0119aa04a86c80d6dfd0776c9ece580 *./tests/data/dnxhd_1080i.rotozoom.out.yuv
-stddev: 1.53 PSNR: 44.37 bytes: 7603200/ 7603200
-1ab8a3f04bde27c33e92fe110892e2cd *./tests/data/a-dnxhd-720p.dnxhd
-22937600 ./tests/data/a-dnxhd-720p.dnxhd
-7d546dc6d2bc87551614c0f730c59e1f *./tests/data/dnxhd_720p.rotozoom.out.yuv
-stddev: 2.10 PSNR: 41.64 bytes: 7603200/ 7603200
-bf8621a44fb65452aded9cbdece81aa2 *./tests/data/a-dnxhd-720p-rd.dnxhd
-22937600 ./tests/data/a-dnxhd-720p-rd.dnxhd
-e556f5fe58df25b5b07930148a23a553 *./tests/data/dnxhd_720p_rd.rotozoom.out.yuv
-stddev: 1.54 PSNR: 44.33 bytes: 7603200/ 7603200
+stddev: 0.82 PSNR: 49.82 bytes: 7603200/ 7603200
+1a4594983ae91f41907b89fe3174c527 *./tests/data/a-dnxhd-1080i.mov
+3031875 ./tests/data/a-dnxhd-1080i.mov
+3c559af629ae0a8fb1a9a0e4b4da7733 *./tests/data/dnxhd_1080i.rotozoom.out.yuv
+stddev: 1.31 PSNR: 45.77 bytes: 760320/ 7603200
+58e07cc6ae0a2d36787044d0e82708a6 *./tests/data/a-dnxhd-720p.dnxhd
+2293760 ./tests/data/a-dnxhd-720p.dnxhd
+ab601eaafef74d80d3d20b780dddd836 *./tests/data/dnxhd_720p.rotozoom.out.yuv
+stddev: 1.36 PSNR: 45.45 bytes: 760320/ 7603200
+092ffb7b8cf3c11556bb05dbb8b476ac *./tests/data/a-dnxhd-720p-rd.dnxhd
+2293760 ./tests/data/a-dnxhd-720p-rd.dnxhd
+33547ca318acff9448cba719cb99296d *./tests/data/dnxhd_720p_rd.rotozoom.out.yuv
+stddev: 1.32 PSNR: 45.66 bytes: 760320/ 7603200
7f9fbe4890bc1df67867bf03803dca48 *./tests/data/a-svq1.mov
766851 ./tests/data/a-svq1.mov
aa03471dac3f49455a33a2b19fda1098 *./tests/data/svq1.rotozoom.out.yuv
-stddev: 3.23 PSNR: 37.92 bytes: 7603200/ 7603200
+stddev: 3.23 PSNR: 37.93 bytes: 7603200/ 7603200
0667077971e0cb63b5f49c580006e90e *./tests/data/a-flashsv.flv
12368953 ./tests/data/a-flashsv.flv
592b3321994e26a990deb3a0a1415de9 *./tests/data/flashsv.rotozoom.out.yuv
-stddev: 0.65 PSNR: 51.83 bytes: 7603200/ 7603200
+stddev: 0.65 PSNR: 51.84 bytes: 7603200/ 7603200
+7ed9804f2e4b962421007afa23a157a9 *./tests/data/a-roqav.roq
+92322 ./tests/data/a-roqav.roq
+fe633f931dbc84fd6ca1a79e25edfd4f *./tests/data/roq.rotozoom.out.yuv
+stddev: 3.80 PSNR: 36.52 bytes: 760320/ 7603200
f6eb0a205350bbd7fb1028a01c7ae8aa *./tests/data/a-mp2.mp2
96130 ./tests/data/a-mp2.mp2
74c7b6b15a001add199619fafe4059a1 *./tests/data/mp2.rotozoom.out.wav
-stddev: 9315.80 PSNR: 16.93 bytes: 1059884/ 1058444
-stddev: 4385.25 PSNR: 23.48 bytes: 1057960/ 1058444
+stddev: 9315.80 PSNR: 16.94 bytes: 1059884/ 1058444
+stddev: 4385.25 PSNR: 23.49 bytes: 1057960/ 1058444
081bfd5e683b13cccf1b07c43c1c5005 *./tests/data/a-ac3.rm
98751 ./tests/data/a-ac3.rm
5d8cce28f83dd33c3c7eaf43a5db5294 *./tests/data/a-g726.wav
24082 ./tests/data/a-g726.wav
4f1ba1af75dee64625a1c852e6cd01d3 *./tests/data/g726.rotozoom.out.wav
-stddev: 8506.46 PSNR: 17.72 bytes: 96148/ 1058444
+stddev: 8506.46 PSNR: 17.73 bytes: 96148/ 1058444
56b75c3a6dacedcf2ce7b0586aa33594 *./tests/data/a-adpcm_ima.wav
267324 ./tests/data/a-adpcm_ima.wav
78a2af1c895792d0c221d127bdd48ece *./tests/data/adpcm_ima_wav.rotozoom.out.wav
-stddev: 903.51 PSNR: 37.20 bytes: 1061792/ 1058444
+stddev: 903.51 PSNR: 37.21 bytes: 1061792/ 1058444
3c06fd2f7831e3e8735b936e23ca220c *./tests/data/a-adpcm_qt.aiff
281252 ./tests/data/a-adpcm_qt.aiff
9580492803ba1c1a3746367b24b751c8 *./tests/data/adpcm_ima_qt.rotozoom.out.wav
-stddev: 914.63 PSNR: 37.09 bytes: 1058604/ 1058444
-9f813f0cc8b2c05821a31828eadf1188 *./tests/data/a-adpcm_ms.wav
-268344 ./tests/data/a-adpcm_ms.wav
+stddev: 914.63 PSNR: 37.10 bytes: 1058604/ 1058444
+a407b87daeef5b25dfb6c5b3f519e9c1 *./tests/data/a-adpcm_ms.wav
+268378 ./tests/data/a-adpcm_ms.wav
7be370f937c51e8a967e6a3d08d5156a *./tests/data/adpcm_ms.rotozoom.out.wav
-stddev: 1050.00 PSNR: 35.90 bytes: 1060620/ 1058444
+stddev: 1050.00 PSNR: 35.91 bytes: 1060620/ 1058444
2546d72df736b5ffa1557e8c9c9ef788 *./tests/data/a-adpcm_yam.wav
266296 ./tests/data/a-adpcm_yam.wav
c80c847a53a0fee17a88fa889ec34a4e *./tests/data/adpcm_yam.rotozoom.out.wav
-stddev: 1247.64 PSNR: 34.40 bytes: 1065004/ 1058444
+stddev: 1247.64 PSNR: 34.41 bytes: 1065004/ 1058444
42d4639866ed4d692eaf126228a4fa2a *./tests/data/a-adpcm_swf.flv
269166 ./tests/data/a-adpcm_swf.flv
628089745a7059ae4055c2515b6d668b *./tests/data/adpcm_swf.rotozoom.out.wav
-stddev: 933.65 PSNR: 36.92 bytes: 1065004/ 1058444
+stddev: 933.65 PSNR: 36.93 bytes: 1065004/ 1058444
+c68f649777ab8e7c9a0f1f221451d3ad *./tests/data/a-alac.m4a
+389386 ./tests/data/a-alac.m4a
+95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/alac.rotozoom.out.wav
+stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
7781a016edfc242a39e4d65af02d861a *./tests/data/a-flac.flac
353368 ./tests/data/a-flac.flac
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/flac.rotozoom.out.wav
stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
26a7f6b0f0b7181df8df3fa589f6bf81 *./tests/data/a-wmav1.asf
106004 ./tests/data/a-wmav1.asf
-stddev:12245.27 PSNR: 14.56 bytes: 1065004/ 1058444
-stddev: 2097.78 PSNR: 29.88 bytes: 1056812/ 1058444
+stddev:12245.27 PSNR: 14.57 bytes: 1065004/ 1058444
+stddev: 2097.78 PSNR: 29.89 bytes: 1056812/ 1058444
7c6c0cb692af01b312ae345723674b5f *./tests/data/a-wmav2.asf
106044 ./tests/data/a-wmav2.asf
-stddev:12249.69 PSNR: 14.56 bytes: 1065004/ 1058444
-stddev: 2091.12 PSNR: 29.91 bytes: 1056812/ 1058444
+stddev:12249.69 PSNR: 14.57 bytes: 1065004/ 1058444
+stddev: 2091.12 PSNR: 29.92 bytes: 1056812/ 1058444
89f5b8dd97e0dddbe59af0d44fd229f3 *./tests/data/a-pcm_alaw.wav
529256 ./tests/data/a-pcm_alaw.wav
0568b0b9a72e31559e150e7e09d301cd *./tests/data/pcm.rotozoom.out.wav
-stddev: 101.67 PSNR: 56.18 bytes: 1058444/ 1058444
+stddev: 101.67 PSNR: 56.19 bytes: 1058444/ 1058444
f443a8eeb1647ec1eeb8370c939e52d4 *./tests/data/a-pcm_mulaw.wav
529256 ./tests/data/a-pcm_mulaw.wav
1c3eeaa8814ebd4916780dff80ed6dc5 *./tests/data/pcm.rotozoom.out.wav
-stddev: 103.38 PSNR: 56.03 bytes: 1058444/ 1058444
+stddev: 103.38 PSNR: 56.04 bytes: 1058444/ 1058444
b7936d7170e0efefb379349d81aed360 *./tests/data/a-pcm_s8.mov
530837 ./tests/data/a-pcm_s8.mov
652edf30f35ad89bf27bcc9d2f9c7b53 *./tests/data/pcm.rotozoom.out.wav
-stddev: 147.89 PSNR: 52.92 bytes: 1058444/ 1058444
+stddev: 147.89 PSNR: 52.93 bytes: 1058444/ 1058444
98cadb3502dbdc99e6e077c28b1a036c *./tests/data/a-pcm_u8.wav
529244 ./tests/data/a-pcm_u8.wav
652edf30f35ad89bf27bcc9d2f9c7b53 *./tests/data/pcm.rotozoom.out.wav
-stddev: 147.89 PSNR: 52.92 bytes: 1058444/ 1058444
+stddev: 147.89 PSNR: 52.93 bytes: 1058444/ 1058444
c42b9c04305455250366c84e17c1023f *./tests/data/a-pcm_s16be.mov
1060037 ./tests/data/a-pcm_s16be.mov
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.rotozoom.out.wav
@@ -261,39 +269,39 @@ stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
1589237 ./tests/data/a-pcm_s24be.mov
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.rotozoom.out.wav
stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
-aaba3cf534ddddf5bcf663bc8c5b5331 *./tests/data/a-pcm_s24le.wav
-1587644 ./tests/data/a-pcm_s24le.wav
+a85380fb79b0d4fff38e24ac1e34bb94 *./tests/data/a-pcm_s24le.wav
+1587668 ./tests/data/a-pcm_s24le.wav
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.rotozoom.out.wav
stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
d7792f0343cd66fda8b50b569e2bcc48 *./tests/data/a-pcm_s32be.mov
2118437 ./tests/data/a-pcm_s32be.mov
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.rotozoom.out.wav
stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
-7661c9b6f221d9f57985a9e4d92c4e63 *./tests/data/a-pcm_s32le.wav
-2116844 ./tests/data/a-pcm_s32le.wav
+da6ed80f4f40f0082577dea80827e014 *./tests/data/a-pcm_s32le.wav
+2116868 ./tests/data/a-pcm_s32le.wav
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.rotozoom.out.wav
stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
118ff3dc83c62ce9ce669eef57e55bb2 *./tests/data/a-pcm_f32be.au
2116824 ./tests/data/a-pcm_f32be.au
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.rotozoom.out.wav
stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
-4104d0804a80fb8d02952ca5103b1012 *./tests/data/a-pcm_f32le.wav
-2116856 ./tests/data/a-pcm_f32le.wav
+46f44f86a18984a832206ab9e29a79f2 *./tests/data/a-pcm_f32le.wav
+2116880 ./tests/data/a-pcm_f32le.wav
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.rotozoom.out.wav
stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
8112296b1ed94f72f20d04b1a54850a7 *./tests/data/a-pcm_f64be.au
4233624 ./tests/data/a-pcm_f64be.au
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.rotozoom.out.wav
stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
-26598accec99bdbaf76d575045aca7a9 *./tests/data/a-pcm_f64le.wav
-4233656 ./tests/data/a-pcm_f64le.wav
+ba17c6d1a270e1333e981f239bf7eb45 *./tests/data/a-pcm_f64le.wav
+4233680 ./tests/data/a-pcm_f64le.wav
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.rotozoom.out.wav
stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
8c74234928ed425b1171211a89f67ead *./tests/data/a-pcm_zork.wav
529256 ./tests/data/a-pcm_zork.wav
864c8c866ac25642c29a13b122c70709 *./tests/data/pcm.rotozoom.out.wav
-stddev: 633.10 PSNR: 40.29 bytes: 1058444/ 1058444
+stddev: 633.10 PSNR: 40.30 bytes: 1058444/ 1058444
8168a5c1343553ef027541830f2cb879 *./tests/data/a-pcm_s24daud.302
10368730 ./tests/data/a-pcm_s24daud.302
-fff1dc03aa2750031203a7d72b832fad *./tests/data/pcm.rotozoom.out.wav
-stddev: 9416.45 PSNR: 16.84 bytes: 6911840/ 1058444
+f552afadfdfcd6348a07095da6382de5 *./tests/data/pcm.rotozoom.out.wav
+stddev: 9415.16 PSNR: 16.85 bytes: 6911864/ 1058444
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/seek.regression.ref b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/seek.regression.ref
index d88496c537..97e9e248e5 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/seek.regression.ref
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/seek.regression.ref
@@ -1,3820 +1,3820 @@
----------------
tests/data/a-ac3.rm
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:271 size:556 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:271 size:556 flags:1
-ret:-1 st:-1 ts:1.894167 flags:1
-ret:-1 st: 0 ts:0.788000 flags:0
-ret: 0 st: 0 ts:-0.317000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:271 size:556 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret: 0 st: 0 dts:2.960000 pts:2.960000 pos:48659 size:558 flags:1
-ret:-1 st:-1 ts:1.470835 flags:1
-ret:-1 st: 0 ts:0.365000 flags:0
-ret: 0 st: 0 ts:-0.741000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:271 size:556 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret: 0 st: 0 dts:2.960000 pts:2.960000 pos:48659 size:558 flags:1
-ret:-1 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 ts:-0.058000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:271 size:556 flags:1
-ret: 0 st: 0 ts:2.836000 flags:1
-ret: 0 st: 0 dts:2.333000 pts:2.333000 pos:38413 size:556 flags:1
-ret:-1 st:-1 ts:1.730004 flags:0
-ret:-1 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 ts:-0.482000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:271 size:556 flags:1
-ret:-1 st: 0 ts:2.413000 flags:1
-ret:-1 st:-1 ts:1.306672 flags:0
-ret:-1 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 ts:-0.905000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:271 size:556 flags:1
-ret: 0 st: 0 ts:1.989000 flags:1
-ret: 0 st: 0 dts:1.915000 pts:1.915000 pos:31581 size:558 flags:1
-ret:-1 st:-1 ts:0.883340 flags:0
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:271 size:556 flags:1
-ret:-1 st: 0 ts:2.672000 flags:0
-ret:-1 st: 0 ts:1.566000 flags:1
-ret:-1 st:-1 ts:0.460008 flags:0
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:271 size:556 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
+ret:-1 st:-1 flags:1 ts: 1.894167
+ret:-1 st: 0 flags:0 ts: 0.788000
+ret: 0 st: 0 flags:1 ts:-0.317000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret: 0 st: 0 flags:1 dts: 2.960000 pts: 2.960000 pos: 48659 size: 558
+ret:-1 st:-1 flags:1 ts: 1.470835
+ret:-1 st: 0 flags:0 ts: 0.365000
+ret: 0 st: 0 flags:1 ts:-0.741000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret: 0 st: 0 flags:1 dts: 2.960000 pts: 2.960000 pos: 48659 size: 558
+ret:-1 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:0 ts:-0.058000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
+ret: 0 st: 0 flags:1 ts: 2.836000
+ret: 0 st: 0 flags:1 dts: 2.333000 pts: 2.333000 pos: 38413 size: 556
+ret:-1 st:-1 flags:0 ts: 1.730004
+ret:-1 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:0 ts:-0.482000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
+ret:-1 st: 0 flags:1 ts: 2.413000
+ret:-1 st:-1 flags:0 ts: 1.306672
+ret:-1 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:0 ts:-0.905000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
+ret: 0 st: 0 flags:1 ts: 1.989000
+ret: 0 st: 0 flags:1 dts: 1.915000 pts: 1.915000 pos: 31581 size: 558
+ret:-1 st:-1 flags:0 ts: 0.883340
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
+ret:-1 st: 0 flags:0 ts: 2.672000
+ret:-1 st: 0 flags:1 ts: 1.566000
+ret:-1 st:-1 flags:0 ts: 0.460008
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
----------------
tests/data/a-adpcm_ima.wav
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:60 size:4096 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:60 size:4096 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.856009 pts:1.856009 pos:29756 size:4096 flags:1
-ret: 0 st: 0 ts:0.788345 flags:0
-ret: 0 st: 0 dts:0.831995 pts:0.831995 pos:13372 size:4096 flags:1
-ret: 0 st: 0 ts:-0.317506 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:60 size:4096 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret: 0 st: 0 dts:2.623991 pts:2.623991 pos:42044 size:4096 flags:1
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.408005 pts:1.408005 pos:22588 size:4096 flags:1
-ret: 0 st: 0 ts:0.365011 flags:0
-ret: 0 st: 0 dts:0.383991 pts:0.383991 pos:6204 size:4096 flags:1
-ret: 0 st: 0 ts:-0.740839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:60 size:4096 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret: 0 st: 0 dts:2.176009 pts:2.176009 pos:34876 size:4096 flags:1
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.023991 pts:1.023991 pos:16444 size:4096 flags:1
-ret: 0 st: 0 ts:-0.058322 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:60 size:4096 flags:1
-ret: 0 st: 0 ts:2.835828 flags:1
-ret: 0 st: 0 dts:2.816009 pts:2.816009 pos:45116 size:4096 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.791995 pts:1.791995 pos:28732 size:4096 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.576009 pts:0.576009 pos:9276 size:4096 flags:1
-ret: 0 st: 0 ts:-0.481655 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:60 size:4096 flags:1
-ret: 0 st: 0 ts:2.412494 flags:1
-ret: 0 st: 0 dts:2.368005 pts:2.368005 pos:37948 size:4096 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.343991 pts:1.343991 pos:21564 size:4096 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.191995 pts:0.191995 pos:3132 size:4096 flags:1
-ret: 0 st: 0 ts:-0.904989 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:60 size:4096 flags:1
-ret: 0 st: 0 ts:1.989184 flags:1
-ret: 0 st: 0 dts:1.983991 pts:1.983991 pos:31804 size:4096 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.896009 pts:0.896009 pos:14396 size:4096 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:60 size:4096 flags:1
-ret: 0 st: 0 ts:2.671678 flags:0
-ret: 0 st: 0 dts:2.688005 pts:2.688005 pos:43068 size:4096 flags:1
-ret: 0 st: 0 ts:1.565850 flags:1
-ret: 0 st: 0 dts:1.536009 pts:1.536009 pos:24636 size:4096 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.511995 pts:0.511995 pos:8252 size:4096 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:60 size:4096 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 60 size: 4096
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 60 size: 4096
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.856009 pts: 1.856009 pos: 29756 size: 4096
+ret: 0 st: 0 flags:0 ts: 0.788345
+ret: 0 st: 0 flags:1 dts: 0.831995 pts: 0.831995 pos: 13372 size: 4096
+ret: 0 st: 0 flags:1 ts:-0.317506
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 60 size: 4096
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret: 0 st: 0 flags:1 dts: 2.623991 pts: 2.623991 pos: 42044 size: 4096
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.408005 pts: 1.408005 pos: 22588 size: 4096
+ret: 0 st: 0 flags:0 ts: 0.365011
+ret: 0 st: 0 flags:1 dts: 0.383991 pts: 0.383991 pos: 6204 size: 4096
+ret: 0 st: 0 flags:1 ts:-0.740839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 60 size: 4096
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret: 0 st: 0 flags:1 dts: 2.176009 pts: 2.176009 pos: 34876 size: 4096
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 1.023991 pts: 1.023991 pos: 16444 size: 4096
+ret: 0 st: 0 flags:0 ts:-0.058322
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 60 size: 4096
+ret: 0 st: 0 flags:1 ts: 2.835828
+ret: 0 st: 0 flags:1 dts: 2.816009 pts: 2.816009 pos: 45116 size: 4096
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.791995 pts: 1.791995 pos: 28732 size: 4096
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.576009 pts: 0.576009 pos: 9276 size: 4096
+ret: 0 st: 0 flags:0 ts:-0.481655
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 60 size: 4096
+ret: 0 st: 0 flags:1 ts: 2.412494
+ret: 0 st: 0 flags:1 dts: 2.368005 pts: 2.368005 pos: 37948 size: 4096
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.343991 pts: 1.343991 pos: 21564 size: 4096
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.191995 pts: 0.191995 pos: 3132 size: 4096
+ret: 0 st: 0 flags:0 ts:-0.904989
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 60 size: 4096
+ret: 0 st: 0 flags:1 ts: 1.989184
+ret: 0 st: 0 flags:1 dts: 1.983991 pts: 1.983991 pos: 31804 size: 4096
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.896009 pts: 0.896009 pos: 14396 size: 4096
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 60 size: 4096
+ret: 0 st: 0 flags:0 ts: 2.671678
+ret: 0 st: 0 flags:1 dts: 2.688005 pts: 2.688005 pos: 43068 size: 4096
+ret: 0 st: 0 flags:1 ts: 1.565850
+ret: 0 st: 0 flags:1 dts: 1.536009 pts: 1.536009 pos: 24636 size: 4096
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.511995 pts: 0.511995 pos: 8252 size: 4096
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 60 size: 4096
----------------
tests/data/a-adpcm_qt.aiff
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:72 size:4080 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:72 size:4080 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.894059 pts:1.894059 pos:88812 size:4080 flags:1
-ret: 0 st: 0 ts:0.788345 flags:0
-ret: 0 st: 0 dts:0.789546 pts:0.789546 pos:37064 size:4080 flags:1
-ret: 0 st: 0 ts:-0.317506 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:72 size:4080 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret: 0 st: 0 dts:2.577642 pts:2.577642 pos:120840 size:4080 flags:1
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.470249 pts:1.470249 pos:68956 size:4080 flags:1
-ret: 0 st: 0 ts:0.365011 flags:0
-ret: 0 st: 0 dts:0.365737 pts:0.365737 pos:17208 size:4080 flags:1
-ret: 0 st: 0 ts:-0.740839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:72 size:4080 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret: 0 st: 0 dts:2.153855 pts:2.153855 pos:100984 size:4080 flags:1
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.046440 pts:1.046440 pos:49100 size:4080 flags:1
-ret: 0 st: 0 ts:-0.058322 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:72 size:4080 flags:1
-ret: 0 st: 0 ts:2.835828 flags:1
-ret: 0 st: 0 dts:2.834535 pts:2.834535 pos:132876 size:4080 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.730045 pts:1.730045 pos:81128 size:4080 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.624082 pts:0.624082 pos:29312 size:4080 flags:1
-ret: 0 st: 0 ts:-0.481655 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:72 size:4080 flags:1
-ret: 0 st: 0 ts:2.412494 flags:1
-ret: 0 st: 0 dts:2.412200 pts:2.412200 pos:113088 size:4080 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.307687 pts:1.307687 pos:61340 size:4080 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.200295 pts:0.200295 pos:9456 size:4080 flags:1
-ret: 0 st: 0 ts:-0.904989 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:72 size:4080 flags:1
-ret: 0 st: 0 ts:1.989184 flags:1
-ret: 0 st: 0 dts:1.988390 pts:1.988390 pos:93232 size:4080 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.883900 pts:0.883900 pos:41484 size:4080 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:72 size:4080 flags:1
-ret: 0 st: 0 ts:2.671678 flags:0
-ret: 0 st: 0 dts:2.671995 pts:2.671995 pos:125260 size:4080 flags:1
-ret: 0 st: 0 ts:1.565850 flags:1
-ret: 0 st: 0 dts:1.564580 pts:1.564580 pos:73376 size:4080 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.460091 pts:0.460091 pos:21628 size:4080 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:72 size:4080 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 72 size: 68
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 72 size: 68
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.894059 pts: 1.894059 pos: 88812 size: 68
+ret: 0 st: 0 flags:0 ts: 0.788345
+ret: 0 st: 0 flags:1 dts: 0.789546 pts: 0.789546 pos: 37064 size: 68
+ret: 0 st: 0 flags:1 ts:-0.317506
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 72 size: 68
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret: 0 st: 0 flags:1 dts: 2.577642 pts: 2.577642 pos: 120840 size: 68
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.470249 pts: 1.470249 pos: 68956 size: 68
+ret: 0 st: 0 flags:0 ts: 0.365011
+ret: 0 st: 0 flags:1 dts: 0.365737 pts: 0.365737 pos: 17208 size: 68
+ret: 0 st: 0 flags:1 ts:-0.740839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 72 size: 68
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret: 0 st: 0 flags:1 dts: 2.153855 pts: 2.153855 pos: 100984 size: 68
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 1.046440 pts: 1.046440 pos: 49100 size: 68
+ret: 0 st: 0 flags:0 ts:-0.058322
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 72 size: 68
+ret: 0 st: 0 flags:1 ts: 2.835828
+ret: 0 st: 0 flags:1 dts: 2.834535 pts: 2.834535 pos: 132876 size: 68
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.730045 pts: 1.730045 pos: 81128 size: 68
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.624082 pts: 0.624082 pos: 29312 size: 68
+ret: 0 st: 0 flags:0 ts:-0.481655
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 72 size: 68
+ret: 0 st: 0 flags:1 ts: 2.412494
+ret: 0 st: 0 flags:1 dts: 2.412200 pts: 2.412200 pos: 113088 size: 68
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.307687 pts: 1.307687 pos: 61340 size: 68
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.200295 pts: 0.200295 pos: 9456 size: 68
+ret: 0 st: 0 flags:0 ts:-0.904989
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 72 size: 68
+ret: 0 st: 0 flags:1 ts: 1.989184
+ret: 0 st: 0 flags:1 dts: 1.988390 pts: 1.988390 pos: 93232 size: 68
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.883900 pts: 0.883900 pos: 41484 size: 68
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 72 size: 68
+ret: 0 st: 0 flags:0 ts: 2.671678
+ret: 0 st: 0 flags:1 dts: 2.671995 pts: 2.671995 pos: 125260 size: 68
+ret: 0 st: 0 flags:1 ts: 1.565850
+ret: 0 st: 0 flags:1 dts: 1.564580 pts: 1.564580 pos: 73376 size: 68
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.460091 pts: 0.460091 pos: 21628 size: 68
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 72 size: 68
----------------
tests/data/a-adpcm_ms.wav
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.856009 pts:1.856009 pos:29752 size:4096 flags:1
-ret: 0 st: 0 ts:0.788345 flags:0
-ret: 0 st: 0 dts:0.831995 pts:0.831995 pos:13368 size:4096 flags:1
-ret: 0 st: 0 ts:-0.317506 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret: 0 st: 0 dts:2.623991 pts:2.623991 pos:42040 size:4096 flags:1
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.408005 pts:1.408005 pos:22584 size:4096 flags:1
-ret: 0 st: 0 ts:0.365011 flags:0
-ret: 0 st: 0 dts:0.383991 pts:0.383991 pos:6200 size:4096 flags:1
-ret: 0 st: 0 ts:-0.740839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret: 0 st: 0 dts:2.176009 pts:2.176009 pos:34872 size:4096 flags:1
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.023991 pts:1.023991 pos:16440 size:4096 flags:1
-ret: 0 st: 0 ts:-0.058322 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st: 0 ts:2.835828 flags:1
-ret: 0 st: 0 dts:2.816009 pts:2.816009 pos:45112 size:4096 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.791995 pts:1.791995 pos:28728 size:4096 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.576009 pts:0.576009 pos:9272 size:4096 flags:1
-ret: 0 st: 0 ts:-0.481655 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st: 0 ts:2.412494 flags:1
-ret: 0 st: 0 dts:2.368005 pts:2.368005 pos:37944 size:4096 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.343991 pts:1.343991 pos:21560 size:4096 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.191995 pts:0.191995 pos:3128 size:4096 flags:1
-ret: 0 st: 0 ts:-0.904989 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st: 0 ts:1.989184 flags:1
-ret: 0 st: 0 dts:1.983991 pts:1.983991 pos:31800 size:4096 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.896009 pts:0.896009 pos:14392 size:4096 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st: 0 ts:2.671678 flags:0
-ret: 0 st: 0 dts:2.688005 pts:2.688005 pos:43064 size:4096 flags:1
-ret: 0 st: 0 ts:1.565850 flags:1
-ret: 0 st: 0 dts:1.536009 pts:1.536009 pos:24632 size:4096 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.511995 pts:0.511995 pos:8248 size:4096 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 90 size: 4096
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 90 size: 4096
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.856009 pts: 1.856009 pos: 29786 size: 4096
+ret: 0 st: 0 flags:0 ts: 0.788345
+ret: 0 st: 0 flags:1 dts: 0.831995 pts: 0.831995 pos: 13402 size: 4096
+ret: 0 st: 0 flags:1 ts:-0.317506
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 90 size: 4096
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret: 0 st: 0 flags:1 dts: 2.623991 pts: 2.623991 pos: 42074 size: 4096
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.408005 pts: 1.408005 pos: 22618 size: 4096
+ret: 0 st: 0 flags:0 ts: 0.365011
+ret: 0 st: 0 flags:1 dts: 0.383991 pts: 0.383991 pos: 6234 size: 4096
+ret: 0 st: 0 flags:1 ts:-0.740839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 90 size: 4096
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret: 0 st: 0 flags:1 dts: 2.176009 pts: 2.176009 pos: 34906 size: 4096
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 1.023991 pts: 1.023991 pos: 16474 size: 4096
+ret: 0 st: 0 flags:0 ts:-0.058322
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 90 size: 4096
+ret: 0 st: 0 flags:1 ts: 2.835828
+ret: 0 st: 0 flags:1 dts: 2.816009 pts: 2.816009 pos: 45146 size: 4096
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.791995 pts: 1.791995 pos: 28762 size: 4096
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.576009 pts: 0.576009 pos: 9306 size: 4096
+ret: 0 st: 0 flags:0 ts:-0.481655
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 90 size: 4096
+ret: 0 st: 0 flags:1 ts: 2.412494
+ret: 0 st: 0 flags:1 dts: 2.368005 pts: 2.368005 pos: 37978 size: 4096
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.343991 pts: 1.343991 pos: 21594 size: 4096
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.191995 pts: 0.191995 pos: 3162 size: 4096
+ret: 0 st: 0 flags:0 ts:-0.904989
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 90 size: 4096
+ret: 0 st: 0 flags:1 ts: 1.989184
+ret: 0 st: 0 flags:1 dts: 1.983991 pts: 1.983991 pos: 31834 size: 4096
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.896009 pts: 0.896009 pos: 14426 size: 4096
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 90 size: 4096
+ret: 0 st: 0 flags:0 ts: 2.671678
+ret: 0 st: 0 flags:1 dts: 2.688005 pts: 2.688005 pos: 43098 size: 4096
+ret: 0 st: 0 flags:1 ts: 1.565850
+ret: 0 st: 0 flags:1 dts: 1.536009 pts: 1.536009 pos: 24666 size: 4096
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.511995 pts: 0.511995 pos: 8282 size: 4096
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 90 size: 4096
----------------
tests/data/a-adpcm_swf.flv
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:208 size:2053 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:208 size:2053 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.858000 pts:1.858000 pos:82968 size:2053 flags:1
-ret: 0 st: 0 ts:0.788000 flags:0
-ret: 0 st: 0 dts:0.789000 pts:0.789000 pos:35381 size:2053 flags:1
-ret:-1 st: 0 ts:-0.317000 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret: 0 st: 0 dts:2.601000 pts:2.601000 pos:116072 size:2053 flags:1
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:64347 size:2053 flags:1
-ret: 0 st: 0 ts:0.365000 flags:0
-ret: 0 st: 0 dts:0.372000 pts:0.372000 pos:16760 size:2053 flags:1
-ret:-1 st: 0 ts:-0.741000 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret: 0 st: 0 dts:2.183000 pts:2.183000 pos:97451 size:2053 flags:1
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.022000 pts:1.022000 pos:45726 size:2053 flags:1
-ret: 0 st: 0 ts:-0.058000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:208 size:2053 flags:1
-ret: 0 st: 0 ts:2.836000 flags:1
-ret: 0 st: 0 dts:2.833000 pts:2.833000 pos:126417 size:2053 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.765000 pts:1.765000 pos:78830 size:2053 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.604000 pts:0.604000 pos:27105 size:2053 flags:1
-ret: 0 st: 0 ts:-0.482000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:208 size:2053 flags:1
-ret: 0 st: 0 ts:2.413000 flags:1
-ret: 0 st: 0 dts:2.368000 pts:2.368000 pos:105727 size:2053 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.347000 pts:1.347000 pos:60209 size:2053 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.186000 pts:0.186000 pos:8484 size:2053 flags:1
-ret: 0 st: 0 ts:-0.905000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:208 size:2053 flags:1
-ret: 0 st: 0 ts:1.989000 flags:1
-ret: 0 st: 0 dts:1.950000 pts:1.950000 pos:87106 size:2053 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.929000 pts:0.929000 pos:41588 size:2053 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 ts:2.672000 flags:0
-ret: 0 st: 0 dts:2.694000 pts:2.694000 pos:120210 size:2053 flags:1
-ret: 0 st: 0 ts:1.566000 flags:1
-ret: 0 st: 0 dts:1.533000 pts:1.533000 pos:68485 size:2053 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.464000 pts:0.464000 pos:20898 size:2053 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 208 size: 2053
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 208 size: 2053
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.858000 pts: 1.858000 pos: 82968 size: 2053
+ret: 0 st: 0 flags:0 ts: 0.788000
+ret: 0 st: 0 flags:1 dts: 0.789000 pts: 0.789000 pos: 35381 size: 2053
+ret:-1 st: 0 flags:1 ts:-0.317000
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret: 0 st: 0 flags:1 dts: 2.601000 pts: 2.601000 pos: 116072 size: 2053
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 64347 size: 2053
+ret: 0 st: 0 flags:0 ts: 0.365000
+ret: 0 st: 0 flags:1 dts: 0.372000 pts: 0.372000 pos: 16760 size: 2053
+ret:-1 st: 0 flags:1 ts:-0.741000
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret: 0 st: 0 flags:1 dts: 2.183000 pts: 2.183000 pos: 97451 size: 2053
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 1.022000 pts: 1.022000 pos: 45726 size: 2053
+ret: 0 st: 0 flags:0 ts:-0.058000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 208 size: 2053
+ret: 0 st: 0 flags:1 ts: 2.836000
+ret: 0 st: 0 flags:1 dts: 2.833000 pts: 2.833000 pos: 126417 size: 2053
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.765000 pts: 1.765000 pos: 78830 size: 2053
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.604000 pts: 0.604000 pos: 27105 size: 2053
+ret: 0 st: 0 flags:0 ts:-0.482000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 208 size: 2053
+ret: 0 st: 0 flags:1 ts: 2.413000
+ret: 0 st: 0 flags:1 dts: 2.368000 pts: 2.368000 pos: 105727 size: 2053
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.347000 pts: 1.347000 pos: 60209 size: 2053
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.186000 pts: 0.186000 pos: 8484 size: 2053
+ret: 0 st: 0 flags:0 ts:-0.905000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 208 size: 2053
+ret: 0 st: 0 flags:1 ts: 1.989000
+ret: 0 st: 0 flags:1 dts: 1.950000 pts: 1.950000 pos: 87106 size: 2053
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.929000 pts: 0.929000 pos: 41588 size: 2053
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:0 ts: 2.672000
+ret: 0 st: 0 flags:1 dts: 2.694000 pts: 2.694000 pos: 120210 size: 2053
+ret: 0 st: 0 flags:1 ts: 1.566000
+ret: 0 st: 0 flags:1 dts: 1.533000 pts: 1.533000 pos: 68485 size: 2053
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.464000 pts: 0.464000 pos: 20898 size: 2053
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-adpcm_yam.wav
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.856009 pts:1.856009 pos:29752 size:4096 flags:1
-ret: 0 st: 0 ts:0.788345 flags:0
-ret: 0 st: 0 dts:0.831995 pts:0.831995 pos:13368 size:4096 flags:1
-ret: 0 st: 0 ts:-0.317506 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret: 0 st: 0 dts:2.623991 pts:2.623991 pos:42040 size:4096 flags:1
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.408005 pts:1.408005 pos:22584 size:4096 flags:1
-ret: 0 st: 0 ts:0.365011 flags:0
-ret: 0 st: 0 dts:0.383991 pts:0.383991 pos:6200 size:4096 flags:1
-ret: 0 st: 0 ts:-0.740839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret: 0 st: 0 dts:2.176009 pts:2.176009 pos:34872 size:4096 flags:1
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.023991 pts:1.023991 pos:16440 size:4096 flags:1
-ret: 0 st: 0 ts:-0.058322 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st: 0 ts:2.835828 flags:1
-ret: 0 st: 0 dts:2.816009 pts:2.816009 pos:45112 size:4096 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.791995 pts:1.791995 pos:28728 size:4096 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.576009 pts:0.576009 pos:9272 size:4096 flags:1
-ret: 0 st: 0 ts:-0.481655 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st: 0 ts:2.412494 flags:1
-ret: 0 st: 0 dts:2.368005 pts:2.368005 pos:37944 size:4096 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.343991 pts:1.343991 pos:21560 size:4096 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.191995 pts:0.191995 pos:3128 size:4096 flags:1
-ret: 0 st: 0 ts:-0.904989 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st: 0 ts:1.989184 flags:1
-ret: 0 st: 0 dts:1.983991 pts:1.983991 pos:31800 size:4096 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.896009 pts:0.896009 pos:14392 size:4096 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st: 0 ts:2.671678 flags:0
-ret: 0 st: 0 dts:2.688005 pts:2.688005 pos:43064 size:4096 flags:1
-ret: 0 st: 0 ts:1.565850 flags:1
-ret: 0 st: 0 dts:1.536009 pts:1.536009 pos:24632 size:4096 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.511995 pts:0.511995 pos:8248 size:4096 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.856009 pts: 1.856009 pos: 29752 size: 4096
+ret: 0 st: 0 flags:0 ts: 0.788345
+ret: 0 st: 0 flags:1 dts: 0.831995 pts: 0.831995 pos: 13368 size: 4096
+ret: 0 st: 0 flags:1 ts:-0.317506
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret: 0 st: 0 flags:1 dts: 2.623991 pts: 2.623991 pos: 42040 size: 4096
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.408005 pts: 1.408005 pos: 22584 size: 4096
+ret: 0 st: 0 flags:0 ts: 0.365011
+ret: 0 st: 0 flags:1 dts: 0.383991 pts: 0.383991 pos: 6200 size: 4096
+ret: 0 st: 0 flags:1 ts:-0.740839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret: 0 st: 0 flags:1 dts: 2.176009 pts: 2.176009 pos: 34872 size: 4096
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 1.023991 pts: 1.023991 pos: 16440 size: 4096
+ret: 0 st: 0 flags:0 ts:-0.058322
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096
+ret: 0 st: 0 flags:1 ts: 2.835828
+ret: 0 st: 0 flags:1 dts: 2.816009 pts: 2.816009 pos: 45112 size: 4096
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.791995 pts: 1.791995 pos: 28728 size: 4096
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.576009 pts: 0.576009 pos: 9272 size: 4096
+ret: 0 st: 0 flags:0 ts:-0.481655
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096
+ret: 0 st: 0 flags:1 ts: 2.412494
+ret: 0 st: 0 flags:1 dts: 2.368005 pts: 2.368005 pos: 37944 size: 4096
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.343991 pts: 1.343991 pos: 21560 size: 4096
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.191995 pts: 0.191995 pos: 3128 size: 4096
+ret: 0 st: 0 flags:0 ts:-0.904989
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096
+ret: 0 st: 0 flags:1 ts: 1.989184
+ret: 0 st: 0 flags:1 dts: 1.983991 pts: 1.983991 pos: 31800 size: 4096
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.896009 pts: 0.896009 pos: 14392 size: 4096
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096
+ret: 0 st: 0 flags:0 ts: 2.671678
+ret: 0 st: 0 flags:1 dts: 2.688005 pts: 2.688005 pos: 43064 size: 4096
+ret: 0 st: 0 flags:1 ts: 1.565850
+ret: 0 st: 0 flags:1 dts: 1.536009 pts: 1.536009 pos: 24632 size: 4096
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.511995 pts: 0.511995 pos: 8248 size: 4096
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096
----------------
tests/data/a-asv1.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5668 size:14316 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5668 size:14316 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.880000 pts:1.880000 pos:776852 size:18256 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.800000 pts:0.800000 pos:305364 size:16180 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:595460 size:17980 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.360000 pts:0.360000 pos:135528 size:14868 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.040000 pts:1.040000 pos:404112 size:16856 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5668 size:14316 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:813408 size:18296 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.720000 pts:1.720000 pos:704148 size:18140 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.640000 pts:0.640000 pos:241776 size:15736 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5668 size:14316 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:813408 size:18296 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.320000 pts:1.320000 pos:524500 size:17548 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.200000 pts:0.200000 pos:77032 size:14496 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5668 size:14316 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:813408 size:18296 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.880000 pts:0.880000 pos:337820 size:16388 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.560000 pts:1.560000 pos:631596 size:18188 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:180224 size:15168 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 14316
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 14316
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: 776852 size: 18256
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: 305364 size: 16180
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: 595460 size: 17980
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 135528 size: 14868
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: 404112 size: 16856
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 14316
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 813408 size: 18296
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos: 704148 size: 18140
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: 241776 size: 15736
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 14316
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 813408 size: 18296
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos: 524500 size: 17548
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 77032 size: 14496
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 14316
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 813408 size: 18296
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: 337820 size: 16388
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: 631596 size: 18188
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 180224 size: 15168
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-asv2.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5668 size:13732 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5668 size:13732 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.880000 pts:1.880000 pos:736164 size:17340 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.800000 pts:0.800000 pos:289720 size:15300 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:564152 size:17016 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.360000 pts:0.360000 pos:128576 size:14052 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.040000 pts:1.040000 pos:383256 size:15896 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5668 size:13732 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:770864 size:17400 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.720000 pts:1.720000 pos:667028 size:17172 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.640000 pts:0.640000 pos:229400 size:14956 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5668 size:13732 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:770864 size:17400 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.320000 pts:1.320000 pos:496944 size:16564 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.200000 pts:0.200000 pos:73188 size:13664 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5668 size:13732 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:770864 size:17400 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.880000 pts:0.880000 pos:320456 size:15592 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.560000 pts:1.560000 pos:598300 size:17180 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:171024 size:14392 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 13732
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 13732
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: 736164 size: 17340
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: 289720 size: 15300
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: 564152 size: 17016
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 128576 size: 14052
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: 383256 size: 15896
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 13732
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 770864 size: 17400
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos: 667028 size: 17172
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: 229400 size: 14956
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 13732
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 770864 size: 17400
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos: 496944 size: 16564
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 73188 size: 13664
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 13732
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 770864 size: 17400
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: 320456 size: 15592
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: 598300 size: 17180
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 171024 size: 14392
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-dv.dv
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.880000 pts:1.880000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.800000 pts:0.800000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:-0.320000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.360000 pts:0.360000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:-0.760000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.040000 pts:1.040000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.720000 pts:1.720000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.640000 pts:0.640000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.320000 pts:1.320000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.200000 pts:0.200000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.880000 pts:0.880000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.560000 pts:1.560000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:144000 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: -1 size:144000
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: -1 size:144000
+ret: 0 st: 0 flags:1 ts:-0.320000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:144000
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: -1 size:144000
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: -1 size:144000
+ret: 0 st: 0 flags:1 ts:-0.760000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:144000
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: -1 size:144000
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:144000
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos: -1 size:144000
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: -1 size:144000
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:144000
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos: -1 size:144000
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: -1 size:144000
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:144000
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: -1 size:144000
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000
+ret: 0 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:144000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: -1 size:144000
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: -1 size:144000
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000
----------------
tests/data/a-dv50.dv
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:288000 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:288000 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.880000 pts:1.880000 pos:-1 size:288000 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.800000 pts:0.800000 pos:-1 size:288000 flags:1
-ret: 0 st: 0 ts:-0.320000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:288000 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:-1 size:288000 flags:1
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:-1 size:288000 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.360000 pts:0.360000 pos:-1 size:288000 flags:1
-ret: 0 st: 0 ts:-0.760000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:288000 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:-1 size:288000 flags:1
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.040000 pts:1.040000 pos:-1 size:288000 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:288000 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:-1 size:288000 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.720000 pts:1.720000 pos:-1 size:288000 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.640000 pts:0.640000 pos:-1 size:288000 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:288000 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:-1 size:288000 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.320000 pts:1.320000 pos:-1 size:288000 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.200000 pts:0.200000 pos:-1 size:288000 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:288000 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:-1 size:288000 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.880000 pts:0.880000 pos:-1 size:288000 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:288000 flags:1
-ret: 0 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:-1 size:288000 flags:1
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.560000 pts:1.560000 pos:-1 size:288000 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:-1 size:288000 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:288000 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:288000
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:288000
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: -1 size:288000
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: -1 size:288000
+ret: 0 st: 0 flags:1 ts:-0.320000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:288000
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:288000
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: -1 size:288000
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: -1 size:288000
+ret: 0 st: 0 flags:1 ts:-0.760000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:288000
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:288000
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: -1 size:288000
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:288000
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:288000
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos: -1 size:288000
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: -1 size:288000
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:288000
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:288000
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos: -1 size:288000
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: -1 size:288000
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:288000
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:288000
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: -1 size:288000
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:288000
+ret: 0 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:288000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: -1 size:288000
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: -1 size:288000
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:288000
----------------
tests/data/a-error-mpeg4-adv.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:9564 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:9564 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:113142 size:12795 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:71660 size:11680 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:113142 size:12795 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:36782 size:10310 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:71660 size:11680 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:9564 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:159370 size:13895 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:159370 size:13895 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:36782 size:10310 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:9564 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:159370 size:13895 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:113142 size:12795 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:9564 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:9564 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:159370 size:13895 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:71660 size:11680 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:113142 size:12795 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:36782 size:10310 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9564
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9564
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 113142 size: 12795
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 71660 size: 11680
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 113142 size: 12795
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 36782 size: 10310
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 71660 size: 11680
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9564
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 159370 size: 13895
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 159370 size: 13895
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 36782 size: 10310
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9564
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 159370 size: 13895
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 113142 size: 12795
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9564
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9564
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 159370 size: 13895
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 71660 size: 11680
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 113142 size: 12795
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 36782 size: 10310
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-ffv1.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:70200 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:70200 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:2485810 size:74128 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:1622716 size:71128 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:2485810 size:74128 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:796840 size:67971 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:1622716 size:71128 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:70200 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:3374440 size:75606 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:3374440 size:75606 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:796840 size:67971 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:70200 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:3374440 size:75606 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:2485810 size:74128 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:70200 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:70200 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:3374440 size:75606 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:1622716 size:71128 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:2485810 size:74128 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:796840 size:67971 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 70200
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 70200
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2485810 size: 74128
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1622716 size: 71128
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2485810 size: 74128
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 796840 size: 67971
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1622716 size: 71128
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 70200
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3374440 size: 75606
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3374440 size: 75606
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 796840 size: 67971
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 70200
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3374440 size: 75606
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2485810 size: 74128
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 70200
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 70200
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3374440 size: 75606
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1622716 size: 71128
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2485810 size: 74128
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 796840 size: 67971
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-flac.flac
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:42 size:1024 flags:1
-ret:-1 st:-1 ts:-1.000000 flags:0
-ret:-1 st:-1 ts:1.894167 flags:1
-ret:-1 st: 0 ts:0.788345 flags:0
-ret:-1 st: 0 ts:-0.317506 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret:-1 st:-1 ts:1.470835 flags:1
-ret:-1 st: 0 ts:0.365011 flags:0
-ret:-1 st: 0 ts:-0.740839 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret:-1 st:-1 ts:1.047503 flags:1
-ret:-1 st: 0 ts:-0.058322 flags:0
-ret:-1 st: 0 ts:2.835828 flags:1
-ret:-1 st:-1 ts:1.730004 flags:0
-ret:-1 st:-1 ts:0.624171 flags:1
-ret:-1 st: 0 ts:-0.481655 flags:0
-ret:-1 st: 0 ts:2.412494 flags:1
-ret:-1 st:-1 ts:1.306672 flags:0
-ret:-1 st:-1 ts:0.200839 flags:1
-ret:-1 st: 0 ts:-0.904989 flags:0
-ret:-1 st: 0 ts:1.989184 flags:1
-ret:-1 st:-1 ts:0.883340 flags:0
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.671678 flags:0
-ret:-1 st: 0 ts:1.565850 flags:1
-ret:-1 st:-1 ts:0.460008 flags:0
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: 42 size: 1024
+ret:-1 st:-1 flags:0 ts:-1.000000
+ret:-1 st:-1 flags:1 ts: 1.894167
+ret:-1 st: 0 flags:0 ts: 0.788345
+ret:-1 st: 0 flags:1 ts:-0.317506
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret:-1 st:-1 flags:1 ts: 1.470835
+ret:-1 st: 0 flags:0 ts: 0.365011
+ret:-1 st: 0 flags:1 ts:-0.740839
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret:-1 st:-1 flags:1 ts: 1.047503
+ret:-1 st: 0 flags:0 ts:-0.058322
+ret:-1 st: 0 flags:1 ts: 2.835828
+ret:-1 st:-1 flags:0 ts: 1.730004
+ret:-1 st:-1 flags:1 ts: 0.624171
+ret:-1 st: 0 flags:0 ts:-0.481655
+ret:-1 st: 0 flags:1 ts: 2.412494
+ret:-1 st:-1 flags:0 ts: 1.306672
+ret:-1 st:-1 flags:1 ts: 0.200839
+ret:-1 st: 0 flags:0 ts:-0.904989
+ret:-1 st: 0 flags:1 ts: 1.989184
+ret:-1 st:-1 flags:0 ts: 0.883340
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.671678
+ret:-1 st: 0 flags:1 ts: 1.565850
+ret:-1 st:-1 flags:0 ts: 0.460008
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-flashsv.flv
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:199 size:240757 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:199 size:240757 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.880000 pts:1.880000 pos:11605762 size:254053 flags:1
-ret: 0 st: 0 ts:0.788000 flags:0
-ret: 0 st: 0 dts:0.800000 pts:0.800000 pos:4820517 size:245503 flags:1
-ret:-1 st: 0 ts:-0.317000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:8811911 size:253041 flags:1
-ret: 0 st: 0 ts:0.365000 flags:0
-ret: 0 st: 0 dts:0.400000 pts:0.400000 pos:2387452 size:241101 flags:1
-ret:-1 st: 0 ts:-0.741000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.040000 pts:1.040000 pos:6302834 size:248927 flags:1
-ret: 0 st: 0 ts:-0.058000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:199 size:240757 flags:1
-ret: 0 st: 0 ts:2.836000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:12114712 size:254237 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.760000 pts:1.760000 pos:10843576 size:253913 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.600000 pts:0.600000 pos:3598805 size:243372 flags:1
-ret: 0 st: 0 ts:-0.482000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:199 size:240757 flags:1
-ret: 0 st: 0 ts:2.413000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:12114712 size:254237 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.320000 pts:1.320000 pos:8053716 size:252195 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.200000 pts:0.200000 pos:1187821 size:238567 flags:1
-ret: 0 st: 0 ts:-0.905000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:199 size:240757 flags:1
-ret: 0 st: 0 ts:1.989000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:12114712 size:254237 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.920000 pts:0.920000 pos:5559238 size:247341 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.672000 flags:0
-ret: 0 st: 0 ts:1.566000 flags:1
-ret: 0 st: 0 dts:1.560000 pts:1.560000 pos:9572247 size:254219 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:2870253 size:242377 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size:240757
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size:240757
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:11605762 size:254053
+ret: 0 st: 0 flags:0 ts: 0.788000
+ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:4820517 size:245503
+ret:-1 st: 0 flags:1 ts:-0.317000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:8811911 size:253041
+ret: 0 st: 0 flags:0 ts: 0.365000
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: 0.400000 pos:2387452 size:241101
+ret:-1 st: 0 flags:1 ts:-0.741000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:6302834 size:248927
+ret: 0 st: 0 flags:0 ts:-0.058000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size:240757
+ret: 0 st: 0 flags:1 ts: 2.836000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:12114712 size:254237
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.760000 pts: 1.760000 pos:10843576 size:253913
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.600000 pts: 0.600000 pos:3598805 size:243372
+ret: 0 st: 0 flags:0 ts:-0.482000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size:240757
+ret: 0 st: 0 flags:1 ts: 2.413000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:12114712 size:254237
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:8053716 size:252195
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos:1187821 size:238567
+ret: 0 st: 0 flags:0 ts:-0.905000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size:240757
+ret: 0 st: 0 flags:1 ts: 1.989000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:12114712 size:254237
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.920000 pts: 0.920000 pos:5559238 size:247341
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.672000
+ret: 0 st: 0 flags:1 ts: 1.566000
+ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:9572247 size:254219
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:2870253 size:242377
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-flv.flv
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:199 size:10380 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:199 size:10380 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:83240 size:12295 flags:1
-ret: 0 st: 0 ts:0.788000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:52585 size:11127 flags:1
-ret:-1 st: 0 ts:-0.317000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:83240 size:12295 flags:1
-ret: 0 st: 0 ts:0.365000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:25960 size:10089 flags:1
-ret:-1 st: 0 ts:-0.741000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:52585 size:11127 flags:1
-ret: 0 st: 0 ts:-0.058000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:199 size:10380 flags:1
-ret: 0 st: 0 ts:2.836000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:117158 size:12730 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:117158 size:12730 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:25960 size:10089 flags:1
-ret: 0 st: 0 ts:-0.482000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:199 size:10380 flags:1
-ret: 0 st: 0 ts:2.413000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:117158 size:12730 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:83240 size:12295 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:199 size:10380 flags:1
-ret: 0 st: 0 ts:-0.905000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:199 size:10380 flags:1
-ret: 0 st: 0 ts:1.989000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:117158 size:12730 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:52585 size:11127 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.672000 flags:0
-ret: 0 st: 0 ts:1.566000 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:83240 size:12295 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:25960 size:10089 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 10380
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 10380
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83240 size: 12295
+ret: 0 st: 0 flags:0 ts: 0.788000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 52585 size: 11127
+ret:-1 st: 0 flags:1 ts:-0.317000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83240 size: 12295
+ret: 0 st: 0 flags:0 ts: 0.365000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 25960 size: 10089
+ret:-1 st: 0 flags:1 ts:-0.741000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 52585 size: 11127
+ret: 0 st: 0 flags:0 ts:-0.058000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 10380
+ret: 0 st: 0 flags:1 ts: 2.836000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 117158 size: 12730
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 117158 size: 12730
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 25960 size: 10089
+ret: 0 st: 0 flags:0 ts:-0.482000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 10380
+ret: 0 st: 0 flags:1 ts: 2.413000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 117158 size: 12730
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83240 size: 12295
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 10380
+ret: 0 st: 0 flags:0 ts:-0.905000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 10380
+ret: 0 st: 0 flags:1 ts: 1.989000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 117158 size: 12730
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 52585 size: 11127
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.672000
+ret: 0 st: 0 flags:1 ts: 1.566000
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83240 size: 12295
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 25960 size: 10089
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-g726.wav
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.894000 pts:1.894000 pos:7632 size:4096 flags:1
-ret: 0 st: 0 ts:0.788375 flags:0
-ret: 0 st: 0 dts:0.788500 pts:0.788500 pos:3210 size:4096 flags:1
-ret: 0 st: 0 ts:-0.317500 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret: 0 st: 0 dts:2.576750 pts:2.576750 pos:10363 size:4096 flags:1
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.470750 pts:1.470750 pos:5939 size:4096 flags:1
-ret: 0 st: 0 ts:0.365000 flags:0
-ret: 0 st: 0 dts:0.365000 pts:0.365000 pos:1516 size:4096 flags:1
-ret: 0 st: 0 ts:-0.740875 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret: 0 st: 0 dts:2.153500 pts:2.153500 pos:8670 size:4096 flags:1
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.047500 pts:1.047500 pos:4246 size:4096 flags:1
-ret: 0 st: 0 ts:-0.058375 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st: 0 ts:2.835875 flags:1
-ret: 0 st: 0 dts:2.835750 pts:2.835750 pos:11399 size:4096 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.730000 pts:1.730000 pos:6976 size:4096 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.624000 pts:0.624000 pos:2552 size:4096 flags:1
-ret: 0 st: 0 ts:-0.481625 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st: 0 ts:2.412500 flags:1
-ret: 0 st: 0 dts:2.412500 pts:2.412500 pos:9706 size:4096 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.306750 pts:1.306750 pos:5283 size:4096 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.200750 pts:0.200750 pos:859 size:4096 flags:1
-ret: 0 st: 0 ts:-0.905000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st: 0 ts:1.989125 flags:1
-ret: 0 st: 0 dts:1.989000 pts:1.989000 pos:8012 size:4096 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.883500 pts:0.883500 pos:3590 size:4096 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
-ret: 0 st: 0 ts:2.671625 flags:0
-ret: 0 st: 0 dts:2.671750 pts:2.671750 pos:10743 size:4096 flags:1
-ret: 0 st: 0 ts:1.565875 flags:1
-ret: 0 st: 0 dts:1.565750 pts:1.565750 pos:6319 size:4096 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.460000 pts:0.460000 pos:1896 size:4096 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:56 size:4096 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.894000 pts: 1.894000 pos: 7632 size: 4096
+ret: 0 st: 0 flags:0 ts: 0.788375
+ret: 0 st: 0 flags:1 dts: 0.788500 pts: 0.788500 pos: 3210 size: 4096
+ret: 0 st: 0 flags:1 ts:-0.317500
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret: 0 st: 0 flags:1 dts: 2.576750 pts: 2.576750 pos: 10363 size: 4096
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.470750 pts: 1.470750 pos: 5939 size: 4096
+ret: 0 st: 0 flags:0 ts: 0.365000
+ret: 0 st: 0 flags:1 dts: 0.365000 pts: 0.365000 pos: 1516 size: 4096
+ret: 0 st: 0 flags:1 ts:-0.740875
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret: 0 st: 0 flags:1 dts: 2.153500 pts: 2.153500 pos: 8670 size: 4096
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 1.047500 pts: 1.047500 pos: 4246 size: 4096
+ret: 0 st: 0 flags:0 ts:-0.058375
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096
+ret: 0 st: 0 flags:1 ts: 2.835875
+ret: 0 st: 0 flags:1 dts: 2.835750 pts: 2.835750 pos: 11399 size: 4096
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 6976 size: 4096
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.624000 pts: 0.624000 pos: 2552 size: 4096
+ret: 0 st: 0 flags:0 ts:-0.481625
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096
+ret: 0 st: 0 flags:1 ts: 2.412500
+ret: 0 st: 0 flags:1 dts: 2.412500 pts: 2.412500 pos: 9706 size: 4096
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.306750 pts: 1.306750 pos: 5283 size: 4096
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.200750 pts: 0.200750 pos: 859 size: 4096
+ret: 0 st: 0 flags:0 ts:-0.905000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096
+ret: 0 st: 0 flags:1 ts: 1.989125
+ret: 0 st: 0 flags:1 dts: 1.989000 pts: 1.989000 pos: 8012 size: 4096
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.883500 pts: 0.883500 pos: 3590 size: 4096
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096
+ret: 0 st: 0 flags:0 ts: 2.671625
+ret: 0 st: 0 flags:1 dts: 2.671750 pts: 2.671750 pos: 10743 size: 4096
+ret: 0 st: 0 flags:1 ts: 1.565875
+ret: 0 st: 0 flags:1 dts: 1.565750 pts: 1.565750 pos: 6319 size: 4096
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 1896 size: 4096
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096
----------------
tests/data/a-h261.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:9645 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:9645 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:126514 size:11377 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:82072 size:10322 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:126514 size:11377 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:44678 size:9404 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:82072 size:10322 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:9645 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:175882 size:11707 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:175882 size:11707 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:44678 size:9404 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:9645 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:175882 size:11707 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:126514 size:11377 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:9645 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:9645 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:175882 size:11707 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:82072 size:10322 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:126514 size:11377 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:44678 size:9404 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9645
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9645
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 126514 size: 11377
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 82072 size: 10322
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 126514 size: 11377
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 44678 size: 9404
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 82072 size: 10322
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9645
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 175882 size: 11707
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 175882 size: 11707
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 44678 size: 9404
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9645
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 175882 size: 11707
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 126514 size: 11377
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9645
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9645
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 175882 size: 11707
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 82072 size: 10322
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 126514 size: 11377
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 44678 size: 9404
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-h263.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:10381 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:10381 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:103714 size:12296 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:66804 size:11128 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:103714 size:12296 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:36450 size:10090 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:66804 size:11128 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:10381 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:144558 size:12731 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:144558 size:12731 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:36450 size:10090 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:10381 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:144558 size:12731 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:103714 size:12296 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:10381 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:10381 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:144558 size:12731 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:66804 size:11128 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:103714 size:12296 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:36450 size:10090 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10381
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10381
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 103714 size: 12296
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 66804 size: 11128
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 103714 size: 12296
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 36450 size: 10090
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 66804 size: 11128
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10381
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 144558 size: 12731
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 144558 size: 12731
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 36450 size: 10090
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10381
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 144558 size: 12731
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 103714 size: 12296
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10381
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10381
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 144558 size: 12731
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 66804 size: 11128
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 103714 size: 12296
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 36450 size: 10090
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-h263p.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:36208 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:36208 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:569938 size:45151 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:355988 size:40907 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:569938 size:45151 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:171054 size:36515 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:355988 size:40907 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:36208 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:804378 size:46411 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:804378 size:46411 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:171054 size:36515 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:36208 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:804378 size:46411 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:569938 size:45151 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:36208 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:36208 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:804378 size:46411 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:355988 size:40907 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:569938 size:45151 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:171054 size:36515 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 36208
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 36208
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 569938 size: 45151
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 355988 size: 40907
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 569938 size: 45151
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 171054 size: 36515
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 355988 size: 40907
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 36208
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 804378 size: 46411
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 804378 size: 46411
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 171054 size: 36515
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 36208
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 804378 size: 46411
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 569938 size: 45151
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 36208
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 36208
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 804378 size: 46411
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 355988 size: 40907
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 569938 size: 45151
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 171054 size: 36515
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-huffyuv.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5736 size:129760 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5736 size:129760 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.880000 pts:1.880000 pos:6069184 size:128520 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.800000 pts:0.800000 pos:2579624 size:129192 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:4778240 size:129424 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.360000 pts:0.360000 pos:1160260 size:128504 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.040000 pts:1.040000 pos:3355296 size:129424 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5736 size:129760 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:6326136 size:128288 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.720000 pts:1.720000 pos:5554008 size:129016 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.640000 pts:0.640000 pos:2062504 size:129204 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5736 size:129760 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:6326136 size:128288 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.320000 pts:1.320000 pos:4260872 size:129280 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.200000 pts:0.200000 pos:646920 size:128204 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5736 size:129760 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:6326136 size:128288 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.880000 pts:0.880000 pos:2838080 size:129268 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.560000 pts:1.560000 pos:5037036 size:129284 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:1546184 size:128860 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5736 size:129760
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5736 size:129760
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:6069184 size:128520
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:2579624 size:129192
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:4778240 size:129424
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:1160260 size:128504
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:3355296 size:129424
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5736 size:129760
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:6326136 size:128288
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos:5554008 size:129016
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos:2062504 size:129204
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5736 size:129760
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:6326136 size:128288
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:4260872 size:129280
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 646920 size:128204
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5736 size:129760
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:6326136 size:128288
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:2838080 size:129268
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:5037036 size:129284
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:1546184 size:128860
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-jpegls.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:164074 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:164074 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.880000 pts:1.880000 pos:7804130 size:176295 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.800000 pts:0.800000 pos:3172792 size:164643 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:6052986 size:174097 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.360000 pts:0.360000 pos:1402356 size:157283 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.040000 pts:1.040000 pos:4170260 size:168401 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:164074 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:8157028 size:176793 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.720000 pts:1.720000 pos:7101766 size:175326 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.640000 pts:0.640000 pos:2519272 size:162522 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:164074 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:8157028 size:176793 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.320000 pts:1.320000 pos:5360830 size:172183 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.200000 pts:0.200000 pos:779846 size:154579 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:164074 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:8157028 size:176793 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.880000 pts:0.880000 pos:3502840 size:166017 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.560000 pts:1.560000 pos:6401464 size:174815 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:1876428 size:159659 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:164074
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:164074
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:7804130 size:176295
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:3172792 size:164643
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:6052986 size:174097
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:1402356 size:157283
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:4170260 size:168401
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:164074
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:8157028 size:176793
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos:7101766 size:175326
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos:2519272 size:162522
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:164074
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:8157028 size:176793
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:5360830 size:172183
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 779846 size:154579
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:164074
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:8157028 size:176793
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:3502840 size:166017
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:6401464 size:174815
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:1876428 size:159659
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-ljpeg.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:96069 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:96069 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.880000 pts:1.880000 pos:4481876 size:94870 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.800000 pts:0.800000 pos:1902330 size:95465 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:3527736 size:95724 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.360000 pts:0.360000 pos:854956 size:94635 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.040000 pts:1.040000 pos:2475578 size:95649 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:96069 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:4671510 size:94595 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.720000 pts:1.720000 pos:4101350 size:95353 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.640000 pts:0.640000 pos:1520296 size:95410 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:96069 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:4671510 size:94595 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.320000 pts:1.320000 pos:3145126 size:95587 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.200000 pts:0.200000 pos:477238 size:94261 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:96069 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:4671510 size:94595 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.880000 pts:0.880000 pos:2093314 size:95528 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.560000 pts:1.560000 pos:3719138 size:95615 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:1139250 size:95032 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 96069
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 96069
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:4481876 size: 94870
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:1902330 size: 95465
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:3527736 size: 95724
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 854956 size: 94635
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:2475578 size: 95649
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 96069
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:4671510 size: 94595
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos:4101350 size: 95353
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos:1520296 size: 95410
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 96069
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:4671510 size: 94595
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:3145126 size: 95587
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 477238 size: 94261
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 96069
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:4671510 size: 94595
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:2093314 size: 95528
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:3719138 size: 95615
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:1139250 size: 95032
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-mjpeg.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:12650 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:12650 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.880000 pts:1.880000 pos:656618 size:15508 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.800000 pts:0.800000 pos:258298 size:13522 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:502632 size:15224 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.360000 pts:0.360000 pos:115666 size:12453 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.040000 pts:1.040000 pos:341140 size:14170 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:12650 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:687716 size:15576 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.720000 pts:1.720000 pos:594720 size:15432 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.640000 pts:0.640000 pos:204894 size:13273 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:12650 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:687716 size:15576 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.320000 pts:1.320000 pos:442576 size:14799 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.200000 pts:0.200000 pos:66366 size:12233 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:12650 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:687716 size:15576 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.880000 pts:0.880000 pos:285502 size:13726 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.560000 pts:1.560000 pos:533212 size:15322 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:153232 size:12726 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 12650
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 12650
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: 656618 size: 15508
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: 258298 size: 13522
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: 502632 size: 15224
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 115666 size: 12453
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: 341140 size: 14170
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 12650
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 687716 size: 15576
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos: 594720 size: 15432
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: 204894 size: 13273
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 12650
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 687716 size: 15576
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos: 442576 size: 14799
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 66366 size: 12233
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 12650
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 687716 size: 15576
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: 285502 size: 13726
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: 533212 size: 15322
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 153232 size: 12726
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-mp2.mp2
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:417 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.026122 pts:0.026122 pos:417 size:418 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.880800 pts:1.880800 pos:30093 size:418 flags:1
-ret: 0 st: 0 ts:0.788333 flags:0
-ret: 0 st: 0 dts:0.809789 pts:0.809789 pos:12956 size:418 flags:1
-ret: 0 st: 0 ts:-0.317500 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:417 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret: 0 st: 0 dts:2.586100 pts:2.586100 pos:41377 size:418 flags:1
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.462844 pts:1.462844 pos:23405 size:418 flags:1
-ret: 0 st: 0 ts:0.365000 flags:0
-ret: 0 st: 0 dts:0.365711 pts:0.365711 pos:5851 size:418 flags:1
-ret: 0 st: 0 ts:-0.740833 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:417 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret: 0 st: 0 dts:2.168144 pts:2.168144 pos:34690 size:418 flags:1
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.044889 pts:1.044889 pos:16718 size:418 flags:1
-ret: 0 st: 0 ts:-0.058333 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:417 flags:1
-ret: 0 st: 0 ts:2.835833 flags:1
-ret: 0 st: 0 dts:2.821200 pts:2.821200 pos:45139 size:418 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.750189 pts:1.750189 pos:28003 size:418 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.600811 pts:0.600811 pos:9613 size:418 flags:1
-ret: 0 st: 0 ts:-0.481667 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:417 flags:1
-ret: 0 st: 0 ts:2.412500 flags:1
-ret: 0 st: 0 dts:2.403244 pts:2.403244 pos:38452 size:418 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.332233 pts:1.332233 pos:21315 size:418 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.182856 pts:0.182856 pos:2925 size:418 flags:1
-ret: 0 st: 0 ts:-0.904989 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:417 flags:1
-ret: 0 st: 0 ts:1.989178 flags:1
-ret: 0 st: 0 dts:1.985289 pts:1.985289 pos:31764 size:418 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.888156 pts:0.888156 pos:14210 size:418 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:417 flags:1
-ret: 0 st: 0 ts:2.671678 flags:0
-ret: 0 st: 0 dts:2.690589 pts:2.690589 pos:43049 size:418 flags:1
-ret: 0 st: 0 ts:1.565844 flags:1
-ret: 0 st: 0 dts:1.541211 pts:1.541211 pos:24659 size:418 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.470200 pts:0.470200 pos:7523 size:418 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:417 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 417
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.026122 pts: 0.026122 pos: 417 size: 418
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.880816 pts: 1.880816 pos: 30093 size: 418
+ret: 0 st: 0 flags:0 ts: 0.788334
+ret: 0 st: 0 flags:1 dts: 0.809796 pts: 0.809796 pos: 12956 size: 418
+ret: 0 st: 0 flags:1 ts:-0.317499
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 417
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret: 0 st: 0 flags:1 dts: 2.586122 pts: 2.586122 pos: 41377 size: 418
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.462857 pts: 1.462857 pos: 23405 size: 418
+ret: 0 st: 0 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:1 dts: 0.365714 pts: 0.365714 pos: 5851 size: 418
+ret: 0 st: 0 flags:1 ts:-0.740831
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 417
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret: 0 st: 0 flags:1 dts: 2.168163 pts: 2.168163 pos: 34690 size: 418
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 1.044898 pts: 1.044898 pos: 16718 size: 418
+ret: 0 st: 0 flags:0 ts:-0.058330
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 417
+ret: 0 st: 0 flags:1 ts: 2.835837
+ret: 0 st: 0 flags:1 dts: 2.821224 pts: 2.821224 pos: 45139 size: 418
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.750204 pts: 1.750204 pos: 28003 size: 418
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.600816 pts: 0.600816 pos: 9613 size: 418
+ret: 0 st: 0 flags:0 ts:-0.481662
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 417
+ret: 0 st: 0 flags:1 ts: 2.412505
+ret: 0 st: 0 flags:1 dts: 2.403265 pts: 2.403265 pos: 38452 size: 418
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.332245 pts: 1.332245 pos: 21315 size: 418
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.182857 pts: 0.182857 pos: 2925 size: 418
+ret: 0 st: 0 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 417
+ret: 0 st: 0 flags:1 ts: 1.989173
+ret: 0 st: 0 flags:1 dts: 1.985306 pts: 1.985306 pos: 31764 size: 418
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.888163 pts: 0.888163 pos: 14210 size: 418
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 417
+ret: 0 st: 0 flags:0 ts: 2.671674
+ret: 0 st: 0 flags:1 dts: 2.690612 pts: 2.690612 pos: 43049 size: 418
+ret: 0 st: 0 flags:1 ts: 1.565841
+ret: 0 st: 0 flags:1 dts: 1.541224 pts: 1.541224 pos: 24659 size: 418
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.470204 pts: 0.470204 pos: 7523 size: 418
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 417
----------------
tests/data/a-mpeg1.mpg
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:9779 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9779 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:-7686143364045.646484 pos:124245 size:11796 flags:1
-ret: 0 st: 0 ts:0.788334 flags:0
-ret: 0 st: 0 dts:0.960000 pts:-7686143364045.646484 pos:76694 size:10792 flags:1
-ret:-1 st: 0 ts:-0.317499 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:-7686143364045.646484 pos:124245 size:11796 flags:1
-ret: 0 st: 0 ts:0.365002 flags:0
-ret: 0 st: 0 dts:0.480000 pts:-7686143364045.646484 pos:37721 size:9873 flags:1
-ret:-1 st: 0 ts:-0.740831 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:-7686143364045.646484 pos:76694 size:10792 flags:1
-ret: 0 st: 0 ts:-0.058330 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9779 flags:1
-ret: 0 st: 0 ts:2.835837 flags:1
-ret: 0 st: 0 dts:1.920000 pts:-7686143364045.646484 pos:177089 size:12057 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:-7686143364045.646484 pos:177089 size:12057 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:-7686143364045.646484 pos:37721 size:9873 flags:1
-ret: 0 st: 0 ts:-0.481662 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9779 flags:1
-ret: 0 st: 0 ts:2.412505 flags:1
-ret: 0 st: 0 dts:1.920000 pts:-7686143364045.646484 pos:177089 size:12057 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:-7686143364045.646484 pos:124245 size:11796 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9779 flags:1
-ret: 0 st: 0 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9779 flags:1
-ret: 0 st: 0 ts:1.989173 flags:1
-ret: 0 st: 0 dts:1.920000 pts:-7686143364045.646484 pos:177089 size:12057 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:-7686143364045.646484 pos:76694 size:10792 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.671674 flags:0
-ret: 0 st: 0 ts:1.565841 flags:1
-ret: 0 st: 0 dts:1.440000 pts:-7686143364045.646484 pos:124245 size:11796 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:-7686143364045.646484 pos:37721 size:9873 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 9779
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9779
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 124245 size: 11796
+ret: 0 st: 0 flags:0 ts: 0.788334
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 76694 size: 10792
+ret:-1 st: 0 flags:1 ts:-0.317499
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 124245 size: 11796
+ret: 0 st: 0 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 37721 size: 9873
+ret:-1 st: 0 flags:1 ts:-0.740831
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 76694 size: 10792
+ret: 0 st: 0 flags:0 ts:-0.058330
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9779
+ret: 0 st: 0 flags:1 ts: 2.835837
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 177089 size: 12057
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 177089 size: 12057
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 37721 size: 9873
+ret: 0 st: 0 flags:0 ts:-0.481662
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9779
+ret: 0 st: 0 flags:1 ts: 2.412505
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 177089 size: 12057
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 124245 size: 11796
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9779
+ret: 0 st: 0 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9779
+ret: 0 st: 0 flags:1 ts: 1.989173
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 177089 size: 12057
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 76694 size: 10792
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.671674
+ret: 0 st: 0 flags:1 ts: 1.565841
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 124245 size: 11796
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 37721 size: 9873
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-mpeg1b.mpg
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:11817 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:11817 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.800000 pts:-7686143364045.646484 pos:198522 size:14837 flags:1
-ret: 0 st: 0 ts:0.788334 flags:0
-ret: 0 st: 0 dts:0.840000 pts:-7686143364045.646484 pos:82544 size:13267 flags:1
-ret:-1 st: 0 ts:-0.317499 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.320000 pts:-7686143364045.646484 pos:136729 size:14470 flags:1
-ret: 0 st: 0 ts:0.365002 flags:0
-ret: 0 st: 0 dts:0.840000 pts:-7686143364045.646484 pos:82544 size:13267 flags:1
-ret:-1 st: 0 ts:-0.740831 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.840000 pts:-7686143364045.646484 pos:82544 size:13267 flags:1
-ret: 0 st: 0 ts:-0.058330 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:11817 flags:1
-ret: 0 st: 0 ts:2.835837 flags:1
-ret: 0 st: 0 dts:1.800000 pts:-7686143364045.646484 pos:198522 size:14837 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.800000 pts:-7686143364045.646484 pos:198522 size:14837 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.360000 pts:-7686143364045.646484 pos:35619 size:12009 flags:1
-ret: 0 st: 0 ts:-0.481662 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:11817 flags:1
-ret: 0 st: 0 ts:2.412505 flags:1
-ret: 0 st: 0 dts:1.800000 pts:-7686143364045.646484 pos:198522 size:14837 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.320000 pts:-7686143364045.646484 pos:136729 size:14470 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:11817 flags:1
-ret: 0 st: 0 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:11817 flags:1
-ret: 0 st: 0 ts:1.989173 flags:1
-ret: 0 st: 0 dts:1.800000 pts:-7686143364045.646484 pos:198522 size:14837 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:1.320000 pts:-7686143364045.646484 pos:136729 size:14470 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.671674 flags:0
-ret: 0 st: 0 ts:1.565841 flags:1
-ret: 0 st: 0 dts:1.320000 pts:-7686143364045.646484 pos:136729 size:14470 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.840000 pts:-7686143364045.646484 pos:82544 size:13267 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 11817
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 11817
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.800000 pts: NOPTS pos: 198522 size: 14837
+ret: 0 st: 0 flags:0 ts: 0.788334
+ret: 0 st: 0 flags:1 dts: 0.840000 pts: NOPTS pos: 82544 size: 13267
+ret:-1 st: 0 flags:1 ts:-0.317499
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.320000 pts: NOPTS pos: 136729 size: 14470
+ret: 0 st: 0 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:1 dts: 0.840000 pts: NOPTS pos: 82544 size: 13267
+ret:-1 st: 0 flags:1 ts:-0.740831
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.840000 pts: NOPTS pos: 82544 size: 13267
+ret: 0 st: 0 flags:0 ts:-0.058330
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 11817
+ret: 0 st: 0 flags:1 ts: 2.835837
+ret: 0 st: 0 flags:1 dts: 1.800000 pts: NOPTS pos: 198522 size: 14837
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.800000 pts: NOPTS pos: 198522 size: 14837
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.360000 pts: NOPTS pos: 35619 size: 12009
+ret: 0 st: 0 flags:0 ts:-0.481662
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 11817
+ret: 0 st: 0 flags:1 ts: 2.412505
+ret: 0 st: 0 flags:1 dts: 1.800000 pts: NOPTS pos: 198522 size: 14837
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.320000 pts: NOPTS pos: 136729 size: 14470
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 11817
+ret: 0 st: 0 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 11817
+ret: 0 st: 0 flags:1 ts: 1.989173
+ret: 0 st: 0 flags:1 dts: 1.800000 pts: NOPTS pos: 198522 size: 14837
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 1.320000 pts: NOPTS pos: 136729 size: 14470
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.671674
+ret: 0 st: 0 flags:1 ts: 1.565841
+ret: 0 st: 0 flags:1 dts: 1.320000 pts: NOPTS pos: 136729 size: 14470
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.840000 pts: NOPTS pos: 82544 size: 13267
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-mpeg2.mpg
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9911 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9911 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:-7686143364045.646484 pos:127925 size:11918 flags:1
-ret: 0 st: 0 ts:0.788334 flags:0
-ret: 0 st: 0 dts:0.960000 pts:-7686143364045.646484 pos:79103 size:10909 flags:1
-ret:-1 st: 0 ts:-0.317499 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:-7686143364045.646484 pos:127925 size:11918 flags:1
-ret: 0 st: 0 ts:0.365002 flags:0
-ret: 0 st: 0 dts:0.480000 pts:-7686143364045.646484 pos:38992 size:9985 flags:1
-ret:-1 st: 0 ts:-0.740831 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:-7686143364045.646484 pos:79103 size:10909 flags:1
-ret: 0 st: 0 ts:-0.058330 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9911 flags:1
-ret: 0 st: 0 ts:2.835837 flags:1
-ret: 0 st: 0 dts:1.920000 pts:-7686143364045.646484 pos:182138 size:12183 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:-7686143364045.646484 pos:182138 size:12183 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:-7686143364045.646484 pos:38992 size:9985 flags:1
-ret: 0 st: 0 ts:-0.481662 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9911 flags:1
-ret: 0 st: 0 ts:2.412505 flags:1
-ret: 0 st: 0 dts:1.920000 pts:-7686143364045.646484 pos:182138 size:12183 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:-7686143364045.646484 pos:127925 size:11918 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9911 flags:1
-ret: 0 st: 0 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9911 flags:1
-ret: 0 st: 0 ts:1.989173 flags:1
-ret: 0 st: 0 dts:1.920000 pts:-7686143364045.646484 pos:182138 size:12183 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:-7686143364045.646484 pos:79103 size:10909 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.671674 flags:0
-ret: 0 st: 0 ts:1.565841 flags:1
-ret: 0 st: 0 dts:1.440000 pts:-7686143364045.646484 pos:127925 size:11918 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:-7686143364045.646484 pos:38992 size:9985 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9911
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9911
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 127925 size: 11918
+ret: 0 st: 0 flags:0 ts: 0.788334
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 79103 size: 10909
+ret:-1 st: 0 flags:1 ts:-0.317499
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 127925 size: 11918
+ret: 0 st: 0 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 38992 size: 9985
+ret:-1 st: 0 flags:1 ts:-0.740831
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 79103 size: 10909
+ret: 0 st: 0 flags:0 ts:-0.058330
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9911
+ret: 0 st: 0 flags:1 ts: 2.835837
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 182138 size: 12183
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 182138 size: 12183
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 38992 size: 9985
+ret: 0 st: 0 flags:0 ts:-0.481662
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9911
+ret: 0 st: 0 flags:1 ts: 2.412505
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 182138 size: 12183
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 127925 size: 11918
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9911
+ret: 0 st: 0 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9911
+ret: 0 st: 0 flags:1 ts: 1.989173
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 182138 size: 12183
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 79103 size: 10909
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.671674
+ret: 0 st: 0 flags:1 ts: 1.565841
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 127925 size: 11918
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 38992 size: 9985
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-mpeg2i.mpg
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9961 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9961 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:-7686143364045.646484 pos:132607 size:11970 flags:1
-ret: 0 st: 0 ts:0.788334 flags:0
-ret: 0 st: 0 dts:0.960000 pts:-7686143364045.646484 pos:82152 size:10965 flags:1
-ret:-1 st: 0 ts:-0.317499 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:-7686143364045.646484 pos:132607 size:11970 flags:1
-ret: 0 st: 0 ts:0.365002 flags:0
-ret: 0 st: 0 dts:0.480000 pts:-7686143364045.646484 pos:40546 size:10045 flags:1
-ret:-1 st: 0 ts:-0.740831 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:-7686143364045.646484 pos:82152 size:10965 flags:1
-ret: 0 st: 0 ts:-0.058330 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9961 flags:1
-ret: 0 st: 0 ts:2.835837 flags:1
-ret: 0 st: 0 dts:1.920000 pts:-7686143364045.646484 pos:188429 size:12232 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:-7686143364045.646484 pos:188429 size:12232 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:-7686143364045.646484 pos:40546 size:10045 flags:1
-ret: 0 st: 0 ts:-0.481662 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9961 flags:1
-ret: 0 st: 0 ts:2.412505 flags:1
-ret: 0 st: 0 dts:1.920000 pts:-7686143364045.646484 pos:188429 size:12232 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:-7686143364045.646484 pos:132607 size:11970 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9961 flags:1
-ret: 0 st: 0 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9961 flags:1
-ret: 0 st: 0 ts:1.989173 flags:1
-ret: 0 st: 0 dts:1.920000 pts:-7686143364045.646484 pos:188429 size:12232 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:-7686143364045.646484 pos:82152 size:10965 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.671674 flags:0
-ret: 0 st: 0 ts:1.565841 flags:1
-ret: 0 st: 0 dts:1.440000 pts:-7686143364045.646484 pos:132607 size:11970 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:-7686143364045.646484 pos:40546 size:10045 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 132607 size: 11970
+ret: 0 st: 0 flags:0 ts: 0.788334
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 82152 size: 10965
+ret:-1 st: 0 flags:1 ts:-0.317499
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 132607 size: 11970
+ret: 0 st: 0 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 40546 size: 10045
+ret:-1 st: 0 flags:1 ts:-0.740831
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 82152 size: 10965
+ret: 0 st: 0 flags:0 ts:-0.058330
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961
+ret: 0 st: 0 flags:1 ts: 2.835837
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 188429 size: 12232
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 188429 size: 12232
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 40546 size: 10045
+ret: 0 st: 0 flags:0 ts:-0.481662
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961
+ret: 0 st: 0 flags:1 ts: 2.412505
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 188429 size: 12232
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 132607 size: 11970
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961
+ret: 0 st: 0 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961
+ret: 0 st: 0 flags:1 ts: 1.989173
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 188429 size: 12232
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 82152 size: 10965
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.671674
+ret: 0 st: 0 flags:1 ts: 1.565841
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 132607 size: 11970
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 40546 size: 10045
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-mpeg2ivlc-qprd.mpg
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:16239 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:16239 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:230333 size:12278 flags:1
-ret: 0 st: 0 ts:0.788334 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-7686143364045.646484 pos:167928 size:13625 flags:1
-ret:-1 st: 0 ts:-0.317499 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.360000 pts:-7686143364045.646484 pos:200050 size:12777 flags:1
-ret: 0 st: 0 ts:0.365002 flags:0
-ret: 0 st: 0 dts:0.400000 pts:-7686143364045.646484 pos:101565 size:29165 flags:1
-ret:-1 st: 0 ts:-0.740831 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.880000 pts:-7686143364045.646484 pos:167928 size:13625 flags:1
-ret: 0 st: 0 ts:-0.058330 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:16239 flags:1
-ret: 0 st: 0 ts:2.835837 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:230333 size:12278 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:230333 size:12278 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.400000 pts:-7686143364045.646484 pos:101565 size:29165 flags:1
-ret: 0 st: 0 ts:-0.481662 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:16239 flags:1
-ret: 0 st: 0 ts:2.412505 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:230333 size:12278 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.360000 pts:-7686143364045.646484 pos:200050 size:12777 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:16239 flags:1
-ret: 0 st: 0 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:16239 flags:1
-ret: 0 st: 0 ts:1.989173 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:230333 size:12278 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:1.360000 pts:-7686143364045.646484 pos:200050 size:12777 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.671674 flags:0
-ret: 0 st: 0 ts:1.565841 flags:1
-ret: 0 st: 0 dts:1.360000 pts:-7686143364045.646484 pos:200050 size:12777 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-7686143364045.646484 pos:167928 size:13625 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 16239
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 16239
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 230333 size: 12278
+ret: 0 st: 0 flags:0 ts: 0.788334
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 167928 size: 13625
+ret:-1 st: 0 flags:1 ts:-0.317499
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 200050 size: 12777
+ret: 0 st: 0 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 101565 size: 29165
+ret:-1 st: 0 flags:1 ts:-0.740831
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 167928 size: 13625
+ret: 0 st: 0 flags:0 ts:-0.058330
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 16239
+ret: 0 st: 0 flags:1 ts: 2.835837
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 230333 size: 12278
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 230333 size: 12278
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 101565 size: 29165
+ret: 0 st: 0 flags:0 ts:-0.481662
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 16239
+ret: 0 st: 0 flags:1 ts: 2.412505
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 230333 size: 12278
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 200050 size: 12777
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 16239
+ret: 0 st: 0 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 16239
+ret: 0 st: 0 flags:1 ts: 1.989173
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 230333 size: 12278
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 200050 size: 12777
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.671674
+ret: 0 st: 0 flags:1 ts: 1.565841
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 200050 size: 12777
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 167928 size: 13625
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-mpeg2reuse.mpg
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:20829 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:20829 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:347037 size:26840 flags:1
-ret: 0 st: 0 ts:0.788334 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-7686143364045.646484 pos:145193 size:23537 flags:1
-ret:-1 st: 0 ts:-0.317499 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.360000 pts:-7686143364045.646484 pos:238861 size:26192 flags:1
-ret: 0 st: 0 ts:0.365002 flags:0
-ret: 0 st: 0 dts:0.400000 pts:-7686143364045.646484 pos:65397 size:21295 flags:1
-ret:-1 st: 0 ts:-0.740831 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.880000 pts:-7686143364045.646484 pos:145193 size:23537 flags:1
-ret: 0 st: 0 ts:-0.058330 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:20829 flags:1
-ret: 0 st: 0 ts:2.835837 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:347037 size:26840 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:347037 size:26840 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.400000 pts:-7686143364045.646484 pos:65397 size:21295 flags:1
-ret: 0 st: 0 ts:-0.481662 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:20829 flags:1
-ret: 0 st: 0 ts:2.412505 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:347037 size:26840 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.360000 pts:-7686143364045.646484 pos:238861 size:26192 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:20829 flags:1
-ret: 0 st: 0 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:20829 flags:1
-ret: 0 st: 0 ts:1.989173 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:347037 size:26840 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:1.360000 pts:-7686143364045.646484 pos:238861 size:26192 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.671674 flags:0
-ret: 0 st: 0 ts:1.565841 flags:1
-ret: 0 st: 0 dts:1.360000 pts:-7686143364045.646484 pos:238861 size:26192 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-7686143364045.646484 pos:145193 size:23537 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 20829
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 20829
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 347037 size: 26840
+ret: 0 st: 0 flags:0 ts: 0.788334
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 145193 size: 23537
+ret:-1 st: 0 flags:1 ts:-0.317499
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 238861 size: 26192
+ret: 0 st: 0 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 65397 size: 21295
+ret:-1 st: 0 flags:1 ts:-0.740831
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 145193 size: 23537
+ret: 0 st: 0 flags:0 ts:-0.058330
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 20829
+ret: 0 st: 0 flags:1 ts: 2.835837
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 347037 size: 26840
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 347037 size: 26840
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 65397 size: 21295
+ret: 0 st: 0 flags:0 ts:-0.481662
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 20829
+ret: 0 st: 0 flags:1 ts: 2.412505
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 347037 size: 26840
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 238861 size: 26192
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 20829
+ret: 0 st: 0 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 20829
+ret: 0 st: 0 flags:1 ts: 1.989173
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 347037 size: 26840
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 238861 size: 26192
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.671674
+ret: 0 st: 0 flags:1 ts: 1.565841
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 238861 size: 26192
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 145193 size: 23537
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-mpeg2thread.mpg
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9961 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9961 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:161221 size:12232 flags:1
-ret: 0 st: 0 ts:0.788334 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-7686143364045.646484 pos:69013 size:10965 flags:1
-ret:-1 st: 0 ts:-0.317499 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.360000 pts:-7686143364045.646484 pos:112448 size:11970 flags:1
-ret: 0 st: 0 ts:0.365002 flags:0
-ret: 0 st: 0 dts:0.400000 pts:-7686143364045.646484 pos:31241 size:10045 flags:1
-ret:-1 st: 0 ts:-0.740831 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.880000 pts:-7686143364045.646484 pos:69013 size:10965 flags:1
-ret: 0 st: 0 ts:-0.058330 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9961 flags:1
-ret: 0 st: 0 ts:2.835837 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:161221 size:12232 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:161221 size:12232 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.400000 pts:-7686143364045.646484 pos:31241 size:10045 flags:1
-ret: 0 st: 0 ts:-0.481662 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9961 flags:1
-ret: 0 st: 0 ts:2.412505 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:161221 size:12232 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.360000 pts:-7686143364045.646484 pos:112448 size:11970 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9961 flags:1
-ret: 0 st: 0 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9961 flags:1
-ret: 0 st: 0 ts:1.989173 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:161221 size:12232 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:1.360000 pts:-7686143364045.646484 pos:112448 size:11970 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.671674 flags:0
-ret: 0 st: 0 ts:1.565841 flags:1
-ret: 0 st: 0 dts:1.360000 pts:-7686143364045.646484 pos:112448 size:11970 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-7686143364045.646484 pos:69013 size:10965 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 161221 size: 12232
+ret: 0 st: 0 flags:0 ts: 0.788334
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 69013 size: 10965
+ret:-1 st: 0 flags:1 ts:-0.317499
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 112448 size: 11970
+ret: 0 st: 0 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 31241 size: 10045
+ret:-1 st: 0 flags:1 ts:-0.740831
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 69013 size: 10965
+ret: 0 st: 0 flags:0 ts:-0.058330
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961
+ret: 0 st: 0 flags:1 ts: 2.835837
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 161221 size: 12232
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 161221 size: 12232
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 31241 size: 10045
+ret: 0 st: 0 flags:0 ts:-0.481662
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961
+ret: 0 st: 0 flags:1 ts: 2.412505
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 161221 size: 12232
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 112448 size: 11970
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961
+ret: 0 st: 0 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961
+ret: 0 st: 0 flags:1 ts: 1.989173
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 161221 size: 12232
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 112448 size: 11970
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.671674
+ret: 0 st: 0 flags:1 ts: 1.565841
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 112448 size: 11970
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 69013 size: 10965
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-mpeg2threadivlc.mpg
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9954 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9954 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:160669 size:11930 flags:1
-ret: 0 st: 0 ts:0.788334 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-7686143364045.646484 pos:68942 size:10791 flags:1
-ret:-1 st: 0 ts:-0.317499 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.360000 pts:-7686143364045.646484 pos:112193 size:11697 flags:1
-ret: 0 st: 0 ts:0.365002 flags:0
-ret: 0 st: 0 dts:0.400000 pts:-7686143364045.646484 pos:31235 size:9980 flags:1
-ret:-1 st: 0 ts:-0.740831 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.880000 pts:-7686143364045.646484 pos:68942 size:10791 flags:1
-ret: 0 st: 0 ts:-0.058330 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9954 flags:1
-ret: 0 st: 0 ts:2.835837 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:160669 size:11930 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:160669 size:11930 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.400000 pts:-7686143364045.646484 pos:31235 size:9980 flags:1
-ret: 0 st: 0 ts:-0.481662 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9954 flags:1
-ret: 0 st: 0 ts:2.412505 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:160669 size:11930 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.360000 pts:-7686143364045.646484 pos:112193 size:11697 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9954 flags:1
-ret: 0 st: 0 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-7686143364045.646484 pos:0 size:9954 flags:1
-ret: 0 st: 0 ts:1.989173 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-7686143364045.646484 pos:160669 size:11930 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:1.360000 pts:-7686143364045.646484 pos:112193 size:11697 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.671674 flags:0
-ret: 0 st: 0 ts:1.565841 flags:1
-ret: 0 st: 0 dts:1.360000 pts:-7686143364045.646484 pos:112193 size:11697 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-7686143364045.646484 pos:68942 size:10791 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9954
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9954
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 160669 size: 11930
+ret: 0 st: 0 flags:0 ts: 0.788334
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 68942 size: 10791
+ret:-1 st: 0 flags:1 ts:-0.317499
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 112193 size: 11697
+ret: 0 st: 0 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 31235 size: 9980
+ret:-1 st: 0 flags:1 ts:-0.740831
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 68942 size: 10791
+ret: 0 st: 0 flags:0 ts:-0.058330
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9954
+ret: 0 st: 0 flags:1 ts: 2.835837
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 160669 size: 11930
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 160669 size: 11930
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 31235 size: 9980
+ret: 0 st: 0 flags:0 ts:-0.481662
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9954
+ret: 0 st: 0 flags:1 ts: 2.412505
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 160669 size: 11930
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 112193 size: 11697
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9954
+ret: 0 st: 0 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9954
+ret: 0 st: 0 flags:1 ts: 1.989173
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 160669 size: 11930
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 112193 size: 11697
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.671674
+ret: 0 st: 0 flags:1 ts: 1.565841
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 112193 size: 11697
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 68942 size: 10791
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-mpeg4-Q.avi
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:11942 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:11942 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:142978 size:15562 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:64442 size:13382 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.360000 pts:-368934881474191040.000000 pos:101236 size:15057 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.400000 pts:-368934881474191040.000000 pos:32850 size:11813 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:64442 size:13382 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:11942 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:142978 size:15562 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:142978 size:15562 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.400000 pts:-368934881474191040.000000 pos:32850 size:11813 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:11942 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:142978 size:15562 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.360000 pts:-368934881474191040.000000 pos:101236 size:15057 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:11942 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:11942 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:142978 size:15562 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:64442 size:13382 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.360000 pts:-368934881474191040.000000 pos:101236 size:15057 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:64442 size:13382 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 11942
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 11942
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 142978 size: 15562
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 64442 size: 13382
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 101236 size: 15057
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 32850 size: 11813
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 64442 size: 13382
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 11942
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 142978 size: 15562
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 142978 size: 15562
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 32850 size: 11813
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 11942
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 142978 size: 15562
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 101236 size: 15057
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 11942
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 11942
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 142978 size: 15562
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 64442 size: 13382
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 101236 size: 15057
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 64442 size: 13382
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-mpeg4-adap.avi
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:6855 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:6855 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:175668 size:16884 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:99006 size:16933 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.360000 pts:-368934881474191040.000000 pos:136592 size:17435 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.400000 pts:-368934881474191040.000000 pos:59872 size:17261 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:99006 size:16933 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:6855 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:175668 size:16884 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:175668 size:16884 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.400000 pts:-368934881474191040.000000 pos:59872 size:17261 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:6855 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:175668 size:16884 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.360000 pts:-368934881474191040.000000 pos:136592 size:17435 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:6855 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:6855 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:175668 size:16884 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:99006 size:16933 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.360000 pts:-368934881474191040.000000 pos:136592 size:17435 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:99006 size:16933 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 6855
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 6855
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 175668 size: 16884
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 99006 size: 16933
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 136592 size: 17435
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 59872 size: 17261
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 99006 size: 16933
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 6855
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 175668 size: 16884
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 175668 size: 16884
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 59872 size: 17261
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 6855
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 175668 size: 16884
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 136592 size: 17435
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 6855
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 6855
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 175668 size: 16884
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 99006 size: 16933
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 136592 size: 17435
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 99006 size: 16933
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-mpeg4-adv.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:8653 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:8653 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:91730 size:11013 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:59504 size:9815 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:91730 size:11013 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:31944 size:8753 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:59504 size:9815 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:8653 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:127624 size:11279 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:127624 size:11279 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:31944 size:8753 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:8653 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:127624 size:11279 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:91730 size:11013 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:8653 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:8653 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:127624 size:11279 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:59504 size:9815 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:91730 size:11013 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:31944 size:8753 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8653
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8653
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 91730 size: 11013
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 59504 size: 9815
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 91730 size: 11013
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 31944 size: 8753
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 59504 size: 9815
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8653
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 127624 size: 11279
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 127624 size: 11279
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 31944 size: 8753
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8653
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 127624 size: 11279
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 91730 size: 11013
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8653
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8653
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 127624 size: 11279
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 59504 size: 9815
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 91730 size: 11013
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 31944 size: 8753
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-mpeg4-nr.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:10673 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:10673 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:100640 size:12464 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:65480 size:11181 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:100640 size:12464 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:35312 size:9987 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:65480 size:11181 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:10673 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:139424 size:12911 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:139424 size:12911 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:35312 size:9987 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:10673 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:139424 size:12911 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:100640 size:12464 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:10673 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:10673 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:139424 size:12911 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:65480 size:11181 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:100640 size:12464 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:35312 size:9987 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10673
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10673
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 100640 size: 12464
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 65480 size: 11181
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 100640 size: 12464
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 35312 size: 9987
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 65480 size: 11181
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10673
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139424 size: 12911
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139424 size: 12911
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 35312 size: 9987
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10673
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139424 size: 12911
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 100640 size: 12464
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10673
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10673
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139424 size: 12911
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 65480 size: 11181
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 100640 size: 12464
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 35312 size: 9987
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-mpeg4-qprd.avi
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:14873 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:14873 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:212738 size:14347 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:152640 size:14348 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.360000 pts:-368934881474191040.000000 pos:182580 size:14281 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.400000 pts:-368934881474191040.000000 pos:94070 size:29366 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:152640 size:14348 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:14873 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:212738 size:14347 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:212738 size:14347 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.400000 pts:-368934881474191040.000000 pos:94070 size:29366 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:14873 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:212738 size:14347 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.360000 pts:-368934881474191040.000000 pos:182580 size:14281 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:14873 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:14873 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:212738 size:14347 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:152640 size:14348 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.360000 pts:-368934881474191040.000000 pos:182580 size:14281 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:152640 size:14348 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14873
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14873
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 212738 size: 14347
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 152640 size: 14348
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 182580 size: 14281
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 94070 size: 29366
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 152640 size: 14348
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14873
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 212738 size: 14347
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 212738 size: 14347
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 94070 size: 29366
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14873
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 212738 size: 14347
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 182580 size: 14281
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14873
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14873
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 212738 size: 14347
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 152640 size: 14348
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 182580 size: 14281
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 152640 size: 14348
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-mpeg4-rc.avi
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:15766 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:15766 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:209236 size:13826 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:154792 size:13382 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.360000 pts:-368934881474191040.000000 pos:182316 size:13326 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.400000 pts:-368934881474191040.000000 pos:95408 size:32807 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:154792 size:13382 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:15766 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:209236 size:13826 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:209236 size:13826 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.400000 pts:-368934881474191040.000000 pos:95408 size:32807 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:15766 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:209236 size:13826 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.360000 pts:-368934881474191040.000000 pos:182316 size:13326 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:15766 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:15766 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:209236 size:13826 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:154792 size:13382 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.360000 pts:-368934881474191040.000000 pos:182316 size:13326 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:154792 size:13382 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 15766
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 15766
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 209236 size: 13826
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 154792 size: 13382
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 182316 size: 13326
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 95408 size: 32807
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 154792 size: 13382
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 15766
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 209236 size: 13826
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 209236 size: 13826
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 95408 size: 32807
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 15766
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 209236 size: 13826
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 182316 size: 13326
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 15766
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 15766
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 209236 size: 13826
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 154792 size: 13382
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 182316 size: 13326
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 154792 size: 13382
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-mpeg4-thread.avi
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:14874 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:14874 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:229568 size:14638 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:163772 size:16380 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.360000 pts:-368934881474191040.000000 pos:196664 size:16051 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.400000 pts:-368934881474191040.000000 pos:98760 size:33020 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:163772 size:16380 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:14874 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:229568 size:14638 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:229568 size:14638 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.400000 pts:-368934881474191040.000000 pos:98760 size:33020 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:14874 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:229568 size:14638 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.360000 pts:-368934881474191040.000000 pos:196664 size:16051 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:14874 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:5660 size:14874 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.840000 pts:-368934881474191040.000000 pos:229568 size:14638 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:163772 size:16380 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.360000 pts:-368934881474191040.000000 pos:196664 size:16051 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-368934881474191040.000000 pos:163772 size:16380 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14874
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14874
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 229568 size: 14638
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 163772 size: 16380
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 196664 size: 16051
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 98760 size: 33020
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 163772 size: 16380
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14874
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 229568 size: 14638
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 229568 size: 14638
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 98760 size: 33020
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14874
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 229568 size: 14638
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 196664 size: 16051
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14874
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14874
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 229568 size: 14638
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 163772 size: 16380
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 196664 size: 16051
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 163772 size: 16380
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-msmpeg4.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:8637 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:8637 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:82520 size:10783 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:53858 size:9624 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:82520 size:10783 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:29400 size:8502 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:53858 size:9624 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:8637 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:114276 size:11180 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:114276 size:11180 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:29400 size:8502 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:8637 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:114276 size:11180 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:82520 size:10783 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:8637 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:8637 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:114276 size:11180 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:53858 size:9624 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:82520 size:10783 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:29400 size:8502 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8637
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8637
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 82520 size: 10783
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 53858 size: 9624
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 82520 size: 10783
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29400 size: 8502
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 53858 size: 9624
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8637
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 114276 size: 11180
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 114276 size: 11180
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29400 size: 8502
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8637
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 114276 size: 11180
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 82520 size: 10783
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8637
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8637
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 114276 size: 11180
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 53858 size: 9624
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 82520 size: 10783
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29400 size: 8502
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-msmpeg4v2.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:9003 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:9003 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:83882 size:11165 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:54790 size:10010 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:83882 size:11165 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:29782 size:8869 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:54790 size:10010 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:9003 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:116112 size:11578 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:116112 size:11578 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:29782 size:8869 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:9003 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:116112 size:11578 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:83882 size:11165 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:9003 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:9003 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:116112 size:11578 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:54790 size:10010 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:83882 size:11165 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:29782 size:8869 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9003
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9003
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83882 size: 11165
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54790 size: 10010
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83882 size: 11165
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29782 size: 8869
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54790 size: 10010
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9003
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116112 size: 11578
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116112 size: 11578
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29782 size: 8869
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9003
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116112 size: 11578
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83882 size: 11165
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9003
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9003
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116112 size: 11578
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54790 size: 10010
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83882 size: 11165
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29782 size: 8869
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-odivx.mp4
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:8719 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:8719 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:75140 size:10776 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:47228 size:9634 flags:1
-ret: 0 st: 0 ts:-0.320000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:8719 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:75140 size:10776 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:23271 size:8524 flags:1
-ret: 0 st: 0 ts:-0.760000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:8719 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:47228 size:9634 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:8719 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:106167 size:11182 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:106167 size:11182 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:23271 size:8524 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:8719 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:106167 size:11182 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:75140 size:10776 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:8719 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:8719 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:106167 size:11182 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:47228 size:9634 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:8719 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:75140 size:10776 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:23271 size:8524 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:8719 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 75140 size: 10776
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 47228 size: 9634
+ret: 0 st: 0 flags:1 ts:-0.320000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 75140 size: 10776
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 23271 size: 8524
+ret: 0 st: 0 flags:1 ts:-0.760000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 47228 size: 9634
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 106167 size: 11182
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 106167 size: 11182
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 23271 size: 8524
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 106167 size: 11182
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 75140 size: 10776
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 106167 size: 11182
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 47228 size: 9634
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 75140 size: 10776
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 23271 size: 8524
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719
----------------
tests/data/a-rv10.rm
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:10388 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:10388 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:98608 size:12303 flags:1
-ret: 0 st: 0 ts:0.788000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:61592 size:11135 flags:1
-ret: 0 st: 0 ts:-0.317000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:10388 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:139556 size:12738 flags:1
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:98608 size:12303 flags:1
-ret: 0 st: 0 ts:0.365000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:31132 size:10097 flags:1
-ret: 0 st: 0 ts:-0.741000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:10388 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:139556 size:12738 flags:1
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:61592 size:11135 flags:1
-ret: 0 st: 0 ts:-0.058000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:10388 flags:1
-ret: 0 st: 0 ts:2.836000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:139556 size:12738 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:139556 size:12738 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:31132 size:10097 flags:1
-ret: 0 st: 0 ts:-0.482000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:10388 flags:1
-ret: 0 st: 0 ts:2.413000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:139556 size:12738 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:98608 size:12303 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:10388 flags:1
-ret: 0 st: 0 ts:-0.905000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:10388 flags:1
-ret: 0 st: 0 ts:1.989000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:139556 size:12738 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:61592 size:11135 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:10388 flags:1
-ret: 0 st: 0 ts:2.672000 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:139556 size:12738 flags:1
-ret: 0 st: 0 ts:1.566000 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:98608 size:12303 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:31132 size:10097 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:10388 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 98608 size: 12303
+ret: 0 st: 0 flags:0 ts: 0.788000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 61592 size: 11135
+ret: 0 st: 0 flags:1 ts:-0.317000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 98608 size: 12303
+ret: 0 st: 0 flags:0 ts: 0.365000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 31132 size: 10097
+ret: 0 st: 0 flags:1 ts:-0.741000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 61592 size: 11135
+ret: 0 st: 0 flags:0 ts:-0.058000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388
+ret: 0 st: 0 flags:1 ts: 2.836000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 31132 size: 10097
+ret: 0 st: 0 flags:0 ts:-0.482000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388
+ret: 0 st: 0 flags:1 ts: 2.413000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 98608 size: 12303
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388
+ret: 0 st: 0 flags:0 ts:-0.905000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388
+ret: 0 st: 0 flags:1 ts: 1.989000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 61592 size: 11135
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388
+ret: 0 st: 0 flags:0 ts: 2.672000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738
+ret: 0 st: 0 flags:1 ts: 1.566000
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 98608 size: 12303
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 31132 size: 10097
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388
----------------
tests/data/a-rv20.rm
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:9361 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:9361 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:84320 size:11344 flags:1
-ret: 0 st: 0 ts:0.788000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:53061 size:10166 flags:1
-ret: 0 st: 0 ts:-0.317000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:9361 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:119008 size:11803 flags:1
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:84320 size:11344 flags:1
-ret: 0 st: 0 ts:0.365000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:25990 size:9101 flags:1
-ret: 0 st: 0 ts:-0.741000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:9361 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:119008 size:11803 flags:1
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:53061 size:10166 flags:1
-ret: 0 st: 0 ts:-0.058000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:9361 flags:1
-ret: 0 st: 0 ts:2.836000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:119008 size:11803 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:119008 size:11803 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:25990 size:9101 flags:1
-ret: 0 st: 0 ts:-0.482000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:9361 flags:1
-ret: 0 st: 0 ts:2.413000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:119008 size:11803 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:84320 size:11344 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:9361 flags:1
-ret: 0 st: 0 ts:-0.905000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:9361 flags:1
-ret: 0 st: 0 ts:1.989000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:119008 size:11803 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:53061 size:10166 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:9361 flags:1
-ret: 0 st: 0 ts:2.672000 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:119008 size:11803 flags:1
-ret: 0 st: 0 ts:1.566000 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:84320 size:11344 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:25990 size:9101 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:9361 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 84320 size: 11344
+ret: 0 st: 0 flags:0 ts: 0.788000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 53061 size: 10166
+ret: 0 st: 0 flags:1 ts:-0.317000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 119008 size: 11803
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 84320 size: 11344
+ret: 0 st: 0 flags:0 ts: 0.365000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 25990 size: 9101
+ret: 0 st: 0 flags:1 ts:-0.741000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 119008 size: 11803
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 53061 size: 10166
+ret: 0 st: 0 flags:0 ts:-0.058000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361
+ret: 0 st: 0 flags:1 ts: 2.836000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 119008 size: 11803
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 119008 size: 11803
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 25990 size: 9101
+ret: 0 st: 0 flags:0 ts:-0.482000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361
+ret: 0 st: 0 flags:1 ts: 2.413000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 119008 size: 11803
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 84320 size: 11344
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361
+ret: 0 st: 0 flags:0 ts:-0.905000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361
+ret: 0 st: 0 flags:1 ts: 1.989000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 119008 size: 11803
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 53061 size: 10166
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361
+ret: 0 st: 0 flags:0 ts: 2.672000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 119008 size: 11803
+ret: 0 st: 0 flags:1 ts: 1.566000
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 84320 size: 11344
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 25990 size: 9101
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361
----------------
tests/data/a-snow.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:3035 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:3035 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:39726 size:3640 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:27446 size:3494 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:39726 size:3640 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:16136 size:3244 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:27446 size:3494 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:3035 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:52616 size:3582 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:52616 size:3582 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:16136 size:3244 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:3035 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:52616 size:3582 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:39726 size:3640 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:3035 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:3035 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:52616 size:3582 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:27446 size:3494 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:39726 size:3640 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:16136 size:3244 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 3035
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 3035
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 39726 size: 3640
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 27446 size: 3494
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 39726 size: 3640
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 16136 size: 3244
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 27446 size: 3494
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 3035
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 52616 size: 3582
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 52616 size: 3582
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 16136 size: 3244
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 3035
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 52616 size: 3582
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 39726 size: 3640
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 3035
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 3035
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 52616 size: 3582
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 27446 size: 3494
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 39726 size: 3640
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 16136 size: 3244
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-snow53.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:72476 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:72476 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:1902800 size:78837 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:1239102 size:74994 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:1902800 size:78837 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:605640 size:71059 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:1239102 size:74994 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:72476 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:2585626 size:79731 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:2585626 size:79731 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:605640 size:71059 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:72476 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:2585626 size:79731 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:1902800 size:78837 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:72476 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:72476 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:2585626 size:79731 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:1239102 size:74994 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:1902800 size:78837 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:605640 size:71059 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 72476
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 72476
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:1902800 size: 78837
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1239102 size: 74994
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:1902800 size: 78837
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 605640 size: 71059
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1239102 size: 74994
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 72476
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:2585626 size: 79731
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:2585626 size: 79731
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 605640 size: 71059
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 72476
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:2585626 size: 79731
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:1902800 size: 78837
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 72476
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 72476
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:2585626 size: 79731
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1239102 size: 74994
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:1902800 size: 78837
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 605640 size: 71059
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-svq1.mov
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:22300 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:22300 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:517568 size:25636 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:326556 size:23552 flags:1
-ret: 0 st: 0 ts:-0.320000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:22300 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:517568 size:25636 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:157040 size:21896 flags:1
-ret: 0 st: 0 ts:-0.760000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:22300 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:326556 size:23552 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:22300 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:722804 size:25888 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:722804 size:25888 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:157040 size:21896 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:22300 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:722804 size:25888 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:517568 size:25636 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:22300 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:22300 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:722804 size:25888 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:326556 size:23552 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:22300 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:517568 size:25636 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:157040 size:21896 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:22300 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517568 size: 25636
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326556 size: 23552
+ret: 0 st: 0 flags:1 ts:-0.320000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517568 size: 25636
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 157040 size: 21896
+ret: 0 st: 0 flags:1 ts:-0.760000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326556 size: 23552
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722804 size: 25888
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722804 size: 25888
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 157040 size: 21896
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722804 size: 25888
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517568 size: 25636
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722804 size: 25888
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326556 size: 23552
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517568 size: 25636
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 157040 size: 21896
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300
----------------
tests/data/a-wmav1.asf
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:3.286000 pts:3.286000 pos:3604 size:743 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st: 0 ts:0.788000 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st: 0 ts:-0.317000 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st: 0 ts:0.365000 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st: 0 ts:-0.741000 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st: 0 ts:-0.058000 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st: 0 ts:2.836000 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st: 0 ts:-0.482000 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st: 0 ts:2.413000 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st: 0 ts:-0.905000 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st: 0 ts:1.989000 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st: 0 ts:2.672000 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st: 0 ts:1.566000 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:404 size:743 flags:1
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 3.286000 pts: 3.286000 pos: 3604 size: 743
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:0 ts: 0.788000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 ts:-0.317000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:0 ts: 0.365000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 ts:-0.741000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:0 ts:-0.058000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 ts: 2.836000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:0 ts:-0.482000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 ts: 2.413000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:0 ts:-0.905000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 ts: 1.989000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:0 ts: 2.672000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 ts: 1.566000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
----------------
tests/data/a-wmav2.asf
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:3.286000 pts:3.286000 pos:3644 size:743 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st: 0 ts:0.788000 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st: 0 ts:-0.317000 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st: 0 ts:0.365000 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st: 0 ts:-0.741000 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st: 0 ts:-0.058000 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st: 0 ts:2.836000 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st: 0 ts:-0.482000 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st: 0 ts:2.413000 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st: 0 ts:-0.905000 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st: 0 ts:1.989000 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st: 0 ts:2.672000 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st: 0 ts:1.566000 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:444 size:743 flags:1
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 3.286000 pts: 3.286000 pos: 3644 size: 743
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:0 ts: 0.788000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 ts:-0.317000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:0 ts: 0.365000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 ts:-0.741000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:0 ts:-0.058000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 ts: 2.836000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:0 ts:-0.482000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 ts: 2.413000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:0 ts:-0.905000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 ts: 1.989000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:0 ts: 2.672000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 ts: 1.566000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
----------------
tests/data/a-wmv1.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:8990 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:8990 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:83754 size:11099 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:54770 size:9931 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:83754 size:11099 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:29806 size:8796 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:54770 size:9931 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:8990 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:115824 size:11487 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:115824 size:11487 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:29806 size:8796 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:8990 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:115824 size:11487 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:83754 size:11099 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:8990 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:8990 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:115824 size:11487 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:54770 size:9931 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:83754 size:11099 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:29806 size:8796 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8990
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8990
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83754 size: 11099
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54770 size: 9931
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83754 size: 11099
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29806 size: 8796
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54770 size: 9931
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8990
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 115824 size: 11487
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 115824 size: 11487
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29806 size: 8796
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8990
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 115824 size: 11487
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83754 size: 11099
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8990
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8990
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 115824 size: 11487
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54770 size: 9931
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83754 size: 11099
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29806 size: 8796
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/a-wmv2.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5664 size:8917 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5664 size:8917 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:83802 size:11170 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:54584 size:9989 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:83802 size:11170 flags:1
-ret: 0 st: 0 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:29644 size:8839 flags:1
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:54584 size:9989 flags:1
-ret: 0 st: 0 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5664 size:8917 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:116070 size:11554 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:116070 size:11554 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:29644 size:8839 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5664 size:8917 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:116070 size:11554 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:83802 size:11170 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5664 size:8917 flags:1
-ret: 0 st: 0 ts:-0.920000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5664 size:8917 flags:1
-ret: 0 st: 0 ts:2.000000 flags:1
-ret: 0 st: 0 dts:1.920000 pts:1.920000 pos:116070 size:11554 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:54584 size:9989 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret: 0 st: 0 ts:1.560000 flags:1
-ret: 0 st: 0 dts:1.440000 pts:1.440000 pos:83802 size:11170 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:29644 size:8839 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5664 size: 8917
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5664 size: 8917
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83802 size: 11170
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54584 size: 9989
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83802 size: 11170
+ret: 0 st: 0 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29644 size: 8839
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54584 size: 9989
+ret: 0 st: 0 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5664 size: 8917
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116070 size: 11554
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116070 size: 11554
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29644 size: 8839
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5664 size: 8917
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116070 size: 11554
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83802 size: 11170
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5664 size: 8917
+ret: 0 st: 0 flags:0 ts:-0.920000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5664 size: 8917
+ret: 0 st: 0 flags:1 ts: 2.000000
+ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116070 size: 11554
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54584 size: 9989
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83802 size: 11170
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29644 size: 8839
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/b-lavf.aif
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:54 size:4096 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:54 size:4096 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret:-32
-ret: 0 st: 0 ts:0.788345 flags:0
-ret: 0 st: 0 dts:0.788345 pts:0.788345 pos:69586 size:4096 flags:1
-ret: 0 st: 0 ts:-0.317506 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:54 size:4096 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret:-32
-ret: 0 st:-1 ts:1.470835 flags:1
-ret:-32
-ret: 0 st: 0 ts:0.365011 flags:0
-ret: 0 st: 0 dts:0.365011 pts:0.365011 pos:32248 size:4096 flags:1
-ret: 0 st: 0 ts:-0.740839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:54 size:4096 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret:-32
-ret: 0 st:-1 ts:1.047503 flags:1
-ret:-32
-ret: 0 st: 0 ts:-0.058322 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:54 size:4096 flags:1
-ret: 0 st: 0 ts:2.835828 flags:1
-ret:-32
-ret: 0 st:-1 ts:1.730004 flags:0
-ret:-32
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.624172 pts:0.624172 pos:55106 size:4096 flags:1
-ret: 0 st: 0 ts:-0.481655 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:54 size:4096 flags:1
-ret: 0 st: 0 ts:2.412494 flags:1
-ret:-32
-ret: 0 st:-1 ts:1.306672 flags:0
-ret:-32
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.200839 pts:0.200839 pos:17768 size:4096 flags:1
-ret: 0 st: 0 ts:-0.904989 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:54 size:4096 flags:1
-ret: 0 st: 0 ts:1.989184 flags:1
-ret:-32
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.883333 pts:0.883333 pos:77964 size:4096 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:54 size:4096 flags:1
-ret: 0 st: 0 ts:2.671678 flags:0
-ret:-32
-ret: 0 st: 0 ts:1.565850 flags:1
-ret:-32
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.460000 pts:0.460000 pos:40626 size:4096 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:54 size:4096 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 54 size: 4096
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 54 size: 4096
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret:-EOF
+ret: 0 st: 0 flags:0 ts: 0.788345
+ret: 0 st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 69586 size: 4096
+ret: 0 st: 0 flags:1 ts:-0.317506
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 54 size: 4096
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret:-EOF
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret:-EOF
+ret: 0 st: 0 flags:0 ts: 0.365011
+ret: 0 st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 32248 size: 4096
+ret: 0 st: 0 flags:1 ts:-0.740839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 54 size: 4096
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret:-EOF
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret:-EOF
+ret: 0 st: 0 flags:0 ts:-0.058322
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 54 size: 4096
+ret: 0 st: 0 flags:1 ts: 2.835828
+ret:-EOF
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret:-EOF
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 55106 size: 4096
+ret: 0 st: 0 flags:0 ts:-0.481655
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 54 size: 4096
+ret: 0 st: 0 flags:1 ts: 2.412494
+ret:-EOF
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret:-EOF
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos: 17768 size: 4096
+ret: 0 st: 0 flags:0 ts:-0.904989
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 54 size: 4096
+ret: 0 st: 0 flags:1 ts: 1.989184
+ret:-EOF
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 77964 size: 4096
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 54 size: 4096
+ret: 0 st: 0 flags:0 ts: 2.671678
+ret:-EOF
+ret: 0 st: 0 flags:1 ts: 1.565850
+ret:-EOF
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 40626 size: 4096
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 54 size: 4096
----------------
tests/data/b-lavf.al
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:1024 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:1024 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.894150 pts:1.894150 pos:41766 size:1024 flags:1
-ret: 0 st: 0 ts:0.788345 flags:0
-ret: 0 st: 0 dts:0.788345 pts:0.788345 pos:17383 size:1024 flags:1
-ret: 0 st: 0 ts:-0.317506 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:1024 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret:-32
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.470839 pts:1.470839 pos:32432 size:1024 flags:1
-ret: 0 st: 0 ts:0.364989 flags:0
-ret: 0 st: 0 dts:0.364989 pts:0.364989 pos:8048 size:1024 flags:1
-ret: 0 st: 0 ts:-0.740816 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:1024 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret:-32
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.047483 pts:1.047483 pos:23097 size:1024 flags:1
-ret: 0 st: 0 ts:-0.058322 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:1024 flags:1
-ret: 0 st: 0 ts:2.835828 flags:1
-ret:-32
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.730023 pts:1.730023 pos:38147 size:1024 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.624172 pts:0.624172 pos:13763 size:1024 flags:1
-ret: 0 st: 0 ts:-0.481678 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:1024 flags:1
-ret: 0 st: 0 ts:2.412517 flags:1
-ret:-32
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.306667 pts:1.306667 pos:28812 size:1024 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.200816 pts:0.200816 pos:4428 size:1024 flags:1
-ret: 0 st: 0 ts:-0.904989 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:1024 flags:1
-ret: 0 st: 0 ts:1.989161 flags:1
-ret: 0 st: 0 dts:1.989161 pts:1.989161 pos:43861 size:1024 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.883356 pts:0.883356 pos:19478 size:1024 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:1024 flags:1
-ret: 0 st: 0 ts:2.671655 flags:0
-ret:-32
-ret: 0 st: 0 ts:1.565850 flags:1
-ret: 0 st: 0 dts:1.565850 pts:1.565850 pos:34527 size:1024 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.460000 pts:0.460000 pos:10143 size:1024 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:1024 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.894150 pts: 1.894150 pos: 41766 size: 1024
+ret: 0 st: 0 flags:0 ts: 0.788345
+ret: 0 st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 17383 size: 1024
+ret: 0 st: 0 flags:1 ts:-0.317506
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret:-EOF
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos: 32432 size: 1024
+ret: 0 st: 0 flags:0 ts: 0.364989
+ret: 0 st: 0 flags:1 dts: 0.364989 pts: 0.364989 pos: 8048 size: 1024
+ret: 0 st: 0 flags:1 ts:-0.740816
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret:-EOF
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 1.047483 pts: 1.047483 pos: 23097 size: 1024
+ret: 0 st: 0 flags:0 ts:-0.058322
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024
+ret: 0 st: 0 flags:1 ts: 2.835828
+ret:-EOF
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.730023 pts: 1.730023 pos: 38147 size: 1024
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 13763 size: 1024
+ret: 0 st: 0 flags:0 ts:-0.481678
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024
+ret: 0 st: 0 flags:1 ts: 2.412517
+ret:-EOF
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 28812 size: 1024
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.200816 pts: 0.200816 pos: 4428 size: 1024
+ret: 0 st: 0 flags:0 ts:-0.904989
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024
+ret: 0 st: 0 flags:1 ts: 1.989161
+ret: 0 st: 0 flags:1 dts: 1.989161 pts: 1.989161 pos: 43861 size: 1024
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.883356 pts: 0.883356 pos: 19478 size: 1024
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024
+ret: 0 st: 0 flags:0 ts: 2.671655
+ret:-EOF
+ret: 0 st: 0 flags:1 ts: 1.565850
+ret: 0 st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos: 34527 size: 1024
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 10143 size: 1024
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024
----------------
tests/data/b-lavf.asf
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:575 size:28487 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 1 dts:3.544000 pts:3.544000 pos:147775 size:209 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:575 size:28487 flags:1
-ret: 0 st: 0 ts:0.788000 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:575 size:28487 flags:1
-ret: 0 st: 0 ts:-0.317000 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:575 size:28487 flags:1
-ret: 0 st: 1 ts:2.577000 flags:0
-ret: 0 st: 1 dts:3.100000 pts:3.100000 pos:29375 size:208 flags:1
-ret: 0 st: 1 ts:1.471000 flags:1
-ret: 0 st: 1 dts:3.100000 pts:3.100000 pos:29375 size:208 flags:1
-ret: 0 st:-1 ts:0.365002 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:575 size:28487 flags:1
-ret: 0 st:-1 ts:-0.740831 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:575 size:28487 flags:1
-ret: 0 st: 0 ts:2.153000 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:575 size:28487 flags:1
-ret: 0 st: 0 ts:1.048000 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:575 size:28487 flags:1
-ret: 0 st: 1 ts:-0.058000 flags:0
-ret: 0 st: 1 dts:3.100000 pts:3.100000 pos:29375 size:208 flags:1
-ret: 0 st: 1 ts:2.836000 flags:1
-ret: 0 st: 1 dts:3.100000 pts:3.100000 pos:29375 size:208 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:575 size:28487 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:575 size:28487 flags:1
-ret: 0 st: 0 ts:-0.482000 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:575 size:28487 flags:1
-ret: 0 st: 0 ts:2.413000 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:575 size:28487 flags:1
-ret: 0 st: 1 ts:1.307000 flags:0
-ret: 0 st: 1 dts:3.100000 pts:3.100000 pos:29375 size:208 flags:1
-ret: 0 st: 1 ts:0.201000 flags:1
-ret: 0 st: 1 dts:3.100000 pts:3.100000 pos:29375 size:208 flags:1
-ret: 0 st:-1 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:575 size:28487 flags:1
-ret: 0 st:-1 ts:1.989173 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:575 size:28487 flags:1
-ret: 0 st: 0 ts:0.883000 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:575 size:28487 flags:1
-ret: 0 st: 0 ts:-0.222000 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:575 size:28487 flags:1
-ret: 0 st: 1 ts:2.672000 flags:0
-ret: 0 st: 1 dts:3.100000 pts:3.100000 pos:29375 size:208 flags:1
-ret: 0 st: 1 ts:1.566000 flags:1
-ret: 0 st: 1 dts:3.100000 pts:3.100000 pos:29375 size:208 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:575 size:28487 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:3.100000 pts:3.100000 pos:575 size:28487 flags:1
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 1 flags:1 dts: 3.544000 pts: 3.544000 pos: 147775 size: 209
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 0 flags:0 ts: 0.788000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 0 flags:1 ts:-0.317000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 1 flags:0 ts: 2.577000
+ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208
+ret: 0 st: 1 flags:1 ts: 1.471000
+ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208
+ret: 0 st:-1 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st:-1 flags:1 ts:-0.740831
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 0 flags:0 ts: 2.153000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 0 flags:1 ts: 1.048000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 1 flags:0 ts:-0.058000
+ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208
+ret: 0 st: 1 flags:1 ts: 2.836000
+ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 0 flags:0 ts:-0.482000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 0 flags:1 ts: 2.413000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 1 flags:0 ts: 1.307000
+ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208
+ret: 0 st: 1 flags:1 ts: 0.201000
+ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208
+ret: 0 st:-1 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st:-1 flags:1 ts: 1.989173
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 0 flags:0 ts: 0.883000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 0 flags:1 ts:-0.222000
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 1 flags:0 ts: 2.672000
+ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208
+ret: 0 st: 1 flags:1 ts: 1.566000
+ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
----------------
tests/data/b-lavf.au
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:24 size:4096 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:24 size:4096 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret:-32
-ret: 0 st: 0 ts:0.788345 flags:0
-ret: 0 st: 0 dts:0.788345 pts:0.788345 pos:69556 size:4096 flags:1
-ret: 0 st: 0 ts:-0.317506 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:24 size:4096 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret:-32
-ret: 0 st:-1 ts:1.470835 flags:1
-ret:-32
-ret: 0 st: 0 ts:0.365011 flags:0
-ret: 0 st: 0 dts:0.365011 pts:0.365011 pos:32218 size:4096 flags:1
-ret: 0 st: 0 ts:-0.740839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:24 size:4096 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret:-32
-ret: 0 st:-1 ts:1.047503 flags:1
-ret:-32
-ret: 0 st: 0 ts:-0.058322 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:24 size:4096 flags:1
-ret: 0 st: 0 ts:2.835828 flags:1
-ret:-32
-ret: 0 st:-1 ts:1.730004 flags:0
-ret:-32
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.624172 pts:0.624172 pos:55076 size:4096 flags:1
-ret: 0 st: 0 ts:-0.481655 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:24 size:4096 flags:1
-ret: 0 st: 0 ts:2.412494 flags:1
-ret:-32
-ret: 0 st:-1 ts:1.306672 flags:0
-ret:-32
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.200839 pts:0.200839 pos:17738 size:4096 flags:1
-ret: 0 st: 0 ts:-0.904989 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:24 size:4096 flags:1
-ret: 0 st: 0 ts:1.989184 flags:1
-ret:-32
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.883333 pts:0.883333 pos:77934 size:4096 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:24 size:4096 flags:1
-ret: 0 st: 0 ts:2.671678 flags:0
-ret:-32
-ret: 0 st: 0 ts:1.565850 flags:1
-ret:-32
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.460000 pts:0.460000 pos:40596 size:4096 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:24 size:4096 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 2048
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 2048
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret:-EOF
+ret: 0 st: 0 flags:0 ts: 0.788345
+ret: 0 st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 69556 size: 2048
+ret: 0 st: 0 flags:1 ts:-0.317506
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 2048
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret:-EOF
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret:-EOF
+ret: 0 st: 0 flags:0 ts: 0.365011
+ret: 0 st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 32218 size: 2048
+ret: 0 st: 0 flags:1 ts:-0.740839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 2048
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret:-EOF
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret:-EOF
+ret: 0 st: 0 flags:0 ts:-0.058322
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 2048
+ret: 0 st: 0 flags:1 ts: 2.835828
+ret:-EOF
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret:-EOF
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 55076 size: 2048
+ret: 0 st: 0 flags:0 ts:-0.481655
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 2048
+ret: 0 st: 0 flags:1 ts: 2.412494
+ret:-EOF
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret:-EOF
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos: 17738 size: 2048
+ret: 0 st: 0 flags:0 ts:-0.904989
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 2048
+ret: 0 st: 0 flags:1 ts: 1.989184
+ret:-EOF
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 77934 size: 2048
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 2048
+ret: 0 st: 0 flags:0 ts: 2.671678
+ret:-EOF
+ret: 0 st: 0 flags:1 ts: 1.565850
+ret:-EOF
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 40596 size: 2048
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 2048
----------------
tests/data/b-lavf.avi
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:9908 size:27867 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:9908 size:27867 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:301466 size:27864 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:301466 size:27864 flags:1
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st: 1 ts:2.586122 flags:0
-ret: 0 st: 1 ts:1.462857 flags:1
-ret: 0 st: 1 dts:1.018776 pts:1.018776 pos:329774 size:209 flags:1
-ret: 0 st:-1 ts:0.365002 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:156166 size:27955 flags:1
-ret:-1 st:-1 ts:-0.740831 flags:1
-ret:-1 st: 0 ts:2.160000 flags:0
-ret: 0 st: 0 ts:1.040000 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:301466 size:27864 flags:1
-ret: 0 st: 1 ts:-0.052245 flags:0
-ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:37784 size:208 flags:1
-ret: 0 st: 1 ts:2.847347 flags:1
-ret: 0 st: 1 dts:1.018776 pts:1.018776 pos:329774 size:209 flags:1
-ret:-1 st:-1 ts:1.730004 flags:0
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:156166 size:27955 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:9908 size:27867 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:301466 size:27864 flags:1
-ret:-1 st: 1 ts:1.306122 flags:0
-ret: 0 st: 1 ts:0.208980 flags:1
-ret: 0 st: 1 dts:0.208980 pts:0.208980 pos:92800 size:209 flags:1
-ret: 0 st:-1 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:9908 size:27867 flags:1
-ret: 0 st:-1 ts:1.989173 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:301466 size:27864 flags:1
-ret: 0 st: 0 ts:0.880000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:301466 size:27864 flags:1
-ret:-1 st: 0 ts:-0.240000 flags:1
-ret:-1 st: 1 ts:2.664490 flags:0
-ret: 0 st: 1 ts:1.567347 flags:1
-ret: 0 st: 1 dts:1.018776 pts:1.018776 pos:329774 size:209 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:156166 size:27955 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 9908 size: 27867
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 9908 size: 27867
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301466 size: 27864
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301466 size: 27864
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st: 1 flags:0 ts: 2.586122
+ret: 0 st: 1 flags:1 ts: 1.462857
+ret: 0 st: 1 flags:1 dts: 1.018776 pts: 1.018776 pos: 329774 size: 209
+ret: 0 st:-1 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 156166 size: 27955
+ret:-1 st:-1 flags:1 ts:-0.740831
+ret:-1 st: 0 flags:0 ts: 2.160000
+ret: 0 st: 0 flags:1 ts: 1.040000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301466 size: 27864
+ret: 0 st: 1 flags:0 ts:-0.052245
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 37784 size: 208
+ret: 0 st: 1 flags:1 ts: 2.847347
+ret: 0 st: 1 flags:1 dts: 1.018776 pts: 1.018776 pos: 329774 size: 209
+ret:-1 st:-1 flags:0 ts: 1.730004
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 156166 size: 27955
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 9908 size: 27867
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301466 size: 27864
+ret:-1 st: 1 flags:0 ts: 1.306122
+ret: 0 st: 1 flags:1 ts: 0.208980
+ret: 0 st: 1 flags:1 dts: 0.208980 pts: 0.208980 pos: 92800 size: 209
+ret: 0 st:-1 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 9908 size: 27867
+ret: 0 st:-1 flags:1 ts: 1.989173
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301466 size: 27864
+ret: 0 st: 0 flags:0 ts: 0.880000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301466 size: 27864
+ret:-1 st: 0 flags:1 ts:-0.240000
+ret:-1 st: 1 flags:0 ts: 2.664490
+ret: 0 st: 1 flags:1 ts: 1.567347
+ret: 0 st: 1 flags:1 dts: 1.018776 pts: 1.018776 pos: 329774 size: 209
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 156166 size: 27955
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/b-lavf.dv
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.800000 pts:0.800000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:-0.320000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:144000 flags:1
-ret: 0 st: 1 ts:2.576667 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:-1 size:144000 flags:1
-ret: 0 st: 1 ts:1.470833 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:0.365002 flags:0
-ret: 0 st: 0 dts:0.360000 pts:0.360000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:-0.740831 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:2.160000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:1.040000 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:-1 size:144000 flags:1
-ret: 0 st: 1 ts:-0.058333 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:144000 flags:1
-ret: 0 st: 1 ts:2.835833 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.640000 pts:0.640000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:-1 size:144000 flags:1
-ret: 0 st: 1 ts:1.306667 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:-1 size:144000 flags:1
-ret: 0 st: 1 ts:0.200833 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:1.989173 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:0.880000 flags:0
-ret: 0 st: 0 dts:0.880000 pts:0.880000 pos:-1 size:144000 flags:1
-ret: 0 st: 0 ts:-0.240000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:144000 flags:1
-ret: 0 st: 1 ts:2.671667 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:-1 size:144000 flags:1
-ret: 0 st: 1 ts:1.565833 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:-1 size:144000 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:144000 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: -1 size:144000
+ret: 0 st: 0 flags:1 ts:-0.320000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000
+ret: 0 st: 1 flags:0 ts: 2.576667
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000
+ret: 0 st: 1 flags:1 ts: 1.470833
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000
+ret: 0 st:-1 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: -1 size:144000
+ret: 0 st:-1 flags:1 ts:-0.740831
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000
+ret: 0 st: 0 flags:0 ts: 2.160000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000
+ret: 0 st: 0 flags:1 ts: 1.040000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000
+ret: 0 st: 1 flags:0 ts:-0.058333
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000
+ret: 0 st: 1 flags:1 ts: 2.835833
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: -1 size:144000
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000
+ret: 0 st: 1 flags:0 ts: 1.306667
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000
+ret: 0 st: 1 flags:1 ts: 0.200833
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000
+ret: 0 st:-1 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000
+ret: 0 st:-1 flags:1 ts: 1.989173
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000
+ret: 0 st: 0 flags:0 ts: 0.880000
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: -1 size:144000
+ret: 0 st: 0 flags:1 ts:-0.240000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000
+ret: 0 st: 1 flags:0 ts: 2.671667
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000
+ret: 0 st: 1 flags:1 ts: 1.565833
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: -1 size:144000
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000
----------------
tests/data/b-lavf.ffm
-ret: 0 st: 0 dts:-0.040000 pts:0.000000 pos:8192 size:24664 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:-0.040000 pts:0.000000 pos:8192 size:24664 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 1 dts:0.940408 pts:0.940408 pos:376832 size:209 flags:1
-ret: 0 st: 0 ts:0.788334 flags:0
-ret: 0 st: 1 dts:0.783673 pts:0.783673 pos:315392 size:209 flags:1
-ret: 0 st: 0 ts:-0.317499 flags:1
-ret: 0 st: 0 dts:-0.040000 pts:0.000000 pos:8192 size:24664 flags:1
-ret: 0 st: 1 ts:2.576668 flags:0
-ret: 0 st: 1 dts:0.940408 pts:0.940408 pos:376832 size:209 flags:1
-ret: 0 st: 1 ts:1.470835 flags:1
-ret: 0 st: 1 dts:0.940408 pts:0.940408 pos:376832 size:209 flags:1
-ret: 0 st:-1 ts:0.365002 flags:0
-ret: 0 st: 1 dts:0.339592 pts:0.339592 pos:155648 size:209 flags:1
-ret: 0 st:-1 ts:-0.740831 flags:1
-ret: 0 st: 0 dts:-0.040000 pts:0.000000 pos:8192 size:24664 flags:1
-ret: 0 st: 0 ts:2.153336 flags:0
-ret: 0 st: 1 dts:0.940408 pts:0.940408 pos:376832 size:209 flags:1
-ret: 0 st: 0 ts:1.047503 flags:1
-ret: 0 st: 1 dts:0.940408 pts:0.940408 pos:376832 size:209 flags:1
-ret: 0 st: 1 ts:-0.058330 flags:0
-ret: 0 st: 0 dts:-0.040000 pts:0.000000 pos:8192 size:24664 flags:1
-ret: 0 st: 1 ts:2.835837 flags:1
-ret: 0 st: 1 dts:0.940408 pts:0.940408 pos:376832 size:209 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 1 dts:0.940408 pts:0.940408 pos:376832 size:209 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 1 dts:0.653061 pts:0.653061 pos:274432 size:209 flags:1
-ret: 0 st: 0 ts:-0.481662 flags:0
-ret: 0 st: 0 dts:-0.040000 pts:0.000000 pos:8192 size:24664 flags:1
-ret: 0 st: 0 ts:2.412505 flags:1
-ret: 0 st: 1 dts:0.940408 pts:0.940408 pos:376832 size:209 flags:1
-ret: 0 st: 1 ts:1.306672 flags:0
-ret: 0 st: 1 dts:0.940408 pts:0.940408 pos:376832 size:209 flags:1
-ret: 0 st: 1 ts:0.200839 flags:1
-ret: 0 st: 1 dts:0.208980 pts:0.208980 pos:114688 size:209 flags:1
-ret: 0 st:-1 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:-0.040000 pts:0.000000 pos:8192 size:24664 flags:1
-ret: 0 st:-1 ts:1.989173 flags:1
-ret: 0 st: 1 dts:0.940408 pts:0.940408 pos:376832 size:209 flags:1
-ret: 0 st: 0 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.880000 pts:0.920000 pos:339968 size:12307 flags:0
-ret: 0 st: 0 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:-0.040000 pts:0.000000 pos:8192 size:24664 flags:1
-ret: 0 st: 1 ts:2.671674 flags:0
-ret: 0 st: 1 dts:0.940408 pts:0.940408 pos:376832 size:209 flags:1
-ret: 0 st: 1 ts:1.565841 flags:1
-ret: 0 st: 1 dts:0.940408 pts:0.940408 pos:376832 size:209 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 1 dts:0.444082 pts:0.444082 pos:204800 size:209 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:-0.040000 pts:0.000000 pos:8192 size:24664 flags:1
+ret: 0 st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos: 8192 size: 24664
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos: 8192 size: 24664
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209
+ret: 0 st: 0 flags:0 ts: 0.788334
+ret: 0 st: 1 flags:1 dts: 0.783673 pts: 0.783673 pos: 315392 size: 209
+ret: 0 st: 0 flags:1 ts:-0.317499
+ret: 0 st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos: 8192 size: 24664
+ret: 0 st: 1 flags:0 ts: 2.576668
+ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209
+ret: 0 st: 1 flags:1 ts: 1.470835
+ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209
+ret: 0 st:-1 flags:0 ts: 0.365002
+ret: 0 st: 1 flags:1 dts: 0.339592 pts: 0.339592 pos: 155648 size: 209
+ret: 0 st:-1 flags:1 ts:-0.740831
+ret: 0 st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos: 8192 size: 24664
+ret: 0 st: 0 flags:0 ts: 2.153336
+ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209
+ret: 0 st: 0 flags:1 ts: 1.047503
+ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209
+ret: 0 st: 1 flags:0 ts:-0.058330
+ret: 0 st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos: 8192 size: 24664
+ret: 0 st: 1 flags:1 ts: 2.835837
+ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 1 flags:1 dts: 0.653061 pts: 0.653061 pos: 274432 size: 209
+ret: 0 st: 0 flags:0 ts:-0.481662
+ret: 0 st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos: 8192 size: 24664
+ret: 0 st: 0 flags:1 ts: 2.412505
+ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209
+ret: 0 st: 1 flags:0 ts: 1.306672
+ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209
+ret: 0 st: 1 flags:1 ts: 0.200839
+ret: 0 st: 1 flags:1 dts: 0.208980 pts: 0.208980 pos: 114688 size: 209
+ret: 0 st:-1 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos: 8192 size: 24664
+ret: 0 st:-1 flags:1 ts: 1.989173
+ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209
+ret: 0 st: 0 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:0 dts: 0.880000 pts: 0.920000 pos: 339968 size: 12307
+ret: 0 st: 0 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos: 8192 size: 24664
+ret: 0 st: 1 flags:0 ts: 2.671674
+ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209
+ret: 0 st: 1 flags:1 ts: 1.565841
+ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 1 flags:1 dts: 0.444082 pts: 0.444082 pos: 204800 size: 209
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos: 8192 size: 24664
----------------
tests/data/b-lavf.flv
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:199 size:31074 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:199 size:31074 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:298403 size:31134 flags:1
-ret: 0 st: 0 ts:0.788000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:298403 size:31134 flags:1
-ret:-1 st: 0 ts:-0.317000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:298403 size:31134 flags:1
-ret: 0 st: 0 ts:0.365000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:149441 size:31125 flags:1
-ret:-1 st: 0 ts:-0.741000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:298403 size:31134 flags:1
-ret: 0 st: 0 ts:-0.058000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:199 size:31074 flags:1
-ret: 0 st: 0 ts:2.836000 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:298403 size:31134 flags:1
-ret:-1 st:-1 ts:1.730004 flags:0
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:149441 size:31125 flags:1
-ret: 0 st: 0 ts:-0.482000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:199 size:31074 flags:1
-ret: 0 st: 0 ts:2.413000 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:298403 size:31134 flags:1
-ret:-1 st:-1 ts:1.306672 flags:0
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:199 size:31074 flags:1
-ret: 0 st: 0 ts:-0.905000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:199 size:31074 flags:1
-ret: 0 st: 0 ts:1.989000 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:298403 size:31134 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:298403 size:31134 flags:1
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.672000 flags:0
-ret: 0 st: 0 ts:1.566000 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:298403 size:31134 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:149441 size:31125 flags:1
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 31074
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 31074
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134
+ret: 0 st: 0 flags:0 ts: 0.788000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134
+ret:-1 st: 0 flags:1 ts:-0.317000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134
+ret: 0 st: 0 flags:0 ts: 0.365000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 149441 size: 31125
+ret:-1 st: 0 flags:1 ts:-0.741000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134
+ret: 0 st: 0 flags:0 ts:-0.058000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 31074
+ret: 0 st: 0 flags:1 ts: 2.836000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134
+ret:-1 st:-1 flags:0 ts: 1.730004
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 149441 size: 31125
+ret: 0 st: 0 flags:0 ts:-0.482000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 31074
+ret: 0 st: 0 flags:1 ts: 2.413000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134
+ret:-1 st:-1 flags:0 ts: 1.306672
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 31074
+ret: 0 st: 0 flags:0 ts:-0.905000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 31074
+ret: 0 st: 0 flags:1 ts: 1.989000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.672000
+ret: 0 st: 0 flags:1 ts: 1.566000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 149441 size: 31125
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/b-lavf.gif
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:2906382 flags:1
-ret:-22 st:-1 ts:-1.000000 flags:0
-ret:-22 st:-1 ts:1.894167 flags:1
-ret:-22 st: 0 ts:0.800000 flags:0
-ret:-22 st: 0 ts:-0.320000 flags:1
-ret:-22 st:-1 ts:2.576668 flags:0
-ret:-22 st:-1 ts:1.470835 flags:1
-ret:-22 st: 0 ts:0.360000 flags:0
-ret:-22 st: 0 ts:-0.760000 flags:1
-ret:-22 st:-1 ts:2.153336 flags:0
-ret:-22 st:-1 ts:1.047503 flags:1
-ret:-22 st: 0 ts:-0.040000 flags:0
-ret:-22 st: 0 ts:2.840000 flags:1
-ret:-22 st:-1 ts:1.730004 flags:0
-ret:-22 st:-1 ts:0.624171 flags:1
-ret:-22 st: 0 ts:-0.480000 flags:0
-ret:-22 st: 0 ts:2.400000 flags:1
-ret:-22 st:-1 ts:1.306672 flags:0
-ret:-22 st:-1 ts:0.200839 flags:1
-ret:-22 st: 0 ts:-0.920000 flags:0
-ret:-22 st: 0 ts:2.000000 flags:1
-ret:-22 st:-1 ts:0.883340 flags:0
-ret:-22 st:-1 ts:-0.222493 flags:1
-ret:-22 st: 0 ts:2.680000 flags:0
-ret:-22 st: 0 ts:1.560000 flags:1
-ret:-22 st:-1 ts:0.460008 flags:0
-ret:-22 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:2906382
+ret:-EINVAL st:-1 flags:0 ts:-1.000000
+ret:-EINVAL st:-1 flags:1 ts: 1.894167
+ret:-EINVAL st: 0 flags:0 ts: 0.800000
+ret:-EINVAL st: 0 flags:1 ts:-0.320000
+ret:-EINVAL st:-1 flags:0 ts: 2.576668
+ret:-EINVAL st:-1 flags:1 ts: 1.470835
+ret:-EINVAL st: 0 flags:0 ts: 0.360000
+ret:-EINVAL st: 0 flags:1 ts:-0.760000
+ret:-EINVAL st:-1 flags:0 ts: 2.153336
+ret:-EINVAL st:-1 flags:1 ts: 1.047503
+ret:-EINVAL st: 0 flags:0 ts:-0.040000
+ret:-EINVAL st: 0 flags:1 ts: 2.840000
+ret:-EINVAL st:-1 flags:0 ts: 1.730004
+ret:-EINVAL st:-1 flags:1 ts: 0.624171
+ret:-EINVAL st: 0 flags:0 ts:-0.480000
+ret:-EINVAL st: 0 flags:1 ts: 2.400000
+ret:-EINVAL st:-1 flags:0 ts: 1.306672
+ret:-EINVAL st:-1 flags:1 ts: 0.200839
+ret:-EINVAL st: 0 flags:0 ts:-0.920000
+ret:-EINVAL st: 0 flags:1 ts: 2.000000
+ret:-EINVAL st:-1 flags:0 ts: 0.883340
+ret:-EINVAL st:-1 flags:1 ts:-0.222493
+ret:-EINVAL st: 0 flags:0 ts: 2.680000
+ret:-EINVAL st: 0 flags:1 ts: 1.560000
+ret:-EINVAL st:-1 flags:0 ts: 0.460008
+ret:-EINVAL st:-1 flags:1 ts:-0.645825
----------------
tests/data/b-lavf.gxf
-ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:5024 size:65536 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:5024 size:65536 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:0.960000 pts:-184467440737095520.000000 pos:741640 size:54736 flags:1
-ret: 0 st: 0 ts:0.780000 flags:0
-ret: 0 st: 0 dts:0.800000 pts:-184467440737095520.000000 pos:653328 size:22148 flags:0
-ret: 0 st: 0 ts:-0.320000 flags:1
-ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:5024 size:65536 flags:1
-ret: 0 st: 1 ts:2.580000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:-184467440737095520.000000 pos:741640 size:54736 flags:1
-ret: 0 st: 1 ts:1.480000 flags:1
-ret: 0 st: 0 dts:0.960000 pts:-184467440737095520.000000 pos:741640 size:54736 flags:1
-ret: 0 st: 2 ts:0.360000 flags:0
-ret: 0 st: 0 dts:0.360000 pts:-184467440737095520.000000 pos:302676 size:25108 flags:0
-ret: 0 st: 2 ts:-0.740000 flags:1
-ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:5024 size:65536 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret: 0 st: 0 dts:0.960000 pts:-184467440737095520.000000 pos:741640 size:54736 flags:1
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:0.960000 pts:-184467440737095520.000000 pos:741640 size:54736 flags:1
-ret: 0 st: 0 ts:-0.060000 flags:0
-ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:5024 size:65536 flags:1
-ret: 0 st: 0 ts:2.840000 flags:1
-ret: 0 st: 0 dts:0.960000 pts:-184467440737095520.000000 pos:741640 size:54736 flags:1
-ret: 0 st: 1 ts:1.740000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:-184467440737095520.000000 pos:741640 size:54736 flags:1
-ret: 0 st: 1 ts:0.620000 flags:1
-ret: 0 st: 0 dts:0.640000 pts:-184467440737095520.000000 pos:497156 size:21596 flags:0
-ret: 0 st: 2 ts:-0.480000 flags:0
-ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:5024 size:65536 flags:1
-ret: 0 st: 2 ts:2.420000 flags:1
-ret: 0 st: 0 dts:0.960000 pts:-184467440737095520.000000 pos:741640 size:54736 flags:1
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:0.960000 pts:-184467440737095520.000000 pos:741640 size:54736 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.200000 pts:-184467440737095520.000000 pos:209504 size:22968 flags:0
-ret: 0 st: 0 ts:-0.900000 flags:0
-ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:5024 size:65536 flags:1
-ret: 0 st: 0 ts:1.980000 flags:1
-ret: 0 st: 0 dts:0.960000 pts:-184467440737095520.000000 pos:741640 size:54736 flags:1
-ret: 0 st: 1 ts:0.880000 flags:0
-ret: 0 st: 0 dts:0.880000 pts:-184467440737095520.000000 pos:696044 size:22484 flags:0
-ret: 0 st: 1 ts:-0.220000 flags:1
-ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:5024 size:65536 flags:1
-ret: 0 st: 2 ts:2.680000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:-184467440737095520.000000 pos:741640 size:54736 flags:1
-ret: 0 st: 2 ts:1.560000 flags:1
-ret: 0 st: 0 dts:0.960000 pts:-184467440737095520.000000 pos:741640 size:54736 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:-184467440737095520.000000 pos:370660 size:54628 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:5024 size:65536 flags:1
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 5024 size: 65536
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 5024 size: 65536
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736
+ret: 0 st: 0 flags:0 ts: 0.780000
+ret: 0 st: 0 flags:0 dts: 0.800000 pts: NOPTS pos: 653328 size: 22148
+ret: 0 st: 0 flags:1 ts:-0.320000
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 5024 size: 65536
+ret: 0 st: 1 flags:0 ts: 2.580000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736
+ret: 0 st: 1 flags:1 ts: 1.480000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736
+ret: 0 st: 2 flags:0 ts: 0.360000
+ret: 0 st: 0 flags:0 dts: 0.360000 pts: NOPTS pos: 302676 size: 25108
+ret: 0 st: 2 flags:1 ts:-0.740000
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 5024 size: 65536
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736
+ret: 0 st: 0 flags:0 ts:-0.060000
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 5024 size: 65536
+ret: 0 st: 0 flags:1 ts: 2.840000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736
+ret: 0 st: 1 flags:0 ts: 1.740000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736
+ret: 0 st: 1 flags:1 ts: 0.620000
+ret: 0 st: 0 flags:0 dts: 0.640000 pts: NOPTS pos: 497156 size: 21596
+ret: 0 st: 2 flags:0 ts:-0.480000
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 5024 size: 65536
+ret: 0 st: 2 flags:1 ts: 2.420000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:0 dts: 0.200000 pts: NOPTS pos: 209504 size: 22968
+ret: 0 st: 0 flags:0 ts:-0.900000
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 5024 size: 65536
+ret: 0 st: 0 flags:1 ts: 1.980000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736
+ret: 0 st: 1 flags:0 ts: 0.880000
+ret: 0 st: 0 flags:0 dts: 0.880000 pts: NOPTS pos: 696044 size: 22484
+ret: 0 st: 1 flags:1 ts:-0.220000
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 5024 size: 65536
+ret: 0 st: 2 flags:0 ts: 2.680000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736
+ret: 0 st: 2 flags:1 ts: 1.560000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 370660 size: 54628
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 5024 size: 65536
----------------
tests/data/b-lavf.mkv
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:291894 size:27834 flags:1
-ret: 0 st: 0 ts:0.788000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:291894 size:27834 flags:1
-ret: 0 st: 0 ts:-0.317000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
-ret: 0 st: 1 ts:2.577000 flags:0
-ret:-32
-ret: 0 st: 1 ts:1.471000 flags:1
-ret: 0 st: 1 dts:1.019000 pts:1.019000 pos:320167 size:209 flags:1
-ret: 0 st:-1 ts:0.365002 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146679 size:27925 flags:1
-ret: 0 st:-1 ts:-0.740831 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
-ret: 0 st: 0 ts:2.153000 flags:0
-ret:-32
-ret: 0 st: 0 ts:1.048000 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:291894 size:27834 flags:1
-ret: 0 st: 1 ts:-0.058000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
-ret: 0 st: 1 ts:2.836000 flags:1
-ret: 0 st: 1 dts:1.019000 pts:1.019000 pos:320167 size:209 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret:-32
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146679 size:27925 flags:1
-ret: 0 st: 0 ts:-0.482000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
-ret: 0 st: 0 ts:2.413000 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:291894 size:27834 flags:1
-ret: 0 st: 1 ts:1.307000 flags:0
-ret:-32
-ret: 0 st: 1 ts:0.201000 flags:1
-ret: 0 st: 1 dts:0.183000 pts:0.183000 pos:72075 size:209 flags:1
-ret: 0 st:-1 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
-ret: 0 st:-1 ts:1.989173 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:291894 size:27834 flags:1
-ret: 0 st: 0 ts:0.883000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:291894 size:27834 flags:1
-ret: 0 st: 0 ts:-0.222000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
-ret: 0 st: 1 ts:2.672000 flags:0
-ret:-32
-ret: 0 st: 1 ts:1.566000 flags:1
-ret: 0 st: 1 dts:1.019000 pts:1.019000 pos:320167 size:209 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146679 size:27925 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:505 size:27837 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 505 size: 27837
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 505 size: 27837
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 291894 size: 27834
+ret: 0 st: 0 flags:0 ts: 0.788000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 291894 size: 27834
+ret: 0 st: 0 flags:1 ts:-0.317000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 505 size: 27837
+ret: 0 st: 1 flags:0 ts: 2.577000
+ret:-EOF
+ret: 0 st: 1 flags:1 ts: 1.471000
+ret: 0 st: 1 flags:1 dts: 1.019000 pts: 1.019000 pos: 320167 size: 209
+ret: 0 st:-1 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146679 size: 27925
+ret: 0 st:-1 flags:1 ts:-0.740831
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 505 size: 27837
+ret: 0 st: 0 flags:0 ts: 2.153000
+ret:-EOF
+ret: 0 st: 0 flags:1 ts: 1.048000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 291894 size: 27834
+ret: 0 st: 1 flags:0 ts:-0.058000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 505 size: 27837
+ret: 0 st: 1 flags:1 ts: 2.836000
+ret: 0 st: 1 flags:1 dts: 1.019000 pts: 1.019000 pos: 320167 size: 209
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret:-EOF
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146679 size: 27925
+ret: 0 st: 0 flags:0 ts:-0.482000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 505 size: 27837
+ret: 0 st: 0 flags:1 ts: 2.413000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 291894 size: 27834
+ret: 0 st: 1 flags:0 ts: 1.307000
+ret:-EOF
+ret: 0 st: 1 flags:1 ts: 0.201000
+ret: 0 st: 1 flags:1 dts: 0.183000 pts: 0.183000 pos: 72075 size: 209
+ret: 0 st:-1 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 505 size: 27837
+ret: 0 st:-1 flags:1 ts: 1.989173
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 291894 size: 27834
+ret: 0 st: 0 flags:0 ts: 0.883000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 291894 size: 27834
+ret: 0 st: 0 flags:1 ts:-0.222000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 505 size: 27837
+ret: 0 st: 1 flags:0 ts: 2.672000
+ret:-EOF
+ret: 0 st: 1 flags:1 ts: 1.566000
+ret: 0 st: 1 flags:1 dts: 1.019000 pts: 1.019000 pos: 320167 size: 209
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146679 size: 27925
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 505 size: 27837
----------------
tests/data/b-lavf.mmf
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:4096 flags:1
-ret:-1 st:-1 ts:-1.000000 flags:0
-ret:-1 st:-1 ts:1.894167 flags:1
-ret:-1 st: 0 ts:0.788345 flags:0
-ret:-1 st: 0 ts:-0.317506 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret:-1 st:-1 ts:1.470835 flags:1
-ret:-1 st: 0 ts:0.365011 flags:0
-ret:-1 st: 0 ts:-0.740839 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret:-1 st:-1 ts:1.047503 flags:1
-ret:-1 st: 0 ts:-0.058322 flags:0
-ret:-1 st: 0 ts:2.835828 flags:1
-ret:-1 st:-1 ts:1.730004 flags:0
-ret:-1 st:-1 ts:0.624171 flags:1
-ret:-1 st: 0 ts:-0.481655 flags:0
-ret:-1 st: 0 ts:2.412494 flags:1
-ret:-1 st:-1 ts:1.306672 flags:0
-ret:-1 st:-1 ts:0.200839 flags:1
-ret:-1 st: 0 ts:-0.904989 flags:0
-ret:-1 st: 0 ts:1.989184 flags:1
-ret:-1 st:-1 ts:0.883340 flags:0
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.671678 flags:0
-ret:-1 st: 0 ts:1.565850 flags:1
-ret:-1 st:-1 ts:0.460008 flags:0
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size: 4096
+ret:-1 st:-1 flags:0 ts:-1.000000
+ret:-1 st:-1 flags:1 ts: 1.894167
+ret:-1 st: 0 flags:0 ts: 0.788345
+ret:-1 st: 0 flags:1 ts:-0.317506
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret:-1 st:-1 flags:1 ts: 1.470835
+ret:-1 st: 0 flags:0 ts: 0.365011
+ret:-1 st: 0 flags:1 ts:-0.740839
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret:-1 st:-1 flags:1 ts: 1.047503
+ret:-1 st: 0 flags:0 ts:-0.058322
+ret:-1 st: 0 flags:1 ts: 2.835828
+ret:-1 st:-1 flags:0 ts: 1.730004
+ret:-1 st:-1 flags:1 ts: 0.624171
+ret:-1 st: 0 flags:0 ts:-0.481655
+ret:-1 st: 0 flags:1 ts: 2.412494
+ret:-1 st:-1 flags:0 ts: 1.306672
+ret:-1 st:-1 flags:1 ts: 0.200839
+ret:-1 st: 0 flags:0 ts:-0.904989
+ret:-1 st: 0 flags:1 ts: 1.989184
+ret:-1 st:-1 flags:0 ts: 0.883340
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.671678
+ret:-1 st: 0 flags:1 ts: 1.565850
+ret:-1 st:-1 flags:0 ts: 0.460008
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/b-lavf.mov
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:27837 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:27837 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 1 dts:0.952018 pts:0.952018 pos:325248 size:1024 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:326272 size:27834 flags:1
-ret: 0 st: 0 ts:-0.320000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:27837 flags:1
-ret:-1 st: 1 ts:2.576667 flags:0
-ret: 0 st: 1 ts:1.470839 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:326272 size:27834 flags:1
-ret: 0 st:-1 ts:0.365002 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:163526 size:27925 flags:1
-ret: 0 st:-1 ts:-0.740831 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:27837 flags:1
-ret:-1 st: 0 ts:2.160000 flags:0
-ret: 0 st: 0 ts:1.040000 flags:1
-ret: 0 st: 1 dts:0.952018 pts:0.952018 pos:325248 size:1024 flags:1
-ret: 0 st: 1 ts:-0.058322 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:27837 flags:1
-ret: 0 st: 1 ts:2.835828 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:326272 size:27834 flags:1
-ret:-1 st:-1 ts:1.730004 flags:0
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 1 dts:0.464399 pts:0.464399 pos:162502 size:1024 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:27837 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 1 dts:0.952018 pts:0.952018 pos:325248 size:1024 flags:1
-ret:-1 st: 1 ts:1.306667 flags:0
-ret: 0 st: 1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:27837 flags:1
-ret: 0 st:-1 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:27837 flags:1
-ret: 0 st:-1 ts:1.989173 flags:1
-ret: 0 st: 1 dts:0.952018 pts:0.952018 pos:325248 size:1024 flags:1
-ret: 0 st: 0 ts:0.880000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:326272 size:27834 flags:1
-ret: 0 st: 0 ts:-0.240000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:27837 flags:1
-ret:-1 st: 1 ts:2.671678 flags:0
-ret: 0 st: 1 ts:1.565850 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:326272 size:27834 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:163526 size:27925 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:36 size:27837 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 1 flags:1 dts: 0.952018 pts: 0.952018 pos: 325248 size: 1024
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326272 size: 27834
+ret: 0 st: 0 flags:1 ts:-0.320000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837
+ret:-1 st: 1 flags:0 ts: 2.576667
+ret: 0 st: 1 flags:1 ts: 1.470839
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326272 size: 27834
+ret: 0 st:-1 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 163526 size: 27925
+ret: 0 st:-1 flags:1 ts:-0.740831
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837
+ret:-1 st: 0 flags:0 ts: 2.160000
+ret: 0 st: 0 flags:1 ts: 1.040000
+ret: 0 st: 1 flags:1 dts: 0.952018 pts: 0.952018 pos: 325248 size: 1024
+ret: 0 st: 1 flags:0 ts:-0.058322
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837
+ret: 0 st: 1 flags:1 ts: 2.835828
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326272 size: 27834
+ret:-1 st:-1 flags:0 ts: 1.730004
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 1 flags:1 dts: 0.464399 pts: 0.464399 pos: 162502 size: 1024
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 1 flags:1 dts: 0.952018 pts: 0.952018 pos: 325248 size: 1024
+ret:-1 st: 1 flags:0 ts: 1.306667
+ret: 0 st: 1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837
+ret: 0 st:-1 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837
+ret: 0 st:-1 flags:1 ts: 1.989173
+ret: 0 st: 1 flags:1 dts: 0.952018 pts: 0.952018 pos: 325248 size: 1024
+ret: 0 st: 0 flags:0 ts: 0.880000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326272 size: 27834
+ret: 0 st: 0 flags:1 ts:-0.240000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837
+ret:-1 st: 1 flags:0 ts: 2.671678
+ret: 0 st: 1 flags:1 ts: 1.565850
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326272 size: 27834
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 163526 size: 27925
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837
----------------
tests/data/b-lavf.mpg
-ret: 0 st: 1 dts:0.500000 pts:0.500000 pos:-1 size:208 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 1 dts:0.500000 pts:0.500000 pos:-1 size:208 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.420000 pts:1.460000 pos:-1 size:681 flags:1
-ret: 0 st: 0 ts:0.788333 flags:0
-ret: 0 st: 1 dts:0.761222 pts:0.761222 pos:-1 size:261 flags:1
-ret: 0 st: 0 ts:-0.317500 flags:1
-ret: 0 st: 1 dts:0.500000 pts:0.500000 pos:-1 size:208 flags:1
-ret: 0 st: 1 ts:2.576667 flags:0
-ret: 0 st: 1 dts:1.518778 pts:1.518778 pos:-1 size:235 flags:1
-ret: 0 st: 1 ts:1.470833 flags:1
-ret: 0 st: 1 dts:1.283678 pts:1.283678 pos:-1 size:379 flags:1
-ret: 0 st:-1 ts:0.365002 flags:0
-ret: 0 st: 1 dts:0.500000 pts:0.500000 pos:-1 size:208 flags:1
-ret: 0 st:-1 ts:-0.740831 flags:1
-ret: 0 st: 1 dts:0.500000 pts:0.500000 pos:-1 size:208 flags:1
-ret: 0 st: 0 ts:2.153333 flags:0
-ret: 0 st: 0 dts:1.420000 pts:1.460000 pos:-1 size:681 flags:1
-ret: 0 st: 0 ts:1.047500 flags:1
-ret: 0 st: 0 dts:1.020000 pts:1.060000 pos:-1 size:16484 flags:0
-ret: 0 st: 1 ts:-0.058333 flags:0
-ret: 0 st: 1 dts:0.500000 pts:0.500000 pos:-1 size:208 flags:1
-ret: 0 st: 1 ts:2.835833 flags:1
-ret: 0 st: 1 dts:1.518778 pts:1.518778 pos:-1 size:235 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.420000 pts:1.460000 pos:-1 size:681 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.620000 pts:0.660000 pos:-1 size:15804 flags:0
-ret: 0 st: 0 ts:-0.481667 flags:0
-ret: 0 st: 1 dts:0.500000 pts:0.500000 pos:-1 size:208 flags:1
-ret: 0 st: 0 ts:2.412500 flags:1
-ret: 0 st: 0 dts:1.420000 pts:1.460000 pos:-1 size:681 flags:1
-ret: 0 st: 1 ts:1.306667 flags:0
-ret: 0 st: 1 dts:1.518778 pts:1.518778 pos:-1 size:235 flags:1
-ret: 0 st: 1 ts:0.200844 flags:1
-ret: 0 st: 1 dts:0.500000 pts:0.500000 pos:-1 size:208 flags:1
-ret: 0 st:-1 ts:-0.904994 flags:0
-ret: 0 st: 1 dts:0.500000 pts:0.500000 pos:-1 size:208 flags:1
-ret: 0 st:-1 ts:1.989173 flags:1
-ret: 0 st: 0 dts:1.420000 pts:1.460000 pos:-1 size:681 flags:1
-ret: 0 st: 0 ts:0.883344 flags:0
-ret: 0 st: 0 dts:0.900000 pts:0.940000 pos:-1 size:12809 flags:0
-ret: 0 st: 0 ts:-0.222489 flags:1
-ret: 0 st: 1 dts:0.500000 pts:0.500000 pos:-1 size:208 flags:1
-ret: 0 st: 1 ts:2.671678 flags:0
-ret: 0 st: 1 dts:1.518778 pts:1.518778 pos:-1 size:235 flags:1
-ret: 0 st: 1 ts:1.565844 flags:1
-ret: 0 st: 1 dts:1.518778 pts:1.518778 pos:-1 size:235 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.500000 pts:0.540000 pos:-1 size:16303 flags:0
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 1 dts:0.500000 pts:0.500000 pos:-1 size:208 flags:1
+ret: 0 st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos: -1 size: 208
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos: -1 size: 208
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.420000 pts: 1.460000 pos: -1 size: 681
+ret: 0 st: 0 flags:0 ts: 0.788333
+ret: 0 st: 1 flags:1 dts: 0.761222 pts: 0.761222 pos: -1 size: 261
+ret: 0 st: 0 flags:1 ts:-0.317500
+ret: 0 st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos: -1 size: 208
+ret: 0 st: 1 flags:0 ts: 2.576667
+ret: 0 st: 1 flags:1 dts: 1.518778 pts: 1.518778 pos: -1 size: 235
+ret: 0 st: 1 flags:1 ts: 1.470833
+ret: 0 st: 1 flags:1 dts: 1.283678 pts: 1.283678 pos: -1 size: 379
+ret: 0 st:-1 flags:0 ts: 0.365002
+ret: 0 st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos: -1 size: 208
+ret: 0 st:-1 flags:1 ts:-0.740831
+ret: 0 st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos: -1 size: 208
+ret: 0 st: 0 flags:0 ts: 2.153333
+ret: 0 st: 0 flags:1 dts: 1.420000 pts: 1.460000 pos: -1 size: 681
+ret: 0 st: 0 flags:1 ts: 1.047500
+ret: 0 st: 0 flags:0 dts: 1.020000 pts: 1.060000 pos: -1 size: 16484
+ret: 0 st: 1 flags:0 ts:-0.058333
+ret: 0 st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos: -1 size: 208
+ret: 0 st: 1 flags:1 ts: 2.835833
+ret: 0 st: 1 flags:1 dts: 1.518778 pts: 1.518778 pos: -1 size: 235
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.420000 pts: 1.460000 pos: -1 size: 681
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:0 dts: 0.620000 pts: 0.660000 pos: -1 size: 15804
+ret: 0 st: 0 flags:0 ts:-0.481667
+ret: 0 st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos: -1 size: 208
+ret: 0 st: 0 flags:1 ts: 2.412500
+ret: 0 st: 0 flags:1 dts: 1.420000 pts: 1.460000 pos: -1 size: 681
+ret: 0 st: 1 flags:0 ts: 1.306667
+ret: 0 st: 1 flags:1 dts: 1.518778 pts: 1.518778 pos: -1 size: 235
+ret: 0 st: 1 flags:1 ts: 0.200844
+ret: 0 st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos: -1 size: 208
+ret: 0 st:-1 flags:0 ts:-0.904994
+ret: 0 st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos: -1 size: 208
+ret: 0 st:-1 flags:1 ts: 1.989173
+ret: 0 st: 0 flags:1 dts: 1.420000 pts: 1.460000 pos: -1 size: 681
+ret: 0 st: 0 flags:0 ts: 0.883344
+ret: 0 st: 0 flags:0 dts: 0.900000 pts: 0.940000 pos: -1 size: 12809
+ret: 0 st: 0 flags:1 ts:-0.222489
+ret: 0 st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos: -1 size: 208
+ret: 0 st: 1 flags:0 ts: 2.671678
+ret: 0 st: 1 flags:1 dts: 1.518778 pts: 1.518778 pos: -1 size: 235
+ret: 0 st: 1 flags:1 ts: 1.565844
+ret: 0 st: 1 flags:1 dts: 1.518778 pts: 1.518778 pos: -1 size: 235
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:0 dts: 0.500000 pts: 0.540000 pos: -1 size: 16303
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos: -1 size: 208
----------------
tests/data/b-lavf.mxf
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:6144 size:24801 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:6144 size:24801 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 6144 size: 24801
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 6144 size: 24801
+ret: 0 st:-1 flags:1 ts: 1.894167
ret:-1
-ret: 0 st: 0 ts:0.800000 flags:0
+ret: 0 st: 0 flags:0 ts: 0.800000
ret:-1
-ret: 0 st: 0 ts:-0.320000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:6144 size:24801 flags:1
-ret: 0 st: 1 ts:2.560000 flags:0
+ret: 0 st: 0 flags:1 ts:-0.320000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 6144 size: 24801
+ret: 0 st: 1 flags:0 ts: 2.560000
ret:-1
-ret: 0 st: 1 ts:1.480000 flags:1
+ret: 0 st: 1 flags:1 ts: 1.480000
ret:-1
-ret: 0 st:-1 ts:0.365002 flags:0
-ret: 0 st: 0 dts:0.360000 pts:-368934881474191040.000000 pos:6144 size:24801 flags:1
-ret: 0 st:-1 ts:-0.740831 flags:1
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:6144 size:24801 flags:1
-ret: 0 st: 0 ts:2.160000 flags:0
+ret: 0 st:-1 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:1 dts: 0.360000 pts: NOPTS pos: 6144 size: 24801
+ret: 0 st:-1 flags:1 ts:-0.740831
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 6144 size: 24801
+ret: 0 st: 0 flags:0 ts: 2.160000
ret:-1
-ret: 0 st: 0 ts:1.040000 flags:1
+ret: 0 st: 0 flags:1 ts: 1.040000
ret:-1
-ret: 0 st: 1 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:6144 size:24801 flags:1
-ret: 0 st: 1 ts:2.840000 flags:1
+ret: 0 st: 1 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 6144 size: 24801
+ret: 0 st: 1 flags:1 ts: 2.840000
ret:-1
-ret: 0 st:-1 ts:1.730004 flags:0
+ret: 0 st:-1 flags:0 ts: 1.730004
ret:-1
-ret: 0 st:-1 ts:0.624171 flags:1
+ret: 0 st:-1 flags:1 ts: 0.624171
ret:-1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:6144 size:24801 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 6144 size: 24801
+ret: 0 st: 0 flags:1 ts: 2.400000
ret:-1
-ret: 0 st: 1 ts:1.320000 flags:0
+ret: 0 st: 1 flags:0 ts: 1.320000
ret:-1
-ret: 0 st: 1 ts:0.200000 flags:1
-ret: 0 st: 0 dts:0.200000 pts:-368934881474191040.000000 pos:6144 size:24801 flags:1
-ret: 0 st:-1 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:6144 size:24801 flags:1
-ret: 0 st:-1 ts:1.989173 flags:1
+ret: 0 st: 1 flags:1 ts: 0.200000
+ret: 0 st: 0 flags:1 dts: 0.200000 pts: NOPTS pos: 6144 size: 24801
+ret: 0 st:-1 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 6144 size: 24801
+ret: 0 st:-1 flags:1 ts: 1.989173
ret:-1
-ret: 0 st: 0 ts:0.880000 flags:0
+ret: 0 st: 0 flags:0 ts: 0.880000
ret:-1
-ret: 0 st: 0 ts:-0.240000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:6144 size:24801 flags:1
-ret: 0 st: 1 ts:2.680000 flags:0
+ret: 0 st: 0 flags:1 ts:-0.240000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 6144 size: 24801
+ret: 0 st: 1 flags:0 ts: 2.680000
ret:-1
-ret: 0 st: 1 ts:1.560000 flags:1
+ret: 0 st: 1 flags:1 ts: 1.560000
ret:-1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:-368934881474191040.000000 pos:6144 size:24801 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:-368934881474191040.000000 pos:6144 size:24801 flags:1
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 6144 size: 24801
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 6144 size: 24801
----------------
tests/data/b-lavf.mxf_d10
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:6144 size:150000 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:6144 size:150000 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 6144 size:150000
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 6144 size:150000
+ret: 0 st:-1 flags:1 ts: 1.894167
ret:-1
-ret: 0 st: 0 ts:0.800000 flags:0
+ret: 0 st: 0 flags:0 ts: 0.800000
ret:-1
-ret: 0 st: 0 ts:-0.320000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:6144 size:150000 flags:1
-ret: 0 st: 1 ts:2.560000 flags:0
+ret: 0 st: 0 flags:1 ts:-0.320000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 6144 size:150000
+ret: 0 st: 1 flags:0 ts: 2.560000
ret:-1
-ret: 0 st: 1 ts:1.480000 flags:1
+ret: 0 st: 1 flags:1 ts: 1.480000
ret:-1
-ret: 0 st:-1 ts:0.365002 flags:0
-ret: 0 st: 0 dts:0.360000 pts:0.360000 pos:6144 size:150000 flags:1
-ret: 0 st:-1 ts:-0.740831 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:6144 size:150000 flags:1
-ret: 0 st: 0 ts:2.160000 flags:0
+ret: 0 st:-1 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 6144 size:150000
+ret: 0 st:-1 flags:1 ts:-0.740831
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 6144 size:150000
+ret: 0 st: 0 flags:0 ts: 2.160000
ret:-1
-ret: 0 st: 0 ts:1.040000 flags:1
+ret: 0 st: 0 flags:1 ts: 1.040000
ret:-1
-ret: 0 st: 1 ts:-0.040000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:6144 size:150000 flags:1
-ret: 0 st: 1 ts:2.840000 flags:1
+ret: 0 st: 1 flags:0 ts:-0.040000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 6144 size:150000
+ret: 0 st: 1 flags:1 ts: 2.840000
ret:-1
-ret: 0 st:-1 ts:1.730004 flags:0
+ret: 0 st:-1 flags:0 ts: 1.730004
ret:-1
-ret: 0 st:-1 ts:0.624171 flags:1
+ret: 0 st:-1 flags:1 ts: 0.624171
ret:-1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:6144 size:150000 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 6144 size:150000
+ret: 0 st: 0 flags:1 ts: 2.400000
ret:-1
-ret: 0 st: 1 ts:1.320000 flags:0
+ret: 0 st: 1 flags:0 ts: 1.320000
ret:-1
-ret: 0 st: 1 ts:0.200000 flags:1
-ret: 0 st: 0 dts:0.200000 pts:0.200000 pos:6144 size:150000 flags:1
-ret: 0 st:-1 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:6144 size:150000 flags:1
-ret: 0 st:-1 ts:1.989173 flags:1
+ret: 0 st: 1 flags:1 ts: 0.200000
+ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 6144 size:150000
+ret: 0 st:-1 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 6144 size:150000
+ret: 0 st:-1 flags:1 ts: 1.989173
ret:-1
-ret: 0 st: 0 ts:0.880000 flags:0
+ret: 0 st: 0 flags:0 ts: 0.880000
ret:-1
-ret: 0 st: 0 ts:-0.240000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:6144 size:150000 flags:1
-ret: 0 st: 1 ts:2.680000 flags:0
+ret: 0 st: 0 flags:1 ts:-0.240000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 6144 size:150000
+ret: 0 st: 1 flags:0 ts: 2.680000
ret:-1
-ret: 0 st: 1 ts:1.560000 flags:1
+ret: 0 st: 1 flags:1 ts: 1.560000
ret:-1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:6144 size:150000 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:6144 size:150000 flags:1
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 6144 size:150000
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 6144 size:150000
----------------
tests/data/b-lavf.nut
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:279 size:27837 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:279 size:27837 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146329 size:27925 flags:1
-ret: 0 st: 0 ts:0.800000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146329 size:27925 flags:1
-ret: 0 st: 0 ts:-0.320000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:279 size:27837 flags:1
-ret: 0 st: 1 ts:2.586122 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146329 size:27925 flags:1
-ret: 0 st: 1 ts:1.462857 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146329 size:27925 flags:1
-ret: 0 st:-1 ts:0.365002 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:279 size:27837 flags:1
-ret: 0 st:-1 ts:-0.740831 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:279 size:27837 flags:1
-ret: 0 st: 0 ts:2.160000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146329 size:27925 flags:1
-ret: 0 st: 0 ts:1.040000 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146329 size:27925 flags:1
-ret: 0 st: 1 ts:-0.052245 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:279 size:27837 flags:1
-ret: 0 st: 1 ts:2.847347 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146329 size:27925 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146329 size:27925 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146329 size:27925 flags:1
-ret: 0 st: 0 ts:-0.480000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:279 size:27837 flags:1
-ret: 0 st: 0 ts:2.400000 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146329 size:27925 flags:1
-ret: 0 st: 1 ts:1.306122 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146329 size:27925 flags:1
-ret: 0 st: 1 ts:0.208980 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:279 size:27837 flags:1
-ret: 0 st:-1 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:279 size:27837 flags:1
-ret: 0 st:-1 ts:1.989173 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146329 size:27925 flags:1
-ret: 0 st: 0 ts:0.880000 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146329 size:27925 flags:1
-ret: 0 st: 0 ts:-0.240000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:279 size:27837 flags:1
-ret: 0 st: 1 ts:2.664490 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146329 size:27925 flags:1
-ret: 0 st: 1 ts:1.567347 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146329 size:27925 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:146329 size:27925 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:279 size:27837 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
+ret: 0 st: 0 flags:0 ts: 0.800000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
+ret: 0 st: 0 flags:1 ts:-0.320000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837
+ret: 0 st: 1 flags:0 ts: 2.586122
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
+ret: 0 st: 1 flags:1 ts: 1.462857
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
+ret: 0 st:-1 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837
+ret: 0 st:-1 flags:1 ts:-0.740831
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837
+ret: 0 st: 0 flags:0 ts: 2.160000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
+ret: 0 st: 0 flags:1 ts: 1.040000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
+ret: 0 st: 1 flags:0 ts:-0.052245
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837
+ret: 0 st: 1 flags:1 ts: 2.847347
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
+ret: 0 st: 0 flags:0 ts:-0.480000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837
+ret: 0 st: 0 flags:1 ts: 2.400000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
+ret: 0 st: 1 flags:0 ts: 1.306122
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
+ret: 0 st: 1 flags:1 ts: 0.208980
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837
+ret: 0 st:-1 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837
+ret: 0 st:-1 flags:1 ts: 1.989173
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
+ret: 0 st: 0 flags:0 ts: 0.880000
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
+ret: 0 st: 0 flags:1 ts:-0.240000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837
+ret: 0 st: 1 flags:0 ts: 2.664490
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
+ret: 0 st: 1 flags:1 ts: 1.567347
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837
----------------
tests/data/b-lavf.ogg
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:1364 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:-1 size:1390 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret:-5
-ret: 0 st: 0 ts:0.788345 flags:0
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:-1 size:1365 flags:1
-ret: 0 st: 0 ts:-0.317506 flags:1
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:-1 size:1384 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:-1 size:1369 flags:1
-ret: 0 st:-1 ts:1.470835 flags:1
-ret:-5
-ret: 0 st: 0 ts:0.365011 flags:0
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:-1 size:1390 flags:1
-ret: 0 st: 0 ts:-0.740839 flags:1
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:-1 size:1384 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:-1 size:1369 flags:1
-ret: 0 st:-1 ts:1.047503 flags:1
-ret:-5
-ret: 0 st: 0 ts:-0.058322 flags:0
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:-1 size:1390 flags:1
-ret: 0 st: 0 ts:2.835828 flags:1
-ret:-5
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:-1 size:1369 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:-1 size:1370 flags:1
-ret: 0 st: 0 ts:-0.481655 flags:0
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:-1 size:1390 flags:1
-ret: 0 st: 0 ts:2.412494 flags:1
-ret:-5
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:-1 size:1369 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:-1 size:1384 flags:1
-ret: 0 st: 0 ts:-0.904989 flags:0
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:-1 size:1390 flags:1
-ret: 0 st: 0 ts:1.989184 flags:1
-ret:-5
-ret: 0 st:-1 ts:0.883340 flags:0
-ret:-5
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:-1 size:1384 flags:1
-ret: 0 st: 0 ts:2.671678 flags:0
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:-1 size:1369 flags:1
-ret: 0 st: 0 ts:1.565850 flags:1
-ret:-5
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:-1 size:1381 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:-209146758205323.718750 pts:-209146758205323.718750 pos:-1 size:1384 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size: 1364
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1390
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret:-EIO
+ret: 0 st: 0 flags:0 ts: 0.788345
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1365
+ret: 0 st: 0 flags:1 ts:-0.317506
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1384
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1369
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret:-EIO
+ret: 0 st: 0 flags:0 ts: 0.365011
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1390
+ret: 0 st: 0 flags:1 ts:-0.740839
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1384
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1369
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret:-EIO
+ret: 0 st: 0 flags:0 ts:-0.058322
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1390
+ret: 0 st: 0 flags:1 ts: 2.835828
+ret:-EIO
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1369
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1370
+ret: 0 st: 0 flags:0 ts:-0.481655
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1390
+ret: 0 st: 0 flags:1 ts: 2.412494
+ret:-EIO
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1369
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1384
+ret: 0 st: 0 flags:0 ts:-0.904989
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1390
+ret: 0 st: 0 flags:1 ts: 1.989184
+ret:-EIO
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret:-EIO
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1384
+ret: 0 st: 0 flags:0 ts: 2.671678
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1369
+ret: 0 st: 0 flags:1 ts: 1.565850
+ret:-EIO
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1381
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: NOPTS pts: NOPTS pos: -1 size: 1384
----------------
tests/data/b-pbmpipe.pbm
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:317075 flags:1
-ret:-22 st:-1 ts:-1.000000 flags:0
-ret:-22 st:-1 ts:1.894167 flags:1
-ret:-22 st: 0 ts:0.800000 flags:0
-ret:-22 st: 0 ts:-0.320000 flags:1
-ret:-22 st:-1 ts:2.576668 flags:0
-ret:-22 st:-1 ts:1.470835 flags:1
-ret:-22 st: 0 ts:0.360000 flags:0
-ret:-22 st: 0 ts:-0.760000 flags:1
-ret:-22 st:-1 ts:2.153336 flags:0
-ret:-22 st:-1 ts:1.047503 flags:1
-ret:-22 st: 0 ts:-0.040000 flags:0
-ret:-22 st: 0 ts:2.840000 flags:1
-ret:-22 st:-1 ts:1.730004 flags:0
-ret:-22 st:-1 ts:0.624171 flags:1
-ret:-22 st: 0 ts:-0.480000 flags:0
-ret:-22 st: 0 ts:2.400000 flags:1
-ret:-22 st:-1 ts:1.306672 flags:0
-ret:-22 st:-1 ts:0.200839 flags:1
-ret:-22 st: 0 ts:-0.920000 flags:0
-ret:-22 st: 0 ts:2.000000 flags:1
-ret:-22 st:-1 ts:0.883340 flags:0
-ret:-22 st:-1 ts:-0.222493 flags:1
-ret:-22 st: 0 ts:2.680000 flags:0
-ret:-22 st: 0 ts:1.560000 flags:1
-ret:-22 st:-1 ts:0.460008 flags:0
-ret:-22 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:317075
+ret:-EINVAL st:-1 flags:0 ts:-1.000000
+ret:-EINVAL st:-1 flags:1 ts: 1.894167
+ret:-EINVAL st: 0 flags:0 ts: 0.800000
+ret:-EINVAL st: 0 flags:1 ts:-0.320000
+ret:-EINVAL st:-1 flags:0 ts: 2.576668
+ret:-EINVAL st:-1 flags:1 ts: 1.470835
+ret:-EINVAL st: 0 flags:0 ts: 0.360000
+ret:-EINVAL st: 0 flags:1 ts:-0.760000
+ret:-EINVAL st:-1 flags:0 ts: 2.153336
+ret:-EINVAL st:-1 flags:1 ts: 1.047503
+ret:-EINVAL st: 0 flags:0 ts:-0.040000
+ret:-EINVAL st: 0 flags:1 ts: 2.840000
+ret:-EINVAL st:-1 flags:0 ts: 1.730004
+ret:-EINVAL st:-1 flags:1 ts: 0.624171
+ret:-EINVAL st: 0 flags:0 ts:-0.480000
+ret:-EINVAL st: 0 flags:1 ts: 2.400000
+ret:-EINVAL st:-1 flags:0 ts: 1.306672
+ret:-EINVAL st:-1 flags:1 ts: 0.200839
+ret:-EINVAL st: 0 flags:0 ts:-0.920000
+ret:-EINVAL st: 0 flags:1 ts: 2.000000
+ret:-EINVAL st:-1 flags:0 ts: 0.883340
+ret:-EINVAL st:-1 flags:1 ts:-0.222493
+ret:-EINVAL st: 0 flags:0 ts: 2.680000
+ret:-EINVAL st: 0 flags:1 ts: 1.560000
+ret:-EINVAL st:-1 flags:0 ts: 0.460008
+ret:-EINVAL st:-1 flags:1 ts:-0.645825
----------------
tests/data/b-pgmpipe.pgm
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:2534775 flags:1
-ret:-22 st:-1 ts:-1.000000 flags:0
-ret:-22 st:-1 ts:1.894167 flags:1
-ret:-22 st: 0 ts:0.800000 flags:0
-ret:-22 st: 0 ts:-0.320000 flags:1
-ret:-22 st:-1 ts:2.576668 flags:0
-ret:-22 st:-1 ts:1.470835 flags:1
-ret:-22 st: 0 ts:0.360000 flags:0
-ret:-22 st: 0 ts:-0.760000 flags:1
-ret:-22 st:-1 ts:2.153336 flags:0
-ret:-22 st:-1 ts:1.047503 flags:1
-ret:-22 st: 0 ts:-0.040000 flags:0
-ret:-22 st: 0 ts:2.840000 flags:1
-ret:-22 st:-1 ts:1.730004 flags:0
-ret:-22 st:-1 ts:0.624171 flags:1
-ret:-22 st: 0 ts:-0.480000 flags:0
-ret:-22 st: 0 ts:2.400000 flags:1
-ret:-22 st:-1 ts:1.306672 flags:0
-ret:-22 st:-1 ts:0.200839 flags:1
-ret:-22 st: 0 ts:-0.920000 flags:0
-ret:-22 st: 0 ts:2.000000 flags:1
-ret:-22 st:-1 ts:0.883340 flags:0
-ret:-22 st:-1 ts:-0.222493 flags:1
-ret:-22 st: 0 ts:2.680000 flags:0
-ret:-22 st: 0 ts:1.560000 flags:1
-ret:-22 st:-1 ts:0.460008 flags:0
-ret:-22 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:2534775
+ret:-EINVAL st:-1 flags:0 ts:-1.000000
+ret:-EINVAL st:-1 flags:1 ts: 1.894167
+ret:-EINVAL st: 0 flags:0 ts: 0.800000
+ret:-EINVAL st: 0 flags:1 ts:-0.320000
+ret:-EINVAL st:-1 flags:0 ts: 2.576668
+ret:-EINVAL st:-1 flags:1 ts: 1.470835
+ret:-EINVAL st: 0 flags:0 ts: 0.360000
+ret:-EINVAL st: 0 flags:1 ts:-0.760000
+ret:-EINVAL st:-1 flags:0 ts: 2.153336
+ret:-EINVAL st:-1 flags:1 ts: 1.047503
+ret:-EINVAL st: 0 flags:0 ts:-0.040000
+ret:-EINVAL st: 0 flags:1 ts: 2.840000
+ret:-EINVAL st:-1 flags:0 ts: 1.730004
+ret:-EINVAL st:-1 flags:1 ts: 0.624171
+ret:-EINVAL st: 0 flags:0 ts:-0.480000
+ret:-EINVAL st: 0 flags:1 ts: 2.400000
+ret:-EINVAL st:-1 flags:0 ts: 1.306672
+ret:-EINVAL st:-1 flags:1 ts: 0.200839
+ret:-EINVAL st: 0 flags:0 ts:-0.920000
+ret:-EINVAL st: 0 flags:1 ts: 2.000000
+ret:-EINVAL st:-1 flags:0 ts: 0.883340
+ret:-EINVAL st:-1 flags:1 ts:-0.222493
+ret:-EINVAL st: 0 flags:0 ts: 2.680000
+ret:-EINVAL st: 0 flags:1 ts: 1.560000
+ret:-EINVAL st:-1 flags:0 ts: 0.460008
+ret:-EINVAL st:-1 flags:1 ts:-0.645825
----------------
tests/data/b-ppmpipe.ppm
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:-1 size:7603575 flags:1
-ret:-22 st:-1 ts:-1.000000 flags:0
-ret:-22 st:-1 ts:1.894167 flags:1
-ret:-22 st: 0 ts:0.800000 flags:0
-ret:-22 st: 0 ts:-0.320000 flags:1
-ret:-22 st:-1 ts:2.576668 flags:0
-ret:-22 st:-1 ts:1.470835 flags:1
-ret:-22 st: 0 ts:0.360000 flags:0
-ret:-22 st: 0 ts:-0.760000 flags:1
-ret:-22 st:-1 ts:2.153336 flags:0
-ret:-22 st:-1 ts:1.047503 flags:1
-ret:-22 st: 0 ts:-0.040000 flags:0
-ret:-22 st: 0 ts:2.840000 flags:1
-ret:-22 st:-1 ts:1.730004 flags:0
-ret:-22 st:-1 ts:0.624171 flags:1
-ret:-22 st: 0 ts:-0.480000 flags:0
-ret:-22 st: 0 ts:2.400000 flags:1
-ret:-22 st:-1 ts:1.306672 flags:0
-ret:-22 st:-1 ts:0.200839 flags:1
-ret:-22 st: 0 ts:-0.920000 flags:0
-ret:-22 st: 0 ts:2.000000 flags:1
-ret:-22 st:-1 ts:0.883340 flags:0
-ret:-22 st:-1 ts:-0.222493 flags:1
-ret:-22 st: 0 ts:2.680000 flags:0
-ret:-22 st: 0 ts:1.560000 flags:1
-ret:-22 st:-1 ts:0.460008 flags:0
-ret:-22 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:7603575
+ret:-EINVAL st:-1 flags:0 ts:-1.000000
+ret:-EINVAL st:-1 flags:1 ts: 1.894167
+ret:-EINVAL st: 0 flags:0 ts: 0.800000
+ret:-EINVAL st: 0 flags:1 ts:-0.320000
+ret:-EINVAL st:-1 flags:0 ts: 2.576668
+ret:-EINVAL st:-1 flags:1 ts: 1.470835
+ret:-EINVAL st: 0 flags:0 ts: 0.360000
+ret:-EINVAL st: 0 flags:1 ts:-0.760000
+ret:-EINVAL st:-1 flags:0 ts: 2.153336
+ret:-EINVAL st:-1 flags:1 ts: 1.047503
+ret:-EINVAL st: 0 flags:0 ts:-0.040000
+ret:-EINVAL st: 0 flags:1 ts: 2.840000
+ret:-EINVAL st:-1 flags:0 ts: 1.730004
+ret:-EINVAL st:-1 flags:1 ts: 0.624171
+ret:-EINVAL st: 0 flags:0 ts:-0.480000
+ret:-EINVAL st: 0 flags:1 ts: 2.400000
+ret:-EINVAL st:-1 flags:0 ts: 1.306672
+ret:-EINVAL st:-1 flags:1 ts: 0.200839
+ret:-EINVAL st: 0 flags:0 ts:-0.920000
+ret:-EINVAL st: 0 flags:1 ts: 2.000000
+ret:-EINVAL st:-1 flags:0 ts: 0.883340
+ret:-EINVAL st:-1 flags:1 ts:-0.222493
+ret:-EINVAL st: 0 flags:0 ts: 2.680000
+ret:-EINVAL st: 0 flags:1 ts: 1.560000
+ret:-EINVAL st:-1 flags:0 ts: 0.460008
+ret:-EINVAL st:-1 flags:1 ts:-0.645825
----------------
tests/data/b-lavf.rm
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:398 size:31082 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:398 size:31082 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:314982 size:31143 flags:1
-ret: 0 st: 0 ts:0.788000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:314982 size:31143 flags:1
-ret: 0 st: 0 ts:-0.317000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:398 size:31082 flags:1
-ret:-1 st: 1 ts:2.577000 flags:0
-ret:-1 st: 1 ts:1.471000 flags:1
-ret: 0 st:-1 ts:0.365002 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:158515 size:31134 flags:1
-ret: 0 st:-1 ts:-0.740831 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:398 size:31082 flags:1
-ret: 0 st: 0 ts:2.153000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:314982 size:31143 flags:1
-ret: 0 st: 0 ts:1.048000 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:314982 size:31143 flags:1
-ret: 0 st: 1 ts:-0.058000 flags:0
-ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:31483 size:278 flags:1
-ret:-1 st: 1 ts:2.836000 flags:1
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:314982 size:31143 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:158515 size:31134 flags:1
-ret: 0 st: 0 ts:-0.482000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:398 size:31082 flags:1
-ret: 0 st: 0 ts:2.413000 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:314982 size:31143 flags:1
-ret:-1 st: 1 ts:1.307000 flags:0
-ret: 0 st: 1 ts:0.201000 flags:1
-ret: 0 st: 1 dts:0.174000 pts:0.174000 pos:78969 size:278 flags:1
-ret: 0 st:-1 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:398 size:31082 flags:1
-ret: 0 st:-1 ts:1.989173 flags:1
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:314982 size:31143 flags:1
-ret: 0 st: 0 ts:0.883000 flags:0
-ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:314982 size:31143 flags:1
-ret: 0 st: 0 ts:-0.222000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:398 size:31082 flags:1
-ret:-1 st: 1 ts:2.672000 flags:0
-ret:-1 st: 1 ts:1.566000 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:158515 size:31134 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:398 size:31082 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 398 size: 31082
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 398 size: 31082
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
+ret: 0 st: 0 flags:0 ts: 0.788000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
+ret: 0 st: 0 flags:1 ts:-0.317000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 398 size: 31082
+ret:-1 st: 1 flags:0 ts: 2.577000
+ret:-1 st: 1 flags:1 ts: 1.471000
+ret: 0 st:-1 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 158515 size: 31134
+ret: 0 st:-1 flags:1 ts:-0.740831
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 398 size: 31082
+ret: 0 st: 0 flags:0 ts: 2.153000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
+ret: 0 st: 0 flags:1 ts: 1.048000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
+ret: 0 st: 1 flags:0 ts:-0.058000
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 31483 size: 278
+ret:-1 st: 1 flags:1 ts: 2.836000
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 158515 size: 31134
+ret: 0 st: 0 flags:0 ts:-0.482000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 398 size: 31082
+ret: 0 st: 0 flags:1 ts: 2.413000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
+ret:-1 st: 1 flags:0 ts: 1.307000
+ret: 0 st: 1 flags:1 ts: 0.201000
+ret: 0 st: 1 flags:1 dts: 0.174000 pts: 0.174000 pos: 78969 size: 278
+ret: 0 st:-1 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 398 size: 31082
+ret: 0 st:-1 flags:1 ts: 1.989173
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
+ret: 0 st: 0 flags:0 ts: 0.883000
+ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
+ret: 0 st: 0 flags:1 ts:-0.222000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 398 size: 31082
+ret:-1 st: 1 flags:0 ts: 2.672000
+ret:-1 st: 1 flags:1 ts: 1.566000
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 158515 size: 31134
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 398 size: 31082
----------------
tests/data/b-lavf.swf
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:55 size:31074 flags:0
-ret:-1 st:-1 ts:-1.000000 flags:0
-ret:-1 st:-1 ts:1.894167 flags:1
-ret:-1 st: 0 ts:0.800000 flags:0
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret:-1 st:-1 ts:1.470835 flags:1
-ret:-1 st: 0 ts:0.360000 flags:0
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret:-1 st:-1 ts:1.047503 flags:1
-ret:-1 st: 0 ts:-0.040000 flags:0
-ret:-1 st: 0 ts:2.840000 flags:1
-ret:-1 st:-1 ts:1.730004 flags:0
-ret:-1 st:-1 ts:0.624171 flags:1
-ret:-1 st: 0 ts:-0.480000 flags:0
-ret:-1 st: 0 ts:2.400000 flags:1
-ret:-1 st:-1 ts:1.306672 flags:0
-ret:-1 st:-1 ts:0.200839 flags:1
-ret:-1 st: 0 ts:-0.920000 flags:0
-ret:-1 st: 0 ts:2.000000 flags:1
-ret:-1 st:-1 ts:0.883340 flags:0
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret:-1 st: 0 ts:1.560000 flags:1
-ret:-1 st:-1 ts:0.460008 flags:0
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:0 dts: 0.000000 pts: 0.000000 pos: 55 size: 31074
+ret:-1 st:-1 flags:0 ts:-1.000000
+ret:-1 st:-1 flags:1 ts: 1.894167
+ret:-1 st: 0 flags:0 ts: 0.800000
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret:-1 st:-1 flags:1 ts: 1.470835
+ret:-1 st: 0 flags:0 ts: 0.360000
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret:-1 st:-1 flags:1 ts: 1.047503
+ret:-1 st: 0 flags:0 ts:-0.040000
+ret:-1 st: 0 flags:1 ts: 2.840000
+ret:-1 st:-1 flags:0 ts: 1.730004
+ret:-1 st:-1 flags:1 ts: 0.624171
+ret:-1 st: 0 flags:0 ts:-0.480000
+ret:-1 st: 0 flags:1 ts: 2.400000
+ret:-1 st:-1 flags:0 ts: 1.306672
+ret:-1 st:-1 flags:1 ts: 0.200839
+ret:-1 st: 0 flags:0 ts:-0.920000
+ret:-1 st: 0 flags:1 ts: 2.000000
+ret:-1 st:-1 flags:0 ts: 0.883340
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret:-1 st: 0 flags:1 ts: 1.560000
+ret:-1 st:-1 flags:0 ts: 0.460008
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/b-lavf.ts
-ret: 0 st: 0 dts:0.660000 pts:0.700000 pos:564 size:24801 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.700000 pts:0.740000 pos:29140 size:16433 flags:0
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:0.820000 pts:0.860000 pos:80088 size:13388 flags:0
-ret: 0 st: 0 ts:0.788333 flags:0
-ret: 0 st: 0 dts:0.740000 pts:0.780000 pos:48316 size:14502 flags:0
-ret: 0 st: 0 ts:-0.317500 flags:1
-ret: 0 st: 0 dts:0.700000 pts:0.740000 pos:29140 size:16433 flags:0
-ret: 0 st: 1 ts:2.576667 flags:0
-ret: 0 st: 0 dts:0.900000 pts:0.940000 pos:110544 size:12781 flags:0
-ret: 0 st: 1 ts:1.470833 flags:1
-ret: 0 st: 0 dts:0.780000 pts:0.820000 pos:65236 size:12623 flags:0
-ret: 0 st:-1 ts:0.365002 flags:0
-ret: 0 st: 0 dts:0.700000 pts:0.740000 pos:29140 size:16433 flags:0
-ret: 0 st:-1 ts:-0.740831 flags:1
-ret: 0 st: 0 dts:0.700000 pts:0.740000 pos:29140 size:16433 flags:0
-ret: 0 st: 0 ts:2.153333 flags:0
-ret: 0 st: 0 dts:0.860000 pts:0.900000 pos:95128 size:13086 flags:0
-ret: 0 st: 0 ts:1.047500 flags:1
-ret: 0 st: 0 dts:0.740000 pts:0.780000 pos:48316 size:14502 flags:0
-ret: 0 st: 1 ts:-0.058333 flags:0
-ret: 0 st: 0 dts:0.700000 pts:0.740000 pos:29140 size:16433 flags:0
-ret: 0 st: 1 ts:2.835833 flags:1
-ret: 0 st: 0 dts:0.900000 pts:0.940000 pos:110544 size:12781 flags:0
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:0.780000 pts:0.820000 pos:65236 size:12623 flags:0
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.700000 pts:0.740000 pos:29140 size:16433 flags:0
-ret: 0 st: 0 ts:-0.481667 flags:0
-ret: 0 st: 0 dts:0.700000 pts:0.740000 pos:29140 size:16433 flags:0
-ret: 0 st: 0 ts:2.412500 flags:1
-ret: 0 st: 0 dts:0.860000 pts:0.900000 pos:95128 size:13086 flags:0
-ret: 0 st: 1 ts:1.306667 flags:0
-ret: 0 st: 0 dts:0.780000 pts:0.820000 pos:65236 size:12623 flags:0
-ret: 0 st: 1 ts:0.200844 flags:1
-ret: 0 st: 0 dts:0.700000 pts:0.740000 pos:29140 size:16433 flags:0
-ret: 0 st:-1 ts:-0.904994 flags:0
-ret: 0 st: 0 dts:0.700000 pts:0.740000 pos:29140 size:16433 flags:0
-ret: 0 st:-1 ts:1.989173 flags:1
-ret: 0 st: 0 dts:0.820000 pts:0.860000 pos:80088 size:13388 flags:0
-ret: 0 st: 0 ts:0.883344 flags:0
-ret: 0 st: 0 dts:0.740000 pts:0.780000 pos:48316 size:14502 flags:0
-ret: 0 st: 0 ts:-0.222489 flags:1
-ret: 0 st: 0 dts:0.700000 pts:0.740000 pos:29140 size:16433 flags:0
-ret: 0 st: 1 ts:2.671678 flags:0
-ret: 0 st: 0 dts:0.900000 pts:0.940000 pos:110544 size:12781 flags:0
-ret: 0 st: 1 ts:1.565844 flags:1
-ret: 0 st: 0 dts:0.780000 pts:0.820000 pos:65236 size:12623 flags:0
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.700000 pts:0.740000 pos:29140 size:16433 flags:0
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.700000 pts:0.740000 pos:29140 size:16433 flags:0
+ret: 0 st: 0 flags:1 dts: 0.660000 pts: 0.700000 pos: 564 size: 24801
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:0 dts: 0.700000 pts: 0.740000 pos: 29140 size: 16433
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:0 dts: 0.820000 pts: 0.860000 pos: 80088 size: 13388
+ret: 0 st: 0 flags:0 ts: 0.788333
+ret: 0 st: 0 flags:0 dts: 0.740000 pts: 0.780000 pos: 48316 size: 14502
+ret: 0 st: 0 flags:1 ts:-0.317500
+ret: 0 st: 0 flags:0 dts: 0.700000 pts: 0.740000 pos: 29140 size: 16433
+ret: 0 st: 1 flags:0 ts: 2.576667
+ret: 0 st: 0 flags:0 dts: 0.900000 pts: 0.940000 pos: 110544 size: 12781
+ret: 0 st: 1 flags:1 ts: 1.470833
+ret: 0 st: 0 flags:0 dts: 0.780000 pts: 0.820000 pos: 65236 size: 12623
+ret: 0 st:-1 flags:0 ts: 0.365002
+ret: 0 st: 0 flags:0 dts: 0.700000 pts: 0.740000 pos: 29140 size: 16433
+ret: 0 st:-1 flags:1 ts:-0.740831
+ret: 0 st: 0 flags:0 dts: 0.700000 pts: 0.740000 pos: 29140 size: 16433
+ret: 0 st: 0 flags:0 ts: 2.153333
+ret: 0 st: 0 flags:0 dts: 0.860000 pts: 0.900000 pos: 95128 size: 13086
+ret: 0 st: 0 flags:1 ts: 1.047500
+ret: 0 st: 0 flags:0 dts: 0.740000 pts: 0.780000 pos: 48316 size: 14502
+ret: 0 st: 1 flags:0 ts:-0.058333
+ret: 0 st: 0 flags:0 dts: 0.700000 pts: 0.740000 pos: 29140 size: 16433
+ret: 0 st: 1 flags:1 ts: 2.835833
+ret: 0 st: 0 flags:0 dts: 0.900000 pts: 0.940000 pos: 110544 size: 12781
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:0 dts: 0.780000 pts: 0.820000 pos: 65236 size: 12623
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:0 dts: 0.700000 pts: 0.740000 pos: 29140 size: 16433
+ret: 0 st: 0 flags:0 ts:-0.481667
+ret: 0 st: 0 flags:0 dts: 0.700000 pts: 0.740000 pos: 29140 size: 16433
+ret: 0 st: 0 flags:1 ts: 2.412500
+ret: 0 st: 0 flags:0 dts: 0.860000 pts: 0.900000 pos: 95128 size: 13086
+ret: 0 st: 1 flags:0 ts: 1.306667
+ret: 0 st: 0 flags:0 dts: 0.780000 pts: 0.820000 pos: 65236 size: 12623
+ret: 0 st: 1 flags:1 ts: 0.200844
+ret: 0 st: 0 flags:0 dts: 0.700000 pts: 0.740000 pos: 29140 size: 16433
+ret: 0 st:-1 flags:0 ts:-0.904994
+ret: 0 st: 0 flags:0 dts: 0.700000 pts: 0.740000 pos: 29140 size: 16433
+ret: 0 st:-1 flags:1 ts: 1.989173
+ret: 0 st: 0 flags:0 dts: 0.820000 pts: 0.860000 pos: 80088 size: 13388
+ret: 0 st: 0 flags:0 ts: 0.883344
+ret: 0 st: 0 flags:0 dts: 0.740000 pts: 0.780000 pos: 48316 size: 14502
+ret: 0 st: 0 flags:1 ts:-0.222489
+ret: 0 st: 0 flags:0 dts: 0.700000 pts: 0.740000 pos: 29140 size: 16433
+ret: 0 st: 1 flags:0 ts: 2.671678
+ret: 0 st: 0 flags:0 dts: 0.900000 pts: 0.940000 pos: 110544 size: 12781
+ret: 0 st: 1 flags:1 ts: 1.565844
+ret: 0 st: 0 flags:0 dts: 0.780000 pts: 0.820000 pos: 65236 size: 12623
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:0 dts: 0.700000 pts: 0.740000 pos: 29140 size: 16433
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:0 dts: 0.700000 pts: 0.740000 pos: 29140 size: 16433
----------------
tests/data/b-lavf.ul
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:1024 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:1024 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.894150 pts:1.894150 pos:41766 size:1024 flags:1
-ret: 0 st: 0 ts:0.788345 flags:0
-ret: 0 st: 0 dts:0.788345 pts:0.788345 pos:17383 size:1024 flags:1
-ret: 0 st: 0 ts:-0.317506 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:1024 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret:-32
-ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.470839 pts:1.470839 pos:32432 size:1024 flags:1
-ret: 0 st: 0 ts:0.364989 flags:0
-ret: 0 st: 0 dts:0.364989 pts:0.364989 pos:8048 size:1024 flags:1
-ret: 0 st: 0 ts:-0.740816 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:1024 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret:-32
-ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.047483 pts:1.047483 pos:23097 size:1024 flags:1
-ret: 0 st: 0 ts:-0.058322 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:1024 flags:1
-ret: 0 st: 0 ts:2.835828 flags:1
-ret:-32
-ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.730023 pts:1.730023 pos:38147 size:1024 flags:1
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.624172 pts:0.624172 pos:13763 size:1024 flags:1
-ret: 0 st: 0 ts:-0.481678 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:1024 flags:1
-ret: 0 st: 0 ts:2.412517 flags:1
-ret:-32
-ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.306667 pts:1.306667 pos:28812 size:1024 flags:1
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.200816 pts:0.200816 pos:4428 size:1024 flags:1
-ret: 0 st: 0 ts:-0.904989 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:1024 flags:1
-ret: 0 st: 0 ts:1.989161 flags:1
-ret: 0 st: 0 dts:1.989161 pts:1.989161 pos:43861 size:1024 flags:1
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.883356 pts:0.883356 pos:19478 size:1024 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:1024 flags:1
-ret: 0 st: 0 ts:2.671655 flags:0
-ret:-32
-ret: 0 st: 0 ts:1.565850 flags:1
-ret: 0 st: 0 dts:1.565850 pts:1.565850 pos:34527 size:1024 flags:1
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.460000 pts:0.460000 pos:10143 size:1024 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:0 size:1024 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret: 0 st: 0 flags:1 dts: 1.894150 pts: 1.894150 pos: 41766 size: 1024
+ret: 0 st: 0 flags:0 ts: 0.788345
+ret: 0 st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 17383 size: 1024
+ret: 0 st: 0 flags:1 ts:-0.317506
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret:-EOF
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret: 0 st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos: 32432 size: 1024
+ret: 0 st: 0 flags:0 ts: 0.364989
+ret: 0 st: 0 flags:1 dts: 0.364989 pts: 0.364989 pos: 8048 size: 1024
+ret: 0 st: 0 flags:1 ts:-0.740816
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret:-EOF
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret: 0 st: 0 flags:1 dts: 1.047483 pts: 1.047483 pos: 23097 size: 1024
+ret: 0 st: 0 flags:0 ts:-0.058322
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024
+ret: 0 st: 0 flags:1 ts: 2.835828
+ret:-EOF
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret: 0 st: 0 flags:1 dts: 1.730023 pts: 1.730023 pos: 38147 size: 1024
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 13763 size: 1024
+ret: 0 st: 0 flags:0 ts:-0.481678
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024
+ret: 0 st: 0 flags:1 ts: 2.412517
+ret:-EOF
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret: 0 st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 28812 size: 1024
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.200816 pts: 0.200816 pos: 4428 size: 1024
+ret: 0 st: 0 flags:0 ts:-0.904989
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024
+ret: 0 st: 0 flags:1 ts: 1.989161
+ret: 0 st: 0 flags:1 dts: 1.989161 pts: 1.989161 pos: 43861 size: 1024
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.883356 pts: 0.883356 pos: 19478 size: 1024
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024
+ret: 0 st: 0 flags:0 ts: 2.671655
+ret:-EOF
+ret: 0 st: 0 flags:1 ts: 1.565850
+ret: 0 st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos: 34527 size: 1024
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 10143 size: 1024
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024
----------------
tests/data/b-lavf.voc
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:32 size:1024 flags:1
-ret:-1 st:-1 ts:-1.000000 flags:0
-ret:-1 st:-1 ts:1.894167 flags:1
-ret:-1 st: 0 ts:0.788333 flags:0
-ret:-1 st: 0 ts:-0.317500 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret:-1 st:-1 ts:1.470835 flags:1
-ret:-1 st: 0 ts:0.365000 flags:0
-ret:-1 st: 0 ts:-0.740833 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret:-1 st:-1 ts:1.047503 flags:1
-ret:-1 st: 0 ts:-0.058333 flags:0
-ret:-1 st: 0 ts:2.835833 flags:1
-ret:-1 st:-1 ts:1.730004 flags:0
-ret:-1 st:-1 ts:0.624171 flags:1
-ret:-1 st: 0 ts:-0.481667 flags:0
-ret:-1 st: 0 ts:2.412500 flags:1
-ret:-1 st:-1 ts:1.306672 flags:0
-ret:-1 st:-1 ts:0.200839 flags:1
-ret:-1 st: 0 ts:-0.904989 flags:0
-ret:-1 st: 0 ts:1.989178 flags:1
-ret:-1 st:-1 ts:0.883340 flags:0
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.671678 flags:0
-ret:-1 st: 0 ts:1.565844 flags:1
-ret:-1 st:-1 ts:0.460008 flags:0
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 32 size: 1024
+ret:-1 st:-1 flags:0 ts:-1.000000
+ret:-1 st:-1 flags:1 ts: 1.894167
+ret:-1 st: 0 flags:0 ts: 0.788333
+ret:-1 st: 0 flags:1 ts:-0.317500
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret:-1 st:-1 flags:1 ts: 1.470835
+ret:-1 st: 0 flags:0 ts: 0.365000
+ret:-1 st: 0 flags:1 ts:-0.740833
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret:-1 st:-1 flags:1 ts: 1.047503
+ret:-1 st: 0 flags:0 ts:-0.058333
+ret:-1 st: 0 flags:1 ts: 2.835833
+ret:-1 st:-1 flags:0 ts: 1.730004
+ret:-1 st:-1 flags:1 ts: 0.624171
+ret:-1 st: 0 flags:0 ts:-0.481667
+ret:-1 st: 0 flags:1 ts: 2.412500
+ret:-1 st:-1 flags:0 ts: 1.306672
+ret:-1 st:-1 flags:1 ts: 0.200839
+ret:-1 st: 0 flags:0 ts:-0.904989
+ret:-1 st: 0 flags:1 ts: 1.989178
+ret:-1 st:-1 flags:0 ts: 0.883340
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.671678
+ret:-1 st: 0 flags:1 ts: 1.565844
+ret:-1 st:-1 flags:0 ts: 0.460008
+ret:-1 st:-1 flags:1 ts:-0.645825
----------------
tests/data/b-lavf.wav
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:4096 flags:1
-ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:4096 flags:1
-ret: 0 st:-1 ts:1.894167 flags:1
-ret:-32
-ret: 0 st: 0 ts:0.788345 flags:0
-ret: 0 st: 0 dts:0.788345 pts:0.788345 pos:69576 size:4096 flags:1
-ret: 0 st: 0 ts:-0.317506 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:4096 flags:1
-ret: 0 st:-1 ts:2.576668 flags:0
-ret:-32
-ret: 0 st:-1 ts:1.470835 flags:1
-ret:-32
-ret: 0 st: 0 ts:0.365011 flags:0
-ret: 0 st: 0 dts:0.365011 pts:0.365011 pos:32238 size:4096 flags:1
-ret: 0 st: 0 ts:-0.740839 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:4096 flags:1
-ret: 0 st:-1 ts:2.153336 flags:0
-ret:-32
-ret: 0 st:-1 ts:1.047503 flags:1
-ret:-32
-ret: 0 st: 0 ts:-0.058322 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:4096 flags:1
-ret: 0 st: 0 ts:2.835828 flags:1
-ret:-32
-ret: 0 st:-1 ts:1.730004 flags:0
-ret:-32
-ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.624172 pts:0.624172 pos:55096 size:4096 flags:1
-ret: 0 st: 0 ts:-0.481655 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:4096 flags:1
-ret: 0 st: 0 ts:2.412494 flags:1
-ret:-32
-ret: 0 st:-1 ts:1.306672 flags:0
-ret:-32
-ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.200839 pts:0.200839 pos:17758 size:4096 flags:1
-ret: 0 st: 0 ts:-0.904989 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:4096 flags:1
-ret: 0 st: 0 ts:1.989184 flags:1
-ret:-32
-ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:0.883333 pts:0.883333 pos:77954 size:4096 flags:1
-ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:4096 flags:1
-ret: 0 st: 0 ts:2.671678 flags:0
-ret:-32
-ret: 0 st: 0 ts:1.565850 flags:1
-ret:-32
-ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.460000 pts:0.460000 pos:40616 size:4096 flags:1
-ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:44 size:4096 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096
+ret: 0 st:-1 flags:0 ts:-1.000000
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096
+ret: 0 st:-1 flags:1 ts: 1.894167
+ret:-EOF
+ret: 0 st: 0 flags:0 ts: 0.788345
+ret: 0 st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 69576 size: 4096
+ret: 0 st: 0 flags:1 ts:-0.317506
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096
+ret: 0 st:-1 flags:0 ts: 2.576668
+ret:-EOF
+ret: 0 st:-1 flags:1 ts: 1.470835
+ret:-EOF
+ret: 0 st: 0 flags:0 ts: 0.365011
+ret: 0 st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 32238 size: 4096
+ret: 0 st: 0 flags:1 ts:-0.740839
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096
+ret: 0 st:-1 flags:0 ts: 2.153336
+ret:-EOF
+ret: 0 st:-1 flags:1 ts: 1.047503
+ret:-EOF
+ret: 0 st: 0 flags:0 ts:-0.058322
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096
+ret: 0 st: 0 flags:1 ts: 2.835828
+ret:-EOF
+ret: 0 st:-1 flags:0 ts: 1.730004
+ret:-EOF
+ret: 0 st:-1 flags:1 ts: 0.624171
+ret: 0 st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 55096 size: 4096
+ret: 0 st: 0 flags:0 ts:-0.481655
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096
+ret: 0 st: 0 flags:1 ts: 2.412494
+ret:-EOF
+ret: 0 st:-1 flags:0 ts: 1.306672
+ret:-EOF
+ret: 0 st:-1 flags:1 ts: 0.200839
+ret: 0 st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos: 17758 size: 4096
+ret: 0 st: 0 flags:0 ts:-0.904989
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096
+ret: 0 st: 0 flags:1 ts: 1.989184
+ret:-EOF
+ret: 0 st:-1 flags:0 ts: 0.883340
+ret: 0 st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 77954 size: 4096
+ret: 0 st:-1 flags:1 ts:-0.222493
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096
+ret: 0 st: 0 flags:0 ts: 2.671678
+ret:-EOF
+ret: 0 st: 0 flags:1 ts: 1.565850
+ret:-EOF
+ret: 0 st:-1 flags:0 ts: 0.460008
+ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 40616 size: 4096
+ret: 0 st:-1 flags:1 ts:-0.645825
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096
----------------
tests/data/b-lavf.y4m
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:64 size:152064 flags:1
-ret:-1 st:-1 ts:-1.000000 flags:0
-ret:-1 st:-1 ts:1.894167 flags:1
-ret:-1 st: 0 ts:0.800000 flags:0
-ret:-1 st: 0 ts:-0.320000 flags:1
-ret:-1 st:-1 ts:2.576668 flags:0
-ret:-1 st:-1 ts:1.470835 flags:1
-ret:-1 st: 0 ts:0.360000 flags:0
-ret:-1 st: 0 ts:-0.760000 flags:1
-ret:-1 st:-1 ts:2.153336 flags:0
-ret:-1 st:-1 ts:1.047503 flags:1
-ret:-1 st: 0 ts:-0.040000 flags:0
-ret:-1 st: 0 ts:2.840000 flags:1
-ret:-1 st:-1 ts:1.730004 flags:0
-ret:-1 st:-1 ts:0.624171 flags:1
-ret:-1 st: 0 ts:-0.480000 flags:0
-ret:-1 st: 0 ts:2.400000 flags:1
-ret:-1 st:-1 ts:1.306672 flags:0
-ret:-1 st:-1 ts:0.200839 flags:1
-ret:-1 st: 0 ts:-0.920000 flags:0
-ret:-1 st: 0 ts:2.000000 flags:1
-ret:-1 st:-1 ts:0.883340 flags:0
-ret:-1 st:-1 ts:-0.222493 flags:1
-ret:-1 st: 0 ts:2.680000 flags:0
-ret:-1 st: 0 ts:1.560000 flags:1
-ret:-1 st:-1 ts:0.460008 flags:0
-ret:-1 st:-1 ts:-0.645825 flags:1
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 64 size:152064
+ret:-1 st:-1 flags:0 ts:-1.000000
+ret:-1 st:-1 flags:1 ts: 1.894167
+ret:-1 st: 0 flags:0 ts: 0.800000
+ret:-1 st: 0 flags:1 ts:-0.320000
+ret:-1 st:-1 flags:0 ts: 2.576668
+ret:-1 st:-1 flags:1 ts: 1.470835
+ret:-1 st: 0 flags:0 ts: 0.360000
+ret:-1 st: 0 flags:1 ts:-0.760000
+ret:-1 st:-1 flags:0 ts: 2.153336
+ret:-1 st:-1 flags:1 ts: 1.047503
+ret:-1 st: 0 flags:0 ts:-0.040000
+ret:-1 st: 0 flags:1 ts: 2.840000
+ret:-1 st:-1 flags:0 ts: 1.730004
+ret:-1 st:-1 flags:1 ts: 0.624171
+ret:-1 st: 0 flags:0 ts:-0.480000
+ret:-1 st: 0 flags:1 ts: 2.400000
+ret:-1 st:-1 flags:0 ts: 1.306672
+ret:-1 st:-1 flags:1 ts: 0.200839
+ret:-1 st: 0 flags:0 ts:-0.920000
+ret:-1 st: 0 flags:1 ts: 2.000000
+ret:-1 st:-1 flags:0 ts: 0.883340
+ret:-1 st:-1 flags:1 ts:-0.222493
+ret:-1 st: 0 flags:0 ts: 2.680000
+ret:-1 st: 0 flags:1 ts: 1.560000
+ret:-1 st:-1 flags:0 ts: 0.460008
+ret:-1 st:-1 flags:1 ts:-0.645825
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/seek_test.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/seek_test.c
index 7d64058458..315fcfc790 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/seek_test.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/seek_test.c
@@ -22,6 +22,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include "libavutil/common.h"
#include "libavformat/avformat.h"
@@ -30,6 +31,32 @@
#undef printf
#undef fprintf
+static char buffer[20];
+
+static const char *ret_str(int v)
+{
+ switch (v) {
+ case AVERROR_EOF: return "-EOF";
+ case AVERROR(EIO): return "-EIO";
+ case AVERROR(ENOMEM): return "-ENOMEM";
+ case AVERROR(EINVAL): return "-EINVAL";
+ default:
+ snprintf(buffer, sizeof(buffer), "%2d", v);
+ return buffer;
+ }
+}
+
+static void ts_str(char buffer[60], int64_t ts, AVRational base)
+{
+ double tsval;
+ if (ts == AV_NOPTS_VALUE) {
+ strcpy(buffer, " NOPTS ");
+ return;
+ }
+ tsval = ts * av_q2d(base);
+ snprintf(buffer, 60, "%9f", tsval);
+}
+
int main(int argc, char **argv)
{
const char *filename;
@@ -74,15 +101,19 @@ int main(int argc, char **argv)
for(i=0; ; i++){
AVPacket pkt;
AVStream *av_uninit(st);
+ char ts_buf[60];
memset(&pkt, 0, sizeof(pkt));
if(ret>=0){
ret= av_read_frame(ic, &pkt);
- printf("ret:%2d", ret);
if(ret>=0){
+ char dts_buf[60];
st= ic->streams[pkt.stream_index];
- printf(" st:%2d dts:%f pts:%f pos:%" PRId64 " size:%d flags:%d", pkt.stream_index, pkt.dts*av_q2d(st->time_base), pkt.pts*av_q2d(st->time_base), pkt.pos, pkt.size, pkt.flags);
- }
+ ts_str(dts_buf, pkt.dts, st->time_base);
+ ts_str(ts_buf, pkt.pts, st->time_base);
+ printf("ret:%-10s st:%2d flags:%d dts:%s pts:%s pos:%7" PRId64 " size:%6d", ret_str(ret), pkt.stream_index, pkt.flags, dts_buf, ts_buf, pkt.pos, pkt.size);
+ } else
+ printf("ret:%s", ret_str(ret)); // necessary to avoid trailing whitespace
printf("\n");
}
@@ -97,7 +128,8 @@ int main(int argc, char **argv)
//FIXME fully test the new seek API
if(i&1) ret = avformat_seek_file(ic, stream_id, INT64_MIN, timestamp, timestamp, 0);
else ret = avformat_seek_file(ic, stream_id, timestamp, timestamp, INT64_MAX, 0);
- printf("ret:%2d st:%2d ts:%f flags:%d\n", ret, stream_id, timestamp*(stream_id<0 ? 1.0/AV_TIME_BASE : av_q2d(st->time_base)), i&1);
+ ts_str(ts_buf, timestamp, stream_id < 0 ? AV_TIME_BASE_Q : st->time_base);
+ printf("ret:%-10s st:%2d flags:%d ts:%s\n", ret_str(ret), stream_id, i&1, ts_buf);
}
return 0;
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/tiny_psnr.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/tiny_psnr.c
index 6327e6f9e4..f8d1b7bfa5 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/tiny_psnr.c
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/tiny_psnr.c
@@ -155,7 +155,7 @@ int main(int argc,char* argv[]){
if(!i) i=1;
dev= int_sqrt( ((sse/i)*F*F) + (((sse%i)*F*F) + i/2)/i );
if(sse)
- psnr= ((2*log16(max<<16) + log16(i) - log16(sse))*284619LL*F + (1<<31)) / (1LL<<32);
+ psnr= ((2*log16(max<<16) + log16(i) - log16(sse))*284619LL*F + (1LL<<31)) / (1LL<<32);
else
psnr= 1000*F-1; //floating point free infinity :)
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/vsynth.regression.ref b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/vsynth.regression.ref
index 5df7b0d95f..59b4d7af9a 100644
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/vsynth.regression.ref
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/vsynth.regression.ref
@@ -1,71 +1,71 @@
1428744c6d5835f27506e69be4f837f4 *./tests/data/a-mpeg1.mpg
712006 ./tests/data/a-mpeg1.mpg
58f0c332bf689117b57fa629a2bc0d2b *./tests/data/mpeg.vsynth.out.yuv
-stddev: 7.62 PSNR: 30.47 bytes: 7603200/ 7603200
+stddev: 7.62 PSNR: 30.48 bytes: 7603200/ 7603200
fbddea2368cd2028fc8db4dfd4682e94 *./tests/data/a-mpeg2.mpg
728044 ./tests/data/a-mpeg2.mpg
b41ca49c1a02e66ce64d262e2cdaec15 *./tests/data/mpeg2.vsynth.out.yuv
-stddev: 7.65 PSNR: 30.44 bytes: 7603200/ 7603200
+stddev: 7.65 PSNR: 30.45 bytes: 7603200/ 7603200
8762c08210b88bf7b8b71a1fe1f5d169 *./tests/data/a-mpeg2ivlc-qprd.mpg
789623 ./tests/data/a-mpeg2ivlc-qprd.mpg
606712937b56e82958874d04ae3ba51a *./tests/data/mpeg2.vsynth.out.yuv
-stddev: 10.07 PSNR: 28.05 bytes: 7603200/ 7603200
+stddev: 10.07 PSNR: 28.06 bytes: 7603200/ 7603200
9aacd4f385b4d48b723aac50b97f105e *./tests/data/a-mpeg2_422.mpg
726333 ./tests/data/a-mpeg2_422.mpg
5f1f31587eca77c95206d4e1bcf93a08 *./tests/data/mpeg2.vsynth.out.yuv
-stddev: 63.33 PSNR: 12.09 bytes: 10137600/ 7603200
+stddev: 63.33 PSNR: 12.10 bytes: 10137600/ 7603200
4c067397b504d65532d7779cd36f3f88 *./tests/data/a-mpeg2.mpg
725668 ./tests/data/a-mpeg2.mpg
9f7b065f98d57cdecf90e6f7a2524eb5 *./tests/data/mpeg2.vsynth.out.yuv
-stddev: 7.65 PSNR: 30.44 bytes: 7603200/ 7603200
+stddev: 7.65 PSNR: 30.45 bytes: 7603200/ 7603200
ec3f6713c88a2b41f6c369fd64341077 *./tests/data/a-mpeg2i.mpg
737473 ./tests/data/a-mpeg2i.mpg
97615390fdd69abfcbc7e02df863a7d2 *./tests/data/mpeg2.vsynth.out.yuv
-stddev: 7.67 PSNR: 30.42 bytes: 7603200/ 7603200
+stddev: 7.67 PSNR: 30.43 bytes: 7603200/ 7603200
522d56a8a2a130ff6b81535e53765fdc *./tests/data/a-mpeg2thread.mpg
804929 ./tests/data/a-mpeg2thread.mpg
1c802c997553895b39fe9a5032ee7821 *./tests/data/mpeg2thread.vsynth.out.yuv
-stddev: 7.64 PSNR: 30.46 bytes: 7603200/ 7603200
+stddev: 7.64 PSNR: 30.47 bytes: 7603200/ 7603200
0f4f31f6e16f39dcb67b7730687e8e4e *./tests/data/a-mpeg2threadivlc.mpg
795389 ./tests/data/a-mpeg2threadivlc.mpg
1c802c997553895b39fe9a5032ee7821 *./tests/data/mpeg2thread.vsynth.out.yuv
-stddev: 7.64 PSNR: 30.46 bytes: 7603200/ 7603200
+stddev: 7.64 PSNR: 30.47 bytes: 7603200/ 7603200
adfde15b5bbeef3096b0adf7b20ccb93 *./tests/data/a-mpeg2reuse.mpg
2081247 ./tests/data/a-mpeg2reuse.mpg
6dbda80b4d368833625316d0400d32dd *./tests/data/mpeg2thread.vsynth.out.yuv
-stddev: 7.67 PSNR: 30.41 bytes: 7603200/ 7603200
+stddev: 7.67 PSNR: 30.42 bytes: 7603200/ 7603200
88957e35efcc718bce0307627ad3298d *./tests/data/a-msmpeg4v2.avi
623788 ./tests/data/a-msmpeg4v2.avi
c6ff1041a0ef62c2a2e5ef519e5e94c4 *./tests/data/msmpeg4v2.vsynth.out.yuv
-stddev: 7.97 PSNR: 30.09 bytes: 7603200/ 7603200
+stddev: 7.97 PSNR: 30.10 bytes: 7603200/ 7603200
d437c6ab3775c50fdec00fa744bb5add *./tests/data/a-msmpeg4.avi
624718 ./tests/data/a-msmpeg4.avi
5ca72c39e3fc5df8e62f223c869589f5 *./tests/data/msmpeg4.vsynth.out.yuv
-stddev: 7.98 PSNR: 30.08 bytes: 7603200/ 7603200
+stddev: 7.98 PSNR: 30.09 bytes: 7603200/ 7603200
4f3461315776e5118866fa3819cff9b6 *./tests/data/a-wmv1.avi
626908 ./tests/data/a-wmv1.avi
5182edba5b5e0354b39ce4f3604b62da *./tests/data/wmv1.vsynth.out.yuv
-stddev: 7.97 PSNR: 30.08 bytes: 7603200/ 7603200
+stddev: 7.97 PSNR: 30.09 bytes: 7603200/ 7603200
13efda9d3811345aadc0632fc9a9332b *./tests/data/a-wmv2.avi
659852 ./tests/data/a-wmv2.avi
5182edba5b5e0354b39ce4f3604b62da *./tests/data/wmv2.vsynth.out.yuv
-stddev: 7.97 PSNR: 30.08 bytes: 7603200/ 7603200
+stddev: 7.97 PSNR: 30.09 bytes: 7603200/ 7603200
d155470b713aeebacb85980b0d5f2ce3 *./tests/data/a-h261.avi
707588 ./tests/data/a-h261.avi
716e83cb51afb1246bfaa80967df48ea *./tests/data/h261.vsynth.out.yuv
-stddev: 9.11 PSNR: 28.92 bytes: 7603200/ 7603200
+stddev: 9.11 PSNR: 28.93 bytes: 7603200/ 7603200
fb4dc9b9eac2628c56cb82cf332e1f58 *./tests/data/a-h263.avi
659686 ./tests/data/a-h263.avi
1a1ba9a3a63ec1a1a9585fded0a7c954 *./tests/data/h263.vsynth.out.yuv
-stddev: 8.03 PSNR: 30.02 bytes: 7603200/ 7603200
+stddev: 8.03 PSNR: 30.03 bytes: 7603200/ 7603200
bbcadeceba295e1dad148aea1e57c370 *./tests/data/a-h263p.avi
2328348 ./tests/data/a-h263p.avi
9554cda00c3487ab3ffda2c3ea22fa2f *./tests/data/h263p.vsynth.out.yuv
-stddev: 2.06 PSNR: 41.82 bytes: 7603200/ 7603200
+stddev: 2.06 PSNR: 41.83 bytes: 7603200/ 7603200
fd83f2ef5887a62b4d755d7cb5f0ac59 *./tests/data/a-odivx.mp4
540144 ./tests/data/a-odivx.mp4
8828a375448dc5c2215163ba70656f89 *./tests/data/mpeg4.vsynth.out.yuv
-stddev: 7.97 PSNR: 30.09 bytes: 7603200/ 7603200
+stddev: 7.97 PSNR: 30.10 bytes: 7603200/ 7603200
ace2536fa169d835d0fb332abde28d51 *./tests/data/a-huffyuv.avi
7933800 ./tests/data/a-huffyuv.avi
c5ccac874dbf808e9088bc3107860042 *./tests/data/huffyuv.vsynth.out.yuv
@@ -73,43 +73,43 @@ stddev: 0.00 PSNR:999.99 bytes: 7603200/ 7603200
b7c96b3d7ef2965cf95ddeedf5251790 *./tests/data/a-mpeg4-rc.avi
832136 ./tests/data/a-mpeg4-rc.avi
650eef31987debab2b6576d302eac456 *./tests/data/rc.vsynth.out.yuv
-stddev: 10.24 PSNR: 27.91 bytes: 7603200/ 7603200
+stddev: 10.24 PSNR: 27.92 bytes: 7603200/ 7603200
7d8eb01fd68d83d62a98585757704d47 *./tests/data/a-mpeg4-adv.avi
589716 ./tests/data/a-mpeg4-adv.avi
f8b226876b1b2c0b98fd6928fd9adbd8 *./tests/data/mpeg4adv.vsynth.out.yuv
-stddev: 6.98 PSNR: 31.24 bytes: 7603200/ 7603200
+stddev: 6.98 PSNR: 31.25 bytes: 7603200/ 7603200
7fc9389fc73794b1e98d89566afeda4d *./tests/data/a-mpeg4-qprd.avi
714568 ./tests/data/a-mpeg4-qprd.avi
177dd172b52df66918f2a505b2df4879 *./tests/data/mpeg4adv.vsynth.out.yuv
-stddev: 9.82 PSNR: 28.27 bytes: 7603200/ 7603200
+stddev: 9.82 PSNR: 28.28 bytes: 7603200/ 7603200
0750613b0fb110b356b043a39720a41c *./tests/data/a-mpeg4-adap.avi
404656 ./tests/data/a-mpeg4-adap.avi
ccd90097ac60e91b8bb2012d31196414 *./tests/data/mpeg4adv.vsynth.out.yuv
-stddev: 14.05 PSNR: 25.16 bytes: 7603200/ 7603200
+stddev: 14.05 PSNR: 25.17 bytes: 7603200/ 7603200
9e677d08f1738569a70e9a387ae7d744 *./tests/data/a-mpeg4-Q.avi
867046 ./tests/data/a-mpeg4-Q.avi
72870f1438ec0502169a5aea5be6f42f *./tests/data/mpeg4adv.vsynth.out.yuv
-stddev: 5.61 PSNR: 33.13 bytes: 7603200/ 7603200
+stddev: 5.61 PSNR: 33.14 bytes: 7603200/ 7603200
7dbabe6477b1cdbeaa231434dbacebb9 *./tests/data/a-mpeg4-thread.avi
778486 ./tests/data/a-mpeg4-thread.avi
2e9f6ee6059f433d05cc95aa4ff7b3d9 *./tests/data/mpeg4thread.vsynth.out.yuv
-stddev: 10.13 PSNR: 28.00 bytes: 7603200/ 7603200
+stddev: 10.13 PSNR: 28.01 bytes: 7603200/ 7603200
7416dfd319f04044d4575dc9d1b406e1 *./tests/data/a-error-mpeg4-adv.avi
756836 ./tests/data/a-error-mpeg4-adv.avi
0d21f59c1600f5b6afb90b5278e28cd6 *./tests/data/error.vsynth.out.yuv
-stddev: 18.08 PSNR: 22.97 bytes: 7603200/ 7603200
+stddev: 18.08 PSNR: 22.98 bytes: 7603200/ 7603200
c02f54157ba08ca12ad979c6308212ad *./tests/data/a-mpeg4-nr.avi
675638 ./tests/data/a-mpeg4-nr.avi
d2b89d5958fb7331f6c9e5b7ecaaa5b6 *./tests/data/mpeg4nr.vsynth.out.yuv
-stddev: 6.99 PSNR: 31.22 bytes: 7603200/ 7603200
+stddev: 6.99 PSNR: 31.23 bytes: 7603200/ 7603200
6bc1f2414aaca7e26f85a68992bc8c1c *./tests/data/a-mpeg1b.mpg
1035727 ./tests/data/a-mpeg1b.mpg
8c9ff248bde54f4509913c80f843ed5f *./tests/data/mpeg1b.vsynth.out.yuv
-stddev: 6.31 PSNR: 32.11 bytes: 7603200/ 7603200
+stddev: 6.31 PSNR: 32.12 bytes: 7603200/ 7603200
af7ddc0d60cb2d1d83b0bfd829cc7b3a *./tests/data/a-mjpeg.avi
1570366 ./tests/data/a-mjpeg.avi
556ba548fe2b1b4ca98ef3f5d5e94bb8 *./tests/data/mjpeg.vsynth.out.yuv
-stddev: 7.92 PSNR: 30.14 bytes: 7603200/ 7603200
+stddev: 7.92 PSNR: 30.15 bytes: 7603200/ 7603200
9092f306f165b98ab0bb4f576f198ad5 *./tests/data/a-ljpeg.avi
6312936 ./tests/data/a-ljpeg.avi
c5ccac874dbf808e9088bc3107860042 *./tests/data/ljpeg.vsynth.out.yuv
@@ -117,27 +117,27 @@ stddev: 0.00 PSNR:999.99 bytes: 7603200/ 7603200
519e26bb1ac0f3db8f90b36537f2f760 *./tests/data/a-jpegls.avi
9089812 ./tests/data/a-jpegls.avi
947cb24ec45a453348ae6fe3fa278071 *./tests/data/jpegls.vsynth.out.yuv
-stddev: 2.85 PSNR: 39.02 bytes: 7603200/ 7603200
+stddev: 2.85 PSNR: 39.03 bytes: 7603200/ 7603200
4d7e82de72a83905cf84b8abc3e70b8f *./tests/data/a-rv10.rm
653905 ./tests/data/a-rv10.rm
1a1ba9a3a63ec1a1a9585fded0a7c954 *./tests/data/rv10.vsynth.out.yuv
-stddev: 8.03 PSNR: 30.02 bytes: 7603200/ 7603200
+stddev: 8.03 PSNR: 30.03 bytes: 7603200/ 7603200
49f656b3a84bd7173ca219fae310750c *./tests/data/a-rv20.rm
627450 ./tests/data/a-rv20.rm
a94d2babdc506b95951977cb55642981 *./tests/data/rv20.vsynth.out.yuv
-stddev: 8.24 PSNR: 29.80 bytes: 7603200/ 7603200
+stddev: 8.24 PSNR: 29.81 bytes: 7603200/ 7603200
b4ce4698764ef2328346badb7227ecbe *./tests/data/a-asv1.avi
1489656 ./tests/data/a-asv1.avi
2dfc5dfc2c1cbbc2543257cd3d2df6af *./tests/data/asv1.vsynth.out.yuv
-stddev: 20.00 PSNR: 22.10 bytes: 7603200/ 7603200
+stddev: 20.00 PSNR: 22.11 bytes: 7603200/ 7603200
dfba6eaf58e515e324c2b370bfcd9158 *./tests/data/a-asv2.avi
1456056 ./tests/data/a-asv2.avi
d451be09793cd0f35b6d91fc36e2571a *./tests/data/asv2.vsynth.out.yuv
-stddev: 18.82 PSNR: 22.62 bytes: 7603200/ 7603200
+stddev: 18.82 PSNR: 22.63 bytes: 7603200/ 7603200
d6a80659cedee7698aefe9c4a8285fa4 *./tests/data/a-flv.flv
636269 ./tests/data/a-flv.flv
5ab46d8dd01dbb1d63df2a84858a4b05 *./tests/data/flv.vsynth.out.yuv
-stddev: 8.02 PSNR: 30.03 bytes: 7603200/ 7603200
+stddev: 8.02 PSNR: 30.04 bytes: 7603200/ 7603200
67ddc7edde5cca49290245d881787890 *./tests/data/a-ffv1.avi
2655376 ./tests/data/a-ffv1.avi
c5ccac874dbf808e9088bc3107860042 *./tests/data/ffv1.vsynth.out.yuv
@@ -145,7 +145,7 @@ stddev: 0.00 PSNR:999.99 bytes: 7603200/ 7603200
d593b3c1a9729ce6dd1721f58fa93712 *./tests/data/a-snow.avi
136088 ./tests/data/a-snow.avi
91021b7d6d7908648fe78cc1975af8c4 *./tests/data/snow.vsynth.out.yuv
-stddev: 22.77 PSNR: 20.97 bytes: 7603200/ 7603200
+stddev: 22.77 PSNR: 20.98 bytes: 7603200/ 7603200
6d29e8c06a645cdee45073c4f3d0004e *./tests/data/a-snow53.avi
3419980 ./tests/data/a-snow53.avi
c5ccac874dbf808e9088bc3107860042 *./tests/data/snowll.vsynth.out.yuv
@@ -153,94 +153,102 @@ stddev: 0.00 PSNR:999.99 bytes: 7603200/ 7603200
27ade3031b17214cf81c19cbf70f37d7 *./tests/data/a-dv.dv
7200000 ./tests/data/a-dv.dv
02ac7cdeab91d4d5621e7ce96dddc498 *./tests/data/dv.vsynth.out.yuv
-stddev: 6.90 PSNR: 31.33 bytes: 7603200/ 7603200
+stddev: 6.90 PSNR: 31.34 bytes: 7603200/ 7603200
bd67f2431db160d4bb6dcd791cea6efd *./tests/data/a-dv411.dv
7200000 ./tests/data/a-dv411.dv
b6640a3a572353f51284acb746eb00c4 *./tests/data/dv.vsynth.out.yuv
-stddev: 30.76 PSNR: 18.36 bytes: 7603200/ 7603200
+stddev: 30.76 PSNR: 18.37 bytes: 7603200/ 7603200
26dba84f0ea895b914ef5b333d8394ac *./tests/data/a-dv50.dv
14400000 ./tests/data/a-dv50.dv
a2ff093e93ffed10f730fa21df02fc50 *./tests/data/dv50.vsynth.out.yuv
-stddev: 1.72 PSNR: 43.37 bytes: 7603200/ 7603200
-8ff3c18dabe28509b4e5b3fdaa7f0856 *./tests/data/a-dnxhd-1080i.mov
-30311415 ./tests/data/a-dnxhd-1080i.mov
-52f50a8031eebf980a1303e4744a49f8 *./tests/data/dnxhd_1080i.vsynth.out.yuv
-stddev: 6.28 PSNR: 32.16 bytes: 7603200/ 7603200
-d206daba40f3c1be8b834de8a41e984c *./tests/data/a-dnxhd-720p.dnxhd
-22937600 ./tests/data/a-dnxhd-720p.dnxhd
-d7f14ee0dd3a4df95f05999677da348b *./tests/data/dnxhd_720p.vsynth.out.yuv
-stddev: 6.39 PSNR: 32.00 bytes: 7603200/ 7603200
-c0a42b916489d3c1d0a315974821e28d *./tests/data/a-dnxhd-720p-rd.dnxhd
-22937600 ./tests/data/a-dnxhd-720p-rd.dnxhd
-50efe763b272af3367985218aff68b1b *./tests/data/dnxhd_720p_rd.vsynth.out.yuv
-stddev: 6.25 PSNR: 32.20 bytes: 7603200/ 7603200
+stddev: 1.72 PSNR: 43.38 bytes: 7603200/ 7603200
+cd1489f18d2186a49ab23c61ed33bce7 *./tests/data/a-dnxhd-1080i.mov
+3031875 ./tests/data/a-dnxhd-1080i.mov
+0c651e840f860592f0d5b66030d9fa32 *./tests/data/dnxhd_1080i.vsynth.out.yuv
+stddev: 6.29 PSNR: 32.15 bytes: 760320/ 7603200
+81f5be451dc18cf8a1d333c7885de60b *./tests/data/a-dnxhd-720p.dnxhd
+2293760 ./tests/data/a-dnxhd-720p.dnxhd
+94b21e5e68ccf9471eff74afd0ebe319 *./tests/data/dnxhd_720p.vsynth.out.yuv
+stddev: 6.32 PSNR: 32.11 bytes: 760320/ 7603200
+1dc6e95925c4f3a230848ec17c02abed *./tests/data/a-dnxhd-720p-rd.dnxhd
+2293760 ./tests/data/a-dnxhd-720p-rd.dnxhd
+02972d2aec120ec1577ec9053d68ae0f *./tests/data/dnxhd_720p_rd.vsynth.out.yuv
+stddev: 6.26 PSNR: 32.19 bytes: 760320/ 7603200
595fc4e38734521356b60e67b813f0fa *./tests/data/a-svq1.mov
1334367 ./tests/data/a-svq1.mov
9cc35c54b2c77d36bd7e308b393c1f81 *./tests/data/svq1.vsynth.out.yuv
-stddev: 9.58 PSNR: 28.49 bytes: 7603200/ 7603200
+stddev: 9.58 PSNR: 28.50 bytes: 7603200/ 7603200
97894502b4cb57aca1105b6333f72dae *./tests/data/a-flashsv.flv
14681925 ./tests/data/a-flashsv.flv
947cb24ec45a453348ae6fe3fa278071 *./tests/data/flashsv.vsynth.out.yuv
-stddev: 2.85 PSNR: 39.02 bytes: 7603200/ 7603200
+stddev: 2.85 PSNR: 39.03 bytes: 7603200/ 7603200
+e96dd14a4c39b3b08c7d80826025c5e4 *./tests/data/a-roqav.roq
+101520 ./tests/data/a-roqav.roq
+6cc165a9309bad35924eda71c160e203 *./tests/data/roq.vsynth.out.yuv
+stddev: 7.75 PSNR: 30.34 bytes: 760320/ 7603200
f6eb0a205350bbd7fb1028a01c7ae8aa *./tests/data/a-mp2.mp2
96130 ./tests/data/a-mp2.mp2
74c7b6b15a001add199619fafe4059a1 *./tests/data/mp2.vsynth.out.wav
-stddev: 9315.80 PSNR: 16.93 bytes: 1059884/ 1058444
-stddev: 4385.25 PSNR: 23.48 bytes: 1057960/ 1058444
+stddev: 9315.80 PSNR: 16.94 bytes: 1059884/ 1058444
+stddev: 4385.25 PSNR: 23.49 bytes: 1057960/ 1058444
081bfd5e683b13cccf1b07c43c1c5005 *./tests/data/a-ac3.rm
98751 ./tests/data/a-ac3.rm
5d8cce28f83dd33c3c7eaf43a5db5294 *./tests/data/a-g726.wav
24082 ./tests/data/a-g726.wav
4f1ba1af75dee64625a1c852e6cd01d3 *./tests/data/g726.vsynth.out.wav
-stddev: 8506.46 PSNR: 17.72 bytes: 96148/ 1058444
+stddev: 8506.46 PSNR: 17.73 bytes: 96148/ 1058444
56b75c3a6dacedcf2ce7b0586aa33594 *./tests/data/a-adpcm_ima.wav
267324 ./tests/data/a-adpcm_ima.wav
78a2af1c895792d0c221d127bdd48ece *./tests/data/adpcm_ima_wav.vsynth.out.wav
-stddev: 903.51 PSNR: 37.20 bytes: 1061792/ 1058444
+stddev: 903.51 PSNR: 37.21 bytes: 1061792/ 1058444
3c06fd2f7831e3e8735b936e23ca220c *./tests/data/a-adpcm_qt.aiff
281252 ./tests/data/a-adpcm_qt.aiff
9580492803ba1c1a3746367b24b751c8 *./tests/data/adpcm_ima_qt.vsynth.out.wav
-stddev: 914.63 PSNR: 37.09 bytes: 1058604/ 1058444
-9f813f0cc8b2c05821a31828eadf1188 *./tests/data/a-adpcm_ms.wav
-268344 ./tests/data/a-adpcm_ms.wav
+stddev: 914.63 PSNR: 37.10 bytes: 1058604/ 1058444
+a407b87daeef5b25dfb6c5b3f519e9c1 *./tests/data/a-adpcm_ms.wav
+268378 ./tests/data/a-adpcm_ms.wav
7be370f937c51e8a967e6a3d08d5156a *./tests/data/adpcm_ms.vsynth.out.wav
-stddev: 1050.00 PSNR: 35.90 bytes: 1060620/ 1058444
+stddev: 1050.00 PSNR: 35.91 bytes: 1060620/ 1058444
2546d72df736b5ffa1557e8c9c9ef788 *./tests/data/a-adpcm_yam.wav
266296 ./tests/data/a-adpcm_yam.wav
c80c847a53a0fee17a88fa889ec34a4e *./tests/data/adpcm_yam.vsynth.out.wav
-stddev: 1247.64 PSNR: 34.40 bytes: 1065004/ 1058444
+stddev: 1247.64 PSNR: 34.41 bytes: 1065004/ 1058444
42d4639866ed4d692eaf126228a4fa2a *./tests/data/a-adpcm_swf.flv
269166 ./tests/data/a-adpcm_swf.flv
628089745a7059ae4055c2515b6d668b *./tests/data/adpcm_swf.vsynth.out.wav
-stddev: 933.65 PSNR: 36.92 bytes: 1065004/ 1058444
+stddev: 933.65 PSNR: 36.93 bytes: 1065004/ 1058444
+c68f649777ab8e7c9a0f1f221451d3ad *./tests/data/a-alac.m4a
+389386 ./tests/data/a-alac.m4a
+95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/alac.vsynth.out.wav
+stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
7781a016edfc242a39e4d65af02d861a *./tests/data/a-flac.flac
353368 ./tests/data/a-flac.flac
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/flac.vsynth.out.wav
stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
26a7f6b0f0b7181df8df3fa589f6bf81 *./tests/data/a-wmav1.asf
106004 ./tests/data/a-wmav1.asf
-stddev:12245.27 PSNR: 14.56 bytes: 1065004/ 1058444
-stddev: 2097.78 PSNR: 29.88 bytes: 1056812/ 1058444
+stddev:12245.27 PSNR: 14.57 bytes: 1065004/ 1058444
+stddev: 2097.78 PSNR: 29.89 bytes: 1056812/ 1058444
7c6c0cb692af01b312ae345723674b5f *./tests/data/a-wmav2.asf
106044 ./tests/data/a-wmav2.asf
-stddev:12249.69 PSNR: 14.56 bytes: 1065004/ 1058444
-stddev: 2091.12 PSNR: 29.91 bytes: 1056812/ 1058444
+stddev:12249.69 PSNR: 14.57 bytes: 1065004/ 1058444
+stddev: 2091.12 PSNR: 29.92 bytes: 1056812/ 1058444
89f5b8dd97e0dddbe59af0d44fd229f3 *./tests/data/a-pcm_alaw.wav
529256 ./tests/data/a-pcm_alaw.wav
0568b0b9a72e31559e150e7e09d301cd *./tests/data/pcm.vsynth.out.wav
-stddev: 101.67 PSNR: 56.18 bytes: 1058444/ 1058444
+stddev: 101.67 PSNR: 56.19 bytes: 1058444/ 1058444
f443a8eeb1647ec1eeb8370c939e52d4 *./tests/data/a-pcm_mulaw.wav
529256 ./tests/data/a-pcm_mulaw.wav
1c3eeaa8814ebd4916780dff80ed6dc5 *./tests/data/pcm.vsynth.out.wav
-stddev: 103.38 PSNR: 56.03 bytes: 1058444/ 1058444
+stddev: 103.38 PSNR: 56.04 bytes: 1058444/ 1058444
b7936d7170e0efefb379349d81aed360 *./tests/data/a-pcm_s8.mov
530837 ./tests/data/a-pcm_s8.mov
652edf30f35ad89bf27bcc9d2f9c7b53 *./tests/data/pcm.vsynth.out.wav
-stddev: 147.89 PSNR: 52.92 bytes: 1058444/ 1058444
+stddev: 147.89 PSNR: 52.93 bytes: 1058444/ 1058444
98cadb3502dbdc99e6e077c28b1a036c *./tests/data/a-pcm_u8.wav
529244 ./tests/data/a-pcm_u8.wav
652edf30f35ad89bf27bcc9d2f9c7b53 *./tests/data/pcm.vsynth.out.wav
-stddev: 147.89 PSNR: 52.92 bytes: 1058444/ 1058444
+stddev: 147.89 PSNR: 52.93 bytes: 1058444/ 1058444
c42b9c04305455250366c84e17c1023f *./tests/data/a-pcm_s16be.mov
1060037 ./tests/data/a-pcm_s16be.mov
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.vsynth.out.wav
@@ -261,39 +269,39 @@ stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
1589237 ./tests/data/a-pcm_s24be.mov
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.vsynth.out.wav
stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
-aaba3cf534ddddf5bcf663bc8c5b5331 *./tests/data/a-pcm_s24le.wav
-1587644 ./tests/data/a-pcm_s24le.wav
+a85380fb79b0d4fff38e24ac1e34bb94 *./tests/data/a-pcm_s24le.wav
+1587668 ./tests/data/a-pcm_s24le.wav
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.vsynth.out.wav
stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
d7792f0343cd66fda8b50b569e2bcc48 *./tests/data/a-pcm_s32be.mov
2118437 ./tests/data/a-pcm_s32be.mov
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.vsynth.out.wav
stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
-7661c9b6f221d9f57985a9e4d92c4e63 *./tests/data/a-pcm_s32le.wav
-2116844 ./tests/data/a-pcm_s32le.wav
+da6ed80f4f40f0082577dea80827e014 *./tests/data/a-pcm_s32le.wav
+2116868 ./tests/data/a-pcm_s32le.wav
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.vsynth.out.wav
stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
118ff3dc83c62ce9ce669eef57e55bb2 *./tests/data/a-pcm_f32be.au
2116824 ./tests/data/a-pcm_f32be.au
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.vsynth.out.wav
stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
-4104d0804a80fb8d02952ca5103b1012 *./tests/data/a-pcm_f32le.wav
-2116856 ./tests/data/a-pcm_f32le.wav
+46f44f86a18984a832206ab9e29a79f2 *./tests/data/a-pcm_f32le.wav
+2116880 ./tests/data/a-pcm_f32le.wav
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.vsynth.out.wav
stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
8112296b1ed94f72f20d04b1a54850a7 *./tests/data/a-pcm_f64be.au
4233624 ./tests/data/a-pcm_f64be.au
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.vsynth.out.wav
stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
-26598accec99bdbaf76d575045aca7a9 *./tests/data/a-pcm_f64le.wav
-4233656 ./tests/data/a-pcm_f64le.wav
+ba17c6d1a270e1333e981f239bf7eb45 *./tests/data/a-pcm_f64le.wav
+4233680 ./tests/data/a-pcm_f64le.wav
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.vsynth.out.wav
stddev: 0.00 PSNR:999.99 bytes: 1058444/ 1058444
8c74234928ed425b1171211a89f67ead *./tests/data/a-pcm_zork.wav
529256 ./tests/data/a-pcm_zork.wav
864c8c866ac25642c29a13b122c70709 *./tests/data/pcm.vsynth.out.wav
-stddev: 633.10 PSNR: 40.29 bytes: 1058444/ 1058444
+stddev: 633.10 PSNR: 40.30 bytes: 1058444/ 1058444
8168a5c1343553ef027541830f2cb879 *./tests/data/a-pcm_s24daud.302
10368730 ./tests/data/a-pcm_s24daud.302
-fff1dc03aa2750031203a7d72b832fad *./tests/data/pcm.vsynth.out.wav
-stddev: 9416.45 PSNR: 16.84 bytes: 6911840/ 1058444
+f552afadfdfcd6348a07095da6382de5 *./tests/data/pcm.vsynth.out.wav
+stddev: 9415.16 PSNR: 16.85 bytes: 6911864/ 1058444
diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tools/patcheck b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tools/patcheck
index 9f5be8202b..0e2836d4bf 100755
--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tools/patcheck
+++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tools/patcheck
@@ -72,6 +72,10 @@ hiegrep '(:\+|,|;)( *|static|\*)*'"$ERE_PRITYP"' *(src|source|input|in)([0-9A-Z_
hiegrep ' *static *'"$ERE_FUNCS"'[^)]*\);' 'static prototype, maybe you should reorder your functions' $*
hiegrep2 '\.long_name *=' 'NULL_IF_CONFIG_SMAL' 'missing NULL_IF_CONFIG_SMAL' $*
+hiegrep2 '\.pix_fmts *= *(' 'const' 'missing const for pix_fmts array' $*
+hiegrep2 '\.sample_fmts *= *(' 'const' 'missing const for sample_fmts array' $*
+hiegrep2 '\.supported_framerates *= *(' 'const' 'missing const for supported_framerates array' $*
+hiegrep2 '\.channel_layouts *= *(' 'const' 'missing const for channel_layouts array' $*
#egrep $OPT '^\+.*const ' $*| grep -v 'static'> $TMP && printf '\nnon static const\n'
#cat $TMP